afc-clean
Pipeline artifact cleanup and codebase hygiene
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Menu
Pipeline artifact cleanup and codebase hygiene
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Basé sur la classification professionnelle SOC
Code and component analysis — analyze code, trace flows, audit consistency, inspect components
Architecture analysis and design review
Full auto pipeline — run spec-to-clean cycle automatically for new features
Save session state for later resumption
Resolve spec ambiguities with clarifying questions
Expert consultation — backend, infra, PM, design, marketing, legal, or tech guidance
| name | afc:clean |
| description | Pipeline artifact cleanup and codebase hygiene |
| argument-hint | [feature name — defaults to current pipeline feature] |
| model | sonnet |
Runs the clean phase independently: artifact cleanup, dead code scan, CI verification, memory update, and pipeline flag release. Equivalent to Phase 5 of
/afc:auto. Use after manually running spec/plan/implement/review phases.
$ARGUMENTS — (optional) Feature name to clean up. Defaults to the currently active pipeline feature.afc_state_is_active) OR a feature name must be providedreview or later"${CLAUDE_SKILL_DIR}/../../scripts/afc-pipeline-manage.sh" phase clean
$ARGUMENTS provides a feature name: use that (for manual cleanup without active pipeline)"No active pipeline and no feature specified. Usage: /afc:clean [feature-name]"Set PIPELINE_ARTIFACT_DIR = .claude/afc/specs/{feature}/
.claude/afc/specs/{feature}/ directory created by the current pipeline.claude/afc/specs/ subdirectories exist, do not delete them (only inform the user of their existence)Prefer external tooling over LLM judgment for dead code detection:
{config.gate} / {config.ci} — most linters detect unused imports/variables automaticallyeslint --rule 'no-unused-vars', ts-prune, knip), use them first{config.ci} final execution.claude/afc/memory/[AUTO-RESOLVED] items -> record decisions in .claude/afc/memory/decisions/.claude/afc/memory/retrospectives/ (reuse as RISK checklist items in future runs).claude/afc/memory/reviews/{feature}-{date}.md before .claude/afc/specs/ deletion.claude/afc/memory/research/{feature}.mdTask("Memory cleanup: afc-architect", subagent_type: "afc:afc-architect",
prompt: "Review your MEMORY.md. Read it, identify and prune old/redundant/obsolete entries, and rewrite it keeping only entries that are still relevant and non-overlapping.")
Use semantic assessment (are entries still relevant? do entries overlap?) rather than a line-count threshold. (Same pattern for afc-security if needed.)| Directory | Pruning Intent | Soft Guideline |
|---|---|---|
quality-history/ | Remove superseded or redundant quality records | ~30 files |
reviews/ | Remove reviews for features no longer in the codebase | ~40 files |
retrospectives/ | Remove retrospectives whose learnings are already captured elsewhere | ~30 files |
research/ | Remove research for libraries/patterns no longer used | ~50 files |
decisions/ | Remove decisions that have been reversed or are no longer relevant | ~60 files |
"Memory rotation: {dir} pruned {N} files"Generate .claude/afc/memory/quality-history/{feature}-{date}.json with pipeline metrics (if pipeline was active):
{
"feature": "{feature}",
"date": "{YYYY-MM-DD}",
"totals": { "changed_files": N }
}
Create .claude/afc/memory/quality-history/ directory if it does not exist.
Clear .claude/afc/memory/checkpoint.md and ~/.claude/projects/{ENCODED_PATH}/memory/checkpoint.md (pipeline complete = session goal achieved; ENCODED_PATH = project path with / replaced by -).
"${CLAUDE_SKILL_DIR}/../../scripts/afc-pipeline-manage.sh" log pipeline-end "Pipeline complete: {feature}"
"${CLAUDE_SKILL_DIR}/../../scripts/afc-pipeline-manage.sh" end
Clean complete: {feature}
├─ Artifacts: {N} files deleted from .claude/afc/specs/{feature}/
├─ Dead code: {N} items removed
├─ CI: PASSED
├─ Memory: {N} files persisted, {N} rotated
└─ Pipeline flag: released