$npx -y skills add VILA-Lab/FigMirror --skill figmirrorThis FigMirror skill should be used when the user asks to "mirror this figure's style", "copy this figure's style", "make a chart that looks like this paper", "reproduce this figure with my data", "match this paper's aesthetic", "I want a NeurIPS-quality version of this", or any
| 1 | # FigMirror (`figmirror`) |
| 2 | |
| 3 | Transfer the visual style of a top-conference paper figure (NeurIPS / ICML / |
| 4 | ICLR / Nature / Science) onto user data via an iterative Drawer / Reviewer |
| 5 | loop. Output is a self-contained matplotlib script + PNG + type-42 PDF that |
| 6 | matches the reference's STYLE — not its data. |
| 7 | |
| 8 | ## When to use |
| 9 | |
| 10 | Trigger when the user provides all three: |
| 11 | |
| 12 | - A reference paper-figure screenshot. |
| 13 | - Their own data in any parseable form (pasted table, CSV, TSV, markdown |
| 14 | table, or dirty terminal text). |
| 15 | - An expectation that the output should look like the reference — even via |
| 16 | casual phrasing ("make this chart but with my numbers", "redo this in |
| 17 | matplotlib"). This includes 3D references when the reference or data is |
| 18 | actually 3D. |
| 19 | |
| 20 | Do not trigger on plain matplotlib chart requests with no reference image. |
| 21 | |
| 22 | ## Required inputs |
| 23 | |
| 24 | - Reference image (PNG / JPG), cropped or uncropped. It may include margins, |
| 25 | captions, neighboring panels, or page text; Stage 0 preprocesses it. |
| 26 | - User data (any parseable form). |
| 27 | - Optional working directory. Default: `<cwd>/figmirror-runs/<run-id>/`. |
| 28 | |
| 29 | ## 3D Insert Gate |
| 30 | |
| 31 | Enable `references/three-d-prompting.md` only when the user asks for a 3D |
| 32 | figure, the reference is visibly 3D, or the parsed data requires a 3D encoding |
| 33 | such as `x/y/z`, surfaces, trajectories, layered profiles, closed objects, 3D |
| 34 | small multiples, 3D bars, or plane projections. Do not use this insert to turn |
| 35 | an ordinary 2D task into 3D. |
| 36 | |
| 37 | ## Architecture |
| 38 | |
| 39 | Three bundled subagents drive the loop; the caller orchestrates from the main |
| 40 | thread: |
| 41 | |
| 42 | - `figure-preprocessor` — **Preprocessor**. Stage 0: preserves the raw upload, |
| 43 | crops away margins/captions/page text/neighboring panels when safe, and writes |
| 44 | `inputs/reference_clean.png` plus a crop check/report. |
| 45 | - `figure-illustrator` — **Drawer**. Per iter: reads reference + data + L2 |
| 46 | library, produces `figure_iter<N>.py`, `img_iter<N>.png`, |
| 47 | `notes_iter<N>.md`, `floor_selfcheck_iter<N>.txt`. Self-checks the layout |
| 48 | floor before returning. |
| 49 | - `figure-critic` — **Reviewer**. Per iter: vision-only audit on a |
| 50 | fresh-context view (reference + draft + L2 library + optional 3D insert + |
| 51 | prior audit only). Returns ONE strict JSON object per the review schema. |
| 52 | |
| 53 | Subagents are stateless across dispatch; iter-to-iter state flows through |
| 54 | workdir files. |
| 55 | |
| 56 | Prefer `subagent_type: figure-preprocessor` / `figure-illustrator` / |
| 57 | `figure-critic`. Fallback path |
| 58 | when those names don't resolve: see `references/iter-loop-spec.md` § |
| 59 | "Subagent dispatch fallback". |
| 60 | |
| 61 | ## Workflow |
| 62 | |
| 63 | For each run: |
| 64 | |
| 65 | 1. **Stage workdir.** Pre-create every directory the loop will write into |
| 66 | (subagents Write into existing dirs only — workspace permission quirk). |
| 67 | Stage the uploaded reference image to `inputs/reference_raw.png` and also |
| 68 | to `inputs/reference_clean.png` as a temporary first-paint copy; stage parsed |
| 69 | data to `inputs/data.txt`, and the L2 library to |
| 70 | `inputs/aesthetic-library.md`; stage the 3D router plus |
| 71 | `references/three-d/` only when the 3D insert gate is enabled. The router |
| 72 | selects exactly one mode file: `three-d/style-transfer.md` for ordinary |
| 73 | user-data figures, or `three-d/strict-reproduction.md` for reproduction, |
| 74 | comparison, or candidate/control replacement. For strict 3D reproduction runs |
| 75 | that need quantitative candidate diagnosis, also stage the optional candidate |
| 76 | scorer. The top-level Orchestrator owns final selection and must run the |
| 77 | selected mode's rendered-image gates before copying any candidate to the |
| 78 | final figure. |
| 79 | 2. **Preprocess reference.** Dispatch `figure-preprocessor` before data-gen, |
| 80 | Drawer, or Reviewer. It writes the clean L1 anchor to |
| 81 | `inputs/reference_clean.png` and records the before/after crop check. |
| 82 | 3. **Echo data parse to user (Decision-7).** Show parsed shape (rows × cols, |
| 83 | columns, NaN cells, sample row); proceed when confirmed, or skip if the |
| 84 | user pre-authorized. Either way, persist the echo to `data_echo.md`. |
| 85 | 4. **Iterate** with the caller-provided `max_iters`; default to 6 when the |
| 86 | caller gives no explicit limit. If the caller enables auto-until-shipped, |
| 87 | ignore `max_iters` and continue until `ship` or a real blocker. Each iter: |
| 88 | - Dispatch the Drawer. |
| 89 | - Stage the Reviewer's audit view (reference + new draft + L2 library + |