# Archify 架构图 (archify)

> 把需求、Mermaid 或代码库证据生成经过校验的独立 HTML 图表，涵盖架构、时序、ERD 等十种类型，也可做成一页式讲解页。

- 分类: [架构调优](https://www.myskills.tools/zh/categories/architecture-tuning/)
- 来源: 社区 · tt-a1i
- 代码仓库: https://github.com/tt-a1i/archify/tree/main/archify (commit edf158c · v3.2)
- SKILL.md: https://github.com/tt-a1i/archify/blob/main/archify/SKILL.md
- 安装命令: `npx skills add tt-a1i/archify --skill archify`
- 许可证: Apache-2.0
- 兼容工具: Claude Code, Codex, Cursor, OpenCode
- 权限: read-repo ✓, write-files ✓, shell ✓, network ✓
- 状态: 扫描通过
- 规则扫描无法覆盖所有风险，安装前请阅读此技能的 SKILL.md，确认权限后再使用。
- ⚠ 若用户同意开启主动模式，会向全局代理规则文件（如 ~/.claude/CLAUDE.md）写入一行配置。

## 核心规则

finalize 返回非零退出码就绝不算成功，必须按失败的检查项修复后重新运行。

## 执行阶段

1. **选择图表类型** — 根据问题在十种原生图表与讲解页之间选择，必要时用 guide 命令辅助判断。
2. **阅读规范与证据** — 读取对应 schema、示例和默认规则；针对真实代码库时追踪源码作为证据。
3. **编写候选文件** — 在 .archify/ 下的独立文件夹中直接写出完整的 candidate.json 或讲解页草稿。
4. **运行 finalize** — 一次运行校验、交付、严格检查和真实浏览器检查；失败则读取回执并修复后重跑。
5. **简短交付** — 以 HTML 链接开头，只补充影响阅读的说明，不罗列命令或检查清单。

## 权限说明（据 SKILL.md 整理）

| 能力 | 是否需要 | 说明 |
|---|---|---|
| 文件写入 | 部分需要 | 在工作目录的 .archify/ 子文件夹中写入候选文件和 HTML；用户同意时还会在全局规则文件中加一行开关。 |
| 命令执行 | 部分需要 | 运行 node bin/archify.mjs 的 finalize、guide、doctor 等子命令，其中包括真实浏览器检查。 |
| 网络外发 | 部分需要 | finalize 会做有限的版本更新检查；仅在用户提供网址时抓取未知品牌图标，不会自动安装更新。 |

## SKILL.md 头部信息（YAML）

```yaml
---
name: archify
description: "Create validated architecture, workflow, sequence, data-flow, lifecycle/state, ERD, class, tree, timeline, and waterfall diagrams as explorable standalone HTML with dark/light themes, motion and image/SVG/WebM export. Accept requirements or Mermaid; inspect repository evidence for code-backed diagrams. Use when visualizing systems, API calls, pipelines, schemas, histories, timings, or everyday steps, parts, relationships and states. Also turn an answer into a one-page explainer, with the conclusion first, structured panels, native diagrams and charts, when the user asks for a page, an explainer or an answer to share (做成一页, 用页面讲), or proactively when the user's rules opt in with an [archify explainer: ...] line. Not for dashboards."
license: Apache-2.0
metadata:
  version: "3.2"
  author: tt-a1i
---
```

首页: https://www.myskills.tools/zh/ · URL: https://www.myskills.tools/zh/skills/archify/
