speckit-archive-cleanup
Archive a merged SpecKit spec, remove completed active specs, refresh roadmap and project-memory state, and prepare the cleanup PR after merge.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Archive a merged SpecKit spec, remove completed active specs, refresh roadmap and project-memory state, and prepare the cleanup PR after merge.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Autonomous SpecKit workflow executor. Reads a populated workflow file and executes all 7 SDD phases (specify → clarify → plan → checklist → tasks → analyze → implement) with programmatic gate validation, multi-agent consensus resolution, and auto-commits. Use when the user says "run autopilot", "execute workflow", "autonomous speckit", or has a workflow file ready for execution.
Autonomous SpecKit workflow executor. Reads a populated workflow file and runs all 7 SDD phases (specify → clarify → plan → checklist → tasks → analyze → implement) with programmatic gate validation, multi-agent consensus resolution, and auto-commits. Use when the user says "run autopilot", "execute workflow", "autonomous speckit", "autonomous execution", "kick off autopilot", "start the autonomous pipeline", "drive it through all the SDD phases", "run the whole thing autonomously", "full end-to-end speckit run", or hands over a populated SPEC-NNN-workflow.md file for end-to-end execution. Requires SpecKit CLI installed, constitution created, and a populated workflow file. Not for SDD methodology questions ($speckit-coach), pre-spec scoping ($grill-me), new-spec setup ($speckit-scaffold-spec), status checks ($speckit-status), or PR comment resolution ($speckit-resolve-pr).
Autonomous SpecKit workflow executor. Reads a populated workflow file and runs all 7 SDD phases (specify → clarify → plan → checklist → tasks → analyze → implement) with programmatic gate validation, multi-agent consensus resolution, and auto-commits. Use when the user says "run autopilot", "execute workflow", "autonomous speckit", "autonomous execution", "kick off autopilot", "start the autonomous pipeline", "drive it through all the SDD phases", "run the whole thing autonomously", "full end-to-end speckit run", or hands over a populated SPEC-NNN-workflow.md file for end-to-end execution. Requires SpecKit CLI installed, constitution created, and a populated workflow file. Not for SDD methodology questions ($speckit-coach), pre-spec scoping ($grill-me), new-spec setup ($speckit-scaffold-spec), status checks ($speckit-status), or PR comment resolution ($speckit-resolve-pr).
Autonomous SpecKit workflow executor. Reads a populated workflow file and executes all 7 SDD phases (specify → clarify → plan → checklist → tasks → analyze → implement) with programmatic gate validation, multi-agent consensus resolution, and auto-commits. Use when the user says "run autopilot", "execute workflow", "autonomous speckit", or has a workflow file ready for execution.
Archive a merged SpecKit spec and clean active workflow residue after the implementation PR has merged. Use after confirming merge provenance, when the user asks for post-merge SpecKit archive hygiene, cleanup hygiene, or removal of completed specs from active specs.
Archive a merged SpecKit spec and clean active workflow residue after the implementation PR has merged. Use after confirming merge provenance, when the user asks for post-merge SpecKit archive hygiene, cleanup hygiene, or removal of completed specs from active specs.
基于 SOC 职业分类
| name | speckit-archive-cleanup |
| description | Archive a merged SpecKit spec, remove completed active specs, refresh roadmap and project-memory state, and prepare the cleanup PR after merge. |
Use this skill after a SpecKit implementation PR has merged and the repository needs post-merge archive hygiene. The goal is to preserve source recovery evidence, update project memory, remove only the completed active spec folder, refresh generated SpecKit indexes, and leave the roadmap ready for the next SPEC.
This skill mutates repository files. It is not a read-only status command, not the scaffold entrypoint, and not the implementation autopilot. If the PR has not merged, stop and report that archive cleanup is premature unless the user explicitly asks for an abandoned-work cleanup and the repository has a clear convention for that path.
Accept any of these:
DOC-007 or PRSG-014specs/docs/ai/specs/.process/When multiple inputs are present, verify they point to the same work. Do not
archive based on a SPEC-ID alone when the merge source is ambiguous. Derive the
repository from local git remote output when only a PR number is supplied.
Before editing:
git status --short --branch.codex/ branch..specify/extensions/archive/commands/archive.md exists..specify/memory/archive-reports/ to match local wording and cleanup style..specify/feature.json. If it is absent, do not create it. If it
exists and points to the completed spec, handle it according to local archive
convention.find specs -mindepth 1 -maxdepth 4 -print and
identify the exact folder owned by the merged spec.Preserve process evidence unless the repository explicitly removes it. In this
repository, docs/ai/specs/.process/* workflow and design files are historical
evidence and should remain.
Use update_plan for this workflow when the tool is available. A normal plan
is:
Keep exactly one plan item in progress at a time. If the user sends a newer instruction while cleanup is underway, let the newer instruction steer the remaining work.
Add an archive report under .specify/memory/archive-reports/ named with the
date and SPEC-ID, for example
2026-06-17-doc-007-post-merge-hygiene.md. Include:
git show or git checkout against the merge
commitAppend concise entries to:
.specify/memory/spec.md.specify/memory/plan.md.specify/memory/changelog.mdThese entries should explain what shipped, why the active specs/** folder can
be removed, where canonical artifacts live now, and where the detailed archive
report is stored.
Update roadmap and traceability files that still show the merged spec as pending, in progress, or blocking downstream work. Move downstream specs from blocked to ready only when the completed spec was the actual blocker. Be specific: name the merged PR and the canonical files that now satisfy the dependency.
If docs/ai/specs/.process/autopilot-state.json exists and points at the
completed spec, rewrite it as completed archive state. Keep it valid JSON. Mark
the active step as archived, the status as completed or completed archived, and
the archive sweep as applied. Preserve useful project command names from the
previous state.
Remove only the completed active spec directory under specs/. Do not delete
specs/.gitkeep. Do not delete unrelated active specs, fixture specs, or
process files. If the active spec folder is still referenced by live tests or
scripts, either decouple those references first or stop and report the blocker.
After removal, run the repository's SpecKit index generator in write mode, then run its check mode. The generated MOC or index should no longer point at the archived spec directory.
If this cleanup adds or edits plugin skills, agents, hooks, manifests, or generated docs references, update the matching validation surfaces in the same branch. For this repository that usually means:
agents/openai.yaml sidecar for Codex skillsDo not leave source and generated payloads out of sync when tests enforce payload parity.
Safe to run in parallel:
git status, gh pr view, find specs,
and rg scansDo not parallelize:
autopilot-state.jsonThose steps all update one shared repository state. Serial edits keep status consistent across project memory, roadmap text, generated indexes, and PR evidence.
Run focused verification before committing:
python3 -m json.tool docs/ai/specs/.process/autopilot-state.json when that
file changed--check modefind specs -mindepth 1 -maxdepth 4 -print audit showing only expected
active specsgit diff --checkIf a command fails because of missing dependencies, sandboxing, or network access, retry only when the environment policy allows it. Otherwise report the skipped check and the practical impact.
Commit intentionally after verification. For archive-only cleanup commits and
PRs, use a lower-case Conventional Commit scope derived from the completed spec
ID. For example, archive cleanup for CAR-001 should use
docs(car-001): archive post-merge state, not
docs(CAR-001): archive post-merge state. The repository PR title gate checks
the final PR title, so apply the same lower-case scope to gh pr create or
gh pr edit --title. Use a separate feat(skills): add archive cleanup workflow commit only when this workflow becomes a plugin skill.
If you stage, commit, push, or create a PR in Codex Desktop, emit the matching Codex git directives only after the action succeeds. In the final response, include the merged PR provenance, active spec folder removed, archive report path, generated files refreshed, verification commands, and remaining risks.