1仕組みと動作原理
ツールチェーンの本質は「JSON-IR → スタンドアロンHTML」コンパイラ:作成者は小さな強い型付けのJSON仕様を記述するだけで、Node CLIがインラインSVGを含む単一ファイルのHTMLにレンダリングし、ランタイムバックエンドに依存しません。
Create a self-contained, interactive HTML diagram from a small typed JSON specification. Static output is the default; enable motion only when the user asks for a demo or presentation.
「境界のある作成パス」の強制:通常の生成では1つの type schema + common schema + 1つのサンプルの閲覧のみが許可され、レンダラー/バリデータ/テストのソースコードを事前に確認することは禁止されています。読解バジェットをトークン効率と安定性に充てています。
Use this bounded path for ordinary generation. Do not read the optional Viewer Runtime reference unless the user asks about those features.
「成果物先行」の規律:次のツールアクションは必ず候補JSONの出力でなければならず、プロンプト文(prose)内で正確な座標を計画することは禁止されています。開始時の制約は、1本のメインパス + まばらなラベル + 最大12個の主要ノードです。
3. Artifact first: the next tool action must write the candidate. 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. Set `meta.quality_profile` to `"showcase"` unless the user explicitly requests a dense `standard` map. Start with automatic routes and labels. Do not add `via`, `channelX`, `channelY`, or `labelAt` before a diagnostic calls for one; apply at most one diagnosed geometry control per repair.
検収はモデルの自己報告ではなく機械のレシートに依拠:validate のレシートが4項目のみのチェックの場合は基本合格、showcase では9つの成果物チェック項目をすべて満たし、composition error が0件、warning が0件である必要があります。
A 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_profile` field, fix it before geometry. For a workflow v2 geometry diagnosis, run `node bin/archify.mjs validate workflow <candidate.json> --layout-json` and use the stable compiler receipt; solver internals are not authoring controls. A passing final validation freezes the candidate: never edit it afterward.
納品は確定的:deliver は仕様のバイトデータを同ディレクトリのプライベートスナップショットに固定し、そのスナップショットをレンダリングおよび検証した上でHTMLをアトミックにコミットし、仕様と成果物の両方のSHA-256およびバイト数を出力します。
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. This is deterministic artifact evidence; it does not exercise the Viewer in a browser.
更新検知は実行可能なローカルスクリプトであり、読み取り専用のチェックのみを行い、ダウンロードやインストールは一切行いません:check-update.mjs が公式マニフェストを取得し、通知を表示した後に eventKey レシートによって確認を行います。
After the first candidate exists, run the packaged checker `scripts/check-update.mjs` once with Node and continue the requested workflow. If the command cannot run, continue without mentioning the check.
マニフェストURLはコードにハードコード:fetchCandidate はURLが定数 DEFAULT_MANIFEST_URL と一致することをアサートした上で、GET + redirect:'error' + タイムアウト + 有界なJSON読み込みを行い、200以外または application/json 以外は例外なく失敗します。
export const DEFAULT_MANIFEST_URL = 'https://tt-a1i.github.io/archify/skill-updates/archify/stable.json';
ブランドロゴは推測ではなく「ダイジェスト固定」を採用:内蔵の Simple Icons カタログをオフラインで照会可能。ユーザーが公式の HTTP(S) URL を提供した場合にのみ取得を実行し、取得した画像を sha256 としてノードに固定します。レンダリングおよび検証時に未固定の取得を行うことはありません。
- Brand identity is optional and explicit. Put a canonical built-in ID in `brand` when the node names that real product. If no preset matches and the user supplied the official HTTP(S) URL, first run `node bin/archify.mjs brands capture "<url>" --json`, then author the returned digest-pinned `brand` object. Render and validate never perform an unpinned capture. Otherwise omit `brand`. Never infer a brand from a vague role such as "database", and never let a badge replace the semantic `type`, label, or relationship facts.
ブラウザのエビデンスはローカルの Chrome/Chromium のヘッドレスCDP(--remote-debugging-pipe)を使用して収集され、Playwright/Puppeteer の依存関係は導入しません。ブラウザが見つからない場合は、合格を装うことなく明確にスキップ(skip)します。
export function findChrome({ env = process.env, platform = process.platform } = {}) { if (Object.prototype.hasOwnProperty.call(env, 'ARCHIFY_CHROME')) { return executable(env.ARCHIFY_CHROME, platform); }
「図が実際のコードを反映する必要がある」場合は git による検証を使用:repository-evidence.mjs が `git -C <repo>` を通じて remote/revision を取得し、リポジトリ相対のPOSIXパスを検証し、絶対パスや制御文字を禁止します。
function runGit(repoRoot, args) { const result = spawnSync('git', ['-C', repoRoot, ...args], { encoding: 'utf8', maxBuffer: 16 * 1024 * 1024, });
2コア機能
3外部依存関係
| Kind | Dependency / Endpoint |
|---|---|
| network | Archify 官方更新 manifest(唯一固定外发端点) |
| network | 用户提供的官方品牌页/图标 URL(仅在显式 brands capture 或节点钉住品牌时抓取;私网地址被拒绝) |
| cli | Node.js >= 18(技能包内无需 npm install,doctor 可直接自检) |
| cli | git(仅在使用 repository evidence 时调用 `git -C <repo>` 取 remote/revision) |
| cli | 本机 Google Chrome / Chromium(visual-check 的无头 CDP 浏览器;缺失则跳过并解释) |
| package | devDependencies(仅仓库开发/测试用,技能包运行时不依赖):ajv 8.17.1 / parse5 7.3.0 / saxes 6.0.0 / simple-icons 16.28.0 |
| network | 本地预览 HTTP 服务(仅绑定 127.0.0.1,URL 必须是 loopback 根路径) |
4推奨統制措置と判定根拠
- scripts/: ローカルスクリプトまたはコマンドの実行: node bin/archify.mjs <validate|deliver|preview|compare|migrate|inspect|chec
- 网络端点: 外部ネットワークアクセスの宣言: GET https://tt-a1i.github.io/archify/skill-updates/archify/stable.json —— f
- 本地工作目录: ファイルの読み書きとアーティファクトの出力: 納品成果物とsidecar:<output.html> および同ディレクトリの receipt/contact-sheet/screenshots(deliver
5二重目の独立検証
- [ok] SKILL.md 声明的 9 项 showcase 检查真实存在 — 实跑 validate architecture examples/web-app.architecture.json --quality showcase --json:ok:true,checks 恰 9 项且全 ok:true,composition.errors=0 / warnings=0,与 SKILL.md 第 28 行「must report all 9 artifact checks with 0 composition errors and 0 warnings」逐字对应。
- [ok] 更新检查只读、不下载不安装 — check-update.mjs 只有 fetch GET(candidate manifest)、有界读取与本地状态文件写入,无下载/解包/执行路径;SKILL.md 第 44 行明文承诺 'never downloads, installs, or executes an update';fetchCandidate 首行即断言 manifestUrl === DEFAULT_MANIFEST_URL。
- [ok] 固定外发端点只有一个 — http(s) 字面量扫描后,可执行代码里的外发目标仅 DEFAULT_MANIFEST_URL(scripts/update-contract.mjs:3 = https://tt-a1i.github.io/archify/skill-updates/archify/stable.json);其余 http 命中为 docs/许可声明/品牌 source 元数据/data-URI、以及 preview 的 127.0.0.1。
- [ok] 品牌抓取的 SSRF 防护成立 — validateUrlShape 拒绝非 HTTP(S)、带凭证 URL、非标准端口、localhost/.local;resolveRequestTarget 对解析出的每个地址做 isPrivateBrandAddress 检查;requestPinned 在 transport.request 的 lookup 中直接返回已校验地址,注释明说是为 'closes the DNS-rebinding gap';ARCHIFY_BRAND_ALLOW_PRIVATE=1 才放开(默认关)。
- [ok] 无凭证/密钥读取 — 对 bin/ renderers/ scripts/ delta/ 的 api_key|secret|password|token|keychain|.netrc|.ssh|bearer|authorization 扫描:命中仅为 URL 凭证字段的反向拒绝(brand-marks.mjs:126、repository-location.mjs:24-25、open-artifact.mjs:82)与 SVG tokenizer 变量名;process.env 命中全部为行为开关(ARCHIFY_*、LOCALAPPDATA、XDG_CACHE_HOME、PROGRAMFILES)。
- [ok] visual-check 的浏览器依赖与降级行为 — findChrome 支持 ARCHIFY_CHROME 覆盖 + 三平台固定路径 + linux 命令探测;不可用时 receipt.status='skipped'、exit code 2(EXIT.skipped)、诊断 viewer/chrome-unavailable,绝不谎报通过。本环境未装 Chrome,故本报告未做浏览器证据冒烟(已如实标注)。
- [ok] repository evidence 的 git 调用与路径校验 — runGit 用 spawnSync('git', ['-C', repoRoot, ...])(maxBuffer 16MiB);verifiedSourcePath 拒绝绝对路径、反斜杠、控制字符,只接受 repo-relative POSIX 路径。
- [ok] 预览服务器只在 loopback — bin/preview.mjs:13 `const loopbackHost = '127.0.0.1'`,server.listen(0, loopbackHost);bin/open-artifact.mjs 拒绝非 http/非 127.0.0.1/带端口之外形状的 URL。
6結論
6a2bea3e072ab6aa…