| name | project-cleanup |
| description | Consolidate project artifacts โ promote scratch to memory, deduplicate memory, process decisions, organize scripts, update steering/skills accuracy. Use periodically or when the project feels cluttered. |
| metadata | {"type":"process","invocation":"user-only","practice":null,"params":{"ephemeral_path":".scratch","durable_path":".memory","scripts_path":"tools","mise_file":"mise.toml","crosslink_lint":"tools/lint/check-crosslinks.sh"}} |
Project Cleanup
Systematic consolidation of project artifacts. Run periodically to prevent drift and clutter.
Phase 1: Promote Scratch โ Memory
Review all files in {{params.ephemeral_path}}/:
- Promote findings/decisions that have lasting value โ
{{params.durable_path}}/
- Archive completed handoffs (superseded by newer ones) โ delete
- Keep only the current handoff and active scratch notes
Decision criteria for promotion:
- Will a future session need this? โ promote
- Is this a one-time finding already captured elsewhere? โ delete
- Is this a decision that should be an ADR? โ write ADR, delete scratch
Phase 2: Process Decisions โ ADR
Check for decisions files (decisions.md, DECISIONS.md, .memory/decisions.md, docs/decisions.md). Process each per init-project's decision-processing procedure: ADR-worthy entries (hard to reverse, surprising, real trade-off) โ write ADR; extract domain terms โ .memory/CONTEXT.md; remove the decisions file once all entries are processed.
Phase 3: Consolidate Memory
Review all files in {{params.durable_path}}/:
- Deduplicate โ merge documents covering the same topic
- Update CONTEXT.md โ add any terms used but not yet defined
- Deprecate โ mark outdated ADRs as superseded (don't delete)
- Aggregate โ if multiple small findings exist on one topic, combine into one document
Check: is every entry in CONTEXT.md still accurate? Remove stale definitions.
Phase 4: References Directory
Verify reference-repo layout per init-project's detection procedure: gitignored references/ or resources/ โ rename to .references/; ensure .references/ is gitignored and documented in AGENTS.md.
Phase 5: Organize Scripts
Review {{params.scripts_path}}/:
- Document โ every script has a usage comment in its header
- Consolidate โ merge scripts with overlapping purpose
- Remove โ delete dead scripts (not referenced anywhere)
- README โ ensure each tool directory has a README with quick-reference commands
Phase 6: Update Task Runner
Review {{params.mise_file}} (or Makefile/justfile):
- Add commonly used invocation patterns as named tasks
- Remove tasks that reference deleted/renamed scripts
- Document โ each task has a description
Phase 7: Verify Steering & Skills
For each eager-context file and skill:
- Accuracy โ do file paths and commands referenced still exist?
- Freshness โ does the content reflect current project state?
- Cross-links โ run
{{params.crosslink_lint}} if it exists
- Params โ do declared params have sensible defaults?
Flag any skill that references files/tools that no longer exist.
Phase 8: README & AGENTS.md Currency
- README.md (user-facing): reflects what the project IS and HOW to use it โ what it does, quick start, how to get value. No internal architecture or agent-only details.
- AGENTS.md (agent-facing): reflects current structure and conventions โ project layout, commands, configs, tool references, and a navigation map covering BOTH user docs (docs/) and agent docs (.memory/, .kiro/).
Phase 9: Ticket Hygiene
If .tickets/ exists:
- Stale open tickets โ work completed but ticket not closed?
tkt close <id>
- Plan drift โ
tkt sync-plan --check to detect status mismatches vs plan.md
- Orphaned tickets โ tickets referencing deleted specs or features? Close with note
- Done tickets with unchecked ACs โ
tkt validate reports these; check or document why skipped
Phase 10: Dependency & Config Hygiene
- Dependencies โ are all tools referenced by scripts actually installed?
- Git โ any untracked files that should be committed or gitignored?
- Stale branches โ any merged branches that can be deleted?
- Issues โ any completed work that should close an open issue?
Report
After cleanup, summarize: files promoted, decisions processed, scratch deleted, memory consolidated, skills flagged, tickets closed, issues closeable.