@dccxx/auggiegw 1.0.25 → 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.opencode/command/opsx-apply.md +149 -0
- package/.opencode/command/opsx-archive.md +154 -0
- package/.opencode/command/opsx-bulk-archive.md +239 -0
- package/.opencode/command/opsx-continue.md +111 -0
- package/.opencode/command/opsx-explore.md +171 -0
- package/.opencode/command/opsx-ff.md +91 -0
- package/.opencode/command/opsx-new.md +66 -0
- package/.opencode/command/opsx-onboard.md +522 -0
- package/.opencode/command/opsx-sync.md +131 -0
- package/.opencode/command/opsx-verify.md +161 -0
- package/.opencode/skills/openspec-apply-change/SKILL.md +156 -0
- package/.opencode/skills/openspec-archive-change/SKILL.md +114 -0
- package/.opencode/skills/openspec-bulk-archive-change/SKILL.md +246 -0
- package/.opencode/skills/openspec-continue-change/SKILL.md +118 -0
- package/.opencode/skills/openspec-explore/SKILL.md +290 -0
- package/.opencode/skills/openspec-ff-change/SKILL.md +101 -0
- package/.opencode/skills/openspec-new-change/SKILL.md +74 -0
- package/.opencode/skills/openspec-onboard/SKILL.md +529 -0
- package/.opencode/skills/openspec-sync-specs/SKILL.md +138 -0
- package/.opencode/skills/openspec-verify-change/SKILL.md +168 -0
- package/dist/cli.js +1171 -71
- package/openspec/changes/archive/2026-02-01-add-kit-install-prompts/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-02-01-add-kit-install-prompts/design.md +113 -0
- package/openspec/changes/archive/2026-02-01-add-kit-install-prompts/proposal.md +28 -0
- package/openspec/changes/archive/2026-02-01-add-kit-install-prompts/specs/kit-command/spec.md +107 -0
- package/openspec/changes/archive/2026-02-01-add-kit-install-prompts/specs/kit-install-prompts/spec.md +90 -0
- package/openspec/changes/archive/2026-02-01-add-kit-install-prompts/tasks.md +62 -0
- package/openspec/changes/archive/2026-02-01-add-opencode-agent-support/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-02-01-add-opencode-agent-support/design.md +131 -0
- package/openspec/changes/archive/2026-02-01-add-opencode-agent-support/proposal.md +35 -0
- package/openspec/changes/archive/2026-02-01-add-opencode-agent-support/specs/kit-command/spec.md +157 -0
- package/openspec/changes/archive/2026-02-01-add-opencode-agent-support/specs/opencode-agent-support/spec.md +65 -0
- package/openspec/changes/archive/2026-02-01-add-opencode-agent-support/tasks.md +54 -0
- package/openspec/config.yaml +20 -0
- package/package.json +2 -1
- package/specs/kit-command/spec.md +157 -0
- package/specs/kit-install-prompts/spec.md +90 -0
- package/specs/opencode-agent-support/spec.md +65 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Verify implementation matches change artifacts before archiving
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Verify that an implementation matches the change artifacts (specs, tasks, design).
|
|
6
|
+
|
|
7
|
+
**Input**: Optionally specify a change name after `/opsx-verify` (e.g., `/opsx-verify add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
8
|
+
|
|
9
|
+
**Steps**
|
|
10
|
+
|
|
11
|
+
1. **If no change name provided, prompt for selection**
|
|
12
|
+
|
|
13
|
+
Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
14
|
+
|
|
15
|
+
Show changes that have implementation tasks (tasks artifact exists).
|
|
16
|
+
Include the schema used for each change if available.
|
|
17
|
+
Mark changes with incomplete tasks as "(In Progress)".
|
|
18
|
+
|
|
19
|
+
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
20
|
+
|
|
21
|
+
2. **Check status to understand the schema**
|
|
22
|
+
```bash
|
|
23
|
+
openspec status --change "<name>" --json
|
|
24
|
+
```
|
|
25
|
+
Parse the JSON to understand:
|
|
26
|
+
- `schemaName`: The workflow being used (e.g., "spec-driven")
|
|
27
|
+
- Which artifacts exist for this change
|
|
28
|
+
|
|
29
|
+
3. **Get the change directory and load artifacts**
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
openspec instructions apply --change "<name>" --json
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
This returns the change directory and context files. Read all available artifacts from `contextFiles`.
|
|
36
|
+
|
|
37
|
+
4. **Initialize verification report structure**
|
|
38
|
+
|
|
39
|
+
Create a report structure with three dimensions:
|
|
40
|
+
- **Completeness**: Track tasks and spec coverage
|
|
41
|
+
- **Correctness**: Track requirement implementation and scenario coverage
|
|
42
|
+
- **Coherence**: Track design adherence and pattern consistency
|
|
43
|
+
|
|
44
|
+
Each dimension can have CRITICAL, WARNING, or SUGGESTION issues.
|
|
45
|
+
|
|
46
|
+
5. **Verify Completeness**
|
|
47
|
+
|
|
48
|
+
**Task Completion**:
|
|
49
|
+
- If tasks.md exists in contextFiles, read it
|
|
50
|
+
- Parse checkboxes: `- [ ]` (incomplete) vs `- [x]` (complete)
|
|
51
|
+
- Count complete vs total tasks
|
|
52
|
+
- If incomplete tasks exist:
|
|
53
|
+
- Add CRITICAL issue for each incomplete task
|
|
54
|
+
- Recommendation: "Complete task: <description>" or "Mark as done if already implemented"
|
|
55
|
+
|
|
56
|
+
**Spec Coverage**:
|
|
57
|
+
- If delta specs exist in `openspec/changes/<name>/specs/`:
|
|
58
|
+
- Extract all requirements (marked with "### Requirement:")
|
|
59
|
+
- For each requirement:
|
|
60
|
+
- Search codebase for keywords related to the requirement
|
|
61
|
+
- Assess if implementation likely exists
|
|
62
|
+
- If requirements appear unimplemented:
|
|
63
|
+
- Add CRITICAL issue: "Requirement not found: <requirement name>"
|
|
64
|
+
- Recommendation: "Implement requirement X: <description>"
|
|
65
|
+
|
|
66
|
+
6. **Verify Correctness**
|
|
67
|
+
|
|
68
|
+
**Requirement Implementation Mapping**:
|
|
69
|
+
- For each requirement from delta specs:
|
|
70
|
+
- Search codebase for implementation evidence
|
|
71
|
+
- If found, note file paths and line ranges
|
|
72
|
+
- Assess if implementation matches requirement intent
|
|
73
|
+
- If divergence detected:
|
|
74
|
+
- Add WARNING: "Implementation may diverge from spec: <details>"
|
|
75
|
+
- Recommendation: "Review <file>:<lines> against requirement X"
|
|
76
|
+
|
|
77
|
+
**Scenario Coverage**:
|
|
78
|
+
- For each scenario in delta specs (marked with "#### Scenario:"):
|
|
79
|
+
- Check if conditions are handled in code
|
|
80
|
+
- Check if tests exist covering the scenario
|
|
81
|
+
- If scenario appears uncovered:
|
|
82
|
+
- Add WARNING: "Scenario not covered: <scenario name>"
|
|
83
|
+
- Recommendation: "Add test or implementation for scenario: <description>"
|
|
84
|
+
|
|
85
|
+
7. **Verify Coherence**
|
|
86
|
+
|
|
87
|
+
**Design Adherence**:
|
|
88
|
+
- If design.md exists in contextFiles:
|
|
89
|
+
- Extract key decisions (look for sections like "Decision:", "Approach:", "Architecture:")
|
|
90
|
+
- Verify implementation follows those decisions
|
|
91
|
+
- If contradiction detected:
|
|
92
|
+
- Add WARNING: "Design decision not followed: <decision>"
|
|
93
|
+
- Recommendation: "Update implementation or revise design.md to match reality"
|
|
94
|
+
- If no design.md: Skip design adherence check, note "No design.md to verify against"
|
|
95
|
+
|
|
96
|
+
**Code Pattern Consistency**:
|
|
97
|
+
- Review new code for consistency with project patterns
|
|
98
|
+
- Check file naming, directory structure, coding style
|
|
99
|
+
- If significant deviations found:
|
|
100
|
+
- Add SUGGESTION: "Code pattern deviation: <details>"
|
|
101
|
+
- Recommendation: "Consider following project pattern: <example>"
|
|
102
|
+
|
|
103
|
+
8. **Generate Verification Report**
|
|
104
|
+
|
|
105
|
+
**Summary Scorecard**:
|
|
106
|
+
```
|
|
107
|
+
## Verification Report: <change-name>
|
|
108
|
+
|
|
109
|
+
### Summary
|
|
110
|
+
| Dimension | Status |
|
|
111
|
+
|--------------|------------------|
|
|
112
|
+
| Completeness | X/Y tasks, N reqs|
|
|
113
|
+
| Correctness | M/N reqs covered |
|
|
114
|
+
| Coherence | Followed/Issues |
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Issues by Priority**:
|
|
118
|
+
|
|
119
|
+
1. **CRITICAL** (Must fix before archive):
|
|
120
|
+
- Incomplete tasks
|
|
121
|
+
- Missing requirement implementations
|
|
122
|
+
- Each with specific, actionable recommendation
|
|
123
|
+
|
|
124
|
+
2. **WARNING** (Should fix):
|
|
125
|
+
- Spec/design divergences
|
|
126
|
+
- Missing scenario coverage
|
|
127
|
+
- Each with specific recommendation
|
|
128
|
+
|
|
129
|
+
3. **SUGGESTION** (Nice to fix):
|
|
130
|
+
- Pattern inconsistencies
|
|
131
|
+
- Minor improvements
|
|
132
|
+
- Each with specific recommendation
|
|
133
|
+
|
|
134
|
+
**Final Assessment**:
|
|
135
|
+
- If CRITICAL issues: "X critical issue(s) found. Fix before archiving."
|
|
136
|
+
- If only warnings: "No critical issues. Y warning(s) to consider. Ready for archive (with noted improvements)."
|
|
137
|
+
- If all clear: "All checks passed. Ready for archive."
|
|
138
|
+
|
|
139
|
+
**Verification Heuristics**
|
|
140
|
+
|
|
141
|
+
- **Completeness**: Focus on objective checklist items (checkboxes, requirements list)
|
|
142
|
+
- **Correctness**: Use keyword search, file path analysis, reasonable inference - don't require perfect certainty
|
|
143
|
+
- **Coherence**: Look for glaring inconsistencies, don't nitpick style
|
|
144
|
+
- **False Positives**: When uncertain, prefer SUGGESTION over WARNING, WARNING over CRITICAL
|
|
145
|
+
- **Actionability**: Every issue must have a specific recommendation with file/line references where applicable
|
|
146
|
+
|
|
147
|
+
**Graceful Degradation**
|
|
148
|
+
|
|
149
|
+
- If only tasks.md exists: verify task completion only, skip spec/design checks
|
|
150
|
+
- If tasks + specs exist: verify completeness and correctness, skip design
|
|
151
|
+
- If full artifacts: verify all three dimensions
|
|
152
|
+
- Always note which checks were skipped and why
|
|
153
|
+
|
|
154
|
+
**Output Format**
|
|
155
|
+
|
|
156
|
+
Use clear markdown with:
|
|
157
|
+
- Table for summary scorecard
|
|
158
|
+
- Grouped lists for issues (CRITICAL/WARNING/SUGGESTION)
|
|
159
|
+
- Code references in format: `file.ts:123`
|
|
160
|
+
- Specific, actionable recommendations
|
|
161
|
+
- No vague suggestions like "consider reviewing"
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspec-apply-change
|
|
3
|
+
description: Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires openspec CLI.
|
|
6
|
+
metadata:
|
|
7
|
+
author: openspec
|
|
8
|
+
version: "1.0"
|
|
9
|
+
generatedBy: "1.1.1"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Implement tasks from an OpenSpec change.
|
|
13
|
+
|
|
14
|
+
**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.
|
|
15
|
+
|
|
16
|
+
**Steps**
|
|
17
|
+
|
|
18
|
+
1. **Select the change**
|
|
19
|
+
|
|
20
|
+
If a name is provided, use it. Otherwise:
|
|
21
|
+
- Infer from conversation context if the user mentioned a change
|
|
22
|
+
- Auto-select if only one active change exists
|
|
23
|
+
- If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select
|
|
24
|
+
|
|
25
|
+
Always announce: "Using change: <name>" and how to override (e.g., `/opsx-apply <other>`).
|
|
26
|
+
|
|
27
|
+
2. **Check status to understand the schema**
|
|
28
|
+
```bash
|
|
29
|
+
openspec status --change "<name>" --json
|
|
30
|
+
```
|
|
31
|
+
Parse the JSON to understand:
|
|
32
|
+
- `schemaName`: The workflow being used (e.g., "spec-driven")
|
|
33
|
+
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
|
|
34
|
+
|
|
35
|
+
3. **Get apply instructions**
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
openspec instructions apply --change "<name>" --json
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This returns:
|
|
42
|
+
- Context file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
|
|
43
|
+
- Progress (total, complete, remaining)
|
|
44
|
+
- Task list with status
|
|
45
|
+
- Dynamic instruction based on current state
|
|
46
|
+
|
|
47
|
+
**Handle states:**
|
|
48
|
+
- If `state: "blocked"` (missing artifacts): show message, suggest using openspec-continue-change
|
|
49
|
+
- If `state: "all_done"`: congratulate, suggest archive
|
|
50
|
+
- Otherwise: proceed to implementation
|
|
51
|
+
|
|
52
|
+
4. **Read context files**
|
|
53
|
+
|
|
54
|
+
Read the files listed in `contextFiles` from the apply instructions output.
|
|
55
|
+
The files depend on the schema being used:
|
|
56
|
+
- **spec-driven**: proposal, specs, design, tasks
|
|
57
|
+
- Other schemas: follow the contextFiles from CLI output
|
|
58
|
+
|
|
59
|
+
5. **Show current progress**
|
|
60
|
+
|
|
61
|
+
Display:
|
|
62
|
+
- Schema being used
|
|
63
|
+
- Progress: "N/M tasks complete"
|
|
64
|
+
- Remaining tasks overview
|
|
65
|
+
- Dynamic instruction from CLI
|
|
66
|
+
|
|
67
|
+
6. **Implement tasks (loop until done or blocked)**
|
|
68
|
+
|
|
69
|
+
For each pending task:
|
|
70
|
+
- Show which task is being worked on
|
|
71
|
+
- Make the code changes required
|
|
72
|
+
- Keep changes minimal and focused
|
|
73
|
+
- Mark task complete in the tasks file: `- [ ]` → `- [x]`
|
|
74
|
+
- Continue to next task
|
|
75
|
+
|
|
76
|
+
**Pause if:**
|
|
77
|
+
- Task is unclear → ask for clarification
|
|
78
|
+
- Implementation reveals a design issue → suggest updating artifacts
|
|
79
|
+
- Error or blocker encountered → report and wait for guidance
|
|
80
|
+
- User interrupts
|
|
81
|
+
|
|
82
|
+
7. **On completion or pause, show status**
|
|
83
|
+
|
|
84
|
+
Display:
|
|
85
|
+
- Tasks completed this session
|
|
86
|
+
- Overall progress: "N/M tasks complete"
|
|
87
|
+
- If all done: suggest archive
|
|
88
|
+
- If paused: explain why and wait for guidance
|
|
89
|
+
|
|
90
|
+
**Output During Implementation**
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
## Implementing: <change-name> (schema: <schema-name>)
|
|
94
|
+
|
|
95
|
+
Working on task 3/7: <task description>
|
|
96
|
+
[...implementation happening...]
|
|
97
|
+
✓ Task complete
|
|
98
|
+
|
|
99
|
+
Working on task 4/7: <task description>
|
|
100
|
+
[...implementation happening...]
|
|
101
|
+
✓ Task complete
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Output On Completion**
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
## Implementation Complete
|
|
108
|
+
|
|
109
|
+
**Change:** <change-name>
|
|
110
|
+
**Schema:** <schema-name>
|
|
111
|
+
**Progress:** 7/7 tasks complete ✓
|
|
112
|
+
|
|
113
|
+
### Completed This Session
|
|
114
|
+
- [x] Task 1
|
|
115
|
+
- [x] Task 2
|
|
116
|
+
...
|
|
117
|
+
|
|
118
|
+
All tasks complete! Ready to archive this change.
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Output On Pause (Issue Encountered)**
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
## Implementation Paused
|
|
125
|
+
|
|
126
|
+
**Change:** <change-name>
|
|
127
|
+
**Schema:** <schema-name>
|
|
128
|
+
**Progress:** 4/7 tasks complete
|
|
129
|
+
|
|
130
|
+
### Issue Encountered
|
|
131
|
+
<description of the issue>
|
|
132
|
+
|
|
133
|
+
**Options:**
|
|
134
|
+
1. <option 1>
|
|
135
|
+
2. <option 2>
|
|
136
|
+
3. Other approach
|
|
137
|
+
|
|
138
|
+
What would you like to do?
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Guardrails**
|
|
142
|
+
- Keep going through tasks until done or blocked
|
|
143
|
+
- Always read context files before starting (from the apply instructions output)
|
|
144
|
+
- If task is ambiguous, pause and ask before implementing
|
|
145
|
+
- If implementation reveals issues, pause and suggest artifact updates
|
|
146
|
+
- Keep code changes minimal and scoped to each task
|
|
147
|
+
- Update task checkbox immediately after completing each task
|
|
148
|
+
- Pause on errors, blockers, or unclear requirements - don't guess
|
|
149
|
+
- Use contextFiles from CLI output, don't assume specific file names
|
|
150
|
+
|
|
151
|
+
**Fluid Workflow Integration**
|
|
152
|
+
|
|
153
|
+
This skill supports the "actions on a change" model:
|
|
154
|
+
|
|
155
|
+
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
|
|
156
|
+
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspec-archive-change
|
|
3
|
+
description: Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires openspec CLI.
|
|
6
|
+
metadata:
|
|
7
|
+
author: openspec
|
|
8
|
+
version: "1.0"
|
|
9
|
+
generatedBy: "1.1.1"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Archive a completed change in the experimental workflow.
|
|
13
|
+
|
|
14
|
+
**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.
|
|
15
|
+
|
|
16
|
+
**Steps**
|
|
17
|
+
|
|
18
|
+
1. **If no change name provided, prompt for selection**
|
|
19
|
+
|
|
20
|
+
Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
21
|
+
|
|
22
|
+
Show only active changes (not already archived).
|
|
23
|
+
Include the schema used for each change if available.
|
|
24
|
+
|
|
25
|
+
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
26
|
+
|
|
27
|
+
2. **Check artifact completion status**
|
|
28
|
+
|
|
29
|
+
Run `openspec status --change "<name>" --json` to check artifact completion.
|
|
30
|
+
|
|
31
|
+
Parse the JSON to understand:
|
|
32
|
+
- `schemaName`: The workflow being used
|
|
33
|
+
- `artifacts`: List of artifacts with their status (`done` or other)
|
|
34
|
+
|
|
35
|
+
**If any artifacts are not `done`:**
|
|
36
|
+
- Display warning listing incomplete artifacts
|
|
37
|
+
- Use **AskUserQuestion tool** to confirm user wants to proceed
|
|
38
|
+
- Proceed if user confirms
|
|
39
|
+
|
|
40
|
+
3. **Check task completion status**
|
|
41
|
+
|
|
42
|
+
Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
|
|
43
|
+
|
|
44
|
+
Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
|
|
45
|
+
|
|
46
|
+
**If incomplete tasks found:**
|
|
47
|
+
- Display warning showing count of incomplete tasks
|
|
48
|
+
- Use **AskUserQuestion tool** to confirm user wants to proceed
|
|
49
|
+
- Proceed if user confirms
|
|
50
|
+
|
|
51
|
+
**If no tasks file exists:** Proceed without task-related warning.
|
|
52
|
+
|
|
53
|
+
4. **Assess delta spec sync state**
|
|
54
|
+
|
|
55
|
+
Check for delta specs at `openspec/changes/<name>/specs/`. If none exist, proceed without sync prompt.
|
|
56
|
+
|
|
57
|
+
**If delta specs exist:**
|
|
58
|
+
- Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
|
|
59
|
+
- Determine what changes would be applied (adds, modifications, removals, renames)
|
|
60
|
+
- Show a combined summary before prompting
|
|
61
|
+
|
|
62
|
+
**Prompt options:**
|
|
63
|
+
- If changes needed: "Sync now (recommended)", "Archive without syncing"
|
|
64
|
+
- If already synced: "Archive now", "Sync anyway", "Cancel"
|
|
65
|
+
|
|
66
|
+
If user chooses sync, execute /opsx-sync logic (use the openspec-sync-specs skill). Proceed to archive regardless of choice.
|
|
67
|
+
|
|
68
|
+
5. **Perform the archive**
|
|
69
|
+
|
|
70
|
+
Create the archive directory if it doesn't exist:
|
|
71
|
+
```bash
|
|
72
|
+
mkdir -p openspec/changes/archive
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Generate target name using current date: `YYYY-MM-DD-<change-name>`
|
|
76
|
+
|
|
77
|
+
**Check if target already exists:**
|
|
78
|
+
- If yes: Fail with error, suggest renaming existing archive or using different date
|
|
79
|
+
- If no: Move the change directory to archive
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
6. **Display summary**
|
|
86
|
+
|
|
87
|
+
Show archive completion summary including:
|
|
88
|
+
- Change name
|
|
89
|
+
- Schema that was used
|
|
90
|
+
- Archive location
|
|
91
|
+
- Whether specs were synced (if applicable)
|
|
92
|
+
- Note about any warnings (incomplete artifacts/tasks)
|
|
93
|
+
|
|
94
|
+
**Output On Success**
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
## Archive Complete
|
|
98
|
+
|
|
99
|
+
**Change:** <change-name>
|
|
100
|
+
**Schema:** <schema-name>
|
|
101
|
+
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
|
|
102
|
+
**Specs:** ✓ Synced to main specs (or "No delta specs" or "Sync skipped")
|
|
103
|
+
|
|
104
|
+
All artifacts complete. All tasks complete.
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Guardrails**
|
|
108
|
+
- Always prompt for change selection if not provided
|
|
109
|
+
- Use artifact graph (openspec status --json) for completion checking
|
|
110
|
+
- Don't block archive on warnings - just inform and confirm
|
|
111
|
+
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
|
|
112
|
+
- Show clear summary of what happened
|
|
113
|
+
- If sync is requested, use openspec-sync-specs approach (agent-driven)
|
|
114
|
+
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspec-bulk-archive-change
|
|
3
|
+
description: Archive multiple completed changes at once. Use when archiving several parallel changes.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires openspec CLI.
|
|
6
|
+
metadata:
|
|
7
|
+
author: openspec
|
|
8
|
+
version: "1.0"
|
|
9
|
+
generatedBy: "1.1.1"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Archive multiple completed changes in a single operation.
|
|
13
|
+
|
|
14
|
+
This skill allows you to batch-archive changes, handling spec conflicts intelligently by checking the codebase to determine what's actually implemented.
|
|
15
|
+
|
|
16
|
+
**Input**: None required (prompts for selection)
|
|
17
|
+
|
|
18
|
+
**Steps**
|
|
19
|
+
|
|
20
|
+
1. **Get active changes**
|
|
21
|
+
|
|
22
|
+
Run `openspec list --json` to get all active changes.
|
|
23
|
+
|
|
24
|
+
If no active changes exist, inform user and stop.
|
|
25
|
+
|
|
26
|
+
2. **Prompt for change selection**
|
|
27
|
+
|
|
28
|
+
Use **AskUserQuestion tool** with multi-select to let user choose changes:
|
|
29
|
+
- Show each change with its schema
|
|
30
|
+
- Include an option for "All changes"
|
|
31
|
+
- Allow any number of selections (1+ works, 2+ is the typical use case)
|
|
32
|
+
|
|
33
|
+
**IMPORTANT**: Do NOT auto-select. Always let the user choose.
|
|
34
|
+
|
|
35
|
+
3. **Batch validation - gather status for all selected changes**
|
|
36
|
+
|
|
37
|
+
For each selected change, collect:
|
|
38
|
+
|
|
39
|
+
a. **Artifact status** - Run `openspec status --change "<name>" --json`
|
|
40
|
+
- Parse `schemaName` and `artifacts` list
|
|
41
|
+
- Note which artifacts are `done` vs other states
|
|
42
|
+
|
|
43
|
+
b. **Task completion** - Read `openspec/changes/<name>/tasks.md`
|
|
44
|
+
- Count `- [ ]` (incomplete) vs `- [x]` (complete)
|
|
45
|
+
- If no tasks file exists, note as "No tasks"
|
|
46
|
+
|
|
47
|
+
c. **Delta specs** - Check `openspec/changes/<name>/specs/` directory
|
|
48
|
+
- List which capability specs exist
|
|
49
|
+
- For each, extract requirement names (lines matching `### Requirement: <name>`)
|
|
50
|
+
|
|
51
|
+
4. **Detect spec conflicts**
|
|
52
|
+
|
|
53
|
+
Build a map of `capability -> [changes that touch it]`:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
auth -> [change-a, change-b] <- CONFLICT (2+ changes)
|
|
57
|
+
api -> [change-c] <- OK (only 1 change)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
A conflict exists when 2+ selected changes have delta specs for the same capability.
|
|
61
|
+
|
|
62
|
+
5. **Resolve conflicts agentically**
|
|
63
|
+
|
|
64
|
+
**For each conflict**, investigate the codebase:
|
|
65
|
+
|
|
66
|
+
a. **Read the delta specs** from each conflicting change to understand what each claims to add/modify
|
|
67
|
+
|
|
68
|
+
b. **Search the codebase** for implementation evidence:
|
|
69
|
+
- Look for code implementing requirements from each delta spec
|
|
70
|
+
- Check for related files, functions, or tests
|
|
71
|
+
|
|
72
|
+
c. **Determine resolution**:
|
|
73
|
+
- If only one change is actually implemented -> sync that one's specs
|
|
74
|
+
- If both implemented -> apply in chronological order (older first, newer overwrites)
|
|
75
|
+
- If neither implemented -> skip spec sync, warn user
|
|
76
|
+
|
|
77
|
+
d. **Record resolution** for each conflict:
|
|
78
|
+
- Which change's specs to apply
|
|
79
|
+
- In what order (if both)
|
|
80
|
+
- Rationale (what was found in codebase)
|
|
81
|
+
|
|
82
|
+
6. **Show consolidated status table**
|
|
83
|
+
|
|
84
|
+
Display a table summarizing all changes:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
| Change | Artifacts | Tasks | Specs | Conflicts | Status |
|
|
88
|
+
|---------------------|-----------|-------|---------|-----------|--------|
|
|
89
|
+
| schema-management | Done | 5/5 | 2 delta | None | Ready |
|
|
90
|
+
| project-config | Done | 3/3 | 1 delta | None | Ready |
|
|
91
|
+
| add-oauth | Done | 4/4 | 1 delta | auth (!) | Ready* |
|
|
92
|
+
| add-verify-skill | 1 left | 2/5 | None | None | Warn |
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
For conflicts, show the resolution:
|
|
96
|
+
```
|
|
97
|
+
* Conflict resolution:
|
|
98
|
+
- auth spec: Will apply add-oauth then add-jwt (both implemented, chronological order)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
For incomplete changes, show warnings:
|
|
102
|
+
```
|
|
103
|
+
Warnings:
|
|
104
|
+
- add-verify-skill: 1 incomplete artifact, 3 incomplete tasks
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
7. **Confirm batch operation**
|
|
108
|
+
|
|
109
|
+
Use **AskUserQuestion tool** with a single confirmation:
|
|
110
|
+
|
|
111
|
+
- "Archive N changes?" with options based on status
|
|
112
|
+
- Options might include:
|
|
113
|
+
- "Archive all N changes"
|
|
114
|
+
- "Archive only N ready changes (skip incomplete)"
|
|
115
|
+
- "Cancel"
|
|
116
|
+
|
|
117
|
+
If there are incomplete changes, make clear they'll be archived with warnings.
|
|
118
|
+
|
|
119
|
+
8. **Execute archive for each confirmed change**
|
|
120
|
+
|
|
121
|
+
Process changes in the determined order (respecting conflict resolution):
|
|
122
|
+
|
|
123
|
+
a. **Sync specs** if delta specs exist:
|
|
124
|
+
- Use the openspec-sync-specs approach (agent-driven intelligent merge)
|
|
125
|
+
- For conflicts, apply in resolved order
|
|
126
|
+
- Track if sync was done
|
|
127
|
+
|
|
128
|
+
b. **Perform the archive**:
|
|
129
|
+
```bash
|
|
130
|
+
mkdir -p openspec/changes/archive
|
|
131
|
+
mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
c. **Track outcome** for each change:
|
|
135
|
+
- Success: archived successfully
|
|
136
|
+
- Failed: error during archive (record error)
|
|
137
|
+
- Skipped: user chose not to archive (if applicable)
|
|
138
|
+
|
|
139
|
+
9. **Display summary**
|
|
140
|
+
|
|
141
|
+
Show final results:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
## Bulk Archive Complete
|
|
145
|
+
|
|
146
|
+
Archived 3 changes:
|
|
147
|
+
- schema-management-cli -> archive/2026-01-19-schema-management-cli/
|
|
148
|
+
- project-config -> archive/2026-01-19-project-config/
|
|
149
|
+
- add-oauth -> archive/2026-01-19-add-oauth/
|
|
150
|
+
|
|
151
|
+
Skipped 1 change:
|
|
152
|
+
- add-verify-skill (user chose not to archive incomplete)
|
|
153
|
+
|
|
154
|
+
Spec sync summary:
|
|
155
|
+
- 4 delta specs synced to main specs
|
|
156
|
+
- 1 conflict resolved (auth: applied both in chronological order)
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
If any failures:
|
|
160
|
+
```
|
|
161
|
+
Failed 1 change:
|
|
162
|
+
- some-change: Archive directory already exists
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Conflict Resolution Examples**
|
|
166
|
+
|
|
167
|
+
Example 1: Only one implemented
|
|
168
|
+
```
|
|
169
|
+
Conflict: specs/auth/spec.md touched by [add-oauth, add-jwt]
|
|
170
|
+
|
|
171
|
+
Checking add-oauth:
|
|
172
|
+
- Delta adds "OAuth Provider Integration" requirement
|
|
173
|
+
- Searching codebase... found src/auth/oauth.ts implementing OAuth flow
|
|
174
|
+
|
|
175
|
+
Checking add-jwt:
|
|
176
|
+
- Delta adds "JWT Token Handling" requirement
|
|
177
|
+
- Searching codebase... no JWT implementation found
|
|
178
|
+
|
|
179
|
+
Resolution: Only add-oauth is implemented. Will sync add-oauth specs only.
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Example 2: Both implemented
|
|
183
|
+
```
|
|
184
|
+
Conflict: specs/api/spec.md touched by [add-rest-api, add-graphql]
|
|
185
|
+
|
|
186
|
+
Checking add-rest-api (created 2026-01-10):
|
|
187
|
+
- Delta adds "REST Endpoints" requirement
|
|
188
|
+
- Searching codebase... found src/api/rest.ts
|
|
189
|
+
|
|
190
|
+
Checking add-graphql (created 2026-01-15):
|
|
191
|
+
- Delta adds "GraphQL Schema" requirement
|
|
192
|
+
- Searching codebase... found src/api/graphql.ts
|
|
193
|
+
|
|
194
|
+
Resolution: Both implemented. Will apply add-rest-api specs first,
|
|
195
|
+
then add-graphql specs (chronological order, newer takes precedence).
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Output On Success**
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
## Bulk Archive Complete
|
|
202
|
+
|
|
203
|
+
Archived N changes:
|
|
204
|
+
- <change-1> -> archive/YYYY-MM-DD-<change-1>/
|
|
205
|
+
- <change-2> -> archive/YYYY-MM-DD-<change-2>/
|
|
206
|
+
|
|
207
|
+
Spec sync summary:
|
|
208
|
+
- N delta specs synced to main specs
|
|
209
|
+
- No conflicts (or: M conflicts resolved)
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**Output On Partial Success**
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
## Bulk Archive Complete (partial)
|
|
216
|
+
|
|
217
|
+
Archived N changes:
|
|
218
|
+
- <change-1> -> archive/YYYY-MM-DD-<change-1>/
|
|
219
|
+
|
|
220
|
+
Skipped M changes:
|
|
221
|
+
- <change-2> (user chose not to archive incomplete)
|
|
222
|
+
|
|
223
|
+
Failed K changes:
|
|
224
|
+
- <change-3>: Archive directory already exists
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**Output When No Changes**
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
## No Changes to Archive
|
|
231
|
+
|
|
232
|
+
No active changes found. Use `/opsx-new` to create a new change.
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**Guardrails**
|
|
236
|
+
- Allow any number of changes (1+ is fine, 2+ is the typical use case)
|
|
237
|
+
- Always prompt for selection, never auto-select
|
|
238
|
+
- Detect spec conflicts early and resolve by checking codebase
|
|
239
|
+
- When both changes are implemented, apply specs in chronological order
|
|
240
|
+
- Skip spec sync only when implementation is missing (warn user)
|
|
241
|
+
- Show clear per-change status before confirming
|
|
242
|
+
- Use single confirmation for entire batch
|
|
243
|
+
- Track and report all outcomes (success/skip/fail)
|
|
244
|
+
- Preserve .openspec.yaml when moving to archive
|
|
245
|
+
- Archive directory target uses current date: YYYY-MM-DD-<name>
|
|
246
|
+
- If archive target exists, fail that change but continue with others
|