Archify 架构图生成
Archify 架构图生成
技能标识:archify
Create polished, validated architecture, workflow, sequence, data-flow, and lifecycle/state diagrams as explorable standalone HTML with inline SVG. Use when the user asks to visualize system architecture, infrastructure, workflows, API sequences, data pipelines, state machines, or to convert/beautify Mermaid.
Archify
Create polished, validated architecture, workflow, sequence, data-flow, and lifecycle/state diagrams as explorable standalone HTML with inline SVG, dark/light themes, optional trace motion, and PNG/JPEG/WebP/SVG/WebM export. Accept plain-language requirements or pasted Mermaid flowchart, sequenceDiagram, and stateDiagram input; inspect repository evidence when the diagram must reflect real code.
Use when the user asks to visualize system architecture, infrastructure, cloud/security/network topology, technical workflows, API call sequences, request lifecycles, data pipelines, ETL/ELT, data lineage, state machines, or to convert/beautify Mermaid.
Install root
Set and keep this environment for every Archify command on the box:
export ARCHIFY_ROOT=本技能目录
cd "$ARCHIFY_ROOT"
Run all CLI invocations via Shell from $ARCHIFY_ROOT with Node >= 18:
node bin/archify.mjs validate|deliver|visual-check|guide|brands|doctor|examples|demo|render|preview|inspect|check|compare|migrate ...
Package paths such as schemas/, examples/, references/, and renderers/ are relative to $ARCHIFY_ROOT. Do not assume a Codex skill checkout or user home path.
Fast authoring path
Use this bounded path for ordinary generation. Do not read the optional Viewer Runtime reference unless the user asks about those features.
-
Choose
architecture,workflow,sequence,dataflow, orlifecyclefrom the question. -
Read one matching schema in
$ARCHIFY_ROOT/schemas/,$ARCHIFY_ROOT/schemas/common.schema.json, and one matching JSON example in$ARCHIFY_ROOT/examples/. Read only those files. Fresh authorship means new stable IDs, domain wording, and layout; use the example for field shape, not facts. New workflow sources useschema_version: 2and its readable layout contract; keepschema_version: 1only when preserving an existing workflow’s fixed geometry. When real product identity matters, querynode bin/archify.mjs brands "<name>" --json; readreferences/brand-marks.mdonly for an unknown brand with a user-provided URL. -
Artifact first: the next tool action must write the candidate JSON under
/workspace(for example/workspace/archify-<slug>.json). Write the candidate before inspecting renderer internals. Do not plan exact coordinates in prose. Start with one clear main path, short side branches, sparse labels, and at most 12 primary nodes. Setmeta.quality_profileto"showcase"unless the user explicitly requests a densestandardmap. Start with automatic routes and labels. Do not addvia,channelX,channelY, orlabelAtbefore a diagnostic calls for one; apply at most one diagnosed geometry control per repair. -
Validate after every candidate edit and immediately before handoff:
cd "$ARCHIFY_ROOT" && node bin/archify.mjs validate <type> /workspace/<candidate>.json --quality showcase --jsonA receipt with only 4 artifact checks is basic validation, never showcase acceptance. A showcase pass must report all 9 artifact checks with 0 composition errors and 0 warnings. If the candidate omits or misspells the exact
meta.quality_profilefield, fix it before geometry. For a workflow v2 geometry diagnosis, runnode bin/archify.mjs validate workflow /workspace/<candidate>.json --layout-jsonand use the stable compiler receipt; solver internals are not authoring controls. A passing final validation freezes the candidate: never edit it afterward. -
For a delivered HTML,
deliveris the final acceptance command. Write HTML under/workspace:cd "$ARCHIFY_ROOT" && node bin/archify.mjs deliver <type> /workspace/<candidate>.json /workspace/<output>.html --quality showcase --jsonA non-zero exit can never be described as success. A failed delivery preserves any previous output, so do not run
visual-checkon that path: it would inspect the stale last-good artifact, not the failed candidate. If validation fails, change only the diagnosedsubject, verifyevidence, choose fromsupportedFixes, and rerun. Continue focused correction while the objective error count reaches a new minimum. If two consecutive rounds do not improve that best count, stop and report the unresolved diagnostics truthfully.
Do not read renderers/shared/geometry.mjs, renderer source, validator source, tests, or benchmarks before the first candidate. Inspect implementation only for an unsupported internal diagnostic or after two focused repairs fail.
Workflow note: use schema v2 for new workflows; preserve schema v1 when an existing source needs fixed legacy geometry. Keep semantic edge labels and act on the compiler diagnostic. The canonical layout, pin, migration, and receipt contract is in $ARCHIFY_ROOT/renderers/workflow/README.md.
Lifecycle note: phase columns 0..4 occupy the main rail; event/terminal column N in 0..2 aligns exactly beneath main column N + 2. A recoverable state uses type: "failure" plus a real transition back to the active state.
Type router
| Type | Use for |
|---|---|
architecture |
Components, services, cloud/security boundaries, infrastructure |
workflow |
Processes, approval gates, tool calls, runbooks, CI/CD |
sequence |
API call chains, request lifecycles, async traces, returns |
dataflow |
Pipelines, ETL/ELT, lineage, governance, consumers |
lifecycle |
State/status transitions, retries, waiting and terminal states |
When ambiguous, run cd "$ARCHIFY_ROOT" && node bin/archify.mjs guide "<scenario>" --json. Scenario proof examples are structural references, not facts to copy.
Mermaid input
Read Mermaid for topology and meaning, then author fresh Archify JSON; do not mechanically render Mermaid styling.
flowchart/graph→workflow, orarchitecturefor a component map.sequenceDiagram→sequence; participants become semantic participants and arrows become messages.stateDiagram→lifecycle; states and transitions retain meaning, not Mermaid style.
Authoring invariants
- One obvious main path; side branches leave the nearest main-path node. Remove low-value edges before adding routing controls.
- Omit
meta.visual_presetby default so every diagram opens inclassic, regardless of whether its resolved color mode is light or dark. Color mode and visual preset are independent. Setsignal-flow,blueprint, oreditorialonly when the user explicitly requests that visual style. - Omit
meta.subtitleby default. Never invent a subtitle that restates the title, nodes, or cards. - Treat the standalone desktop viewer as a first-screen artifact by default. Generate one responsive artifact for laptops and external displays—never device-specific HTML or alternate topology. Prefer authored vertical rhythm that stays readable at common desktop sizes (1440×900, 1600×1000, 1920×1080; also 2048×1320 for large displays when relevant). Repair overflow by removing redundant content or compacting spacing before shrinking nodes or labels. Never counterfeit a pass with
overflow: hidden, clipped content, an internal diagram scroller, stretched SVG height, or smaller typography. - Omit
meta.legendfor the truthfulautodefault. When needed, use onlymode: auto|all|hiddenand renderer-supportedentries.<kind>.label|visible. - Choose one primary authored language from an explicit user choice; otherwise follow the request or conversation’s dominant language.
meta.localecontrols only renderer-owned Viewer UI: use"en"or"zh-CN"for the corresponding supported primary language. For every other language, omitmeta.localeand disclose that Viewer UI falls back to English. The renderer never translates authored content. Seereferences/authoring-contract.mdfor details. - Preserve exact product names, code identifiers, commands, protocols, API paths, and environment names.
- Brand identity is optional and explicit. Put a canonical built-in ID in
brandwhen the node names that real product. If no preset matches and the user supplied the official HTTP(S) URL, first runnode bin/archify.mjs brands capture "<url>" --json, then author the returned digest-pinnedbrandobject. Otherwise omitbrand. - For sequence diagrams, omit
meta.column_fitfor the stablefixedlayout. Set it to"spread"when needed for wide layouts or long participant labels. - Component types are
frontend,backend,database,cloud,security,messagebus, andexternal; variants aredefault,emphasis,security, anddashed. - Relationship labels are semantic data. When one collides, move the label, adjust the route or spacing, then shorten wording while preserving meaning. Deleting a meaningful label is not a geometry repair.
- Omit
meta.engineering_profileby default. Enabledeployment-ownershiponly when the user explicitly asks for production deployment topology, ownership handoff, or fail-closed deployment review and the source facts are known. - Never accept an edge crossing an unrelated opaque node, an ambiguous shared corridor, or a relationship label masking another route.
Read $ARCHIFY_ROOT/references/authoring-contract.md only when you need field enums, spacing math, geometry repair rules, repository evidence, or mode-specific placement.
Delivery and handoff (Grok Bot)
Use validate during repair and deliver once for final acceptance. Delivery freezes the exact specification bytes into a private same-directory snapshot, renders and checks that snapshot, atomically commits the HTML, and reports SHA-256 plus byte counts for both specification and artifact.
After a successful delivery, optionally collect bounded desktop evidence without modifying the trusted HTML:
cd "$ARCHIFY_ROOT" && node bin/archify.mjs visual-check /workspace/<output>.html --json
If visual-check cannot run (no browser runtime on the box), report that honestly and still hand off the delivered HTML; do not invent browser evidence.
Keep claims separate: deliver proves deterministic artifact checks; visual-check proves bounded browser behavior when available; perceptual polish requires a real human or image-capable review.
Deliverables
- Write candidate JSON and final HTML under
/workspace(never under the skill package tree). - Return the checked HTML path, diagram type, validation summary, specification/artifact receipt, and truthful visual-review status.
- Attach the HTML for the user via a
file:///workspace/<output>.htmlpath (parent agent delivers with SendToUser). Do not claim Codex-local open/preview semantics; use--open/previewonly when an interactive desktop preview on this box is explicitly requested and available.
Never claim success for a non-zero command or claim visual inspection you did not perform.
Optional viewer capabilities
Generated HTML already contains theme switching, pan/zoom, search, focus, relationship tracing, semantic views, presentation, and truthful exports. These are reader capabilities, not extra authoring work. meta.animation: "trace" is opt-in; meta.views is optional and should contain at most five curated chapters.
Read $ARCHIFY_ROOT/references/viewer-runtime.md only when the user explicitly asks for Share Cards, Route/Reach cards, motion, guided stories, deep links, presentation, search/focus, or another Viewer Runtime feature.
Setup check
No npm install is required for ordinary validate/deliver runtime (validators and brand marks are pre-generated in the package). Verify with:
cd "$ARCHIFY_ROOT" && node bin/archify.mjs doctor
cd "$ARCHIFY_ROOT" && node bin/archify.mjs demo /workspace/archify-demo
DevDependencies (ajv, parse5, saxes, simple-icons) are only needed to regenerate validators or brand marks via scripts/; do not install them for normal diagram work.
附件:references/authoring-contract.md
Authoring contract
Read this reference only after the Fast authoring path calls for more detail. The schemas and examples remain authoritative.
Schema lookup
Read both the mode schema and schemas/common.schema.json. The mode schemas use $ref, so the common file is where shared enums live.
componentType:frontend,backend,database,cloud,security,messagebus,externalvariant:default,emphasis,security,dashed- Relationship IDs use the shared identifier pattern and must be unique in their collection.
Do not invent fields. Use the nearest matching example for structure, then author fresh IDs, wording, facts, and layout.
Workflow layout contracts
Use schema v2 for new workflows and keep schema v1 when an existing source must
retain fixed geometry. In both versions, col stays in 0..5 and semantic
edge labels are never deleted as a spacing repair. Do not change only
schema_version when absolute coordinates exist: follow the canonical
migration and layout-receipt contract.
The complete normative invariants live in the workflow renderer’s
layout contracts.
Legend contract
Omit meta.legend for the truthful default: auto lists only semantic kinds
present in typed IR. Use mode: "all" for a renderer reference or
mode: "hidden" to remove the full legend. Under entries, only keys listed
by the selected mode schema are valid; each key accepts label, visible, or
both. visible: true may show an unused supported convention, while
visible: false hides it. hidden cannot be overridden.
A label override changes reader wording only. Never infer a kind from prose or
use the legend to compensate for missing nodes, states, messages, or flows.
Long labels are measured and wrap into deterministic rows. Architecture’s
implicit automatic viewBox grows from that same measured footprint. For
backwards compatibility, a legacy document with no meta.legend may omit an
implicit auto legend that cannot fit its explicit viewBox; this never changes
its typed topology. Adding meta.legend makes the presentation intentional and
strict: if its resolved labels cannot fit the authored viewBox, shorten or hide
them, or widen the viewBox using the emitted diagnostic.
Language consistency
Choose one primary authored language. An explicit user choice wins; otherwise
use the language of the request, or the conversation’s dominant language when
the request itself is language-neutral. Separately choose the Viewer locale.
For supported languages, always write the matching meta.locale: "en" for
English or "zh-CN" for Simplified Chinese. The renderer consumes the authored
locale without inferring language from diagram strings. Documents that omit it
remain valid and default to English.
meta.locale controls only renderer-owned reader surfaces: <html lang>, the
document-title suffix, default SVG description and focus labels, default legend
labels, and fixed Viewer controls, statuses, accessibility names, and errors.
It never translates authored content. Apply the primary language separately to
titles, subtitles, node and relationship copy, boundaries, lanes, groups,
guided views, legend label overrides, and cards. A bilingual diagram still
chooses one primary locale for the Viewer; follow an explicit primary-language
request, then prompt order or conversation dominance.
For a requested language outside en and zh-CN, do not write an unsupported
locale. Keep every reader-facing authored string in the requested language,
omit meta.locale so the renderer safely uses English, and explicitly tell the
user that fixed Viewer UI and <html lang> remain English and the artifact is
not fully localized. The fallback applies only to renderer-owned surfaces; it
never permits authored copy to fall back to English. Do not silently substitute
zh-CN for another language or Chinese locale.
Keep exact product names, code identifiers, commands, protocols, API paths, and
environment names intact. Those terms may remain English inside localized copy,
but surrounding explanatory prose must still use the selected language.
Renderer-owned default legend labels follow meta.locale; author a
meta.legend.entries.*.label override only when the diagram needs different
domain wording, and keep that authored override in the primary language.
Visual preset default
Omit meta.visual_preset by default. The renderer then opens the diagram in
classic for both light and dark color modes. Color mode and visual preset are
independent viewer state: switching Light / Dark must preserve the current
preset. Author signal-flow, blueprint, or editorial only when the user
explicitly requests that visual style.
Engineering profile default
Omit meta.engineering_profile for an ordinary system architecture. Region,
cluster, and security boundary wording do not by themselves enable an
engineering profile. Enable deployment-ownership only when the user
explicitly asks for a production deployment topology, ownership handoff, or
fail-closed deployment review and the source facts are known. Once enabled,
do not remove the engineering profile merely to pass validation; repair the
authored facts or report the diagnostics truthfully.
Title hierarchy
Use one concise title and let the diagram carry the explanation. Omit
meta.subtitle by default, and never use it to restate the title, nodes, edges,
or cards. Include one short supporting line only when the user explicitly asks
for a subtitle; an omitted or blank subtitle must not leave an empty visual row
in the generated viewer.
Executable geometry rules
- Node anchors start at side midpoints.
left/rightchange the horizontal endpoint;top/bottomchange the vertical endpoint. For an automatic Architecture relationship, unobstructed facing ports whose axis offset is under 16px may share one horizontal or vertical axis when both endpoints retain the 16px corner gutter. If exactly one endpoint belongs to a spread group, only its unshared counterpart moves; relationships spread at both endpoints keep their distinct ports and outside bridge. - A side is a direction contract. The first and final route segment must be perpendicular and outward/inward in the named direction.
- Automatic Port Spread is a default renderer behavior for architecture, workflow, data-flow, and lifecycle diagrams. Shared automatic endpoints spread deterministically and symmetrically with a 16px corner gutter. It does not apply to sequence messages, single relationships, or explicit
via,channelX,channelY,labelAt, or non-autoroutes. - Showcase route rhythm: every nonzero segment must be at least 8px; every interior segment must be at least 16px. When spread ports are nearly parallel, the router uses a 24px endpoint stub and a 16px outside bridge instead of manufacturing a tiny dogleg.
- Shared endpoint corridors are allowed only when they remain semantically unambiguous. Unrelated collinear overlap of 8px or more fails showcase.
- Container borders are intentional pass-through geometry, but a long edge running along a structural border is not.
- An edge crossing an unrelated opaque node is always a hard failure, independent of quality profile.
Spacing and labels
Spacing recommendations mean clear gap between boxes, not center distance. A 200px center distance between 165px-wide nodes leaves only 35px of clear gap.
For a relationship label, require:
clear gap > label mask width + 8px breathing room
label mask width ≈ 6.5px × ASCII units + 13px
CJK characters count as two units
Relationship labels are semantic data. If the gap is too small, move the label,
adjust the route or spacing, then shorten the wording while preserving meaning.
Omit only wording already fully implied by both endpoints and carrying no
protocol, action, direction, synchronous/asynchronous behavior, or
cross-boundary mechanism. Preserve every meaningful label.
Deleting it is not a spacing repair. If a relationship starts unlabeled because
its endpoints fully imply it, explain why the wording is redundant; this is a
semantic authoring choice, not a spacing repair. In workflow v2, let the compiler
allocate its measured mask before applying a diagnosed labelAt,
labelDx/labelDy, or labelSegment. Apply one diagnosed geometry control at
a time.
Repair order
- Fix missing/invalid
meta.quality_profileand schema errors. - Fix node overlap or out-of-range placement.
- Fix edge-through-node and endpoint-direction errors.
- Fix crossings, ambiguous corridors, border runs, and route rhythm.
- Fix label-to-node, label-to-label, then label-to-route clearance.
Run validate after every edit. Consume diagnostics[] by stable code, exact subject, measured evidence, and supportedFixes. If the diagnostic gives labelAt, use that point instead of estimating another offset.
Mode placement
Architecture
Use one left-to-right spine with short vertical branches. Prefer 6–12 primary components and group only real ownership, trust, process, or deployment boundaries. Boundaries do not replace relationships.
Grid placement is preferred when the schema supports it. Free positions are appropriate for a bounded exception, not for prose-level coordinate planning. Keep external actors outside the system boundary when that is factually true.
Workflow
Lanes express responsibility or phase. Columns 0..5 express logical
progression. Start new workflows on readable-v2; retain fixed-v1 only for
legacy geometry compatibility. Keep the happy path monotonic, preserve semantic
edge labels, and route retries and exception returns outside the main lane
corridor.
Sequence
Participants are ordered by conversation role. Messages own their vertical order. Use return/async/security variants for meaning, not decoration; sequence does not use Automatic Port Spread.
Dataflow
Stages express transformation or custody. Rows separate parallel streams. Label only data contracts, classifications, or cross-boundary movement that is not obvious.
Lifecycle
Main phases use columns 0..4; event and terminal bands use columns 0..2.
Event/terminal column N aligns to the same x coordinate as main column
N + 2. A recoverable failure needs a real transition back to an active state.
A card or guided view saying “retry” is not topology.
Repository evidence
When an architecture diagram must reflect real code, inspect repository
entrypoints, runtime boundaries, storage, transports, and deployment
configuration before authoring. Record only evidence you actually verified.
--repo-root <path> is architecture-only and is accepted by architecture
render, validate, deliver, preview, and compare; workflow, sequence,
dataflow, and lifecycle reject it. Never infer runtime causality from file
proximity or naming alone.
Hand-placed fallback
Use only when no renderer can run. Start from assets/template.html, keep semantic CSS classes, preserve the inline SVG/accessibility structure, and run the delivery visual checklist. Never introduce inline literal colors that break dark/light parity.
附件:references/brand-marks.md
Brand marks
Use a brand mark only when a real product, provider, model family, channel, or
service identity helps the reader. Semantic type still explains what the node
does; brand explains whose product it is.
Agent decision path
-
Search the built-in catalogue when the request names a recognizable brand:
node bin/archify.mjs brands "Claude" --json -
Put the returned canonical ID in the node, participant, or state:
{ "id": "planner", "type": "backend", "label": "Claude", "brand": "claude" } -
If there is no catalogue match and the user supplied the official website, capture its icon explicitly:
node bin/archify.mjs brands capture "https://partner.example.com" --jsonPut the command’s digest-pinned
brandvalue in the authored node:{ "id": "partner", "type": "external", "label": "Partner portal", "brand": { "url": "https://partner.example.com", "sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" } } -
If there is no match and no user-provided URL, omit
brand. Do not invent a URL or silently assign a visually similar company.
Known-brand URLs resolve to the bundled vector instead of using the network. Unknown URL capture accepts only bounded raster image formats, blocks credentials, nonstandard public ports, and private or link-local destinations, uses bounded concurrency and one total deadline, and returns the captured content digest. Later render and validate operations require that exact digest; blocked, unavailable, changed, oversized, or unsafe content fails closed instead of silently changing the artifact.
The final artifact never fetches a brand asset when opened. Preset vectors and digest-verified captured site icons remain embedded in SVG, PNG, WebP, JPEG, Share Card, and WebM exports.
Use node bin/archify.mjs brands --json to inspect all canonical IDs, aliases,
categories, domains, and provenance. Current categories cover AI, cloud,
engineering, data, collaboration, business systems, channels, languages, and
frameworks.
附件:references/delivery-contract.md
Delivery contract
Validate and deliver
Use validate after every candidate edit. CLI HTML output paths must end in .html, including after symbolic-link resolution.
Compare receipt paths must end in .json. Explicit CLI paths may be absolute or
outside the current working directory; authored meta.output remains confined
to that directory. A type mismatch fails before writing with
output/cli-extension or output/cli-resolved-extension. These checks prevent
accidental file-type overwrites; they do not sandbox explicit CLI directories
or prevent replacement of an existing artifact of the expected type.
Use final atomic delivery only after the candidate is frozen:
node bin/archify.mjs deliver <type> <candidate.json> <output.html> --quality showcase --json
Deliver reads the specification once, writes those exact bytes to a private same-directory candidate snapshot, renders that snapshot, runs the complete artifact checker, and only replaces the target after all artifact checks pass. The JSON receipt includes SHA-256 and byte counts for both specification and artifact. Renderer, checker, receipt, or commit failure exits non-zero, removes private state, preserves the previous trusted artifact, and never invokes an opener.
Run visual-check only after deliver exits zero for the current candidate. If
delivery fails and the output path already exists, that path still names the
previous trusted artifact; running visual-check then would measure and capture
stale output, not the rejected candidate. Report the delivery diagnostics and
repair the source before collecting new visual evidence.
The delivery interface exposes three separate claims:
deliverproves deterministic artifact checks and byte identity.visual-checkcollects automated browser evidence from the exact artifact.- Perceptual visual review records a human or image-capable reviewer’s judgment.
Passing one claim never implies either of the others. Never claim that the deterministic receipt includes visual review. It does not include browser evidence either.
Automated browser evidence
After delivery, inspect the exact trusted HTML without rerendering or modifying it:
node bin/archify.mjs visual-check <output.html> --json
The zero-dependency command uses Chrome/Chromium through the DevTools pipe. It
measures light-theme containment at 1440×900, 1600×1000, 1920×1080, and
2048×1320, then captures light/dark screenshots at 1440×900 and 2048×1320. It
writes four PNG sidecars, one relative-path HTML contact sheet, and one JSON
receipt beside the artifact. The receipt binds the source artifact SHA-256 and
byte count, identifies evidenceKind: "automated-browser", records READ plus
Still runtime state, and always reports visualReview: "pending"; automated
browser evidence cannot claim perceptual review.
browser_evidence in the handoff records only the outcome of this automated command:
passedmaps from exit 0 and receiptstatus: "pass"only after every required measurement and capture completes and passes.failedmaps from exit 1 and receiptstatus: "fail"when the inspection finds a defect, the command fails, or a runtime/capture error leaves the evidence incomplete.skippedmaps only from exit 2 and receiptstatus: "skipped"when Chrome/Chromium is unavailable and the inspection does not run.
Runtime or capture failures leave incomplete evidence and must not be normalized to skipped. Failed or skipped capture runs remove stale
image/contact-sheet sidecars rather than presenting prior evidence as current.
They do not invalidate an already successful deterministic delivery, and they
do not turn a perceptual visual review into passed or failed. Retry an
environmental failure through the supported command in a browser-capable
execution context when practical. Keep the packaged transport unchanged unless
the failure reproduces through that seam in a capable environment.
Optional opening
Add --open only when the user wants an immediate local preview. It runs after that atomic commit, uses one argument-array OS opener with a five-second bound, and records open.status. Keep it off for CI, unattended agents, and non-interactive environments. Failure or unsupported opening does not invalidate delivery; its status proves only whether the local opener invocation succeeded.
Last-Good Live Preview
For an active desktop authoring loop only:
node bin/archify.mjs preview <type> <input>.json <output>.html --quality showcase
Preview watches one explicit input on loopback, binds each stable digest to a private snapshot, and advances only after the existing verified delivery pipeline passes. Invalid, half-written, deleted, or superseded input leaves the previous verified revision on screen and on disk. Identical bytes do not rebuild or reload.
The preview runtime ships inside the zero-dependency Skill ZIP and must work without node_modules.
Never start it by default. Do not use it for CI, unattended agents, remote sharing, or mobile use. --no-open is only for a user who will open the printed local URL or for loop testing. Stop it with Ctrl-C before handoff. Server state, port, source path, diagnostics, error text, and reload tokens must never enter the generated artifact or any export.
Perceptual delivery gate
Automated validation and browser evidence cannot prove visual polish. After deterministic delivery, inspect the actual HTML in a capable browser or render the evidence screenshots with an image reader. Check both themes when changed, the default READ view, line crossings/corridors, label masks, node/card fit, focus/search/passport closure, and export cleanliness.
For the default standalone desktop viewer, measure 1440×900, 1600×1000, and 1920×1080. When the artifact is intended for a large desktop display, also measure 2048×1320. A first-screen pass requires document.documentElement.scrollWidth <= window.innerWidth and scrollHeight <= window.innerHeight at every checked size. At the largest checked viewport, inspect the rendered composition for a conspicuous empty lower band: the main panel and necessary conclusion cards should use the available height as a balanced whole, not collapse into a shallow strip. If a desktop viewport overflows, repair the authored composition by removing only genuinely redundant content or compacting spacing before shrinking nodes, labels, or the main panel. Do not hide overflow, clip content, introduce an internal diagram scroller, or reduce node/label typography to make the measurement pass. Narrow/mobile containment may retain vertical page scrolling.
A manual browser record is supplementary to the automated status. Reproducing the same coverage requires all four exact viewport measurements, both endpoint themes, and an artifact-bound record of the inspected SHA-256 and byte count. It never changes browser_evidence: when Chrome/Chromium is unavailable, that status remains skipped even when the manual browser record is complete and visual_review: passed; an automated failed result likewise remains failed. An unconstrained browser glance can support perceptual review only.
Report exactly one truthful status:
visual_review: passed— only after inspecting the rendered artifact.visual_review: skipped (image reader unavailable)— when no capable visual surface exists.visual_review: failed— with the concrete visible defect.
Use correction_rounds: 0, correction_rounds: 1, or correction_rounds: 2; never exceed a maximum of two focused correction rounds. Never report visual_review: passed without inspecting the artifact.
If visual review changes the candidate, validation and delivery must run again because the prior frozen specification receipt is no longer current.
Handoff receipt
Return:
diagram_type: architecture|workflow|sequence|dataflow|lifecycle
output: /absolute/path/to/file.html
specification_sha256: <receipt value>
artifact_sha256: <receipt value>
validation: 9/9 showcase, 0 errors, 0 warnings
browser_evidence: passed|failed|skipped
visual_review: passed|skipped (image reader unavailable)|failed
correction_rounds: 0|1|2
Derive browser_evidence only from the latest artifact-bound visual-check receipt. Record any manual browser work separately with its artifact binding, viewport/theme scope, and observations; never use it or visual_review to overwrite the automated status.
Opening, preview status, Share Cards, and other viewer exports are not validation claims.
附件:references/viewer-runtime.md
Viewer Runtime reference
Read this only when the user asks for a reader-facing capability. Ordinary generation does not require implementing or re-documenting these features; they are already in the generated HTML.
Exploration
- Diagram Guide lists current actions and shortcuts.
- Reading Depth starts at READ at the default 100% scale, reveals FULL detail at 175%, and falls back to MAP only below 100%. Focus, story, route, and semantic interactions reveal their exact facts at any scale.
- Semantic Lens summarizes selected node/relationship kinds without changing authored geometry.
- Intent Trace previews a fine-pointer or keyboard target before committed focus.
- Node Finder searches labels and stable IDs.
- Semantic Passport opens on focus, shows authored upstream/downstream facts, supports a copyable deep link, has an explicit close action, closes on true outside activation and Escape, and never enters canonical export.
- Semantic Radar mirrors the visible viewport and authored graph without becoming a second source of truth.
- Direct Relationship Pin makes a unique compiled relationship operable while preserving the authored line and stable relationship identity. It must fail closed on conflicting source/target/label/ID metadata.
- Route Probe resolves exactly two endpoints over authored directed relationships. It never infers a route from geometry.
Guided views and story
meta.views may define at most five curated chapters using stable node IDs. The Named Chapter Rail, Chapter Delta Preview, Story Beat Navigator, Story Follow Camera, Story Director Strip, Story Horizon, and Shareable Story Moment links all derive from that one authored array; none owns parallel topology or layout.
Story transitions classify only the exact relationship between adjacent authored stops: forward, reverse, multiple, or grouped/no direct link. Never infer a transitive edge, verb, causality, or runtime behavior from proximity, kinds, or story order. Playback is reader-started, bounded, stale-safe, and motion-governed.
Motion and presentation
meta.animation: "trace" enables a finite reader-controlled Live/Still trace. Static is the default. Still, reduced motion, page hiding, print, and canonical export preserve complete static meaning. Presentation Stage changes viewer chrome and framing, never authored geometry. This is not a mobile product feature; narrow layouts get containment only.
Canonical exports
The export menu can copy/download full-diagram PNG, download JPEG/WebP, download a dual-theme SVG, and record a trace-enabled WebM. Viewer state—Guide, Lens, finder, focus, route, story, camera, radar, presentation, motion ownership, and temporary overlays—must be removed from canonical export.
Share Card
The optional 1200×630 Share Card PNG is for README, release, social, or launch previews. It uses the current theme and visual preset, contains the complete canonical diagram without cropping, and never claims validation. Copy Share Card reuses the same canonical PNG when clipboard image writes are supported.
Route Share Card
After a real directed Route Probe resolves, the reader may use Export → Route Share Card. It reuses the exact ordered route snapshot and the shared Share Card seam: format=share-card, variant=route. The isolated clone may use only static data-share-route-* decoration. It is download-only, fails closed for stale/unreachable/conflicting routes, and never becomes the canonical artifact.
Reach Share Card
After a non-empty authored reachability query, the reader may use Export → Reach Share Card. It consumes the already resolved upstream/downstream node and edge set without rerunning traversal: format=share-card, variant=reach. The isolated clone may use only static data-share-reach-* decoration. It is download-only. Call it authored reachability—not impact, blast radius, breakage, or runtime causality.
Truth boundary
Viewer exports are communication assets. They do not replace the checked HTML, the deterministic delivery receipt, or a real visual review. Do not add a hosted service, storage surface, dependency, schema branch, or mobile product surface for these viewer-only capabilities.
附件:THIRD_PARTY_NOTICES.md
Third-party notices
Archify includes optional vector data for third-party brand marks. These marks are provided only to identify technologies and services in user-authored diagrams. Their inclusion does not imply sponsorship, endorsement, partnership, or affiliation with Archify.
The Archify MIT license applies to Archify’s own code and content. It does not replace the copyright licenses, trademark policies, or brand guidelines that apply to third-party marks. Users are responsible for confirming that their particular use is permitted.
Simple Icons
Most of the built-in vector paths and their metadata were generated from Simple Icons 16.28.0. Simple Icons makes its collection work available under CC0 1.0 Universal.
As Simple Icons explains in its disclaimer, CC0 for the collection does not mean that every underlying icon is CC0. License and brand-guideline metadata may be incomplete or change over time. The absence of an individual license entry is not a grant of permission.
Archify embeds the selected icons as vector-path data and may render them in a user-selected color. The following individual licenses were recorded in the pinned Simple Icons 16.28.0 metadata:
| Mark | Recorded source | Recorded license | Archify treatment |
|---|---|---|---|
| Angular | Angular press kit | CC-BY-4.0 |
Embedded as vector-path data; color may be changed by the authored diagram. |
| Apache Airflow | Apache logos | Apache-2.0 |
Embedded as vector-path data; Apache trademarks remain subject to the ASF trademark policy. |
| Apache Kafka | Apache logos | Apache-2.0 |
Embedded as vector-path data; Apache trademarks remain subject to the ASF trademark policy. |
| .NET | .NET brand repository | CC0-1.0 |
Embedded as vector-path data; color may be changed by the authored diagram. |
| JavaScript | JS community logo | MIT |
Embedded as vector-path data; color may be changed by the authored diagram. |
| Jenkins | Jenkins artwork source | CC-BY-SA-3.0 |
Embedded as vector-path data; color may be changed by the authored diagram. Jenkins retains its trademark rights. |
| Rust | Rust project | CC-BY-SA-4.0 |
Embedded as vector-path data; color may be changed by the authored diagram. See the Rust media guide. |
| Vue.js | Vue logo source | CC-BY-NC-SA-4.0 |
Embedded as vector-path data; color may be changed by the authored diagram. The non-commercial and share-alike conditions remain applicable; see the Vue artwork terms. |
The source, guideline, and known license fields for every packaged mark are
preserved in renderers/shared/generated-brand-marks.mjs.
OpenAI mark
The OpenAI vector path is recorded from the OpenAI brand guidelines, not from Simple Icons. Use remains subject to those current guidelines and any applicable trademark rights. Its inclusion does not state or imply endorsement by OpenAI.
No additional rights granted
Brand names, logos, and trademarks remain the property of their respective owners. This notice records provenance and known terms; it does not grant rights that Archify does not hold, and it does not state that every packaged mark has been cleared for every commercial, promotional, or redistributive use.