6aspec 2.0.0-dev.3 → 2.0.0-dev.30

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.
Files changed (95) hide show
  1. package/.6aspec/rules/biz/code.md +122 -28
  2. package/.6aspec/rules/biz/code_implementation_sop.md +77 -0
  3. package/.6aspec/rules/brown/brown_archive_sop.md +17 -11
  4. package/.6aspec/rules/brown/brown_constitution.md +11 -0
  5. package/.6aspec/rules/brown/brown_continue_sop.md +10 -3
  6. package/.6aspec/rules/brown/brown_design_sop.md +285 -71
  7. package/.6aspec/rules/brown/brown_explore_sop.md +314 -0
  8. package/.6aspec/rules/brown/brown_ff_sop.md +31 -18
  9. package/.6aspec/rules/brown/brown_impact_sop.md +101 -45
  10. package/.6aspec/rules/brown/brown_implement_sop.md +127 -43
  11. package/.6aspec/rules/brown/brown_list_sop.md +12 -12
  12. package/.6aspec/rules/brown/brown_new_sop.md +63 -38
  13. package/.6aspec/rules/brown/brown_proposal_sop.md +286 -76
  14. package/.6aspec/rules/brown/brown_quick_sop.md +5 -5
  15. package/.6aspec/rules/brown/brown_review_sop.md +4 -4
  16. package/.6aspec/rules/brown/brown_rollback_sop.md +29 -19
  17. package/.6aspec/rules/brown/brown_specs_sop.md +412 -120
  18. package/.6aspec/rules/brown/brown_status_sop.md +13 -3
  19. package/.6aspec/rules/brown/brown_tasks_sop.md +212 -83
  20. package/.6aspec/rules/brown/brown_understand_sop.md +111 -40
  21. package/.6aspec/rules/brown/brown_update_sop.md +287 -0
  22. package/.6aspec/rules/brown/brown_verify_sop.md +138 -58
  23. package/.6aspec/rules/green/{6A_archive_sop.md → green_archive_sop.md} +3 -3
  24. package/.6aspec/rules/green/{6A_clarify_sop.md → green_clarify_sop.md} +1 -1
  25. package/.6aspec/rules/green/{6A_code_implementation_sop.md → green_code_implementation_sop.md} +18 -3
  26. package/.6aspec/rules/green/{6A_continue_sop.md → green_continue_sop.md} +3 -3
  27. package/.6aspec/rules/green/{6A_new_sop.md → green_new_sop.md} +90 -11
  28. package/.6aspec/rules/green/green_status_schema.md +4 -4
  29. package/.6aspec/rules/green/{6A_status_sop.md → green_status_sop.md} +3 -3
  30. package/.6aspec/rules/green/{6A_tasks_sop.md → green_tasks_sop.md} +1 -1
  31. package/.claude/commands/6aspec/brown/explore.md +11 -0
  32. package/.claude/commands/6aspec/brown/update.md +11 -0
  33. package/.claude/commands/6aspec/code.md +10 -0
  34. package/.claude/commands/6aspec/green/archive.md +1 -1
  35. package/.claude/commands/6aspec/green/clarify.md +2 -2
  36. package/.claude/commands/6aspec/green/continue.md +1 -1
  37. package/.claude/commands/6aspec/green/design.md +2 -2
  38. package/.claude/commands/6aspec/green/{execute-task.md → implement.md} +1 -1
  39. package/.claude/commands/6aspec/green/import-model-table.md +1 -1
  40. package/.claude/commands/6aspec/green/init.md +2 -2
  41. package/.claude/commands/6aspec/green/model.md +2 -2
  42. package/.claude/commands/6aspec/green/new.md +2 -2
  43. package/.claude/commands/6aspec/green/rollback.md +1 -1
  44. package/.claude/commands/6aspec/green/status.md +1 -1
  45. package/.claude/commands/6aspec/green/tasks.md +2 -2
  46. package/.claude/commands/6aspec/green/visual-logic.md +2 -2
  47. package/.claude/commands/opsx/apply.md +152 -0
  48. package/.claude/commands/opsx/archive.md +157 -0
  49. package/.claude/commands/opsx/bulk-archive.md +242 -0
  50. package/.claude/commands/opsx/continue.md +114 -0
  51. package/.claude/commands/opsx/explore.md +174 -0
  52. package/.claude/commands/opsx/ff.md +94 -0
  53. package/.claude/commands/opsx/new.md +69 -0
  54. package/.claude/commands/opsx/onboard.md +525 -0
  55. package/.claude/commands/opsx/sync.md +134 -0
  56. package/.claude/commands/opsx/verify.md +164 -0
  57. package/.claude/settings.local.json +21 -1
  58. package/.cursor/commands/6aspec/brown/explore.md +11 -0
  59. package/.cursor/commands/6aspec/brown/update.md +9 -0
  60. package/.cursor/commands/6aspec/code.md +8 -0
  61. package/.cursor/commands/6aspec/green/archive.md +1 -1
  62. package/.cursor/commands/6aspec/green/clarify.md +2 -2
  63. package/.cursor/commands/6aspec/green/continue.md +1 -1
  64. package/.cursor/commands/6aspec/green/design.md +2 -2
  65. package/.cursor/commands/6aspec/green/{execute-task.md → implement.md} +1 -1
  66. package/.cursor/commands/6aspec/green/import-model-table.md +1 -1
  67. package/.cursor/commands/6aspec/green/init.md +2 -2
  68. package/.cursor/commands/6aspec/green/model.md +2 -2
  69. package/.cursor/commands/6aspec/green/new.md +2 -2
  70. package/.cursor/commands/6aspec/green/rollback.md +1 -1
  71. package/.cursor/commands/6aspec/green/status.md +1 -1
  72. package/.cursor/commands/6aspec/green/tasks.md +2 -2
  73. package/.cursor/commands/6aspec/green/visual-logic.md +2 -2
  74. package/.cursor/commands/opsx-apply.md +152 -0
  75. package/.cursor/commands/opsx-archive.md +157 -0
  76. package/.cursor/commands/opsx-bulk-archive.md +242 -0
  77. package/.cursor/commands/opsx-continue.md +114 -0
  78. package/.cursor/commands/opsx-explore.md +174 -0
  79. package/.cursor/commands/opsx-ff.md +94 -0
  80. package/.cursor/commands/opsx-new.md +69 -0
  81. package/.cursor/commands/opsx-onboard.md +525 -0
  82. package/.cursor/commands/opsx-sync.md +134 -0
  83. package/.cursor/commands/opsx-verify.md +164 -0
  84. package/README.md +1 -1
  85. package/bin/6aspec +17 -1
  86. package/lib/cli.js +1 -1
  87. package/package.json +1 -1
  88. /package/.6aspec/rules/green/{6A_constitution.md → green_constitution.md} +0 -0
  89. /package/.6aspec/rules/green/{6A_design_sop.md → green_design_sop.md} +0 -0
  90. /package/.6aspec/rules/green/{6A_import_model_table_sop.md → green_import_model_table_sop.md} +0 -0
  91. /package/.6aspec/rules/green/{6A_init_event_list_sop.md → green_init_event_list_sop.md} +0 -0
  92. /package/.6aspec/rules/green/{6A_init_map_sop.md → green_init_map_sop.md} +0 -0
  93. /package/.6aspec/rules/green/{6A_model_sop.md → green_model_sop.md} +0 -0
  94. /package/.6aspec/rules/green/{6A_rollback_sop.md → green_rollback_sop.md} +0 -0
  95. /package/.6aspec/rules/green/{6A_visual_logic_sop.md → green_visual_logic_sop.md} +0 -0
