跳到正文
cccskills
免费在 GitHub 公开

draw-json-architecture

Draws an interactive HTML Architecture Viewer for any code flow the user names. Walks through seven research-driven steps (flow, name, repo research, lens colors, evidence flags, lens+mechanism per stop, build) and verifies links, claims, and generated artifacts before delivery.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(19)

  • SKILL.md4.5 KB
  • assets/favicon.svg286 B
  • assets/meta-data.json418 B
  • assets/reference-template.md3.0 KB
  • assets/template.html71.1 KB
  • assets/test-template.mjs3.3 KB
  • prompts/01-read-flow.md1.7 KB
  • prompts/02-name-the-surface.md1.7 KB
  • prompts/03-research-the-flow.md3.5 KB
  • prompts/04-pick-colors.md2.6 KB
  • prompts/05-confirm-drift.md4.3 KB
  • prompts/06-pick-mechanism.md8.1 KB
  • prompts/07-author-the-surface.md8.8 KB
  • scripts/audit-claims.mjs6.5 KB
  • scripts/builder.mjs7.9 KB
  • scripts/claims.mjs1.5 KB
  • scripts/config.mjs3.6 KB
  • scripts/coverage.mjs10.0 KB
  • scripts/validate.mjs13.8 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Draw-JSON-architecture

One self-contained HTML Architecture Viewer per code flow, built from JSON in the surface's own folder. Walk the seven steps below in order, confirming with the user at each. No file is written until step 7. Long-form detail per step lives in prompts/.

Step 1 — Read the flow

If <flow> is missing, stop with: No flow provided. Re-run as /draw-json-architecture <flow>. Otherwise echo it back and let the user correct the framing. → prompts/01-read-flow.md

Step 2 — Name the surface

Derive a short kebab-case slug from the flow phrase — drop filler words, keep the meaningful nouns ("home screen to order placement" → home-to-order; "user signup" → user-signup). Confirm the folder it will create. → prompts/02-name-the-surface.md

Step 3 — Research the repo, propose stops + lenses

Walk the journey in code, entry to exit. Propose stops (each "thing that happens": page, handler, job, redirect) and lenses (one per dimension you actually saw — ui, database, api, llm, or surface-specific: cache, queue, webhook, …). Cite the file for every lens. Confirm; loop until settled.

Never propose a stop the code lacks. Never propose a lens you haven't seen. → prompts/03-research-the-flow.md

Step 4 — Pick a color per lens

For each confirmed lens, ask: "What color should <lens> paint?" Offer three CSS color names; user can override. Recap the palette and get one confirmation. → prompts/04-pick-colors.md

Step 5 — Confirm evidence flags per lens

An evidence flag is any non-happy-path fact the diagram should expose. Classify each as drift (diagram/code disagreement), risk (real runtime or correctness hazard), or assumption (intentional modeling choice). For each lens, propose 2–4 candidates from what you saw in step 3 — not a fixed list. User picks. → prompts/05-confirm-drift.md

Step 6 — Pick lens + mechanism per stop

Before writing the graph, decide each stop's primary lens (lens_selected) and call mechanism (type) together. Mechanism is constrained by lens — e.g. ui only accepts sequential (a page render arrives sync); api accepts all four (sequential, async, parallel, streaming). Use parallel only for a proven fan-out; if serial code is modeled as structural fan-out, record that as an assumption in reference.md. Walk the user through every stop and confirm both fields in one pass. → prompts/06-pick-mechanism.md

Step 7 — Author + build

Write source files under the configured source root (default architecture/<slug>/) using the lens+mechanism decided in step 6 (don't re-decide as you write), then run from the repo root:

  1. node skills/draw-json-architecture/scripts/validate.mjs <slug> — structural check.
  2. node <sourceRoot>/<slug>/assets/<slug>.test.mjs — surface truth-guard.
  3. node skills/draw-json-architecture/scripts/audit-claims.mjs <slug> --strict — file/link/line/evidence/truth-guard audit.
  4. node skills/draw-json-architecture/scripts/coverage.mjs <slug> --model "<model>" — coverage + meta-data refresh.
  5. node skills/draw-json-architecture/scripts/builder.mjs <slug> — write the openable HTML.

Point the user at the builder output (default architecture/<slug>/<slug>.html). → prompts/07-author-the-surface.md

Rules

  • Don't modify this skill's files while drawing a surface — surface-specific data lives in the surface's folder.
  • Lens palette is per-surface. Validator + coverage read each surface's palette from its mapping.json; new lenses need zero skill edits.
  • No hardcoded repo identity. The GitHub link base is auto-derived from git remote origin and the repo's default branch (origin/HEAD, else the checked-out branch); missing remote → plain paths.
  • No unsupported claims. Any discrepancy.exist:true entry must have code evidence, a category (drift, risk, or assumption), and a truth-guard assertion or an explicit reason why it cannot be guarded.

Version

version: in this file's frontmatter is the only place the skill version is stored. Generated surfaces do not carry a skill version field.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

报告此技能的问题