research-method-figure
A sub-capability of weekly-research-slides. It turns a method semantic model
into a publication-quality figure, and it can learn a visual style from a
reference and apply it to different content.
METHOD MODEL (shared with slides and video)
|
figure_spec.yaml + style_profile.yaml
|
editable figure.drawio -> figure.svg / .pdf / .png -> figure.pptx
Architecture (do not duplicate science)
- Scientific truth lives in the method model (
method_model.yaml) and the
figure spec's semantic_ids.
- Layout lives in
figure_spec.yaml (explicit geometry, or column/row
hints the layout engine resolves).
- Appearance lives in a reusable
style_profile.yaml, referenced by name.
- The same method must not be reinterpreted per renderer. The Draw.io, SVG and
PowerPoint outputs all consume one Figure IR.
Canonical format
.drawio is the canonical editable artifact (not TikZ). It is portable, has
explicit geometry, exports cleanly to SVG/PDF/PNG, and is easy to refine by hand.
TikZ is an optional future backend.
Workflow
- Understand the method. Read the paper/notes and write or reuse
method_model.yaml (the same model used by the slide and video pipelines).
- Classify sources in
source_inventory.yaml: CONTENT_SOURCE,
STRUCTURE_SOURCE, STYLE_SOURCE, LAYOUT_SOURCE, ASSET_SOURCE. A STYLE_SOURCE
controls appearance only and must never inject labels, architecture, claims,
data or logos.
- Choose or extract a style. Use a preset in
styles/, or extract one from
a reference (extract_style.py), then review the profile and its confidence.
- Build the figure. From a
figure_spec.yaml, or synthesize one from the
method model (build_figure.py --method).
- Preflight and repair. Run
qa_figure.py, read the contact preview, fix
the source or the layout, rebuild. At least one repair cycle is expected.
- Export.
.drawio + .svg + .pdf + .png, and optionally native PPTX.
Commands
python skills/research-method-figure/scripts/figure_doctor.py
python skills/research-method-figure/scripts/build_figure.py \
--method method_model.yaml --style topconf-clean --output figure.drawio
python skills/research-method-figure/scripts/compare_methods.py \
--left competitor.yaml --right ours.yaml --style topconf-clean --output comparison.drawio
python skills/research-method-figure/scripts/method_delta.py \
--prev v3.yaml --curr v4.yaml --style topconf-clean --output delta.drawio
python skills/research-method-figure/scripts/extract_style.py \
--reference reference.svg --name paper-style
python skills/research-method-figure/scripts/qa_figure.py \
--spec figure_spec.yaml --style topconf-clean --output-dir qa
Style transfer vs reconstruction
- Style transfer: reference is a STYLE_SOURCE; our content, reference's
visual grammar. Pipeline:
reference -> style_profile.yaml, then
our method -> figure_spec + style_profile -> figure.
- Reconstruction: reference is a STRUCTURE_SOURCE; rebuild its visible
elements as native editable objects, render, compare, repair. Report
editability boundaries honestly; never rasterize all text/arrows.
Read next
references/figure-spec.md — the figure spec and Figure IR.
references/figure-visual-grammar.md — shared shape/colour/edge grammar.
references/figure-storytelling.md — choosing topology per figure type.
references/style-extraction.md — extraction, confidence, source roles.
references/method-comparison.md — normalized comparison and method delta.
references/figure-qa.md — preflight, visual QA, repair loop.
../../references/layout-contracts.md — shared SAFE_TEXT_BOX, clearances, zones.
Requirements
Python 3.11+ with PyYAML, jsonschema, Pillow. rsvg-convert for SVG→PNG/PDF
(optional but recommended). Node + pptxgenjs for the PowerPoint bridge.
1---2name: research-method-figure3description: Turn a research method into a publication-quality, editable scientific figure with draw.io as the canonical source. Use when the user asks to draw a method figure, a paper figure, an architecture or mechanism diagram, a competitor-vs-ours comparison in one visual language, a method-delta figure for a weekly update, or to extract the visual style of a reference figure and redraw different content in that style. Outputs editable .drawio plus SVG/PDF/PNG and native PowerPoint. Not for arbitrary illustration, logos, or copying a copyrighted figure.4license: MIT5---67# research-method-figure89A sub-capability of **weekly-research-slides**. It turns a method semantic model10into a publication-quality figure, and it can learn a visual style from a11reference and apply it to different content.1213```text14METHOD MODEL (shared with slides and video)15 |16 figure_spec.yaml + style_profile.yaml17 |18 editable figure.drawio -> figure.svg / .pdf / .png -> figure.pptx19```2021## Architecture (do not duplicate science)2223- **Scientific truth** lives in the method model (`method_model.yaml`) and the24 figure spec's `semantic_id`s.25- **Layout** lives in `figure_spec.yaml` (explicit `geometry`, or `column`/`row`26 hints the layout engine resolves).27- **Appearance** lives in a reusable `style_profile.yaml`, referenced by name.28- The same method must not be reinterpreted per renderer. The Draw.io, SVG and29 PowerPoint outputs all consume one Figure IR.3031## Canonical format3233`.drawio` is the canonical editable artifact (not TikZ). It is portable, has34explicit geometry, exports cleanly to SVG/PDF/PNG, and is easy to refine by hand.35TikZ is an optional future backend.3637## Workflow38391. **Understand the method.** Read the paper/notes and write or reuse40 `method_model.yaml` (the same model used by the slide and video pipelines).412. **Classify sources** in `source_inventory.yaml`: CONTENT_SOURCE,42 STRUCTURE_SOURCE, STYLE_SOURCE, LAYOUT_SOURCE, ASSET_SOURCE. A STYLE_SOURCE43 controls appearance only and must never inject labels, architecture, claims,44 data or logos.453. **Choose or extract a style.** Use a preset in `styles/`, or extract one from46 a reference (`extract_style.py`), then review the profile and its confidence.474. **Build the figure.** From a `figure_spec.yaml`, or synthesize one from the48 method model (`build_figure.py --method`).495. **Preflight and repair.** Run `qa_figure.py`, read the contact preview, fix50 the source or the layout, rebuild. At least one repair cycle is expected.516. **Export.** `.drawio` + `.svg` + `.pdf` + `.png`, and optionally native PPTX.5253## Commands5455```bash56python skills/research-method-figure/scripts/figure_doctor.py57python skills/research-method-figure/scripts/build_figure.py \58 --method method_model.yaml --style topconf-clean --output figure.drawio59python skills/research-method-figure/scripts/compare_methods.py \60 --left competitor.yaml --right ours.yaml --style topconf-clean --output comparison.drawio61python skills/research-method-figure/scripts/method_delta.py \62 --prev v3.yaml --curr v4.yaml --style topconf-clean --output delta.drawio63python skills/research-method-figure/scripts/extract_style.py \64 --reference reference.svg --name paper-style65python skills/research-method-figure/scripts/qa_figure.py \66 --spec figure_spec.yaml --style topconf-clean --output-dir qa67```6869## Style transfer vs reconstruction7071- **Style transfer**: reference is a STYLE_SOURCE; our content, reference's72 visual grammar. Pipeline: `reference -> style_profile.yaml`, then73 `our method -> figure_spec + style_profile -> figure`.74- **Reconstruction**: reference is a STRUCTURE_SOURCE; rebuild its visible75 elements as native editable objects, render, compare, repair. Report76 editability boundaries honestly; never rasterize all text/arrows.7778## Read next7980- `references/figure-spec.md` — the figure spec and Figure IR.81- `references/figure-visual-grammar.md` — shared shape/colour/edge grammar.82- `references/figure-storytelling.md` — choosing topology per figure type.83- `references/style-extraction.md` — extraction, confidence, source roles.84- `references/method-comparison.md` — normalized comparison and method delta.85- `references/figure-qa.md` — preflight, visual QA, repair loop.86- `../../references/layout-contracts.md` — shared SAFE_TEXT_BOX, clearances, zones.8788## Requirements8990Python 3.11+ with `PyYAML`, `jsonschema`, `Pillow`. `rsvg-convert` for SVG→PNG/PDF91(optional but recommended). Node + `pptxgenjs` for the PowerPoint bridge.