全部技能 / 设计 / archify
设计 · tt-a1i/archify

archify

description: 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.

风险提醒:黄色 · 留意使用AI 侦查报告
作者 tt-a1iGitHub tt-a1i/archify ↗Stars 63070许可 MIT(仓库根 LICENSE(Copyright (c) 2026 tt-a1i)已核;GitHub API spdx_id=MIT;archify/package.json "license": "MIT";SKILL.md frontmatter license: MIT。另附 THIRD_PARTY_NOTICES.md:内置品牌矢量图来自 Simple Icons 16.28.0(CC0 集合,个别图标另附许可,如 Vue 为 CC-BY-NC-SA-4.0、Jenkins 为 CC-BY-SA-3.0),字体 JetBrains Mono 为 SIL OFL 1.1)commit d673e8300d
agent 宿主通常会约束 skill 执行权限;风险提醒为 AI 侦查观点,不构成质量或安全保证。第三方 skill 仅作拆解与展示,安装使用风险自负,版权归原作者。

1实现原理 · 为什么它能做到

工具链本质是一台「JSON-IR → 独立 HTML」编译器:作者只写一份小型强类型 JSON 规格,Node CLI 渲染成内联 SVG 的单文件 HTML,不依赖运行时后端。

archify/SKILL.md
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.
注:这里在做什么:把「画图」降级为「填 JSON 字段」。类型化 IR + 官方 schema 让几何、语义、样式三者分离;HTML 是自包含产物(模板与字体以字节内嵌在 assets/template.html),可直接分发。

强制「有界创作路径」:普通生成只允许读 1 个 type schema + common schema + 1 个示例,禁止提前翻渲染器/校验器/测试源码——用阅读预算换 token 与稳定性。

archify/SKILL.md
Use this bounded path for ordinary generation. Do not read the optional Viewer Runtime reference unless the user asks about those features.
注:配套硬指令在 SKILL.md 后段('Do not read `renderers/shared/geometry.mjs`, renderer source, validator source, tests, or benchmarks before the first candidate'):只有出现无法解释的内部诊断、或连续两轮修复失败,才允许读实现。这是针对长上下文 agent 的防跑偏设计。

「产物先行」纪律:下一个工具动作必须是写出候选 JSON,禁止在 prose 里规划精确坐标;起点约束为一条主路径 + 稀疏标签 + 至多 12 个主节点。

archify/SKILL.md
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.
注:这里在做什么:把「先想后写」换成「先写后被机器诊断」,避免模型在脑内做几何演算(那正是它最不可靠的部分)。quality_profile 默认 showcase,只有用户明确要密集图才降为 standard。

验收靠机器回执而不是模型自述:validate 回执只有 4 项检查 = 基础通过,showcase 必须报满 9 项 artifact 检查且 0 composition error、0 warning。

archify/SKILL.md
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.
注:实跑核对:`node bin/archify.mjs validate architecture examples/web-app.architecture.json --quality showcase --json` 返回 ok:true,checks 数组恰好 9 项(single_svg / finite_svg / orthogonal_arrows / label_route_clearance / relationship_crossings / relationship_corridors / container_border_runs / route_rhythm / legend_clearance),composition.profile=showcase、errors=0、warnings=0。

交付是确定性的:deliver 把规格字节冻结成同目录私有快照,渲染并校验该快照,再原子提交 HTML,输出规格与产物两者的 SHA-256 与字节数。

archify/SKILL.md
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.
注:SKILL.md 明确划三条互不替代的证据:deliver=确定性 artifact 检查、visual-check=真实浏览器内的有界行为、感知性视觉评审必须由人或具备视觉能力的评审者完成('Report browser evidence and perceptual review independently')。诚实度纪律:非零退出永不描述为成功;失败的交付保留上一版输出,且禁止对失败路径跑 visual-check(那会检查到 stale 的 last-good 产物)。

更新感知是可运行的本地脚本,只做只读检查、绝不下载/安装:check-update.mjs 抓官方 manifest,展示通知后按 eventKey 回执确认。

archify/SKILL.md
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.
注:SKILL.md 第 44 行把边界写死:'The notice is information, not permission. Keep the installed version unchanged; this v0.1 workflow never downloads, installs, or executes an update, and silence is never consent.' 并且禁止转述远端 manifest 的 summary(只能引用 checker 的固定本地句子),这是防「远端文案被当作指令」的注入纪律。

manifest 地址被代码硬钉:fetchCandidate 先断言 URL 等于常量 DEFAULT_MANIFEST_URL,再以 GET + redirect:'error' + 超时 + 有界 JSON 读取,非 200 或非 application/json 一律失败。

archify/scripts/update-contract.mjs
export const DEFAULT_MANIFEST_URL = 'https://tt-a1i.github.io/archify/skill-updates/archify/stable.json';
注:冻结常量与 skill-release.json 的 updateManifestUrl 一致(本地版本元数据也校验一致),把「更新检查被指向第三方」这条路堵死。配套证据:scripts/check-update.mjs 的 fetchCandidate 内 `if (manifestUrl !== DEFAULT_MANIFEST_URL) throw new UpdateContractError('unexpected manifest URL');` 与 `redirect: 'error'`。

