AGENT SKILL

figure-typst

Use when the manuscript root is `.typ` (or the user asked for CeTZ / Typst diagrams) — catalog templates first (layered boxes, fletcher exchange), copy the `.typ`, edit only the contract lets, typst-compile-standalone, stop when the PDF sits next to the source. LaTeX TikZ → figure-tikz. Not for experiment-data plots (→ figure-matplotlib), manuscript wiring (→ figure-pipeline), or chat panel cards (→ figure-interaction).

License 许可
MIT
所属仓库
yibocat/prismnext
最近更新
2026-09-05
Stars
★ 4
Forks
0

01 前言 Front Matter

name
figure-typst
license
MIT
description
Use when the manuscript root is `.typ` (or the user asked for CeTZ / Typst diagrams) — catalog templates first (layered boxes, fletcher exchange), copy the `.typ`, edit only the contract lets, typst-compile-standalone, stop when the PDF sits next to the source. LaTeX TikZ → figure-tikz. Not for experiment-data plots (→ figure-matplotlib), manuscript wiring (→ figure-pipeline), or chat panel cards (→ figure-interaction).

02 资源文件 5

03 SKILL.md 正文

Typst / CeTZ Graphics

Typst papers only (.typ root). If the paper is LaTeX, use figure-tikz.

Start from a shipped, compilable figure. When the PDF is next to the .typ, the job is done.

library/catalog.json is the menu. Paths in this file (library/…) are relative to this skill folder — the directory that contains this SKILL.md — not the project root. Do not edit this folder. Compile with typst-compile-standalone. Do not bump pins (@preview/cetz:0.3.4, @preview/fletcher:0.5.8). Do not start from an empty canvas / diagram. First compile may download the pinned Universe packages (network); do not curl them yourself.

Pick a base

  1. Read library/catalog.json. Match the request to an id / name / tags / domain. One clear hit → name it and proceed. Several fit → list the ids and let the user pick.
  2. No catalog hit → closest template, still the closed path. Do not invent a third package.
Ask Template
Layered boxes / pipeline / schematic architecture-boxes (CeTZ 0.3.4)
Commutative / exchange / arrows exchange-diagram (fletcher 0.5.8)
Data from a run / large CSV Stop. figure-matplotlib

Pins are part of the contract. fletcher:0.5.8 already pulls cetz:0.3.4 — do not import a newer CeTZ in the same file.

Catalog path (closed)

Four steps. No reconnaissance.

  1. Copy library/<path>/<typ> into the project's figures folder (Workspace Folder Descriptions — do not guess figures/ if the project uses another name). Rename to the figure. Never edit the file under library/.
  2. Edit the copy — read that item's template.meta.json edit_contract. Change only listed #let parameters. Follow operations. Keep every invariant. Do not restyle from scratch.
  3. Compile — typst-compile-standalone with mainFile set to that figure path. On error: edit the copy, compile again. Never run a Typst engine via bash.
  4. Stop. Chat already previews the PDF next to the source.

Done = that PDF exists. One short sentence in chat (what the diagram shows). Nothing else.

Do not (unless the user named that next step)

  • typst-compile — that is the manuscript build, not a figure
  • latex-compile-standalone or TikZ
  • bash typst / tinymist / curl / rm
  • #image into the manuscript, or interaction-write
  • bump @preview/cetz or @preview/fletcher pins

04 同仓库更多 Skills

yibocat
yibocat/prismnext

demo-multi-file

Local test skill with an extra notes file

★ 4
yibocat
yibocat/prismnext

writing-results

Use when drafting a Results / Experiments / Analysis section — narrating verified evidence from run receipts, with complete statistical reporting, derivation analysis, and honest treatment of negative results. Every number traces to a run; every claim survives the audit.

★ 4
yibocat
yibocat/prismnext

writing-related-work

Use when drafting a Related Work / literature review section or a standalone synthesis note — organizing prior work into a grounded, cited narrative or comparing methods across papers, from the project library plus staged external discovery. Never cites from memory.

★ 4
yibocat
yibocat/prismnext

writing-preliminaries

Use when drafting a Preliminaries / Background / Notation section — definitions, problem setup, and formal statements the rest of the paper builds on, with notation consistency and machine-checked formal claims. Reference patterns, not molds; include only what later sections actually use.

★ 4
yibocat
yibocat/prismnext

writing-methods

Use when drafting a Methods / Methodology / Approach / Model section — expounding the ideas and the reasoning behind the method, grounded in the project's brief, notes, and prior discussions, with empirical details from run receipts. Structure follows the idea's shape; reference angles, not fixed templates.

★ 4
yibocat
yibocat/prismnext

writing-introduction

Use when drafting or rewriting a paper's Introduction — framing the problem, positioning against prior work, and stating contributions as checkable claims, grounded in the brief, notes, and the library. Reference rhetorical patterns, adapted to the paper — never applied as molds.

★ 4