| name | tidy |
| description | Garbage-collect a feature's issue directory โ archive done issues, regenerate SUMMARY.md from completion records, audit for zombie/duplicate tests, and flag orphan issues with no PRD or refines link. Use when a feature's done issues pile up (โ8+), when the working set feels cluttered, or after a redo to clean up superseded tests. |
| argument-hint | Feature slug (optional; omit to pick from INDEX) |
Tidy
A periodic garbage-collection pass over a feature, so the active working set stays small and
SUMMARY.md reflects what's actually been built. This is the reverse-direction counterpart to the
forward pipeline (to-prd โ to-issues โ tdd): it folds delivered work back into a current-reality
view and clears history out of the live set. All artifacts follow ARTIFACT-FORMAT.md.
Invocation
/tidy <feat> โ tidy that feature.
/tidy โ read .scratch/INDEX.md, list features whose done count is high relative to
active issues, and ask which to tidy.
When to run
- A feature has roughly 8+
done issues cluttering issues/.
- Right after a
redo/fix slice lands, to retire the tests it superseded.
- Any time the live working set feels noisy and you want reality re-summarized.
Process
1. Survey
Read .scratch/<feat>/issues/*.md (top level only, not archive/). Group by frontmatter status.
Read the ### ๅฎๆ block of each done issue. Read the latest non-superseded PRD*.md and note
which user stories / slices it covers.
2. Present the plan (dry-run, no writes)
Show one preview covering all four actions, then wait for confirmation (yes-all or item-by-item):
๐ Tidy ่ฎกๅ๏ผbalance๏ผdry-run๏ผๆช่ฝ็๏ผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ๅฝๆกฃ done issue๏ผgit mv โ issues/archive/๏ผbody ไธๅจ๏ผ:
01-init-schema.md, 02-balance-api.md, 05-redo-balance-api.md (3)
้็ๆ SUMMARY.md๏ผ่ๅไธ่ฟฐ done ็ๅฎๆ่ฎฐๅฝ๏ผ
ๆต่ฏๅฎก่ฎก:
โ ๅตๅฐธๆต่ฏ โ ่ขซ redo ๅไปฃ๏ผๅปบ่ฎฎๅ :
tests/test_balance_rest.py (4 cases) โ 02-balance-api๏ผๅทฒ่ขซ 05-redo ๅไปฃ๏ผ
โ ็ไผผ้ๅค่ฆ็:
tests/test_balance_edge.py ไธ test_balance_api.py ้ฝ่ฆ็ใ่ดไฝ้ขๆ็ปใ
โ ๅ
ถไฝๆต่ฏไฟ็
ๅญคๅฟๆฃๆต:
โ 04-cache.md (category: detail) ๆขๆ refines ไนไธๅจไปปไฝ PRD ็จๆทๆ
ไบไธ
ๅปบ่ฎฎ๏ผ่กฅ refines / ๅนถๅ
ฅ PRD-vN / ๆ detail ๅฝๆกฃ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
็กฎ่ฎคๆง่ก๏ผ(y / ้้กนๆ)
3. Execute on confirm
- Archive โ
git mv .scratch/<feat>/issues/NN-*.md .scratch/<feat>/issues/archive/ for each
confirmed done issue. Create archive/ if absent. Never edit the body or status โ immutability holds.
- Regenerate
SUMMARY.md โ aggregate the ### ๅฎๆ blocks into .scratch/<feat>/SUMMARY.md per the format doc.
- Test audit โ for zombie tests (those a
redo/fix slice replaced) and duplicates the user confirmed, delete the test files (or the specific cases). Run the test suite after deletion to confirm nothing green turned red unexpectedly.
- Orphan resolution โ for each flagged orphan, apply the user's choice: add a
refines: field,
fold it into a PRD revision (hand off to /to-prd), or relabel category: detail and archive.
4. Update the index
Regenerate .scratch/INDEX.md โ the done counts drop, archived counts rise, active columns now
reflect only live work.
Report what moved, what was deleted, and any orphans left unresolved for the user to decide later.