/improve — Feature Enhancement
Usage
/improve "add confidence score display to extraction results"
/improve E2-S3 # improve based on existing story
/improve --perf src/service/extraction.py # performance improvement
Steps
Write or locate the story.
- If no story exists: write one with acceptance criteria → append to
specs/stories/. - If story exists: read acceptance criteria from
specs/stories/. - Every improvement needs a story. No story → no code.
- If no story exists: write one with acceptance criteria → append to
Assess impact — identify which layers are affected:
# What files will change? grep -rn "relevant_function_or_class" src/ # What tests cover them? uv run pytest --collect-only -q | grep "relevant_module"Read architecture —
.claude/architecture.md,api-contracts.md,data-models.md.Implement the change:
- Modify existing code (don't create parallel paths).
- Update types/interfaces if contracts change.
- Update API contracts if endpoints change.
- Follow the six quality principles (read
.claude/skills/code-gen/SKILL.md).
Update tests:
- Modify existing tests to match new behavior.
- Add new tests for new acceptance criteria.
- Run full suite — no regressions allowed.
uv run pytest -x -q --cov=src --cov-report=term-missing npm test -- --coverageRun code review — spawn
code-revieweron changed files.Fix BLOCK findings (max 3 retries).
Update story file with implementation status.
Difference from /refactor
| /refactor | /improve | |
|---|---|---|
| Changes behavior? | No | Yes |
| Needs a story? | No (traces to principles) | Yes (traces to acceptance criteria) |
| Updates tests? | Tests must still pass unchanged | Tests change to match new behavior |
| Modifies contracts? | Never | May update APIs, types, schemas |
Gotchas
- Improving without a story. Even small changes need acceptance criteria. "Make it faster" is not a story — "Extraction latency < 2s for 100-page PDFs" is.
- Scope creep. Improving one feature and "while I'm here" fixing three others. Each change gets its own story.
- Breaking existing tests. If tests fail after your change, determine: is the test wrong (behavior intentionally changed) or is your code wrong? Don't blindly update tests to pass.
- Forgetting API contract updates. If you change a response shape, update
api-contracts.mdAND the TypeScript interfaces. Frontend breaks silently otherwise. - No baseline measurement for performance improvements. Before optimizing, measure current performance. After optimizing, measure again. No numbers = no proof it helped.
- Parallel path anti-pattern. Don't create
extraction_v2.pyalongsideextraction.py. Modify in place, use feature flags if needed.