This repository (Asymmetric-al/core)
These repo-owned sections sit above the official OpenSpec skill. Reconcile this
overlay after upstream refreshes before running bun run skills:sync.
Use the locally pinned CLI only: bun run openspec -- <command>. Do not invoke
@latest. Core does not use Stores. Pass an explicit change ID before any
mutating OpenSpec operation. Follow AGENTS.md and docs/ai/rules/openspec.md.
Do not bypass TDD, exact base-maia, data-access boundaries, security, or
repository checks. Do not archive unmerged or incomplete work. Do not run
openspec update against the live customized repository. Do not treat product
runtime Eve as a coding agent.
Allowed-tools metadata includes Bash(bun:*) so the local wrapper can run.
Triggers
- The matching OpenSpec workflow is requested: Explore, Propose, Update, Apply,
Verify, Sync, or Archive.
- Numbered commands
/1-start-project through /4-close-project wrap these
workflows.
Workflow
- Read
openspec/config.yaml, openspec/project.md, and the relevant specs
or active change.
- Invoke
bun run openspec -- with the explicit change ID for mutating work.
- Keep Core TDD, UI, data-boundary, and Guardian rules in force.
- Leave the change active until implementation has merged.
Checklist
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, 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.
<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 --json to 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: " 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:
openspec instructions archive --change "<name>" --json
Keep the same selected-root flags on this command. This lookup is advisory and
optional: it only supplies extra prompt inputs, so it 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 and no operation guidance. Do not report an error and do not stop.
A successful response may omit both optional fields. 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.
Check artifact completion status
Run openspec status --change "<name>" --json to check artifact completion.
Parse the JSON to understand:
schemaName: The workflow being used
planningHome, changeRoot, artifactPaths, and actionContext: path and scope context
artifacts: 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
Read the tasks file (typically tasks.md) to check for incomplete tasks.
Count tasks marked with - [ ] (incomplete) vs - [x] (complete).
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 no tasks file exists: Proceed without task-related warning.
Assess delta spec sync state
Use artifactPaths.specs.existingOutputPaths from status JSON as the only
delta-spec source. If the specs entry is missing or
existingOutputPaths is empty, proceed without a sync prompt and 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-aware planningHome.root from step 2, not a hardcoded repo path)
- Determine what changes would be applied (adds, modifications, removals, renames)
- Show a combined summary before prompting
Prompt options:
- If changes needed: "Sync now (recommended)", "Archive without syncing"
- If already synced: "Archive now", "Sync anyway", "Cancel"
Route on the answer:
- "Cancel" — stop, do not archive
- "Archive without syncing" or "Archive now" — proceed to archive
- "Sync now" or "Sync anyway" — sync, then verify (below)
- Anything else — ask again rather than archiving
Before a selected sync writes any main spec, run
openspec instructions specs --change "<name>" --json once with the same
selected-root flags. Require a zero exit status and valid artifact-instruction
JSON. If the lookup fails or returns invalid JSON, report the error and stop
before writing any main spec or moving the change. A valid response with omitted
rules is the no-rules case. Apply returned rules only to the content and
form of main specs produced by this merge; do not use them as archive guidance,
change CLI behavior, or copy the rule text into any output file.
Then run the openspec-sync-specs workflow inline (agent-driven intelligent merge) for change '', passing the delta spec analysis and the fetched specs-rule snapshot from above, and wait for it to finish. The inline sync must reuse that snapshot without fetching specs instructions again. Do not delegate it to a background task — step 5 would move changeRoot out from under a sync that is still reading it, leaving the change archived and the main specs never updated. If your agent can only run it by delegation, delegate synchronously and wait for the result.
Then re-run the comparison from the top of this step against every capability that has a delta spec in artifactPaths.specs.existingOutputPaths — not only the ones the sync reports it touched. A successful sync leaves nothing left to apply, so each capability must now read as already synced:
- ADDED requirements present
- MODIFIED requirements carrying the scenario and description changes named in the delta, with their other scenarios intact
- REMOVED requirements gone — and where this sync retired a capability (removed its last requirement, leaving
## Requirements empty), its main spec deleted rather than left empty; a spec the sync deliberately kept and reported is also a match
- RENAMED requirements present under the new name and absent under the old one
If the sync failed, or any capability does not match, report what differs and stop — do not archive. Nothing has moved and changeRoot is intact, so the user can fix the mismatch or re-run the sync and start the archive again.
Perform the archive
Create an archive directory under planningHome.changesDir if it doesn't exist:
mkdir -p "<planningHome.changesDir>/archive"
Generate the 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).
Check if target already exists:
- If yes: Fail with error, suggest renaming existing archive or using different date
- If no: Move
changeRoot to the archive directory
mv "<changeRoot>" "<planningHome.changesDir>/archive/<target-name>"
Display summary
Show archive completion summary including:
- Change name
- Schema that was used
- Archive location
- Whether specs were synced (if applicable)
- Note about any warnings (incomplete artifacts/tasks)
Output On Success
## Archive Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** the archive path derived from `planningHome.changesDir`/<target-name>/
**Specs:** <"✓ Synced to main specs" only if the step 4 verification passed; otherwise "No delta specs" or "Sync skipped">
<"All artifacts complete. All tasks complete." — or, if archived with warnings, list them instead (e.g. "Archived with 2 incomplete tasks")>
Guardrails
- Announce the selected change; prompt for selection when it is ambiguous
- Use artifact graph (openspec status --json) for completion checking
- Don't block archive on warnings - just inform and confirm
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
- Show clear summary of what happened
- If sync is requested, run the
openspec-sync-specs workflow inline (agent-driven)
- Never archive while a spec sync is still in flight — run the sync inline and verify the main specs before moving
changeRoot
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
- Apply relevant runtime context and report conflicts; operation guidance remains advisory
- Consider every guidance entry and explain any inapplicable or conflicting advice
- Existing CLI checks, resolved paths, prompts, and command contracts are unchanged
- Artifact rules constrain only the specs being written and are never operation guidance
- Never copy runtime context, operation guidance, or artifact-rule text verbatim into output files
1---2name: openspec-archive-change3description: Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.4license: MIT5---67<!-- CORE-OVERLAY-START -->89## This repository (Asymmetric-al/core)1011These repo-owned sections sit above the official OpenSpec skill. Reconcile this12overlay after upstream refreshes before running `bun run skills:sync`.1314Use the locally pinned CLI only: `bun run openspec -- <command>`. Do not invoke15`@latest`. Core does not use Stores. Pass an explicit change ID before any16mutating OpenSpec operation. Follow `AGENTS.md` and `docs/ai/rules/openspec.md`.17Do not bypass TDD, exact `base-maia`, data-access boundaries, security, or18repository checks. Do not archive unmerged or incomplete work. Do not run19`openspec update` against the live customized repository. Do not treat product20runtime Eve as a coding agent.2122Allowed-tools metadata includes `Bash(bun:*)` so the local wrapper can run.2324### Triggers2526- The matching OpenSpec workflow is requested: Explore, Propose, Update, Apply,27 Verify, Sync, or Archive.28- Numbered commands `/1-start-project` through `/4-close-project` wrap these29 workflows.3031### Workflow32331. Read `openspec/config.yaml`, `openspec/project.md`, and the relevant specs34 or active change.352. Invoke `bun run openspec --` with the explicit change ID for mutating work.363. Keep Core TDD, UI, data-boundary, and Guardian rules in force.374. Leave the change active until implementation has merged.3839### Checklist4041- [ ] Local pinned CLI used via `bun run openspec --`42- [ ] Explicit change ID used for mutating operations43- [ ] Stores were not introduced44- [ ] Incomplete or unmerged work was not archived45- [ ] `openspec update` was not run against the live repo46- [ ] Product Eve was not treated as a coding agent4748<!-- CORE-OVERLAY-END -->4950Archive a completed change in the experimental workflow.5152**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.5354`<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.5556**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.5758**Steps**59601. **Select the change**6162 If a name is provided, use it. Otherwise:63 - Infer from conversation context if the user mentioned a change64 - Auto-select if only one active change exists65 - If ambiguous, run `openspec list --json` to get available changes and ask the user to select one6667 When prompting, show only active changes (not already archived).68 Include the schema used for each change if available.6970 Always announce: "Using change: <name>" and how to override (e.g., `/openspec-archive-change <other>`).7172 **Load current archive inputs before the existing archive checks:**7374 After resolving the selected change and planning root, run:7576 ```bash77 openspec instructions archive --change "<name>" --json78 ```7980 Keep the same selected-root flags on this command. This lookup is advisory and81 optional: it only supplies extra prompt inputs, so it must never block archiving.82 If it exits non-zero or returns invalid JSON — for example on an older CLI that83 does not support this command yet — continue the archive workflow with no84 context and no operation guidance. Do not report an error and do not stop.8586 A successful response may omit both optional fields. Treat `context` as a87 required prompt-level input: read and consider it, and apply relevant project88 facts, conventions, and constraints. Treat `operationGuidance` as optional89 additive advice: read and consider every entry, and follow entries that are90 applicable and compatible with the built-in archive workflow.9192 Keep both fields separate from built-in steps, explicit user choices, resolved93 paths, CLI checks, and command contracts. If context conflicts with one of those94 controlling inputs, report the conflict and preserve the controlling value. If95 guidance is inapplicable or conflicts with a controlling input, do not follow it96 and explain why. Do not infer replacement paths, skipped prompts, or flags from97 either field, and do not copy their text verbatim into specs, change artifacts,98 or archive summaries unless the user separately asks for it. These are99 prompt-level behavior contracts, not enforceable checks.1001012. **Check artifact completion status**102103 Run `openspec status --change "<name>" --json` to check artifact completion.104105 Parse the JSON to understand:106 - `schemaName`: The workflow being used107 - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context108 - `artifacts`: List of artifacts with their status (`done`, `skipped`, or other)109110 **If any artifacts are neither `done` nor `skipped`** (skipped artifacts satisfy the requirement - the change declares skip_specs):111 - Display warning listing incomplete artifacts112 - Ask the user to confirm they want to proceed113 - Proceed if user confirms1141153. **Check task completion status**116117 Read the tasks file (typically `tasks.md`) to check for incomplete tasks.118119 Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).120121 **If incomplete tasks found:**122 - Display warning showing count of incomplete tasks123 - Ask the user to confirm they want to proceed124 - Proceed if user confirms125126 **If no tasks file exists:** Proceed without task-related warning.1271284. **Assess delta spec sync state**129130 Use `artifactPaths.specs.existingOutputPaths` from status JSON as the only131 delta-spec source. If the `specs` entry is missing or132 `existingOutputPaths` is empty, proceed without a sync prompt and do not infer133 delta specs from other artifacts.134135 **If delta specs exist:**136 - Compare each delta spec with its corresponding main spec at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` (use the store-aware `planningHome.root` from step 2, not a hardcoded repo path)137 - Determine what changes would be applied (adds, modifications, removals, renames)138 - Show a combined summary before prompting139140 **Prompt options:**141 - If changes needed: "Sync now (recommended)", "Archive without syncing"142 - If already synced: "Archive now", "Sync anyway", "Cancel"143144 Route on the answer:145 - "Cancel" — stop, do not archive146 - "Archive without syncing" or "Archive now" — proceed to archive147 - "Sync now" or "Sync anyway" — sync, then verify (below)148 - Anything else — ask again rather than archiving149150 Before a selected sync writes any main spec, run151 `openspec instructions specs --change "<name>" --json` once with the same152 selected-root flags. Require a zero exit status and valid artifact-instruction153 JSON. If the lookup fails or returns invalid JSON, report the error and stop154 before writing any main spec or moving the change. A valid response with omitted155 `rules` is the no-rules case. Apply returned `rules` only to the content and156 form of main specs produced by this merge; do not use them as archive guidance,157 change CLI behavior, or copy the rule text into any output file.158159 Then run the `openspec-sync-specs` workflow inline (agent-driven intelligent merge) for change '<name>', passing the delta spec analysis and the fetched specs-rule snapshot from above, and wait for it to finish. The inline sync must reuse that snapshot without fetching `specs` instructions again. Do not delegate it to a background task — step 5 would move `changeRoot` out from under a sync that is still reading it, leaving the change archived and the main specs never updated. If your agent can only run it by delegation, delegate synchronously and wait for the result.160161 Then re-run the comparison from the top of this step against every capability that has a delta spec in `artifactPaths.specs.existingOutputPaths` — not only the ones the sync reports it touched. A successful sync leaves nothing left to apply, so each capability must now read as already synced:162 - ADDED requirements present163 - MODIFIED requirements carrying the scenario and description changes named in the delta, with their other scenarios intact164 - REMOVED requirements gone — and where this sync retired a capability (removed its last requirement, leaving `## Requirements` empty), its main spec deleted rather than left empty; a spec the sync deliberately kept and reported is also a match165 - RENAMED requirements present under the new name and absent under the old one166167 If the sync failed, or any capability does not match, report what differs and stop — do not archive. Nothing has moved and `changeRoot` is intact, so the user can fix the mismatch or re-run the sync and start the archive again.1681695. **Perform the archive**170171 Create an `archive` directory under `planningHome.changesDir` if it doesn't exist:172173 ```bash174 mkdir -p "<planningHome.changesDir>/archive"175 ```176177 Generate the 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`).178179 **Check if target already exists:**180 - If yes: Fail with error, suggest renaming existing archive or using different date181 - If no: Move `changeRoot` to the archive directory182183 ```bash184 mv "<changeRoot>" "<planningHome.changesDir>/archive/<target-name>"185 ```1861876. **Display summary**188189 Show archive completion summary including:190 - Change name191 - Schema that was used192 - Archive location193 - Whether specs were synced (if applicable)194 - Note about any warnings (incomplete artifacts/tasks)195196**Output On Success**197198```markdown199## Archive Complete200201**Change:** <change-name>202**Schema:** <schema-name>203**Archived to:** the archive path derived from `planningHome.changesDir`/<target-name>/204**Specs:** <"✓ Synced to main specs" only if the step 4 verification passed; otherwise "No delta specs" or "Sync skipped">205206<"All artifacts complete. All tasks complete." — or, if archived with warnings, list them instead (e.g. "Archived with 2 incomplete tasks")>207```208209**Guardrails**210211- Announce the selected change; prompt for selection when it is ambiguous212- Use artifact graph (openspec status --json) for completion checking213- Don't block archive on warnings - just inform and confirm214- Preserve .openspec.yaml when moving to archive (it moves with the directory)215- Show clear summary of what happened216- If sync is requested, run the `openspec-sync-specs` workflow inline (agent-driven)217- Never archive while a spec sync is still in flight — run the sync inline and verify the main specs before moving `changeRoot`218- If delta specs exist, always run the sync assessment and show the combined summary before prompting219- Apply relevant runtime context and report conflicts; operation guidance remains advisory220- Consider every guidance entry and explain any inapplicable or conflicting advice221- Existing CLI checks, resolved paths, prompts, and command contracts are unchanged222- Artifact rules constrain only the specs being written and are never operation guidance223- Never copy runtime context, operation guidance, or artifact-rule text verbatim into output files