fission-ai/openspec/openspec-bulk-archive-change
Claude Code and agent skill by fission-ai/openspec
- community
Checking that the SKILL.md file is still in the repository.
Archive multiple completed OpenSpec changes at once. Use when archiving several parallel changes. Also use for a plural archive request - "openspec bulk-archive", "opsx bulk-archive", "openspec archive all", or "openspec archive these changes".
Install
npx vskill@latest install fission-ai/openspec/openspec-bulk-archive-changeSKILL.md
Archive multiple completed changes in a single operation.
This skill allows you to batch-archive changes, handling spec conflicts intelligently by checking the codebase to determine what's actually implemented.
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, 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: None required (prompts for selection)
Steps
- Get active changes
Run openspec list --json to get all active changes.
If no active changes exist, inform user and stop.
- Prompt for change selection
Ask the user to choose changes (multi-select):
- Show each change name and task status from the list output
- Include an option for "All changes"
- Allow any number of selections (1+ works, 2+ is the typical use case)
IMPORTANT: Do NOT auto-select. Always let the user choose.
Load current archive inputs once for the selected root before batch validation:
Choose one selected change from this root and run openspec instructions archive --change "<selected-change>" --json with the same selected-root flags. This lookup is advisory and optional: it only supplies extra prompt inputs, so it must never block the batch. If it fails or returns invalid JSON — for example on an older CLI that does not support this command yet — continue the batch with no context and no operation guidance. Do not report an error and do not stop.
A valid response may omit context and operationGuidance. Treat context as a required prompt-level input across the batch: 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 batch workflow.
Keep both fields separate from conflict analysis, 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 skipped prompts, replacement paths, or flags from either field, and do not copy their text verbatim into specs, changes, or summaries. These are prompt-level behavior contracts, not enforceable checks.
- Batch validation - gather status for all selected changes
Run openspec list --json once with the same selected-root flags for task progress. If the lookup fails, returns invalid JSON, or omits any selected change, contains a duplicate selected change, or returns invalid counts, report the problem and stop before syncing or archiving the batch.
For each selected change, collect:
a. Artifact status - Run openspec status --change "<name>" --json
- Parse
schemaName,artifacts,planningHome,changeRoot,artifactPaths, andactionContext - Note which artifacts are
donevs other states
b. Task completion - Find the changes entry from the list response whose name exactly matches this change
- Require nonnegative integer
totalTasksandcompletedTasks, withcompletedTasks <= totalTasks - Incomplete tasks =
totalTasks - completedTasks - The CLI resolves the schema's tracked task files, including custom artifact names, output paths, and globs
- Do not infer task completion from artifact status, an artifact id of
tasks, or the absence of a top-leveltasks.md - The CLI counts only
x/Xcheckbox markers as complete; other markers remain incomplete - If
totalTasksis zero, note as "No tasks"
c. Delta specs - Check artifactPaths.specs.existingOutputPaths from status JSON
- List which capability specs exist
- For each, extract requirement names (lines matching
### Requirement: <name>) - Treat this list as the only delta-spec source. If the
specsentry is
missing or the list is empty, perform no spec sync or specs-instruction lookup for that change; do not infer deltas from unrelated artifacts.
- Evaluate this independently for every change, including mixed-schema
batches where some schemas have no specs artifact.
d. Archive target - Compute each change's target name once and record it as that change's <target-name>
- Use the change name as-is when it already starts with a
YYYY-MM-DD-prefix; otherwise prepend the current date asYYYY-MM-DD-<name>(same rule asopenspec archive) - Check whether
<planningHome.changesDir>/archive/<target-name>already exists - If it exists, or another selected change resolves to the same target name, mark every such change
BlockedwithArchive directory already exists - A blocked change is never synced or moved: show it as
Blockedin the step 6 table, leave it out of conflict resolution (resolve its conflicts using only the other changes), and record it as Failed in step 8d - Checking here, before any main spec is written, matches
openspec archive: a collision found after sync would leave main specs rewritten for an archive that never happened
- Detect spec conflicts
Build a map keyed by <capability-path>, the exact path relative to specs/:
``text identity/user-auth -> [change-a, change-b] <- CONFLICT (2+ changes) billing/user-auth -> [change-c] <- OK (different full path) ``
A conflict exists when 2+ selected changes have delta specs for the exact same <capability-path>.
- Resolve conflicts agentically
For each conflict, investigate the codebase:
a. Read the delta specs from each conflicting change to understand what each claims to add/modify
b. Search the codebase for implementation evidence:
- Look for code implementing requirements from each delta spec
- Check for related files, functions, or tests
c. Determine resolution:
- If only one change is actually implemented -> sync that one's specs
- If both implemented -> apply in chronological order (older first, newer overwrites)
- If neither implemented -> skip spec sync, warn user
d. Record resolution for each conflict:
- An inclusion or exclusion decision for every delta spec, keyed by change and
<capability-path> - Which included delta specs to apply and in what order
- Which delta specs to exclude from sync because their implementation is missing
- Rationale (what was found in codebase)
- Show consolidated status table
Display a table summarizing all changes:
```markdown
| Change | Artifacts | Tasks | Specs | Conflicts | Status | |
|---|---|---|---|---|---|---|
| schema-management | Done | 5/5 | 2 delta | None | Ready | |
| project-config | Done | 3/3 | 1 delta | None | Ready | |
| add-oauth | Done | 4/4 | 1 delta | identity/user-auth (!) | Ready* | |
| add-verify-skill | 1 left | 2/5 | None | None | Warn |
```
For conflicts, show the resolution: ```text
- Conflict resolution:
- identity/user-auth spec: Will apply add-oauth then add-jwt (both implemented, chronological order)
```
For incomplete changes, show warnings: ```text Warnings:
- add-verify-skill: 1 incomplete artifact, 3 incomplete tasks
```
- Confirm batch operation
Ask the user a single confirmation question:
- "Archive N changes?" with options based on status
- Options might include:
- "Archive all N changes"
- "Archive only N ready changes (skip incomplete)"
- "Cancel"
If there are incomplete changes, make clear they'll be archived with warnings.
Route on the answer by intent, not by exact label — you wrote these labels, so match what the user picked rather than the wording above:
- "Cancel" — stop, do not archive. Report that nothing was archived and skip the remaining steps.
- The archive-everything option — proceed with every selected change that is not
Blocked - The ready-only option — proceed with only the changes the step 6 table marks
ReadyorReady*, and record the rest as Skipped in step 8d, exceptBlockedchanges, which stay Failed withArchive directory already exists. If aReady*change's conflict partner is skipped, re-derive that conflict's resolution using only the changes being archived. - Anything else — ask again rather than archiving
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-bulk-archive-change/SKILL.md
Popularity
- Repository stars
- 66,939
- Repository forks
- 4,614
- 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-bulk-archive-change)