品牌标志走「摘要钉住」而不是猜测:内置 Simple Icons 目录可离线查询;只有用户给出官方 HTTP(S) URL 时才抓取,并把抓到的图钉成 sha256 写进节点,渲染与校验永不做未钉住的抓取。

archify/SKILL.md
- 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.
注:抓取侧带 SSRF 防护:仅 HTTP(S)、禁带凭证、非标准端口拒绝、localhost/.local 拒绝、解析后若落在私网地址段拒绝,并把通过校验的 IP 钉进 socket lookup 以关闭 DNS rebinding 窗口(见 renderers/shared/brand-marks.mjs)。字节上限 256KiB(HTML)/1MiB(图)、并发 3、总超时。

浏览器证据用本机 Chrome/Chromium 的无头 CDP(--remote-debugging-pipe)采集,不引入 Playwright/Puppeteer 依赖;找不到浏览器则明确 skip 而不是假装通过。

archify/bin/visual-check.mjs
export function findChrome({ env = process.env, platform = process.platform } = {}) { if (Object.prototype.hasOwnProperty.call(env, 'ARCHIFY_CHROME')) { return executable(env.ARCHIFY_CHROME, platform); }
注:本机实测:该环境无 Chrome 时 visual-check 走 EXIT.skipped 并产出诊断码 viewer/chrome-unavailable('Chrome or Chromium is unavailable. Set ARCHIFY_CHROME to its executable path.')。headless 参数含 --headless=new / --remote-debugging-pipe / --disable-gpu;仅当 root 或显式 ARCHIFY_CHROME_NO_SANDBOX=1 才追加 --no-sandbox。

「图必须反映真实代码」时用 git 取证:repository-evidence.mjs 通过 `git -C <repo>` 读取 remote/revision 并校验 repo-relative POSIX 路径,禁止绝对路径与控制字符。

archify/renderers/shared/repository-evidence.mjs
function runGit(repoRoot, args) { const result = spawnSync('git', ['-C', repoRoot, ...args], { encoding: 'utf8', maxBuffer: 16 * 1024 * 1024, });
注:这里在做什么:把「架构图里的仓库链接/版本」变成可核验事实而非模型编造;路径形状校验(拒绝绝对路径、反斜杠、控制字符)避免把任意本地路径写进产物。

2核心能力

01五类图统一 IR:architecture / workflow / sequence / dataflow / lifecycle,各带官方 JSON Schema 与场景判定表
02自然语言或 Mermaid 入参:flowchart/graph、sequenceDiagram、stateDiagram 读拓扑后重写为 Archify JSON,不机械照搬 Mermaid 样式
03showcase 级机器校验:9 项 artifact 检查 + composition errors/warnings 必须为 0 才算通过
04确定性交付回执:规格与产物 SHA-256 + 字节数,交付后规格冻结禁改
05自包含交互式查看器:主题切换、平移缩放、搜索、聚焦、关系追踪、语义视图、演示模式;PNG/JPEG/WebP/SVG/WebM 导出为阅读器能力,不算额外创作工作
06浏览器行为证据:对已交付 HTML 采集体积/可读性/查看器 chrome 净空与截图 sidecar,不改写也不重渲染产物
07内置品牌库 + 安全抓取:`brands` 离线查询、`brands capture <url>` 摘要钉住
08工作流/生命周期专项工程:workflow schema v2 布局合同、v1→v2 migrate、架构 compare(delta),以及 scenario recipe guide

3外部依赖

类型依赖
networkArchify 官方更新 manifest(唯一固定外发端点)
network用户提供的官方品牌页/图标 URL(仅在显式 brands capture 或节点钉住品牌时抓取;私网地址被拒绝)
cliNode.js >= 18(技能包内无需 npm install,doctor 可直接自检)
cligit(仅在使用 repository evidence 时调用 `git -C <repo>` 取 remote/revision)
cli本机 Google Chrome / Chromium(visual-check 的无头 CDP 浏览器;缺失则跳过并解释)
packagedevDependencies(仅仓库开发/测试用,技能包运行时不依赖):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风险提醒 风险提醒:黄色 · 留意使用

风险提醒:黄色 · 留意使用
  • 体量与阅读成本高 — 技能目录 214 个文件、8.5MB(含 756KB 模板与大量 test/docs),首次使用的 agent 若违反「禁读清单」会迅速吃掉上下文;作者用 SKILL.md 纪律约束,但这依赖宿主是否遵从。
  • 可执行面宽于纯提示词技能 — 会在本机跑 Node、git 与无头 Chrome,并向用户产物目录写 HTML/截图/sidecar;使用前应确认宿主的命令执行与写盘授权范围。
  • 更新通知的信任链在远端 — 通知内容来自 tt-a1i.github.io 的 manifest;虽然代码只取固定字段且禁止转述远端文案,若该 Pages 被篡改,展示给用户的版本/严重级别信息仍源自远端(不会自动安装,风险被限制在信息层)。
  • 品牌素材许可非单一 — Simple Icons 集合为 CC0 但个别图标另有许可(如 Vue CC-BY-NC-SA-4.0、Jenkins CC-BY-SA-3.0),商用嵌入图检查需自行核对节点所用品牌;THIRD_PARTY_NOTICES.md 已逐项披露但不等同于授权。
  • visual-check 通过 ≠ 好看 — 作者本人反复强调机器测量不构成感知评审;若使用者把 ok:true 当作设计质量结论,会得到虚假信心。
风险提醒:黄色,留意使用。它是真·可执行技能包(Node CLI + 本地 Chrome + git),不是纯提示词;外发面清晰可预期:一个可关闭的官方 manifest GET(URL 被硬钉、redirect:'error'、只读)加一条可选、显式触发且带 SSRF 防护的品牌抓取;无任何凭证/密钥/cookie 读取(env 仅作配置开关:ARCHIFY_CHROME、ARCHIFY_BRAND_ALLOW_PRIVATE 等);写盘限于用户指定产物路径与缓存目录。相比同为黄档的常见抓取类技能,其网络与写盘行为更多,故标注为黄而非蓝。

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结论

  • 把「画得好看」问题工程化:类型化 IR + 官方 schema + 机器校验回执,模型只需填字段,几何正确性由编译器与 9 项检查兜底。
  • 反自欺纪律罕见地严格:非零退出不可称成功、失败不跑 visual-check、三类证据(确定性检查/浏览器行为/感知评审)分开报告、交付后规格冻结。
  • 上下文经济学:明确划定「候选前的禁读清单」与按需阅读的 references 层,长任务不易跑偏。
  • 网络面窄且防注入:唯一固定端点是自家 Pages manifest,抓取走摘要钉住 + 私网拒绝 + DNS 固定,更新文案被禁止转述为指令。
  • 产物真自包含:模板、字体子集、品牌矢量全部内嵌,交付 HTML 无运行时依赖,便于归档与分享。
  • 工程化程度可核查:生成器自带 --check、golden 测试、136 个 test 文件、SECURITY.md 私密披露流程与 THIRD_PARTY_NOTICES 逐项许可。
  • 适合:适合需要「可交付、可复核、可归档」技术图的人:架构/流程/时序/数据流/状态图,尤其要求产物能离线打开、能给出校验与哈希证据、能进 CI 或文档流水线的场景;也适合把「图必须与真实代码/仓库一致」当硬要求(repository evidence + brand 摘要钉住)的工程团队。宿主需具备 shell(node)与写盘权限;要拿浏览器证据还需本机 Chrome/Chromium。
    不适合:不适合只想要一张随手示意图、不愿承担安装/校验开销的轻量场景;不适合要求「感知性审美保证」的交付(机器回执不评审好看,需人工或具备视觉能力的评审者);不适合无 shell 的环境(SKILL.md 留有手改 assets/template.html 的降级路径,但等于放弃校验与交付回执);不适合把更新检查当作自动升级机制使用(本版永不下载安装)。
    安装 agent 直装可复制
    ① 本站镜像 更新 2026-09-15
    方式 A · 人下载镜像包下载 archify.tar.gz
    sha256: 6a2bea3e072ab6aa…
    方式 B · JSON 格式安装指南,复制给 agent
    安装指南
    agent 读 JSON 指南后会自动从本站下载安装,无需更多说明。
    ② 上游 GitHub · 原始来源
    能访问 GitHub?直接去上游安装(实时版,可能已更新)GitHub 原始 ↗
    本页镜像锁定 commit d673e8300d;上游为实时仓库。
    来源信息 GitHub 原始
    作者 / 仓库tt-a1i / tt-a1i/archify
    原始 GitHubtt-a1i/archify ↗
    Stars63070
    最近推送2026-09-15
    本 skill commitd673e8300d
    许可MIT(仓库根 LICENSE(Copyright (c) 2026 tt-a1i)已核;GitHub API spdx_id=MIT;archify/package.json "license": "MIT";SKILL.md frontmatter license: MIT。另附 THIRD_PARTY_NOTICES.md:内置品牌矢量图来自 Simple Icons 16.28.0(CC0 集合,个别图标另附许可,如 Vue 为 CC-BY-NC-SA-4.0、Jenkins 为 CC-BY-SA-3.0),字体 JetBrains Mono 为 SIL OFL 1.1)
    本站信息
    收录日期2026-09-06
    分类设计
    侦查报告AI 侦查 · 2 遍 · 2026-09-06
    本站镜像与 GitHub 原始是不同来源:本站锁定 commit 快照经 /r2 分发;GitHub 为实时上游,内容可能已更新。
    同分类邻近