/syv-skills:improve-code-designfrom syv-skills
Identifies named design anti-patterns in codebases and prescribes specific remedies. Useful for design reviews, assessing agent-generated code, or when changes keep breaking unrelated parts.
Ships in syv-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Name the anti-pattern, name what it costs, name the remedy. Names are the product: "extract this into a Strategy" is actionable, "clean this up" is not.
You already know the theory. What you don't know is which of it applies here, and your default failure is to report too much. The reference files exist to constrain output, not to teach.
In scope: does this code violate a named principle, and is there a named remedy? Out: bugs (flag briefly, don't develop), style, unconventional-but-clear naming. Misleading names are in.
A weak candidate costs more than a missing one: it teaches the reader the review pads, and the strong findings get skimmed with the rest.
$SKILL_DIR below means the directory containing this SKILL.md (${CLAUDE_SKILL_DIR} in Claude Code). A bare scripts/... path resolves against the repo under review and won't be found.
Comment trust. Sample three or four comments that make a factual claim about behaviour and check them against the code. State the mode in one line at the top of the review:
Ask at most one clarifying question, and only if the answer changes a severity ("how many processes does this run in?"). Under ~50 lines or a single self-contained function there is no structure to review — answer directly instead.
Run these before reading code. They surface candidates faster and more completely than grepping.
python3 "$SKILL_DIR/scripts/tells.py" PATH [--lang py|ts|both]
python3 "$SKILL_DIR/scripts/cochange.py" PATH [--since 2y]
Stdlib only. tells.py finds duplicate predicates across modules, getters that manufacture defaults, cleanup verbs without a context manager, constant tables keyed by another module's type ids, sibling entry points sharing an input type, and TypeScript boundary tells. cochange.py ranks files that change together but live apart — the Structure family, measured. If python3 isn't available, say the mechanical pass was skipped rather than substituting grep. Output is candidates; everything still goes through the gate.
Don't delegate "find design problems in X". It's open-ended search with no stopping criterion, so a subagent returns the first real things it sees at low recall, and better prompting doesn't fix that task shape. Delegate enumeration instead, and keep judgment here, because the Structure family is only visible with every unit in one context.
python3 "$SKILL_DIR/scripts/inventory.py" plan PATH --batch 8
Hand each batch to the design-inventory subagent, started with a fresh context window. It returns a factual table per file and evaluates nothing. Pass the batch and nothing else; adding "and note anything problematic" reintroduces the satisficing this step removes. How to run it depends on the harness:
$SKILL_DIR/subagents/. The Claude Code and Cursor plugins register them as named agents, so say "Use the design-inventory subagent on batch 3: <paths>".$SKILL_DIR/subagents/design-inventory.md (the text below its frontmatter), and give it the batch. To keep it as a named agent, save it in Gemini CLI as a Markdown file in .gemini/agents/ with only name and description frontmatter (the Claude Code tools and model values don't apply there), or in Codex as a TOML file in .codex/agents/ with name, description and the prompt as developer_instructions.Below ~15 files, skip delegation and read them yourself. Either way, write the path of every file that was read, one per line, to covered.txt, then prove coverage:
python3 "$SKILL_DIR/scripts/inventory.py" check PATH --covered covered.txt
Anything uncovered goes in the report as not examined. A tally that reads as complete when it isn't is worse than a missing candidate.
In Claude Code, the batch fan-out and the audit below can run as one dynamic workflow if the user has opted in, by typing ultracode in their prompt, asking for a workflow, or turning ultracode on with /effort ultracode. Don't start one otherwise; the steps stay the same either way.
Read FAMILIES.md, then apply three tests in order (use git log where a rule asks about history), and give each candidate a strength (Strong, Worth exploring or Speculative, defined in REPORT.md):
You can't reliably gate your own findings — by now each one has an advocate. Hand the drafted list to the design-auditor subagent, also with a fresh context (same three routes as above, with $SKILL_DIR/subagents/design-auditor.md):
Expand $SKILL_DIR to an absolute path in the request; the subagent doesn't know it.
Use the design-auditor subagent on these candidates:
<list>. Comment mode:<Trusted|Untrusted>. Worked suppressions:$SKILL_DIR/NEGATIVES.md. Language list:$SKILL_DIR/LANGUAGE.md.
It verifies each claim and returns KEEP / DOWNGRADE / DROP with evidence. Then read the drops: overturn one only where the evidence doesn't support the cited rule (a count that missed a directory, a test that asserts something else), and say that you did and why. Don't overturn because you liked the finding.
The eight rules, so you can draft against them. The auditor prompt owns their definitions and verification steps; if the two disagree, it wins.
Two or more candidates rated Strong after the gate → write the report. Fewer → say it in the conversation and stop. Never build the report to justify the review.
The report is one self-contained page: published where the harness can (in Claude Code, the Artifact tool), where it stays private to the user until they share it; otherwise a local HTML file whose full absolute path you give the user. Delivery, contract, palette and card structure are in REPORT.md. Every candidate carries: a title in the codebase's own nouns · family · standard name · what it costs · the named remedy · what the remedy costs and how you'd know it was wrong. Coverage and the gate tally (drafted, kept, downgraded, dropped) go above the findings. No agent instructions in the report, and no refactoring yet.
Ask which candidate to work through, then walk the tree: what varies and what doesn't, which callers are affected, what the tests look like afterwards, what the remedy costs. The grill-me skill, a relentless interview through the decision tree, is a good companion.
When it's unclear whether two things are one thing, leaving them apart is the reversible choice (LANGUAGE.md, on DRY and YAGNI); say so even if you proposed merging them.
The instruction for a coding agent comes out of this conversation, not the report. The step is done when the user has settled what to change; then write it: what to change, what to leave, what must not break.
FAMILIES.md · LANGUAGE.md · NEGATIVES.md · REPORT.md · subagents/
External: refactoring.guru · lawsofsoftwareengineering.com
FAMILIES.md (opens in a new tab)LANGUAGE.md (opens in a new tab)NEGATIVES.md (opens in a new tab)REPORT.md (opens in a new tab)scripts/cochange.py (opens in a new tab)scripts/inventory.py (opens in a new tab)scripts/tells.py (opens in a new tab)subagents/design-auditor.md (opens in a new tab)subagents/design-inventory.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub syv-ai/agentic-coding-playbook --plugin syv-skills20 skills in this plugin
/brainstormingThinks an idea through with the user before anything is built — new angles and radical alternatives, their thoughts organised and drawn, every open decision settled — and ends in an agreed design. Use when a feature or behaviour change is underspecified, when several approaches are plausible, when the user wants to explore an idea or think a design through, or wants their thinking organised or mapped. To only be questioned on a plan that already exists, use grill-me./executing-plansExecutes a written implementation plan task by task, verifying each step and reviewing the result against the plan before calling it done. Use when there is an existing plan to implement, in this session or one started fresh from a handoff./grill-meOther plugins' skills for the same job