spec-archive
Skill6 starsChanged 44 days agoMITView on GitHub
Fold a completed OpenSpec change into the project's specs, commit the move, and open the PR - the last link in the spec chain. Wraps `/opsx:archive`, which is git-blind. Use when the user says "archive the change", "archive that spec", "/spec-archive", "fold this into the specs", "close out the change", "it's done, land it", "finish the spec", or points at a change whose tasks are all ticked and whose code is verified. Gates on real task progress before archiving anything. Boundary: tasks still unticked -> `spec-apply`; applied but not proven green -> `spec-verify`; opening a PR with no change to archive -> `git-pr-create`; retiring a whole capability rather than completing a change -> that is a new change, so `spec-propose`. The PR's `Resolves:` line comes from the branch-to-issue link `spec-propose` set. Never merges the PR it opens.
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 73
Read what moved (see What The Archive Writes) and commit both halves as one commit via git-commit, scoped to the spec:
- Very specific: line 123
Never openspec archive --yes without reading progress.remaining first.
- Very specific: line 125
Never hand-edit openspec/specs/ - correct the change and re-archive
- Distinctive: line 126
Never split the directory move and the spec fold across two commits
- Very specific: line 127
Never gh pr merge. Why -> merging is the user's review gate, and an agent merging its own spec work removes the only human check between …
- Very specific: line 128
Never auto-run openspec init.
- Distinctive: line 129
Never mutate the global openspec profile without asking
- Very specific: line 130
Never --no-verify on the commit or the push
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Spec Archive
completed change -> gate -> archive -> specs updated -> commit -> PR.
The last link in spec-explore -> spec-propose -> spec-apply -> spec-verify -> spec-archive. /opsx:archive owns the OpenSpec mechanics and never branches, commits, or opens a PR. This skill owns that seam, plus the one gate the CLI declines to enforce. Never author spec content here.
Preconditions
openspec context --jsonno_openspec_root -> stop, offer openspec init --tools claude, wait for the user. Never auto-init, never fall back to the current directory. Use the returned root.path as authoritative. User names a store -> openspec store list --json for ids, then --store <id> on every command that accepts one, sticky for the rest of the run.
Then two things must hold before anything is archived:
- The work is verified -
spec-verifyran and its gate passed. Not verified -> send the user there and stop. Why -> archiving folds the delta into the specs, so doing it before the code is proven makes the spec the fiction rather than the record - The tree is clean enough to commit the archive alone. Unrelated edits in flight -> commit or stash them first. Why -> the archive move and the spec fold are one commit, and a dirty tree drags someone else's work into it
The Gate
This is the point of this wrapper. Read the task progress before archiving, and never pass --yes without having read it:
openspec instructions apply --change "<name>" --jsonstate: "all_done", equivalently progress.remaining == 0 -> the gate passes. Anything else -> stop. Name every unticked task and send the user to spec-apply. Do not archive. Do not "just tick the boxes".
Do not gate on isComplete from openspec status --json. It reports that all four artifact FILES exist, not that any task is finished. Probed: a change with 1 of 3 tasks ticked reports isComplete: true while openspec instructions apply --json reports progress: {total: 3, complete: 1, remaining: 2}. Only the second one counts checkboxes.
Probed, on a change with 0 of 3 tasks complete, openspec archive <name> --yes printed exactly one line:
Warning: N incomplete task(s) found. Continuing due to --yes flag.It then exited 0 and folded the spec delta into openspec/specs/ as though the feature had shipped. The warning is the only signal, nothing fails, and the exit code says success.
Why -> the archive is the moment a claim becomes the project's durable specification. An unearned archive leaves openspec/specs/ describing a feature nobody built, and every later change plans against that lie.
--yes suppresses the interactive prompt after the gate has passed. It is never the way past the warning.
Flow
- Preflight per Preconditions. Resolve the change name - user named one -> use it; ambiguous ->
openspec list --jsonand ask. Never guess which change is "the finished one" - Gate on
progress.remainingper The Gate. Nonzero -> stop here and report the unticked tasks - Archive.
.claude/commands/opsx/archive.mdpresent -> invoke it; the OpenSpec-side mechanics are its job and this skill owns only the git seam. Absent -> drive the CLI directly:openspec archive "<name>" - Post-check:
Catches an archived change whose tasks were never finished. It is a backstop, not a substitute for The Gate - by the time it fires the specs are already wrong and the fix is a revert, not an editopenspec validate --archived - Read what moved (see What The Archive Writes) and commit both halves as one commit via
git-commit, scoped to the spec:
Why -> splitting them leaves a commit wheredocs(spec): archive <change-name>openspec/specs/claims a capability whose change record is still sitting open inopenspec/changes/ git-pr-createon the branchspec-proposestarted. It derives the title, body, and label itself, and fills the template'sResolves:line from the branch-to-issue linkspec-proposeset (git config --get branch.<name>.issue). No link -> the line is dropped and the PR closes nothing. Say so; do not let it go missing quietly- Report: the archive path, the capability specs touched, the PR url, plus the missing-link note if step 6 hit one. Nothing else
What The Archive Writes
Two file moves, one commit:
openspec/changes/<name>/->openspec/changes/archive/<YYYY-MM-DD>-<name>/- Each spec delta folded into
openspec/specs/<capability>/spec.md
git status after the archive shows both. Stage both.
Never hand-edit anything under openspec/specs/. The openspec CLI owns those files and the next archive overwrites the edit without a word. A spec that ended up wrong gets fixed by correcting the CHANGE - its specs/ delta, via spec-propose's flow - and letting the archive write it. This is the docs-autoupdate seam: the change is the source, the archived spec is the output.
Flags
| Flag | Use |
--yes | Only after The Gate passed, to skip the interactive prompt |
--skip-specs | Infrastructure, tooling, or doc-only changes that carry no spec delta |
--json | Reading the result programmatically |
--no-validate | Never |
--skip-specsis for a change that genuinely has nothing to fold. Never reach for it to get past a validation complaint. Why -> the complaint says the delta is malformed; skipping the fold archives the change anyway and leaves the specs silent about work that shipped--no-validateis never used. Why -> validation is the only check that the delta about to become the project's spec is well-formed, and it runs on exactly the file nobody will re-read afterwards
Several Changes At Once
/opsx:bulk-archive where installed, then one commit per change - same message shape, same gate applied to each. Not installed -> it needs the custom profile, and the profile is GLOBAL state shared by every repo on the machine. Ask before changing it, never silently:
openspec config set profile customUser declines -> loop this skill one change at a time. That is the correct fallback, not a degraded one.
When Not to Use This
- Tasks still unticked ->
spec-apply - Applied but not proven green ->
spec-verify - Just opening a PR, with no change to archive ->
git-pr-create - Retiring a whole capability rather than completing a change -> that is a new change, so
spec-propose
Rules
- Never
openspec archive --yeswithout readingprogress.remainingfirst.isCompleteis artifact existence, not task completion. See The Gate - Never
--no-validate - Never hand-edit
openspec/specs/- correct the change and re-archive - Never split the directory move and the spec fold across two commits
- Never
gh pr merge. Why -> merging is the user's review gate, and an agent merging its own spec work removes the only human check between generated code and the base branch - Never auto-run
openspec init. Offer it and wait - Never mutate the global openspec profile without asking
- Never
--no-verifyon the commit or the push
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- sourjya/kiro-rails★ 9same name
- gobstech/Banco_Ideias_AI_driven_development★ 0same name
- mahdyarief/spec-driven-agent-kit★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- blog-writeSkill
- cloudflare-hygieneSkill
- git-branch-cleanupSkill
- git-branch-createSkill
- git-branch-syncSkill
- git-commitSkill
- git-issue-createSkill
- git-issue-startSkill
- git-issue-triageSkill
- git-pr-createSkill
- herdr-dispatchSkill
- humanizeSkill
- macos-cleanupSkill
- macos-maintenanceSkill
- obsidian-markdownSkill
- spec-applySkill
- spec-exploreSkill
- spec-proposeSkill
- spec-verifySkill
- vercel-hygieneSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

