AGENT SKILL

audit

Audit a whole repository or a large directory for design complexity. Ranks red flags by how often each file changes, verifies candidates against each rule's exemptions in parallel, has a cold reader judge the interfaces of the most-changed modules, and returns the investments worth making first. Use when the user asks for an audit, a design or complexity review of an entire codebase or package, a hotspot map, or where design work would pay off most. Use it even when the user only asks where the code is worst or what to clean up first.

License 许可
MIT
最近更新
2026-10-16
Stars
★ 2
Forks
0

01 前言 Front Matter

name
audit
license
MIT
description
Audit a whole repository or a large directory for design complexity. Ranks red flags by how often each file changes, verifies candidates against each rule's exemptions in parallel, has a cold reader judge the interfaces of the most-changed modules, and returns the investments worth making first. Use when the user asks for an audit, a design or complexity review of an entire codebase or package, a hotspot map, or where design work would pay off most. Use it even when the user only asks where the code is worst or what to clean up first.
allowed-tools
Read Grep Glob Agent AskUserQuestion Workflow mcp__plugin_software-design_software-design__check mcp__plugin_software-design_software-design__interface
compatibility
Claude Code, Codex or pi with the software-design plugin, whose MCP server is built from source with Rust (rustup).

03 SKILL.md 正文

Audit a codebase

Complexity is what developers experience in the code they work on, weighted by how often they work on it. The audit therefore starts from churn: findings in files that change every week come first; findings in files nobody touches come last.

Tools. The plugin's software-design MCP server provides two tools: check returns findings as JSON; interface returns signatures and interface comments without bodies. In Claude Code their full names are mcp__plugin_software-design_software-design__check and mcp__plugin_software-design_software-design__interface. The plugin root is two directories above this skill. Pass directory, the repository's absolute path, on every call: outside Claude Code the server does not run in the project. If neither tool is available, run the global installer at https://github.com/iaserrat/software-design to build the runtime, then start a new session. From an installed plugin directory, sh scripts/software-design install also builds it synchronously (log: ~/.software-design/build.log, needs Rust and a C compiler).

Agents. This skill delegates to the plugin's agents, such as software-design:flag-verifier. Each agent's instructions are in the plugin root's agents directory, in the Markdown file named after the agent. Where those agent types do not exist, as outside Claude Code, give each task to a general subagent together with that file's instructions. With no subagents at all, follow the instructions yourself, one task at a time; for a cold read, look only at the interface tool's output before reading any implementation, and say in the report that the read was not independent.

Copy this checklist and tick it off as you go:

- [ ] 1. Depth chosen: workflow only if the user asked for an audit
- [ ] 2. Hotspots, confirmed findings and cold reads collected
- [ ] 3. Investments ordered by churn times findings removed
- [ ] 4. User chose the first investment

1. Choose the depth

  • The user asked for an audit in their own words: run the bundled multi-agent workflow:

    Workflow({ name: "software-design:deep-audit", args: { paths: [<directory, or omit for the whole repository>], verify: 12, modules: 3 } })

    It runs the check tool at tier B, verifies the twelve heaviest candidates in parallel with software-design:flag-verifier, and sends the interfaces of the three most-changed modules to software-design:cold-reader. It logs what it did not cover.

    Where the Workflow tool does not exist, as outside Claude Code, run the same steps yourself: the check tool at tier B, software-design:flag-verifier on the twelve heaviest candidates, and software-design:cold-reader on the directories of the three heaviest findings. Log what you did not cover.

  • You decided an audit would help, without the user asking for one: do not start the workflow. Call the check tool with tier: "B" yourself, summarise the hotspots, and offer the full audit, stating that it runs about fifteen agents.

2. Report

  1. Hotspots: the files with the most churn and the most findings, as a table of path, commits in the last year, confirmed findings, and red flags.
  2. Confirmed findings: grouped by red flag, each with path:line, its section, and the recommended fix.
  3. Interfaces a newcomer cannot use: the cold reader's unanswered questions per module.
  4. Investments, in order: each a concrete change, the files it touches, and the red flags it removes. Order by churn times the number of findings removed. A steady 10 to 20 percent of development time spent on such investments pays for itself without stalling feature work, so propose a first step that fits that budget.

Ask the user with AskUserQuestion which investment to start, recommendation first, and hand the chosen one to the software-design:change skill.

04 同仓库更多 Skills

iaserrat
iaserrat/software-design

review

Reviews code for design red flags, such as shallow modules, pass-through methods, information leakage, repeated code, comments that repeat code, vague names and ignored errors, and tests whether public interfaces can be used without reading their implementation. Ranks findings by how often the code changes and verifies each against the rule's own exemptions. Use when the user asks to review a diff, branch, pull request, file or directory for design quality, complexity or maintainability, asks whether code is well designed, or asks whether an API, class or module is clear or usable without reading its code.

★ 2
iaserrat
iaserrat/software-design

perf

Make code faster without making it more complex. Measures before changing anything, looks for a fundamental fix first, and otherwise redesigns around the critical path with special cases moved off it. Use when the user asks to optimise, speed up, or reduce the latency, allocations or memory of code, or to review a change made for performance. Use it even when the user names a specific micro-optimisation, because measuring comes first.

★ 2
iaserrat
iaserrat/software-design

document

Write or improve the interface and implementation comments of a module. Comments carry what the code cannot say (units, boundaries, invariants, errors, reasons) and never repeat the code. A comment that is hard to write is reported as a design problem. Use when the user asks to document, comment or explain a module, class, function or API, to fix poor or outdated comments, or when the software-design hooks report comments that repeat the code. Use it even when the user only asks to add comments or docstrings.

★ 2
iaserrat
iaserrat/software-design

design

Designs the interface of a new class, module, API, service or feature before its code is written. Lists the knowledge the module hides, designs three competing interfaces in parallel, tests each on a reader who has never seen the code, compares the caller code each needs, and writes interface comments first. Use whenever the user asks to design, sketch, shape, structure or plan a class, module, API, interface or service, asks which methods or signatures something should have, wants to compare designs, or says "design it twice", even when they only describe what the code must do. Typical requests include "design the class interface", "what methods should this class have", "how should I structure this module", "sketch an API for", "design X before I write it", or any description of a class, module or API that does not exist yet.

★ 2
iaserrat
iaserrat/software-design

change

Plan a change to existing code strategically. Before editing, works out what the code would look like had it been designed with this change in mind, compares that with the smallest patch, and lets the user choose. After editing, checks the diff for red flags and stale comments. Use when the user asks to add a feature to, fix, or extend existing code and the change adds a parameter, flag, special case or exception, touches a module's interface, or spreads across several files. Use it even when the request sounds like a small patch, because small patches are how complexity accumulates.

★ 2
iaserrat
iaserrat/software-design

release

Bump the version in every manifest, update the changelog, tag main and publish a GitHub release marked latest.

★ 2