with one click
corgispec-gh-archive
// Archive a completed change in the experimental workflow with GitHub integration. Use when the user wants to finalize and archive a change after implementation is complete.
// Archive a completed change in the experimental workflow with GitHub integration. Use when the user wants to finalize and archive a change after implementation is complete.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | corgispec-gh-archive |
| description | Archive a completed change in the experimental workflow with GitHub integration. Use when the user wants to finalize and archive a change after implementation is complete. |
| license | MIT |
| compatibility | Requires openspec CLI and gh CLI. |
| metadata | {"author":"openspec","version":"1.0","generatedBy":"1.3.0"} |
Archive a completed change in the experimental workflow with GitHub integration.
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 change and resolve worktree
Read openspec/config.yaml for isolation settings.
If isolation.mode: worktree: Changes live inside worktrees, not the main checkout. Read references/worktree-discovery.md for the full discovery procedure. Quick summary:
openspec list --json — if it returns changes, use them<isolation.root>/ directories, verify each with git worktree list and check openspec/changes/<name>/ exists insideIf no isolation: openspec list --json directly. Auto-select if one, prompt if multiple.
If name provided by user, use it directly.
Check artifact completion status
Run openspec status --change "<name>" --json and warn if artifacts are incomplete.
Check task completion status
Read tasks.md if it exists. Warn if incomplete tasks remain.
Assess delta spec sync state
Check for delta specs at openspec/changes/<name>/specs/ and prompt whether to sync before archive.
4.5 Update GitHub issues (if tracked)
Read openspec/changes/<name>/.github.yaml BEFORE archiving moves it.
If tracking exists (using number field):
gh issue view <number> --json labels --jq '.labels[].name'
If the child already has done, skip the label change for that child.
If the child has none of todo, in-progress, or review, STOP and report:
"⚠️ Child issue #<number> has unexpected labels: <actual labels>. Aborting."
Otherwise proceed:
gh issue edit <number> --remove-label "todo,in-progress,review" --add-label "done"
Note: Do NOT close the issue. Closing removes issues from board label columns. gh issue comment <parent_number> --body "Change '<name>' archived. All groups done. Specs synced: <yes/no/skipped>."
gh issue view <parent_number> --json labels --jq '.labels[].name'
Confirm backlog is present. If not, STOP and report:
"⚠️ Expected label backlog on parent issue but found: <actual labels>. Aborting label change."gh issue edit <parent_number> --remove-label "backlog" --add-label "done"
If gh is unavailable or .github.yaml is missing, skip silently.
Perform the archive
Create openspec/changes/archive/ if it does not exist and move the change to openspec/changes/archive/YYYY-MM-DD-<name>.
5.5 Clean up worktree (if isolation active)
If worktree isolation is active (from step 1.3) and the worktree exists:
git worktree remove <worktree-path> --force
<branch_name> remains for the user to merge via PR.Worktree removed. Branch <branch_name> preserved — create a PR to merge it, or run \git branch -d <branch_name>` to discard.`Display summary
Show:
Output On Success
## Archive Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** synced / skipped / no delta specs
**GitHub:** parent and child issues moved to done (open, not closed)
**Worktree:** removed (branch `<branch-name>` preserved) / not applicable
Guardrails
openspec status --json for completion checking.openspec.yaml and .github.yaml by moving the full directory