fission-ai/openspec/openspec-archive-change
Claude Code and agent skill by fission-ai/openspec
- community
Checking that the SKILL.md file is still in the repository.
Archive a completed OpenSpec change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete. Also use when the user says "openspec archive" or "opsx archive".
Install
npx vskill@latest install fission-ai/openspec/openspec-archive-changeSKILL.md
The same SKILL.md was published earlier as fission-ai/openspec/openspec-archive-change.
Archive a completed change in the experimental workflow.
Store selection: If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run openspec store list --json to discover registered store ids, then pass --store <id> on the commands that read or write specs and changes (new change, status, instructions, lifecycle actions, list, show, validate, archive, doctor, context, schemas, view). Once selected, treat --store <id> as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run openspec status --change "<name>" --json --store "<id>", not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local openspec/ root.
Project check: These steps expect a project that already uses OpenSpec. Before the first step that writes anything (new change, archive, sync specs, or authoring an artifact file), confirm the project has a root: run openspec list --json (with --store <id> when a store is selected, since the store is then the root) and read root. A root object means the project is set up. "root": null means it is not - there is no openspec/ directory here, and a write such as openspec new change would create one as a side effect. The command also exits non-zero, which is that answer rather than a broken CLI, so read the JSON instead of retrying or working around it.
One "root": null is not about setup: when a status error message starts with Declared in or Invalid store declaration in and names this project's openspec/config.yaml (or config.yml), the project does use OpenSpec through a store it declares, which this machine cannot resolve (the store is not registered, or the store: line is malformed). Do not treat it as uninitialized and skip the branches below: stop before writing and show the user that error's message and fix.
Otherwise, with no root, what happens next depends on how this workflow was reached:
- Auto-selected: you chose this workflow yourself, without the user naming OpenSpec, naming this skill, or invoking this skill by name. Stop using OpenSpec and answer the request normally, as you would with no OpenSpec installed. Do not ask them to set anything up and do not mention OpenSpec setup.
- Explicit OpenSpec request: the user named OpenSpec, named this skill, or invoked this skill by name. Stop before writing and ask how to proceed: set this project up (
openspec init), target a store they already have (--store <id>), or continue without OpenSpec for this request. Wait for their answer.
In both branches, never create the root as a side effect: do not run openspec init until the user asks for it, do not hand-create openspec/ files, and do not let a command create it.
<capability-path> is the spec directory relative to specs/ (for example, user-auth or identity/user-auth). Preserve the full path from each delta spec when resolving its main spec.
Input: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
Steps
- Select the change
If a name is provided, use it. Otherwise:
- Infer from conversation context if the user mentioned a change
- Auto-select if only one active change exists
- If ambiguous, run
openspec list --jsonto get available changes and ask the user to select one
When prompting, show only active changes (not already archived). Include the schema used for each change if available.
Always announce: "Using change: <name>" and how to override (e.g., openspec-archive-change <other>).
Load current archive inputs before the existing archive checks:
After resolving the selected change and planning root, run this once for the archive: ``bash openspec instructions archive --change "<name>" --json `` Keep the same selected-root flags on this command. This lookup is advisory and optional: a failed lookup must never block archiving. If it exits non-zero or returns invalid JSON — for example on an older CLI that does not support this command yet — continue the archive workflow with no context, no operation guidance, and no lifecycle actions. Do not report an error and do not stop.
A successful response may omit every optional field. Treat context as a required prompt-level input: read and consider it, and apply relevant project facts, conventions, and constraints. Treat operationGuidance as optional additive advice: read and consider every entry, and follow entries that are applicable and compatible with the built-in archive workflow.
Keep both fields separate from built-in steps, explicit user choices, resolved paths, CLI checks, and command contracts. If context conflicts with one of those controlling inputs, report the conflict and preserve the controlling value. If guidance is inapplicable or conflicts with a controlling input, do not follow it and explain why. Do not infer replacement paths, skipped prompts, or flags from either field, and do not copy their text verbatim into specs, change artifacts, or archive summaries unless the user separately asks for it. These are prompt-level behavior contracts, not enforceable checks.
The response may also include lifecycle (before, completed, handling) or lifecycleError: project lifecycle actions for this archive. Older CLIs omit both. When both are absent, skip every lifecycle step below.
- Check artifact completion status
Run openspec status --change "<name>" --json to check artifact completion.
Parse the JSON to understand:
schemaName: The workflow being usedplanningHome,changeRoot,artifactPaths, andactionContext: path and scope contextartifacts: List of artifacts with their status (done,skipped, or other)
If any artifacts are neither `done` nor `skipped` (skipped artifacts satisfy the requirement - the change declares skip_specs):
- Display warning listing incomplete artifacts
- Ask the user to confirm they want to proceed
- Proceed if user confirms
- Check task completion status
Run openspec list --json with the same selected-root flags and find the entry in changes whose name exactly matches the selected change. Require exactly one match and nonnegative integer totalTasks and completedTasks, with completedTasks <= totalTasks. The CLI resolves the schema's tracked task files, including custom artifact names, output paths, and globs. Incomplete tasks = totalTasks - completedTasks.
Do not infer task completion from artifact status or the absence of a top-level tasks.md. If the lookup fails, returns invalid JSON, omits or duplicates the selected change, or returns invalid counts, report the problem and stop before syncing or archiving. The CLI counts only x/X checkbox markers as complete; other markers, including unfamiliar ones, remain incomplete.
If incomplete tasks found:
- Display warning showing count of incomplete tasks
- Ask the user to confirm they want to proceed
- Proceed if user confirms
If `totalTasks` is zero: Proceed without a task-related warning.
- Assess delta spec sync state
If lifecycleError is present: report its issues and fix, and stop before syncing specs or moving the change. Archiving never reaches lifecycle.completed on a broken config.
Check the archive target first: Record the target name as <target-name>: use the change name as-is when it already starts with a YYYY-MM-DD- prefix; otherwise prepend the current date as YYYY-MM-DD-<change-name>. Never stack a second date (same rule as openspec archive).
If <planningHome.changesDir>/archive/<target-name> already exists, stop before writing any main spec. Report the collision, name any main specs this run already synced, leave changeRoot where it is, and suggest renaming the existing archive or this change.
Use artifactPaths.specs.existingOutputPaths from status JSON as the only delta-spec source. If the specs entry is missing or existingOutputPaths is empty, skip sync and continue at the archive target recheck below. The before actions still apply. Do not infer delta specs from other artifacts.
If delta specs exist:
- Compare each delta spec with its corresponding main spec at
<planningHome.root>/openspec/specs/<capability-path>/spec.md(use the store-awareplanningHome.rootfrom step 2, not a hardcoded repo path) - A missing main spec is not automatically "already synced". For a new capability, the main spec is an output of the sync, not an input:
- If the delta has MODIFIED or RENAMED requirements, report that only ADDED requirements can create a new main spec and mark that capability as sync-blocked. Never invent a requirement that has no current version.
- Otherwise, if the delta has only REMOVED requirements and the change's
.openspec.yamldeclaresretire_capabilities: true, the capability is already retired: count it as already synced, warn that there is nothing left to remove, and do not recreate the main spec. Apply this rule both now and when verifying a completed sync. - Otherwise, if the delta has no ADDED requirements, report that no sync is possible and mark that capability as sync-blocked. For a REMOVED-only delta, warn that there is no main spec to remove from and leave the main-spec tree unchanged.
openspec archiverefuses the unmarked REMOVED-only case withSpec must have at least one requirement. - Otherwise, count the capability as needing sync and name it in the summary (
<capability-path>: new main spec will be created). If the delta also has REMOVED requirements, warn that they will be ignored because there is no main spec to remove from. The sync creates the main spec from only the delta's ADDED requirements, exactly asopenspec archivedoes. - Determine what changes would be applied (adds, modifications, removals, renames)
- Continue assessing the remaining capabilities even when one is sync-blocked. Show a combined summary before prompting.
Prompt options:
- If any capability is sync-blocked: explain why and offer only "Archive without syncing", "Cancel"
- Otherwise, if changes needed: "Sync now (recommended)", "Archive without syncing", "Cancel"
- Otherwise, if already synced: "Archive now", "Sync anyway", "Cancel"
Route on the answer:
- "Cancel" — stop, do not archive
- "Archive without syncing" or "Archive now" — skip sync and continue through the checks below
- "Sync now" or "Sync anyway" — select sync, then continue through the checks below. Do not start any sync while a capability is sync-blocked; explain the blocker and repeat the available choices.
- Anything else — ask again rather than archiving
After a pause, reuse the archive inputs from step 1 without fetching them again. Check the archive target again now. If <planningHome.changesDir>/archive/<target-name> exists, stop before writing any main spec, leave changeRoot where it is, and suggest renaming the existing archive or this change.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/openspec-archive-change/SKILL.md
Popularity
- Repository stars
- 73,500
- Repository forks
- 5,029
- 7-day trend score
- 56
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/fission-ai/openspec/openspec-archive-change)