archify
Archify
Create checked HTML as a native diagram, explainer, story, or standalone Code Analysis workbench.
Run commands from your working directory. Unless the user names another location, give each new artifact request its own folder .archify/<type>-<slug>-<YYYYMMDD-HHMMSS>/ there (local time, chosen once): keep the candidate and <slug>.html in it and reuse it for repairs. Native diagrams use candidate.json with meta.output relative to the working directory; explainers may use candidate.archify.md and a portable output filename. A later request gets a new folder. Replace bin/archify.mjs in every command with the installed package's absolute path, or its path relative to your working directory; CLI input and output paths resolve from that directory.
For a native diagram of a real codebase, read Repository authoring while tracing the requested behavior. A system description uses the native steps below; a frozen candidate uses the handoff path.
Choose the artifact
- For drawing a system, flow, schema or history, use a native diagram and the Type router. Deliver the requested diagram through
finalize; code analysis is a separate mode. - For local repository architecture health, module coupling, cycles, layer violations, large files, complexity hotspots or refactoring orientation, use Code Analysis below; the agent handles commands and no architecture JSON is required.
- For a guided walkthrough, animated/static dual-theme SVG, interactive stage player, or 1080p MP4/WebM video over one or more native diagrams, read Story authoring. Use
story draft/attachto add playback to a native Viewer, orstory validate/svg/stage/videofor declarative component choreography. - Only when the user explicitly asks to explain or visualize a pull request, a branch change or a
git diff, or to attach change diagrams to a PR, or names the companion skillarchify-prwhen installed, read PR review authoring first: it covers the three-dot diff, change-marked merged-superset views and thepr validate/pr build/pr attachloop. - Use
explainerwhen the user asks for the answer as a page: a page, one page, an explainer, something to share (“做成一页”, “用页面讲”, “answer with a page”). - Explainer mode is
proactiveby default. A rules line[archify explainer: <mode>]in context selects another; an instruction in the conversation overrides it for that conversation. proactive(default, no line needed): also make a page, unasked, when the answer is a complex flow or process, a diagnosis or troubleshooting result, an option comparison, trade-off or decision, a test or review report, or a plan, and needs a table, steps or several sections to be read well.on-demand: make a page only when asked; otherwise answer in text or draw the requested diagram.always-on(opt-in only): every reply that reaches a conclusion also gets a compact page of at most four panels.- In every mode a page needs a conclusion with some structure behind it. Chat, short or one-line answers, routine status updates (“done, tests pass”), raw command output, a requested native diagram and any reply where the user asks for text only or no page (“只要文字”, “不用做页面”) get none. Make at most one page per reply, and none when the user names another page tool or another skill already made a page for that reply.
- To change the mode, only when the user asks (“只在我要求时做页面”, “always make a page”), write or replace one
[archify explainer: <mode>]line in the current agent's global rules file (such as~/.codex/AGENTS.md,~/.claude/CLAUDE.mdor~/.config/devin/AGENTS.md) and name the file, for example[archify explainer: on-demand] Make Archify explainer pages only when I ask for one.; deleting the line restoresproactive. Never switch toalways-onunasked. - For
explainer, read Explainer authoring for its conclusion, reasons, scope, board layout and optional native diagrams. Write the complete draft, then runfinalize explainerfor validation, atomic delivery and artifact checks. Use panel patch for local content revisions.
Existing candidate handoff
When the user supplies a frozen candidate, run finalize first as one CLI invocation. Its passing receipt completes the automated gates; follow any visual review recommendation under Delivery before claiming visual quality. For repair, follow step 5.
finalize includes a bounded update check in its delivery receipt; see Update awareness.
Native diagram authoring
Use this path for ordinary generation. Read branch references only when their stated trigger applies.
- Choose
architecture,workflow,sequence,dataflow,lifecycle,erd,class,tree,timeline, orwaterfallfrom the question. - Use
