openspec-archive-change
Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a completed change after implementation is complete.
- License 许可
- MIT
- 所属仓库
- cp-yu/edera
- 最近更新
- 2026-06-23
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- openspec-archive-change
- license
- MIT
- metadata
- { "author": "openspec", "version": "1.0", "generatedBy": "1.4.1-cpyu.1" }
- description
- Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a completed change after implementation is complete.
- compatibility
- Requires openspec CLI.
03 SKILL.md 正文
Archive a completed change in the experimental workflow.
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.
Before archiving, run openspec config project --json and consume git policy from its normalized project config: git.commitMessage.archive, git.commitMessage.merge, git.merge.strategy, and git.branch.deleteAfterArchive; do not parse raw YAML inside the skill.
Steps
-
Select change If no clear change name is provided, run
openspec list --json, show active changes with schema, and ask. Do not guess. -
Unified Full Verify Gate Run
openspec verify status "<change-name>" --json. Fresh PASS/PASS_WITH_WARNINGS continues. MISSING/STALE runs Step 2.5 then reruns the gate. FAIL_NEEDS_REMEDIATION hard-blocks with CRITICAL issues. ResolvePENDING_VERIFICATIONthrough the appropriateopenspec verify phase2optimization/verification call, then rerun status.ABORTED_UNSAFEhard-stops for manual recovery.
2.5. Execute Full Verify
When the verify result is missing or stale, execute the same verify contract as /opsx:verify using the subagent-orchestrated skeleton:
- Determine
changeName, absolutechangeDir, and absoluteprojectRoot - Spawn the reviewer subagent with Read and Bash tool capability, instruct it to invoke the
openspec-reviewerskill for canonical Phase 1, and pass onlychangeName,changeDir, andprojectRoot - Validate the reviewer payload, apply only deterministic
tasks.mdwrite-back in the main workspace, and persist the canonical Phase 1 payload - Execute the verify workflow end-to-end, including Phase 2 (spawn optimizer subagent with Read and Bash tool capability, invoke
openspec-optimizer, and pass onlychangeName,changeDir, andprojectRoot) whenever the/opsx:verifycontract would make it eligible - In
P1_SPECULATIVE_FENCE, invoke the reviewer subagent again withchangeName,changeDir, andprojectRootfor the speculative verdict - The top-level archive flow MUST NOT inline a current-agent review skeleton or silently downgrade to reread mode
Continue through Phase 2 when eligible;
SKIPPEDis valid only for config/user skip. Persist fresh verify before archiving. This is the only archive gate; no mini-check or bypass exists.
-
Check artifact completion status Run
openspec status --change "<name>" --json. Warn and confirm before proceeding if any artifact is notdone. -
Check task completion status Read
tasks.md; warn and confirm before proceeding if incomplete checkboxes remain. Missing tasks are not a task-related blocker. -
Assess delta sync state If delta specs or
opsx-delta.yamlexist, assess whether sync is required. The archive CLI performs verify, sync, and move-to-archive; do not duplicate sync writes manually. -
Run archive CLI Run
openspec archive "<change-name>"after the verify gate is fresh. CLI only verifies, syncs, moves the change to archive, and prints the git handoff reminder. CLI MUST NOT create commits, merge branches, switch branches, delete branches, remove worktrees, or generate commit messages. -
Git handoff Read the archive CLI output and the projected git policy from
openspec config project --json. Summary fields include change name, schema, archive location, verify gate result, specs / OPSX sync result, agent-owned git follow-up status, and merge strategy. -
Agent git flow The agent continues the post-archive git flow. First handle the implementation boundary before OpenSpec/docs archive artifacts. If uncommitted real project implementation changes remain, create a normal implementation commit that contains only those changes. Then always create a semantic boundary commit with
git commit --allow-empty; this boundary commit may be intentionally empty when the effective implementation diff is already carried by retainedwip: opt-*checkpoint commits. Ifgit.commitMessage.boundaryis set, read that project-relative path; otherwise readopenspec/references/openspec-boundary-commit-message.md. Use that template to build the boundary commit message and rungit commit -F -for the boundary commit. Ifgit.commitMessage.archiveis set, read that project-relative path; otherwise readopenspec/references/openspec-archive-commit-message.md. Use that template before creating the OpenSpec/docs archive commit, add only archive/synced paths, and rungit commit -F -. If a merge or squash commit message is needed, prepare it from the configured or built-in merge template. Ifgit.commitMessage.mergeis set, read that project-relative path; otherwise readopenspec/references/openspec-merge-summary-message.md. Applygit.merge.strategywithgit merge --no-ff,git merge --ff-only, orgit merge --squashas appropriate. Usegit.branch.deleteAfterArchiveonly after confirming the branch is merged withgit branch --merged. Build paths withpath.join(),path.resolve(), andpath.normalize(). -
Display summary Include change, schema, archive location, verify gate result, specs / OPSX sync result, agent-owned git follow-up status, Merge Strategy, cleanup responsibility, verify reuse/reexecution, and warnings. Do not report that CLI created an archive commit, performed a merge, or deleted a feature branch.
Output On Success
## Archive Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Verify Gate:** Fresh PASS or PASS_WITH_WARNINGS result confirmed
**Specs / OPSX:** ✓ Synced to main specs and project OPSX (or "No deltas" or "Skipped all archive-time sync writes")
**Agent Git Follow-up:** <completed / pending with reason>
**Merge Strategy:** <git.merge.strategy>
**Cleanup Responsibility:** <agent>
Archive completed after satisfying the unified full verify gate.
Guardrails
- Always prompt for change selection if not provided
- Do not downgrade the verify gate into a lightweight archive-only check
- Show clearly whether verify was reused or re-executed
- In
core, useopenspec sync "<change-name>"rather than manual inline sync - If delta specs or
opsx-delta.yamlexist, always run the shared sync assessment before moving the change directory
04 同仓库更多 Skills
openspec-snack
Quick code-first sync: generate or update proposal + specs + simplified design from git diff when the code is already written. Use after iterative coding to back-fill specs and OPSX delta without redoing propose→apply. Does not generate tasks.md.
openspec-reviewer
Internal clean-context Phase 1 verification reviewer. Judges implementation completeness, correctness, coherence, and cleanliness by reading files from changeName, changeDir, and projectRoot. Never accesses conversation history.
openspec-propose
Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.
openspec-optimizer
Internal clean-context Phase 2 optimization proposer. Analyzes implementation files and outputs behavior-preserving Search/Replace blocks. Never modifies files directly. Reads failedDirections to avoid repeating broken strategies.
openspec-impact-sweeper
Generate a lightweight OPSX-grounded JSON impact report for one project concept. Use from explore before scope or proposal readiness claims.
openspec-explore
Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.