@@ -0,0 +1,157 @@
1
+ ---
2
+ name: /opsx-archive
3
+ id: opsx-archive
4
+ category: Workflow
5
+ description: Archive a completed change in the experimental workflow
6
+ ---
7
+
8
+ Archive a completed change in the experimental workflow.
9
+
10
+ **Input**: Optionally specify a change name after `/opsx:archive` (e.g., `/opsx:archive add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
11
+
12
+ **Steps**
13
+
14
+ 1. **If no change name provided, prompt for selection**
15
+
16
+ Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
17
+
18
+ Show only active changes (not already archived).
19
+ Include the schema used for each change if available.
20
+
21
+ **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
22
+
23
+ 2. **Check artifact completion status**
24
+
25
+ Run `openspec status --change "<name>" --json` to check artifact completion.
26
+
27
+ Parse the JSON to understand:
28
+ - `schemaName`: The workflow being used
29
+ - `artifacts`: List of artifacts with their status (`done` or other)
30
+
31
+ **If any artifacts are not `done`:**
32
+ - Display warning listing incomplete artifacts
33
+ - Prompt user for confirmation to continue
34
+ - Proceed if user confirms
35
+
36
+ 3. **Check task completion status**
37
+
38
+ Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
39
+
40
+ Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
41
+
42
+ **If incomplete tasks found:**
43
+ - Display warning showing count of incomplete tasks
44
+ - Prompt user for confirmation to continue
45
+ - Proceed if user confirms
46
+
47
+ **If no tasks file exists:** Proceed without task-related warning.
48
+
49
+ 4. **Assess delta spec sync state**
50
+
51
+ Check for delta specs at `openspec/changes/<name>/specs/`. If none exist, proceed without sync prompt.
52
+
53
+ **If delta specs exist:**
54
+ - Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
55
+ - Determine what changes would be applied (adds, modifications, removals, renames)
56
+ - Show a combined summary before prompting
57
+
58
+ **Prompt options:**
59
+ - If changes needed: "Sync now (recommended)", "Archive without syncing"
60
+ - If already synced: "Archive now", "Sync anyway", "Cancel"
61
+
62
+ If user chooses sync, execute `/opsx:sync` logic. Proceed to archive regardless of choice.
63
+
64
+ 5. **Perform the archive**
65
+
66
+ Create the archive directory if it doesn't exist:
67
+ ```bash
68
+ mkdir -p openspec/changes/archive
69
+ ```
70
+
71
+ Generate target name using current date: `YYYY-MM-DD-<change-name>`
72
+
73
+ **Check if target already exists:**
74
+ - If yes: Fail with error, suggest renaming existing archive or using different date
75
+ - If no: Move the change directory to archive
76
+
77
+ ```bash
78
+ mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
79
+ ```
80
+
81
+ 6. **Display summary**
82
+
83
+ Show archive completion summary including:
84
+ - Change name
85
+ - Schema that was used
86
+ - Archive location
87
+ - Spec sync status (synced / sync skipped / no delta specs)
88
+ - Note about any warnings (incomplete artifacts/tasks)
89
+
90
+ **Output On Success**
91
+
92
+ ```
93
+ ## Archive Complete
94
+
95
+ **Change:** <change-name>
96
+ **Schema:** <schema-name>
97
+ **Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
98
+ **Specs:** ✓ Synced to main specs
99
+
100
+ All artifacts complete. All tasks complete.
101
+ ```
102
+
103
+ **Output On Success (No Delta Specs)**
104
+
105
+ ```
106
+ ## Archive Complete
107
+
108
+ **Change:** <change-name>
109
+ **Schema:** <schema-name>
110
+ **Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
111
+ **Specs:** No delta specs
112
+
113
+ All artifacts complete. All tasks complete.
114
+ ```
115
+
116
+ **Output On Success With Warnings**
117
+
118
+ ```
119
+ ## Archive Complete (with warnings)
120
+
121
+ **Change:** <change-name>
122
+ **Schema:** <schema-name>
123
+ **Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
124
+ **Specs:** Sync skipped (user chose to skip)
125
+
126
+ **Warnings:**
127
+ - Archived with 2 incomplete artifacts
128
+ - Archived with 3 incomplete tasks
129
+ - Delta spec sync was skipped (user chose to skip)
130
+
131
+ Review the archive if this was not intentional.
132
+ ```
133
+
134
+ **Output On Error (Archive Exists)**
135
+
136
+ ```
137
+ ## Archive Failed
138
+
139
+ **Change:** <change-name>
140
+ **Target:** openspec/changes/archive/YYYY-MM-DD-<name>/
141
+
142
+ Target archive directory already exists.
143
+
144
+ **Options:**
145
+ 1. Rename the existing archive
146
+ 2. Delete the existing archive if it's a duplicate
147
+ 3. Wait until a different date to archive
148
+ ```
149
+
150
+ **Guardrails**
151
+ - Always prompt for change selection if not provided
152
+ - Use artifact graph (openspec status --json) for completion checking
153
+ - Don't block archive on warnings - just inform and confirm
154
+ - Preserve .openspec.yaml when moving to archive (it moves with the directory)
155
+ - Show clear summary of what happened
156
+ - If sync is requested, use /opsx:sync approach (agent-driven)
157
+ - If delta specs exist, always run the sync assessment and show the combined summary before prompting
@@ -0,0 +1,242 @@
1
+ ---
2
+ name: /opsx-bulk-archive
3
+ id: opsx-bulk-archive
4
+ category: Workflow
5
+ description: Archive multiple completed changes at once
6
+ ---
7
+
8
+ Archive multiple completed changes in a single operation.
9
+
10
+ This skill allows you to batch-archive changes, handling spec conflicts intelligently by checking the codebase to determine what's actually implemented.
11
+
12
+ **Input**: None required (prompts for selection)
13
+
14
+ **Steps**
15
+
16
+ 1. **Get active changes**
17
+
18
+ Run `openspec list --json` to get all active changes.
19
+
20
+ If no active changes exist, inform user and stop.
21
+
22
+ 2. **Prompt for change selection**
23
+
24
+ Use **AskUserQuestion tool** with multi-select to let user choose changes:
25
+ - Show each change with its schema
26
+ - Include an option for "All changes"
27
+ - Allow any number of selections (1+ works, 2+ is the typical use case)
28
+
29
+ **IMPORTANT**: Do NOT auto-select. Always let the user choose.
30
+
31
+ 3. **Batch validation - gather status for all selected changes**
32
+
33
+ For each selected change, collect:
34
+
35
+ a. **Artifact status** - Run `openspec status --change "<name>" --json`
36
+ - Parse `schemaName` and `artifacts` list
37
+ - Note which artifacts are `done` vs other states
38
+
39
+ b. **Task completion** - Read `openspec/changes/<name>/tasks.md`
40
+ - Count `- [ ]` (incomplete) vs `- [x]` (complete)
41
+ - If no tasks file exists, note as "No tasks"
42
+
43
+ c. **Delta specs** - Check `openspec/changes/<name>/specs/` directory
44
+ - List which capability specs exist
45
+ - For each, extract requirement names (lines matching `### Requirement: <name>`)
46
+
47
+ 4. **Detect spec conflicts**
48
+
49
+ Build a map of `capability -> [changes that touch it]`:
50
+
51
+ ```
52
+ auth -> [change-a, change-b] <- CONFLICT (2+ changes)
53
+ api -> [change-c] <- OK (only 1 change)
54
+ ```
55
+
56
+ A conflict exists when 2+ selected changes have delta specs for the same capability.
57
+
58
+ 5. **Resolve conflicts agentically**
59
+
60
+ **For each conflict**, investigate the codebase:
61
+
62
+ a. **Read the delta specs** from each conflicting change to understand what each claims to add/modify
63
+
64
+ b. **Search the codebase** for implementation evidence:
65
+ - Look for code implementing requirements from each delta spec
66
+ - Check for related files, functions, or tests
67
+
68
+ c. **Determine resolution**:
69
+ - If only one change is actually implemented -> sync that one's specs
70
+ - If both implemented -> apply in chronological order (older first, newer overwrites)
71
+ - If neither implemented -> skip spec sync, warn user
72
+
73
+ d. **Record resolution** for each conflict:
74
+ - Which change's specs to apply
75
+ - In what order (if both)
76
+ - Rationale (what was found in codebase)
77
+
78
+ 6. **Show consolidated status table**
79
+
80
+ Display a table summarizing all changes:
81
+
82
+ ```
83
+ | Change | Artifacts | Tasks | Specs | Conflicts | Status |
84
+ |---------------------|-----------|-------|---------|-----------|--------|
85
+ | schema-management | Done | 5/5 | 2 delta | None | Ready |
86
+ | project-config | Done | 3/3 | 1 delta | None | Ready |
87
+ | add-oauth | Done | 4/4 | 1 delta | auth (!) | Ready* |
88
+ | add-verify-skill | 1 left | 2/5 | None | None | Warn |
89
+ ```
90
+
91
+ For conflicts, show the resolution:
92
+ ```
93
+ * Conflict resolution:
94
+ - auth spec: Will apply add-oauth then add-jwt (both implemented, chronological order)
95
+ ```
96
+
97
+ For incomplete changes, show warnings:
98
+ ```
99
+ Warnings:
100
+ - add-verify-skill: 1 incomplete artifact, 3 incomplete tasks
101
+ ```
102
+
103
+ 7. **Confirm batch operation**
104
+
105
+ Use **AskUserQuestion tool** with a single confirmation:
106
+
107
+ - "Archive N changes?" with options based on status
108
+ - Options might include:
109
+ - "Archive all N changes"
110
+ - "Archive only N ready changes (skip incomplete)"
111
+ - "Cancel"
112
+
113
+ If there are incomplete changes, make clear they'll be archived with warnings.
114
+
115
+ 8. **Execute archive for each confirmed change**
116
+
117
+ Process changes in the determined order (respecting conflict resolution):
118
+
119
+ a. **Sync specs** if delta specs exist:
120
+ - Use the openspec-sync-specs approach (agent-driven intelligent merge)
121
+ - For conflicts, apply in resolved order
122
+ - Track if sync was done
123
+
124
+ b. **Perform the archive**:
125
+ ```bash
126
+ mkdir -p openspec/changes/archive
127
+ mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
128
+ ```
129
+
130
+ c. **Track outcome** for each change:
131
+ - Success: archived successfully
132
+ - Failed: error during archive (record error)
133
+ - Skipped: user chose not to archive (if applicable)
134
+
135
+ 9. **Display summary**
136
+
137
+ Show final results:
138
+
139
+ ```
140
+ ## Bulk Archive Complete
141
+
142
+ Archived 3 changes:
143
+ - schema-management-cli -> archive/2026-01-19-schema-management-cli/
144
+ - project-config -> archive/2026-01-19-project-config/
145
+ - add-oauth -> archive/2026-01-19-add-oauth/
146
+
147
+ Skipped 1 change:
148
+ - add-verify-skill (user chose not to archive incomplete)
149
+
150
+ Spec sync summary:
151
+ - 4 delta specs synced to main specs
152
+ - 1 conflict resolved (auth: applied both in chronological order)
153
+ ```
154
+
155
+ If any failures:
156
+ ```
157
+ Failed 1 change:
158
+ - some-change: Archive directory already exists
159
+ ```
160
+
161
+ **Conflict Resolution Examples**
162
+
163
+ Example 1: Only one implemented
164
+ ```
165
+ Conflict: specs/auth/spec.md touched by [add-oauth, add-jwt]
166
+
167
+ Checking add-oauth:
168
+ - Delta adds "OAuth Provider Integration" requirement
169
+ - Searching codebase... found src/auth/oauth.ts implementing OAuth flow
170
+
171
+ Checking add-jwt:
172
+ - Delta adds "JWT Token Handling" requirement
173
+ - Searching codebase... no JWT implementation found
174
+
175
+ Resolution: Only add-oauth is implemented. Will sync add-oauth specs only.
176
+ ```
177
+
178
+ Example 2: Both implemented
179
+ ```
180
+ Conflict: specs/api/spec.md touched by [add-rest-api, add-graphql]
181
+
182
+ Checking add-rest-api (created 2026-01-10):
183
+ - Delta adds "REST Endpoints" requirement
184
+ - Searching codebase... found src/api/rest.ts
185
+
186
+ Checking add-graphql (created 2026-01-15):
187
+ - Delta adds "GraphQL Schema" requirement
188
+ - Searching codebase... found src/api/graphql.ts
189
+
190
+ Resolution: Both implemented. Will apply add-rest-api specs first,
191
+ then add-graphql specs (chronological order, newer takes precedence).
192
+ ```
193
+
194
+ **Output On Success**
195
+
196
+ ```
197
+ ## Bulk Archive Complete
198
+
199
+ Archived N changes:
200
+ - <change-1> -> archive/YYYY-MM-DD-<change-1>/
201
+ - <change-2> -> archive/YYYY-MM-DD-<change-2>/
202
+
203
+ Spec sync summary:
204
+ - N delta specs synced to main specs
205
+ - No conflicts (or: M conflicts resolved)
206
+ ```
207
+
208
+ **Output On Partial Success**
209
+
210
+ ```
211
+ ## Bulk Archive Complete (partial)
212
+
213
+ Archived N changes:
214
+ - <change-1> -> archive/YYYY-MM-DD-<change-1>/
215
+
216
+ Skipped M changes:
217
+ - <change-2> (user chose not to archive incomplete)
218
+
219
+ Failed K changes:
220
+ - <change-3>: Archive directory already exists
221
+ ```
222
+
223
+ **Output When No Changes**
224
+
225
+ ```
226
+ ## No Changes to Archive
227
+
228
+ No active changes found. Use `/opsx:new` to create a new change.
229
+ ```
230
+
231
+ **Guardrails**
232
+ - Allow any number of changes (1+ is fine, 2+ is the typical use case)
233
+ - Always prompt for selection, never auto-select
234
+ - Detect spec conflicts early and resolve by checking codebase
235
+ - When both changes are implemented, apply specs in chronological order
236
+ - Skip spec sync only when implementation is missing (warn user)
237
+ - Show clear per-change status before confirming
238
+ - Use single confirmation for entire batch
239
+ - Track and report all outcomes (success/skip/fail)
240
+ - Preserve .openspec.yaml when moving to archive
241
+ - Archive directory target uses current date: YYYY-MM-DD-<name>
242
+ - If archive target exists, fail that change but continue with others
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: /opsx-continue
3
+ id: opsx-continue
4
+ category: Workflow
5
+ description: Continue working on a change - create the next artifact (Experimental)
6
+ ---
7
+
8
+ Continue working on a change by creating the next artifact.
9
+
10
+ **Input**: Optionally specify a change name after `/opsx:continue` (e.g., `/opsx:continue add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
11
+
12
+ **Steps**
13
+
14
+ 1. **If no change name provided, prompt for selection**
15
+
16
+ Run `openspec list --json` to get available changes sorted by most recently modified. Then use the **AskUserQuestion tool** to let the user select which change to work on.
17
+
18
+ Present the top 3-4 most recently modified changes as options, showing:
19
+ - Change name
20
+ - Schema (from `schema` field if present, otherwise "spec-driven")
21
+ - Status (e.g., "0/5 tasks", "complete", "no tasks")
22
+ - How recently it was modified (from `lastModified` field)
23
+
24
+ Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to continue.
25
+
26
+ **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
27
+
28
+ 2. **Check current status**
29
+ ```bash
30
+ openspec status --change "<name>" --json
31
+ ```
32
+ Parse the JSON to understand current state. The response includes:
33
+ - `schemaName`: The workflow schema being used (e.g., "spec-driven")
34
+ - `artifacts`: Array of artifacts with their status ("done", "ready", "blocked")
35
+ - `isComplete`: Boolean indicating if all artifacts are complete
36
+
37
+ 3. **Act based on status**:
38
+
39
+ ---
40
+
41
+ **If all artifacts are complete (`isComplete: true`)**:
42
+ - Congratulate the user
43
+ - Show final status including the schema used
44
+ - Suggest: "All artifacts created! You can now implement this change with `/opsx:apply` or archive it with `/opsx:archive`."
45
+ - STOP
46
+
47
+ ---
48
+
49
+ **If artifacts are ready to create** (status shows artifacts with `status: "ready"`):
50
+ - Pick the FIRST artifact with `status: "ready"` from the status output
51
+ - Get its instructions:
52
+ ```bash
53
+ openspec instructions <artifact-id> --change "<name>" --json
54
+ ```
55
+ - Parse the JSON. The key fields are:
56
+ - `context`: Project background (constraints for you - do NOT include in output)
57
+ - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
58
+ - `template`: The structure to use for your output file
59
+ - `instruction`: Schema-specific guidance
60
+ - `outputPath`: Where to write the artifact
61
+ - `dependencies`: Completed artifacts to read for context
62
+ - **Create the artifact file**:
63
+ - Read any completed dependency files for context
64
+ - Use `template` as the structure - fill in its sections
65
+ - Apply `context` and `rules` as constraints when writing - but do NOT copy them into the file
66
+ - Write to the output path specified in instructions
67
+ - Show what was created and what's now unlocked
68
+ - STOP after creating ONE artifact
69
+
70
+ ---
71
+
72
+ **If no artifacts are ready (all blocked)**:
73
+ - This shouldn't happen with a valid schema
74
+ - Show status and suggest checking for issues
75
+
76
+ 4. **After creating an artifact, show progress**
77
+ ```bash
78
+ openspec status --change "<name>"
79
+ ```
80
+
81
+ **Output**
82
+
83
+ After each invocation, show:
84
+ - Which artifact was created
85
+ - Schema workflow being used
86
+ - Current progress (N/M complete)
87
+ - What artifacts are now unlocked
88
+ - Prompt: "Run `/opsx:continue` to create the next artifact"
89
+
90
+ **Artifact Creation Guidelines**
91
+
92
+ The artifact types and their purpose depend on the schema. Use the `instruction` field from the instructions output to understand what to create.
93
+
94
+ Common artifact patterns:
95
+
96
+ **spec-driven schema** (proposal → specs → design → tasks):
97
+ - **proposal.md**: Ask user about the change if not clear. Fill in Why, What Changes, Capabilities, Impact.
98
+ - The Capabilities section is critical - each capability listed will need a spec file.
99
+ - **specs/<capability>/spec.md**: Create one spec per capability listed in the proposal's Capabilities section (use the capability name, not the change name).
100
+ - **design.md**: Document technical decisions, architecture, and implementation approach.
101
+ - **tasks.md**: Break down implementation into checkboxed tasks.
102
+
103
+ For other schemas, follow the `instruction` field from the CLI output.
104
+
105
+ **Guardrails**
106
+ - Create ONE artifact per invocation
107
+ - Always read dependency artifacts before creating a new one
108
+ - Never skip artifacts or create out of order
109
+ - If context is unclear, ask the user before creating
110
+ - Verify the artifact file exists after writing before marking progress
111
+ - Use the schema's artifact sequence, don't assume specific artifact names
112
+ - **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
113
+ - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
114
+ - These guide what you write, but should never appear in the output
@@ -0,0 +1,174 @@
1
+ ---
2
+ name: /opsx-explore
3
+ id: opsx-explore
4
+ category: Workflow
5
+ description: "Enter explore mode - think through ideas, investigate problems, clarify requirements"
6
+ ---
7
+
8
+ Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
9
+
10
+ **IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first (e.g., start a change with `/opsx:new` or `/opsx:ff`). You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
11
+
12
+ **This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
13
+
14
+ **Input**: The argument after `/opsx:explore` is whatever the user wants to think about. Could be:
15
+ - A vague idea: "real-time collaboration"
16
+ - A specific problem: "the auth system is getting unwieldy"
17
+ - A change name: "add-dark-mode" (to explore in context of that change)
18
+ - A comparison: "postgres vs sqlite for this"
19
+ - Nothing (just enter explore mode)
20
+
21
+ ---
22
+
23
+ ## The Stance
24
+
25
+ - **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
26
+ - **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
27
+ - **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
28
+ - **Adaptive** - Follow interesting threads, pivot when new information emerges
29
+ - **Patient** - Don't rush to conclusions, let the shape of the problem emerge
30
+ - **Grounded** - Explore the actual codebase when relevant, don't just theorize
31
+
32
+ ---
33
+
34
+ ## What You Might Do
35
+
36
+ Depending on what the user brings, you might:
37
+
38
+ **Explore the problem space**
39
+ - Ask clarifying questions that emerge from what they said
40
+ - Challenge assumptions
41
+ - Reframe the problem
42
+ - Find analogies
43
+
44
+ **Investigate the codebase**
45
+ - Map existing architecture relevant to the discussion
46
+ - Find integration points
47
+ - Identify patterns already in use
48
+ - Surface hidden complexity
49
+
50
+ **Compare options**
51
+ - Brainstorm multiple approaches
52
+ - Build comparison tables
53
+ - Sketch tradeoffs
54
+ - Recommend a path (if asked)
55
+
56
+ **Visualize**
57
+ ```
58
+ ┌─────────────────────────────────────────┐
59
+ │ Use ASCII diagrams liberally │
60
+ ├─────────────────────────────────────────┤
61
+ │ │
62
+ │ ┌────────┐ ┌────────┐ │
63
+ │ │ State │────────▶│ State │ │
64
+ │ │ A │ │ B │ │
65
+ │ └────────┘ └────────┘ │
66
+ │ │
67
+ │ System diagrams, state machines, │
68
+ │ data flows, architecture sketches, │
69
+ │ dependency graphs, comparison tables │
70
+ │ │
71
+ └─────────────────────────────────────────┘
72
+ ```
73
+
74
+ **Surface risks and unknowns**
75
+ - Identify what could go wrong
76
+ - Find gaps in understanding
77
+ - Suggest spikes or investigations
78
+
79
+ ---
80
+
81
+ ## OpenSpec Awareness
82
+
83
+ You have full context of the OpenSpec system. Use it naturally, don't force it.
84
+
85
+ ### Check for context
86
+
87
+ At the start, quickly check what exists:
88
+ ```bash
89
+ openspec list --json
90
+ ```
91
+
92
+ This tells you:
93
+ - If there are active changes
94
+ - Their names, schemas, and status
95
+ - What the user might be working on
96
+
97
+ If the user mentioned a specific change name, read its artifacts for context.
98
+
99
+ ### When no change exists
100
+
101
+ Think freely. When insights crystallize, you might offer:
102
+
103
+ - "This feels solid enough to start a change. Want me to create one?"
104
+ → Can transition to `/opsx:new` or `/opsx:ff`
105
+ - Or keep exploring - no pressure to formalize
106
+
107
+ ### When a change exists
108
+
109
+ If the user mentions a change or you detect one is relevant:
110
+
111
+ 1. **Read existing artifacts for context**
112
+ - `openspec/changes/<name>/proposal.md`
113
+ - `openspec/changes/<name>/design.md`
114
+ - `openspec/changes/<name>/tasks.md`
115
+ - etc.
116
+
117
+ 2. **Reference them naturally in conversation**
118
+ - "Your design mentions using Redis, but we just realized SQLite fits better..."
119
+ - "The proposal scopes this to premium users, but we're now thinking everyone..."
120
+
121
+ 3. **Offer to capture when decisions are made**
122
+
123
+ | Insight Type | Where to Capture |
124
+ |--------------|------------------|
125
+ | New requirement discovered | `specs/<capability>/spec.md` |
126
+ | Requirement changed | `specs/<capability>/spec.md` |
127
+ | Design decision made | `design.md` |
128
+ | Scope changed | `proposal.md` |
129
+ | New work identified | `tasks.md` |
130
+ | Assumption invalidated | Relevant artifact |
131
+
132
+ Example offers:
133
+ - "That's a design decision. Capture it in design.md?"
134
+ - "This is a new requirement. Add it to specs?"
135
+ - "This changes scope. Update the proposal?"
136
+
137
+ 4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
138
+
139
+ ---
140
+
141
+ ## What You Don't Have To Do
142
+
143
+ - Follow a script
144
+ - Ask the same questions every time
145
+ - Produce a specific artifact
146
+ - Reach a conclusion
147
+ - Stay on topic if a tangent is valuable
148
+ - Be brief (this is thinking time)
149
+
150
+ ---
151
+
152
+ ## Ending Discovery
153
+
154
+ There's no required ending. Discovery might:
155
+
156
+ - **Flow into action**: "Ready to start? `/opsx:new` or `/opsx:ff`"
157
+ - **Result in artifact updates**: "Updated design.md with these decisions"
158
+ - **Just provide clarity**: User has what they need, moves on
159
+ - **Continue later**: "We can pick this up anytime"
160
+
161
+ When things crystallize, you might offer a summary - but it's optional. Sometimes the thinking IS the value.
162
+
163
+ ---
164
+
165
+ ## Guardrails
166
+
167
+ - **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
168
+ - **Don't fake understanding** - If something is unclear, dig deeper
169
+ - **Don't rush** - Discovery is thinking time, not task time
170
+ - **Don't force structure** - Let patterns emerge naturally
171
+ - **Don't auto-capture** - Offer to save insights, don't just do it
172
+ - **Do visualize** - A good diagram is worth many paragraphs
173
+ - **Do explore the codebase** - Ground discussions in reality
174
+ - **Do question assumptions** - Including the user's and your own