skills/kaizen/SKILL.md
Continuous accidental-complexity reduction — audit codebase against craftsmanship principles via parallel agents, pick highest-ROI target, simplify, hand off to /ship, run /retro, then loop. Use when invoked as `/kaizen`. Loops by default; pass `--once` for a single iteration. Pass `--auto` to merge automatically once CI is green; default is to wait for the user to merge in the GitHub UI. Project-agnostic; reads simplicity heuristics from CLAUDE.md and project memory.
npx skillsauth add eumemic/dev-skills kaizenInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You're driving an autonomous loop that scours the codebase for accidental complexity, ships the highest-ROI simplification, runs /retro, then either merges or waits.
This skill is a thin specialization over the shared loop-driver framework. Read dev-skills:loop-driver for the shared phases (branching, /ship handoff, /retro, merge, idle escalation, flag passthrough). This file owns:
Everything else — flags, branching, /ship invocation, /retro pass, merge handling, idle escalation — lives in loop-driver.
(See loop-driver for the shared invariants — one PR per change, no scope expansion, fail hard, etc. These are additional to those.)
/bughunt candidate and move on. Don't fix it under a kaizen PR.CLAUDE.md and any feedback_* memories before picking. Project-specific anti-patterns weight your search heavily.Dispatch multiple agents in parallel (single message, multiple Agent tool calls) covering different dimensions of craftsmanship. Each agent returns ranked findings; you synthesize.
Before launching agents, read CLAUDE.md (project root) and any feedback_* / project_* memory files about complexity, style, simplicity priorities. Pass the relevant excerpts into each agent's prompt so their findings are calibrated to this project's bar.
Pick 4–6 dimensions appropriate to the codebase. The standard set:
CLAUDE.md's invariants/anti-patterns sections. Find code that maintains the same invariant differently across sites, or violates it subtly.process_X + process_X_v2, defer_X + defer_retry_X), multi-site inlined state machines, copy-paste with slight variation.fallback, legacy, compat_, TODO, XXX, HACK, FIXME, workaround, recover, repair, reconcile. Each match is a candidate, not a verdict.except Exception: blocks that don't re-raise; symptom-suppression guards; "fail soft" handlers in places where "fail hard" is the project's stance.CLAUDE.md excerpts and feedback_* memory excerpts so calibration matches the project.(impact × confidence) ÷ blast-radius, return top 3–5.Use subagent_type: general-purpose for the audit agents. They run parallel via a single message with multiple Agent tool calls. If the loop was invoked with --model=<value> (see loop-driver flags), include model: "<value>" on each Agent call so every audit subagent runs on the chosen Claude generation; otherwise omit model: and let them inherit the session's model.
Collect the ranked lists. Merge into a single global ranking — same target appearing across multiple agents amplifies its score. Rank by: cross-agent corroboration first (multiple dimensions flagging it = signal), then per-dimension severity, then blast radius (smaller wins ties).
Before committing to a target, read the actual file (not just the agent's excerpt). Confirm:
If the audit produces no candidate at the depth applied, fall through to loop-driver Phase 8's empty-iteration branch.
Apply the loop-driver's quality-gate principle. For kaizen, the bar is:
A candidate clears the gate only if all are true:
If the top candidate fails the gate but a borderline candidate exists ("might be load-bearing"), present 2–3 options to the user via AskUserQuestion with rationale. Don't gamble on a contentious refactor.
If no candidate clears the gate: report what was found and why each was rejected, then proceed to loop-driver Phase 8 as if the iteration were empty (the audit wasn't empty, but the iteration is non-productive — that's still an --idle-count increment). Don't ship a borderline change just because the audit produced output.
Make the focused simplification. Keep it tight:
/bughunt (if it's a hidden bug) or back to the user (if it's a feature)./ship defaultsWhen invoking dev-skills:ship (loop-driver Phase 4):
--commit-type=refactor--issue=<N> not applicable.(Additive to loop-driver's shared boundaries.)
AskUserQuestion when (in addition to loop-driver's shared triggers):
When in doubt, ask. A wrong-target kaizen PR teaches the user to distrust the loop.
testing
This skill should be used when the user asks to "test this feature", "verify this works", "run tests", "check if this is working", "test thoroughly", or mentions testing a specific feature or fix.
tools
Drive a GitHub `shovel-ready` issue queue end-to-end — pick highest-ROI, TDD, /ship, /retro, merge; when empty, audit closed work and unlabeled candidates to refill it; otherwise wait for new labels. Use when the user invokes `/shovel-ready`, asks to "work the shovel-ready queue", "drain shovel-ready", "drive issues to merge", "autopilot on labeled issues", "issue-label queue", or sets up an autonomous-development loop on a GitHub-labeled issue tracker. GitHub-specific (uses `gh` CLI); skip for GitLab/Jira.
development
Drive a code change from working tree to a green PR — runs project checks, /simplify, code-review subagent, commits, opens PR, monitors CI. Stops when CI is green; caller handles merge. Use when invoked as `/ship`, or when another skill (e.g., `/shovel-ready`, `/kaizen`, `/bughunt`) hands off a working tree of changes to be shipped. Project-agnostic; reads check commands from CLAUDE.md.
development
Reflect on a slice of the current session (a single iteration, the whole session, or a natural pause point) to identify durable, codifiable learnings about workflow OR dev infrastructure — and ship them only if they clear a quality bar. Most invocations produce nothing; that's the point. Use when the user asks to "run a retro", "do a retrospective", "reflect on the session", "what did you learn", "improve skills based on this session", "codify learnings"; when invoked from a loop driver (`/shovel-ready`, `/kaizen`, `/bughunt`) with `--scope=iteration`; or **proactively at pause points** when the agent is waiting on async work (CI, autodev runs, monitor events) and has cycles to think meta.