Improve

From melodic-software/claude-code-plugins · View interactive version

Improve is an AI agent skill from the GitHub repository melodic-software/claude-code-plugins. Codebase scan for module-level friction (shallow modules, seam leaks, locality gaps): an HTML candidate report, then a Design-It-Twice interview on the chosen one. Use when 'improve architecture', 'find deepening opportunities', 'shallow modules', 'design it twice', 'compare alternative interfaces',

How to use this skill

Skill file

Arguments. [deepening|boundaries|conventions] [--repo <repo> ...] [--medium <value>] [--unattended]. e.g., boundaries. --repo and the other target forms in CODE2 run any lens across several repositories (../../reference/improvement-steps.md, "Scope and fan-out"); the default stays this repository. --medium sets where the deepening report goes (actions/deepening.md, Phase 2). --unattended is the caller's declaration that no user is present; it is never inferred, and only the deepening lens has that mode (actions/deepening.md, "Unattended mode"). With another lens, say so and stop. medium option for the medium resolver (CODE8 "The deepening report"): ${user_config.medium}, or "" when that reads empty or unsubstituted; never put a ${user_config.*} string in a shell command.

Repository context. Gather first

<!-- BEGIN GENERATED: gather-block. Edit docs/conventions/gather-block/block.md, then run scripts/sync-gather-block.py -->

Run each command below as its own Bash call, all sent together in one message (worktree isolation).

Keep any bound in the command's own pipe (output limits).

Unless this section says otherwise, treat a failure (not a repository, git unavailable) as an unknown value and carry on. Keep these as body calls, never ## Pre-computed context lines (gather-block convention).

<!-- END GENERATED: gather-block -->

Variables

Arguments: $ARGUMENTS

Verification level: for the deepening lens, run

bash "${CLAUDE_PLUGIN_ROOT}/lib/read-verification.sh" --plugin architecture --skill improve and

keep its line; Phase 1.5 says what the level does there

(levels).

Improve settings: for the deepening and conventions lenses, resolve <home> ("Convention home"

in ../../reference/improvement-steps.md), then run

node "${CLAUDE_SKILL_DIR}/scripts/improve-settings.mjs" --home <home> from the repository root,

with --no-config in place of --home <home> when no home resolves. Keep its values, and report

each entry of its errors. A value the invocation prompt names wins for that run. If the script

cannot run, use the defaults in ${CLAUDE_PLUGIN_ROOT}/reference/config.md ("Improve keys") and say

so.

Purpose

Improvement is distinct from review and planning. Review evaluates a diff against criteria (reactive). Planning designs new work (forward-looking). This skill scans existing code for friction and proposes candidates for improvement (proactive).

The scan-present-pick process generalizes across improvement lenses. Each lens (action) brings its own analysis method and vocabulary via an actions/<lens>.md playbook plus a research/<lens>/ reference set, loaded only when that lens runs. The first lens, deepening, implements Ousterhout's deep-module concept: finding shallow modules (interface nearly as complex as implementation) and proposing how to deepen them. The aim is testability and AI/agent-navigability (AX): a deep module's small interface lets a reader, human or agent, grasp its purpose without traversing the whole import graph. The boundaries lens checks the module boundaries a repository has recorded against the references its build manifests declare, and hands each rule the user confirms to the enforcement audit as an architecture-test proposal. The conventions lens derives the building blocks, owners and feature blueprints the code already follows, proposes each as a rule, and routes each rule the user accepts to the place that records its kind.

Whether the files that change together live together is a separate skill, /architecture:improve-layout.

This finds existing friction. It does not plan new work, apply mechanical code-level tidyings, enforce rules on a diff, or review changes before a PR. Those are separate concerns handled by planning, tidying, rule-enforcement, and review tools respectively (see "Composition").

Actions

| Argument | Action | What it does |

|----------|--------|-------------|

| (empty) | Defaults to deepening | Runs the deepening lens |

| deepening | Deepening (Ousterhout) | Shallow→deep module scan → HTML report → interview loop on each selected candidate (with a Design-It-Twice branch for parallel interface exploration) → hand off the agreed candidates for planning, never implementing them. Full process: actions/deepening.md |

