| name | corgispec-gh-archive |
| description | Validate and archive a completed CorgiSpec change, extract durable knowledge, and close GitHub tracking. Use when archiving a change whose normalized tracking provider is GitHub. |
| hooks | {"PreToolUse":[{"matcher":"Edit|Write","hooks":[{"type":"command","command":"corgispec hook pre-write"}]}]} |
Archive a GitHub-tracked change
Resolve and validate
- Resolve the change and isolated worktree with references/worktree-discovery.md when required.
- Run
corgispec status "<change>" --json, corgispec apply "<change>" --json, and corgispec archive "<change>" --json.
- Require matching
changeRoot plus artifactPaths, contextFiles, taskArtifactId, trackingProvider, and trackingProviderSource. Stop and request a CLI upgrade when absent.
- Require
trackingProvider: "github"; never infer provider from schemaName.
- Use CLI task status and returned context for completeness and QA/review evidence. Accept store paths outside the working directory without reconstruction.
Archive and synchronize
- Read GitHub tracker state at
<changeRoot>/.github.yaml before archival.
- Present CLI blockers and overridable warnings. Never bypass a blocker.
- Execute only the archive action returned by the CLI; let OpenSpec choose and report the archived root.
- Verify the payload moved without overwriting a conflicting destination.
- Extract durable knowledge from returned artifact paths, implementation evidence, and Git history.
- Post the archive summary to GitHub, verify issue labels, mark completed children and the parent done, update progress, and close issues according to policy.
- Remove the worktree only after all closeout steps succeed; keep the branch unless explicitly asked to delete it.
Report old changeRoot, actual archived root, warnings, knowledge extraction, issue transitions, and worktree cleanup. Never hardcode planning/archive paths, route by schema, overwrite an archive, or archive unresolved blockers.