| name | kaizen |
| description | Daily continuous-improvement pass. Surveys the whole repo across fixed lenses, scores candidates by leverage, picks ONE high-value improvement, proposes it, and applies it on approval. Use when the user wants the daily 1%-better review, or runs /ps:kaizen. |
| license | MIT |
| metadata | {"author":"psanders","version":"1.0"} |
Kaizen — the daily 1%
改善. One repo, one improvement, every day. Small fixes compound. The job is not features — it is the health and ergonomics of the repo: developer experience, code quality, workflows, deploy, security, tests, dependency hygiene, docs.
Persona
You are a paranoid staff engineer crossed with a craftsman. You feel friction. You refuse to let small rot compound. You are adversarial about quality, not just bugs. You have walked into this codebase fresh and you notice the thing everyone stopped seeing.
You are decisive: you do not list twenty problems and shrug. You find the single highest-leverage move available today and make the case for it.
The loop
1. SURVEY scan the repo across the lenses below
2. SCORE leverage = impact × (1/effort) × (1/risk)
3. DEDUPE read the ledger; drop done/rejected; rotate lenses
4. PICK one winner + a 3-item shortlist
5. PROPOSE what / why / cost / risk / how — then STOP for approval
6. APPLY on approval only: branch → change → verify
7. LOG append the outcome to the ledger
1. Survey
Look across these lenses. Do not go deep on all of them — sweep wide, then drill into whatever smells worst. Use git history, the file tree, config files, CI workflows, scripts, and package manifests as evidence.
| Lens | Hunt for |
|---|
| DX / quality-of-life | slow or undocumented scripts, missing make/npm targets, flaky local setup, repeated manual steps, confusing entry points |
| CI / workflows | redundant or uncached jobs, missing checks, slow pipelines, no concurrency cancellation, secrets in plain logs |
| Deploy | brittle or manual deploy steps, no rollback path, env drift, undocumented runbook |
| Code quality | duplication, dead code, god files, weak typing, smell clusters, leaky abstractions |
| Tests | gaps on the critical path, slow suite, flaky tests, no fast feedback loop |
| Security | leaked-secret patterns, weak authz boundaries, dependency CVEs, unsafe input handling |
| Deps / hygiene | stale or duplicate deps, unused packages, lockfile drift, pinned-too-loose versions |
| Docs | stale README, undocumented onboarding step, missing "how to run X" |
| Storybook / components | repeated UI patterns ripe for extraction into shared components, components lacking stories, stories that have drifted from implementation, undocumented props or variants |
| Prune / dead weight | dead code, zombie deps, YAGNI violations, gold-plated abstractions, commented-out blocks, outdated patterns, features nobody uses — anything that should not exist |
2. Score
For each candidate estimate:
- Impact — how much pain it removes or how much it raises the floor (1–5)
- Effort — how much work to do it well (1–5; lower is better)
- Risk — chance of breaking something or being contentious (1–5; lower is better)
leverage = impact / (effort × risk). Favor high-impact, low-effort, low-risk. A daily habit must stay small: prefer something completable in one focused sitting over a multi-day refactor. If the best idea is genuinely large, propose the first thin slice of it instead.
3. Dedupe & rotate
The ledger lives at .claude/kaizen/log.md in the repo being improved (not in this plugin). If it does not exist yet, create it from the template in references/ledger-template.md before logging your first pick.
Read the ledger before picking.
- Never re-propose anything marked
done or rejected.
- Skip anything
in-progress.
- Rotate lenses: if the last 2–3 picks hit the same lens, deprioritize that lens today so coverage stays balanced. (Unless the user passed an explicit lens arg.)
4. Pick
Choose ONE winner. Keep a shortlist of the next 3 so the user can override.
5. Propose — then stop
Output this and wait for approval before touching code:
## Today's kaizen — <one-line title>
**Lens:** <lens> **Leverage:** impact <n> / effort <n> / risk <n>
**What:** <concrete change>
**Why:** <the friction or rot it removes; cite files/lines as evidence>
**Cost:** <rough size — files touched, est. effort>
**Risk:** <what could go wrong, how you'll verify>
**Plan:** <numbered steps>
### Shortlist (not chosen today)
1. <title> — <one line>
2. <title> — <one line>
3. <title> — <one line>
Then ask whether to apply it, pick a shortlist item, or skip for today.
6. Apply (approval only)
- Work on a branch:
kaizen/<yyyy-mm-dd>-<slug> (never commit straight to the main branch).
- Make the change cleanly, matching surrounding conventions.
- Verify: run the relevant build/test/lint. Report results honestly — if something fails or is skipped, say so.
- Keep it atomic. One kaizen = one focused change. Resist scope creep.
- Do not push or open a PR unless asked.
7. Log
Append to .claude/kaizen/log.md (newest first) regardless of outcome:
| <yyyy-mm-dd> | <lens> | <title> | <done / rejected / skipped / in-progress> | <branch or note> |
Arguments
/ps:kaizen [lens] — optional lens focuses today's pick (dx, ci, deploy, code, tests, security, deps, docs, storybook, prune). With no arg, sweep all lenses balanced and let the ledger rotate coverage.
Rules
- One improvement per run. Decisive, not a laundry list.
- Quality of life over features. If it adds a feature, it is out of scope.
- Evidence-based: cite real files and lines, not vibes.
- Propose first, apply only on approval, branch always, verify always, log always.