visualizing-codebases
Builds an interactive static D3 site that visualizes a codebase, starting with a C4 view of system context, containers, components, and code, with dependency cycles between modules and classes. Use when the user says "visualize this codebase", or asks for C4 diagrams or a map of a codebase's structure and dependency cycles. Not for prose walkthroughs; use explaining-architecture.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- visualizing-codebases
- description
- Builds an interactive static D3 site that visualizes a codebase, starting with a C4 view of system context, containers, components, and code, with dependency cycles between modules and classes. Use when the user says "visualize this codebase", or asks for C4 diagrams or a map of a codebase's structure and dependency cycles. Not for prose walkthroughs; use explaining-architecture.
02 资源文件 8
- 参考文档agents/openai.yaml375 B
- 参考文档references/c4-model-schema.md4.1 KB
- 参考文档references/c4-view.md2.1 KB
- 脚本scripts/build-c4-site.mjs17.4 KB
- 脚本scripts/site/app.js48.9 KB
- 脚本scripts/site/index.html3.0 KB
- 脚本scripts/site/page.html4.4 KB
- 脚本scripts/site/styles.css20.9 KB
03 SKILL.md 正文
Visualizing codebases
Model the codebase from its source, then build a static site the reader can click through. The site shows what exists and how it depends on itself. Judging it is the reader's job.
Views
Each view is a model you write from the code and a script that turns it into pages. Build the C4 view unless the user names another one listed here.
| View | Shows | Read |
|---|---|---|
| C4 | System context, containers, components, and code, with dependency cycles | C4 view, then its model schema |
Rules
- Describe, never prescribe. The site and the reply state elements, dependencies, and cycles as facts. No refactoring advice, severity, smells, rankings of what to fix, or "should". When the user asks for refactoring advice, say this skill stops at the map and leave the call to them.
- Evidence for every element and edge. Each code element is a real file, module, or class. Each relationship is an import, call, or configured connection you saw in source, build, deploy, or config files. Never infer an edge from a name. External systems are remote services the code calls, not libraries.
- Complete imports. A missed import hides a cycle. Prefer the language's own import-graph tooling or compiler output when installed; otherwise parse every import statement. Count only imports between the repository's own modules. Leave tests and generated code out unless the user asks, and say which kinds of imports you excluded, such as type-only or dynamic ones.
Steps
- Scope: the repository root, or the subtree the user names. Read the README, manifests, entrypoints, and deploy files (container, compose, infrastructure, CI) before any source.
- Write the view's model as its reference says. Put it in
visualized/at the repository root unless the user names another directory. - Run the view's build script with Node 18 or later (check with
node --version). On exit 1, fix every error stderr names and rerun until exit 0. - When a browser tool is available, open
visualized/index.htmland every page it links, and read the console. The pages load D3 7.9.0 from cdn.jsdelivr.net, so they need a network connection. Fix what fails and rebuild. Without a browser tool, say the pages were not opened. - Report, adapting the wording:
- The path to
visualized/index.html, and how to open it. - What the view's reference says to report, without commentary on cycles.
- What the model leaves out and why: excluded imports, tests, generated code, or parts that could not be traced.
- The path to
04 同仓库更多 Skills
writing-system-prompts
Writes and reviews system prompts for AI tools, agents, chatbots, and LLM products using a fixed section order and a quality checklist. Use when the user says "write a system prompt", or when drafting a system prompt or auditing one for missing stop criteria, tool rules, constraints, or examples. Not for compressing an existing prompt; use improving-prompts.
writing-prose
Writes and edits prose for people in a plain, conversational, short house style with no em dashes. Use when the user says "write this up", or when drafting or revising documentation, READMEs, explanations, blog posts, or other human-facing prose. Not for prompts written for agents; use writing-system-prompts or composing-agent-prompts.
writing-acceptance-criteria
Writes or rewrites acceptance criteria until each is provable: one observable outcome with a named check that can fail. Use when the user says "write acceptance criteria", or asks to write, rewrite, or tighten acceptance criteria or a definition of done. Not for proving work meets them; use proving-claims.
summarizing-shipped-work
Summarizes the user's merged GitHub PRs for a timeframe into a grouped, linked shipped-work report with highlights, and offers to update a brag document. Use when the user says "what shipped?", or when asked what the user shipped (this week, last month, a quarter, since a date), for a status update, or to update a brag doc.
running-retros
Mines a session transcript, past agent sessions, or named sources such as PR review comments for durable learnings, then proposes approval-gated edits to skills, AGENTS.md, or docs and tracker issues. Use when the user says "retro", or when the user explicitly asks for a retrospective. Never infer from session end or friction.
learning-from-mistakes
Codifies the latest correction or mistake in the conversation as a short imperative rule in the project or global CLAUDE.md or AGENTS.md, after the user approves it. Use when the user says "learn from this mistake", or when the user asks to learn from a mistake, remember a lesson for next time, add a rule to CLAUDE.md, or not repeat a behavior. Not for a whole session; use running-retros.