| boundaries | Boundaries | Recorded boundary rules (from the enforcement ladder's "Where boundary rules live" list) → edges from /architecture:map-dependencies → each edge that crosses a rule, presented for the user to pick → each confirmed rule written to a findings file for /corrections:codify findings (if enabled). With no rule recorded, asks which directions are forbidden. Full process: actions/boundaries.md |

| conventions | Conventions | Recorded rules, paved paths and decisions → building blocks, owners and feature blueprints derived from the code and its history, each reproduced → one proposed rule per item, recorded only on the user's yes → a boundary rule to the architecture concern file, a divergence to /corrections:codify (if enabled), a paved-path entry to /discipline:reuse-or-replace (if enabled). Full process: actions/conventions.md |

One lens per invocation. Lenses don't chain implicitly. Read the action's playbook for its full process.

Adding a lens

A new improvement lens (e.g. coupling, testability, dependency-direction review) is an addition. Never edit an existing lens's contract to add one (open for extension, closed for modification). A step another lens already takes the same way is cited from ../../reference/improvement-steps.md, not restated. Add the lens in every place that lists the roster:

This skill's scripts/lens-roster.test.sh fails when a file in actions/ has no Actions-table row or no argument-hint entry.

Reference index. Load on demand

| File | Load when |

|------|-----------|

| research/deepening/scan-briefing.md | Before briefing the Phase 1 scan subagents. It is the canonical prompt (vocabulary primer, friction checklist, dependency categories, the two badge-acceptance heuristics, per-candidate return schema), so scan quality does not vary run-to-run |

| ../../reference/vocabulary.md (/architecture:principles) | Applying the deletion test, or naming anything in a candidate, report, or interview turn. The terms are used exactly, not paraphrased |

| research/deepening/dependencies.md | Classifying a candidate's dependencies, where the category chooses the testing strategy |

| research/deepening/html-report.md | Writing the report record the builder renders: its fields, the card parts and their order, the page order, the header's evidence counts, the diagram patterns, and the Mermaid label rule |

| research/deepening/interface-design.md | Entering the Design-It-Twice branch, or a single proposed shape is not converging in the interview loop |

| research/boundaries/README.md | Running the boundaries lens: what counts as a boundary rule, mapping a rule's module names to graph nodes, what manifest edges cannot show, and the findings-row template |

| research/conventions/README.md | Running the conventions lens: the kinds it derives and the evidence each needs, where each kind of proposal goes, and how a boundary rule is written into the architecture concern file |

| ../../reference/improvement-steps.md | A lens playbook cites one of its sections: base freshness, scope and fan-out, recorded decisions, the convention home and its exit codes, memory-tier writes, badge bands, the hand-off |

The lens playbooks and the shared steps write the plugin root as <plugin-root>, which is

${CLAUDE_PLUGIN_ROOT}, and this skill's directory as <skill-dir>, which is

${CLAUDE_SKILL_DIR}. Put those paths in place of the placeholders before running a command.

What this skill does not do

Composition

Graceful degradation: where a named step below is not available in the consuming project, inline the equivalent work in this session instead of blocking on it.

| When | Then | How |

|------|------|-----|

| A debugging pass finds an architectural root cause | Run this skill's deepening lens | Structured deepening review of the affected module |

| A candidate shape is agreed | Hand off to /planning:design (if enabled), whose handoff carries the shape into the plan; else summarize the agreed shape for design and planning | Consumes the agreed-shape entry from the candidate artifact (see actions/deepening.md) |

| During the interview loop | Maintain resolved project vocabulary | Invoke /domain-driven-design:ubiquitous-language curate (if enabled) via the Skill tool when available in the current session; otherwise update an existing consumer-declared glossary in its own shape |

| Post-improvement | Review the implemented changes with the project's review tool | Standard diff review |

| The boundaries lens wrote a findings file | Offer /corrections:codify findings <file> (if enabled); never run it unasked | Without it, the report states each confirmed rule and the architecture test it calls for (actions/boundaries.md, Phase 4) |

| The user accepts a conventions-lens proposal | Route it by kind: a boundary rule into the architecture concern file's ## Boundary rules section; a divergence to /corrections:codify (if enabled); a paved-path entry to /discipline:reuse-or-replace (if enabled), which writes it after its own yes | Without the routed skill, the report carries the description or the draft (actions/conventions.md, Phase 4) |

Next

Related

Gotchas

Failure modes this lens runs into, each stated as the rule it implies.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.