clone

a browser grid puzzle game where you push words around to rewrite the rules of each level

main
miau-is-true / .codex / skills / openspec-archive-change / SKILL.md
SKILL.md 4.5K rendered
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: MIT5compatibility: Requires openspec CLI.6metadata:7 author: openspec8 version: "1.0"9 generatedBy: "1.4.1"10---1112Archive a completed change in the experimental workflow.1314**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.1516**Steps**17181. **If no change name provided, prompt for selection**1920 Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.2122 Show only active changes (not already archived).23 Include the schema used for each change if available.2425 **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.26272. **Check artifact completion status**2829 Run `openspec status --change "<name>" --json` to check artifact completion.3031 Parse the JSON to understand:32 - `schemaName`: The workflow being used33 - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context34 - `artifacts`: List of artifacts with their status (`done` or other)3536 If status reports `actionContext.mode: "workspace-planning"`, explain that workspace archive is not supported in this slice and STOP. Do not move workspace changes into repo-local archives or edit linked repos.3738 **If any artifacts are not `done`:**39 - Display warning listing incomplete artifacts40 - Use **AskUserQuestion tool** to confirm user wants to proceed41 - Proceed if user confirms42433. **Check task completion status**4445 Read the tasks file (typically `tasks.md`) to check for incomplete tasks.4647 Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).4849 **If incomplete tasks found:**50 - Display warning showing count of incomplete tasks51 - Use **AskUserQuestion tool** to confirm user wants to proceed52 - Proceed if user confirms5354 **If no tasks file exists:** Proceed without task-related warning.55564. **Assess delta spec sync state**5758 Use `artifactPaths.specs.existingOutputPaths` from status JSON to check for delta specs. If none exist, proceed without sync prompt.5960 **If delta specs exist:**61 - Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`62 - Determine what changes would be applied (adds, modifications, removals, renames)63 - Show a combined summary before prompting6465 **Prompt options:**66 - If changes needed: "Sync now (recommended)", "Archive without syncing"67 - If already synced: "Archive now", "Sync anyway", "Cancel"6869 If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.70715. **Perform the archive**7273 Create an `archive` directory under `planningHome.changesDir` if it doesn't exist:74 ```bash75 mkdir -p "<planningHome.changesDir>/archive"76 ```7778 Generate target name using current date: `YYYY-MM-DD-<change-name>`7980 **Check if target already exists:**81 - If yes: Fail with error, suggest renaming existing archive or using different date82 - If no: Move `changeRoot` to the archive directory8384 ```bash85 mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"86 ```87886. **Display summary**8990 Show archive completion summary including:91 - Change name92 - Schema that was used93 - Archive location94 - Whether specs were synced (if applicable)95 - Note about any warnings (incomplete artifacts/tasks)9697**Output On Success**9899```100## Archive Complete101102**Change:** <change-name>103**Schema:** <schema-name>104**Archived to:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/105**Specs:** ✓ Synced to main specs (or "No delta specs" or "Sync skipped")106107All artifacts complete. All tasks complete.108```109110**Guardrails**111- Always prompt for change selection if not provided112- Use artifact graph (openspec status --json) for completion checking113- Don't block archive on warnings - just inform and confirm114- Preserve .openspec.yaml when moving to archive (it moves with the directory)115- Show clear summary of what happened116- If sync is requested, use openspec-sync-specs approach (agent-driven)117- If delta specs exist, always run the sync assessment and show the combined summary before prompting