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,94 @@
1
+ ---
2
+ name: /opsx-ff
3
+ id: opsx-ff
4
+ category: Workflow
5
+ description: Create a change and generate all artifacts needed for implementation in one go
6
+ ---
7
+
8
+ Fast-forward through artifact creation - generate everything needed to start implementation.
9
+
10
+ **Input**: The argument after `/opsx:ff` is the change name (kebab-case), OR a description of what the user wants to build.
11
+
12
+ **Steps**
13
+
14
+ 1. **If no input provided, ask what they want to build**
15
+
16
+ Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
17
+ > "What change do you want to work on? Describe what you want to build or fix."
18
+
19
+ From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
20
+
21
+ **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
22
+
23
+ 2. **Create the change directory**
24
+ ```bash
25
+ openspec new change "<name>"
26
+ ```
27
+ This creates a scaffolded change at `openspec/changes/<name>/`.
28
+
29
+ 3. **Get the artifact build order**
30
+ ```bash
31
+ openspec status --change "<name>" --json
32
+ ```
33
+ Parse the JSON to get:
34
+ - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
35
+ - `artifacts`: list of all artifacts with their status and dependencies
36
+
37
+ 4. **Create artifacts in sequence until apply-ready**
38
+
39
+ Use the **TodoWrite tool** to track progress through the artifacts.
40
+
41
+ Loop through artifacts in dependency order (artifacts with no pending dependencies first):
42
+
43
+ a. **For each artifact that is `ready` (dependencies satisfied)**:
44
+ - Get instructions:
45
+ ```bash
46
+ openspec instructions <artifact-id> --change "<name>" --json
47
+ ```
48
+ - The instructions JSON includes:
49
+ - `context`: Project background (constraints for you - do NOT include in output)
50
+ - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
51
+ - `template`: The structure to use for your output file
52
+ - `instruction`: Schema-specific guidance for this artifact type
53
+ - `outputPath`: Where to write the artifact
54
+ - `dependencies`: Completed artifacts to read for context
55
+ - Read any completed dependency files for context
56
+ - Create the artifact file using `template` as the structure
57
+ - Apply `context` and `rules` as constraints - but do NOT copy them into the file
58
+ - Show brief progress: "✓ Created <artifact-id>"
59
+
60
+ b. **Continue until all `applyRequires` artifacts are complete**
61
+ - After creating each artifact, re-run `openspec status --change "<name>" --json`
62
+ - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
63
+ - Stop when all `applyRequires` artifacts are done
64
+
65
+ c. **If an artifact requires user input** (unclear context):
66
+ - Use **AskUserQuestion tool** to clarify
67
+ - Then continue with creation
68
+
69
+ 5. **Show final status**
70
+ ```bash
71
+ openspec status --change "<name>"
72
+ ```
73
+
74
+ **Output**
75
+
76
+ After completing all artifacts, summarize:
77
+ - Change name and location
78
+ - List of artifacts created with brief descriptions
79
+ - What's ready: "All artifacts created! Ready for implementation."
80
+ - Prompt: "Run `/opsx:apply` to start implementing."
81
+
82
+ **Artifact Creation Guidelines**
83
+
84
+ - Follow the `instruction` field from `openspec instructions` for each artifact type
85
+ - The schema defines what each artifact should contain - follow it
86
+ - Read dependency artifacts for context before creating new ones
87
+ - Use the `template` as a starting point, filling in based on context
88
+
89
+ **Guardrails**
90
+ - Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)
91
+ - Always read dependency artifacts before creating a new one
92
+ - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
93
+ - If a change with that name already exists, ask if user wants to continue it or create a new one
94
+ - Verify each artifact file exists after writing before proceeding to next
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: /opsx-new
3
+ id: opsx-new
4
+ category: Workflow
5
+ description: Start a new change using the experimental artifact workflow (OPSX)
6
+ ---
7
+
8
+ Start a new change using the experimental artifact-driven approach.
9
+
10
+ **Input**: The argument after `/opsx:new` is the change name (kebab-case), OR a description of what the user wants to build.
11
+
12
+ **Steps**
13
+
14
+ 1. **If no input provided, ask what they want to build**
15
+
16
+ Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
17
+ > "What change do you want to work on? Describe what you want to build or fix."
18
+
19
+ From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
20
+
21
+ **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
22
+
23
+ 2. **Determine the workflow schema**
24
+
25
+ Use the default schema (omit `--schema`) unless the user explicitly requests a different workflow.
26
+
27
+ **Use a different schema only if the user mentions:**
28
+ - A specific schema name → use `--schema <name>`
29
+ - "show workflows" or "what workflows" → run `openspec schemas --json` and let them choose
30
+
31
+ **Otherwise**: Omit `--schema` to use the default.
32
+
33
+ 3. **Create the change directory**
34
+ ```bash
35
+ openspec new change "<name>"
36
+ ```
37
+ Add `--schema <name>` only if the user requested a specific workflow.
38
+ This creates a scaffolded change at `openspec/changes/<name>/` with the selected schema.
39
+
40
+ 4. **Show the artifact status**
41
+ ```bash
42
+ openspec status --change "<name>"
43
+ ```
44
+ This shows which artifacts need to be created and which are ready (dependencies satisfied).
45
+
46
+ 5. **Get instructions for the first artifact**
47
+ The first artifact depends on the schema. Check the status output to find the first artifact with status "ready".
48
+ ```bash
49
+ openspec instructions <first-artifact-id> --change "<name>"
50
+ ```
51
+ This outputs the template and context for creating the first artifact.
52
+
53
+ 6. **STOP and wait for user direction**
54
+
55
+ **Output**
56
+
57
+ After completing the steps, summarize:
58
+ - Change name and location
59
+ - Schema/workflow being used and its artifact sequence
60
+ - Current status (0/N artifacts complete)
61
+ - The template for the first artifact
62
+ - Prompt: "Ready to create the first artifact? Run `/opsx:continue` or just describe what this change is about and I'll draft it."
63
+
64
+ **Guardrails**
65
+ - Do NOT create any artifacts yet - just show the instructions
66
+ - Do NOT advance beyond showing the first artifact template
67
+ - If the name is invalid (not kebab-case), ask for a valid name
68
+ - If a change with that name already exists, suggest using `/opsx:continue` instead
69
+ - Pass --schema if using a non-default workflow
@@ -0,0 +1,525 @@
1
+ ---
2
+ name: /opsx-onboard
3
+ id: opsx-onboard
4
+ category: Workflow
5
+ description: Guided onboarding - walk through a complete OpenSpec workflow cycle with narration
6
+ ---
7
+
8
+ Guide the user through their first complete OpenSpec workflow cycle. This is a teaching experience—you'll do real work in their codebase while explaining each step.
9
+
10
+ ---
11
+
12
+ ## Preflight
13
+
14
+ Before starting, check if OpenSpec is initialized:
15
+
16
+ ```bash
17
+ openspec status --json 2>&1 || echo "NOT_INITIALIZED"
18
+ ```
19
+
20
+ **If not initialized:**
21
+ > OpenSpec isn't set up in this project yet. Run `openspec init` first, then come back to `/opsx:onboard`.
22
+
23
+ Stop here if not initialized.
24
+
25
+ ---
26
+
27
+ ## Phase 1: Welcome
28
+
29
+ Display:
30
+
31
+ ```
32
+ ## Welcome to OpenSpec!
33
+
34
+ I'll walk you through a complete change cycle—from idea to implementation—using a real task in your codebase. Along the way, you'll learn the workflow by doing it.
35
+
36
+ **What we'll do:**
37
+ 1. Pick a small, real task in your codebase
38
+ 2. Explore the problem briefly
39
+ 3. Create a change (the container for our work)
40
+ 4. Build the artifacts: proposal → specs → design → tasks
41
+ 5. Implement the tasks
42
+ 6. Archive the completed change
43
+
44
+ **Time:** ~15-20 minutes
45
+
46
+ Let's start by finding something to work on.
47
+ ```
48
+
49
+ ---
50
+
51
+ ## Phase 2: Task Selection
52
+
53
+ ### Codebase Analysis
54
+
55
+ Scan the codebase for small improvement opportunities. Look for:
56
+
57
+ 1. **TODO/FIXME comments** - Search for `TODO`, `FIXME`, `HACK`, `XXX` in code files
58
+ 2. **Missing error handling** - `catch` blocks that swallow errors, risky operations without try-catch
59
+ 3. **Functions without tests** - Cross-reference `src/` with test directories
60
+ 4. **Type issues** - `any` types in TypeScript files (`: any`, `as any`)
61
+ 5. **Debug artifacts** - `console.log`, `console.debug`, `debugger` statements in non-debug code
62
+ 6. **Missing validation** - User input handlers without validation
63
+
64
+ Also check recent git activity:
65
+ ```bash
66
+ git log --oneline -10 2>/dev/null || echo "No git history"
67
+ ```
68
+
69
+ ### Present Suggestions
70
+
71
+ From your analysis, present 3-4 specific suggestions:
72
+
73
+ ```
74
+ ## Task Suggestions
75
+
76
+ Based on scanning your codebase, here are some good starter tasks:
77
+
78
+ **1. [Most promising task]**
79
+ Location: `src/path/to/file.ts:42`
80
+ Scope: ~1-2 files, ~20-30 lines
81
+ Why it's good: [brief reason]
82
+
83
+ **2. [Second task]**
84
+ Location: `src/another/file.ts`
85
+ Scope: ~1 file, ~15 lines
86
+ Why it's good: [brief reason]
87
+
88
+ **3. [Third task]**
89
+ Location: [location]
90
+ Scope: [estimate]
91
+ Why it's good: [brief reason]
92
+
93
+ **4. Something else?**
94
+ Tell me what you'd like to work on.
95
+
96
+ Which task interests you? (Pick a number or describe your own)
97
+ ```
98
+
99
+ **If nothing found:** Fall back to asking what the user wants to build:
100
+ > I didn't find obvious quick wins in your codebase. What's something small you've been meaning to add or fix?
101
+
102
+ ### Scope Guardrail
103
+
104
+ If the user picks or describes something too large (major feature, multi-day work):
105
+
106
+ ```
107
+ That's a valuable task, but it's probably larger than ideal for your first OpenSpec run-through.
108
+
109
+ For learning the workflow, smaller is better—it lets you see the full cycle without getting stuck in implementation details.
110
+
111
+ **Options:**
112
+ 1. **Slice it smaller** - What's the smallest useful piece of [their task]? Maybe just [specific slice]?
113
+ 2. **Pick something else** - One of the other suggestions, or a different small task?
114
+ 3. **Do it anyway** - If you really want to tackle this, we can. Just know it'll take longer.
115
+
116
+ What would you prefer?
117
+ ```
118
+
119
+ Let the user override if they insist—this is a soft guardrail.
120
+
121
+ ---
122
+
123
+ ## Phase 3: Explore Demo
124
+
125
+ Once a task is selected, briefly demonstrate explore mode:
126
+
127
+ ```
128
+ Before we create a change, let me quickly show you **explore mode**—it's how you think through problems before committing to a direction.
129
+ ```
130
+
131
+ Spend 1-2 minutes investigating the relevant code:
132
+ - Read the file(s) involved
133
+ - Draw a quick ASCII diagram if it helps
134
+ - Note any considerations
135
+
136
+ ```
137
+ ## Quick Exploration
138
+
139
+ [Your brief analysis—what you found, any considerations]
140
+
141
+ ┌─────────────────────────────────────────┐
142
+ │ [Optional: ASCII diagram if helpful] │
143
+ └─────────────────────────────────────────┘
144
+
145
+ Explore mode (`/opsx:explore`) is for this kind of thinking—investigating before implementing. You can use it anytime you need to think through a problem.
146
+
147
+ Now let's create a change to hold our work.
148
+ ```
149
+
150
+ **PAUSE** - Wait for user acknowledgment before proceeding.
151
+
152
+ ---
153
+
154
+ ## Phase 4: Create the Change
155
+
156
+ **EXPLAIN:**
157
+ ```
158
+ ## Creating a Change
159
+
160
+ A "change" in OpenSpec is a container for all the thinking and planning around a piece of work. It lives in `openspec/changes/<name>/` and holds your artifacts—proposal, specs, design, tasks.
161
+
162
+ Let me create one for our task.
163
+ ```
164
+
165
+ **DO:** Create the change with a derived kebab-case name:
166
+ ```bash
167
+ openspec new change "<derived-name>"
168
+ ```
169
+
170
+ **SHOW:**
171
+ ```
172
+ Created: `openspec/changes/<name>/`
173
+
174
+ The folder structure:
175
+ ```
176
+ openspec/changes/<name>/
177
+ ├── proposal.md ← Why we're doing this (empty, we'll fill it)
178
+ ├── design.md ← How we'll build it (empty)
179
+ ├── specs/ ← Detailed requirements (empty)
180
+ └── tasks.md ← Implementation checklist (empty)
181
+ ```
182
+
183
+ Now let's fill in the first artifact—the proposal.
184
+ ```
185
+
186
+ ---
187
+
188
+ ## Phase 5: Proposal
189
+
190
+ **EXPLAIN:**
191
+ ```
192
+ ## The Proposal
193
+
194
+ The proposal captures **why** we're making this change and **what** it involves at a high level. It's the "elevator pitch" for the work.
195
+
196
+ I'll draft one based on our task.
197
+ ```
198
+
199
+ **DO:** Draft the proposal content (don't save yet):
200
+
201
+ ```
202
+ Here's a draft proposal:
203
+
204
+ ---
205
+
206
+ ## Why
207
+
208
+ [1-2 sentences explaining the problem/opportunity]
209
+
210
+ ## What Changes
211
+
212
+ [Bullet points of what will be different]
213
+
214
+ ## Capabilities
215
+
216
+ ### New Capabilities
217
+ - `<capability-name>`: [brief description]
218
+
219
+ ### Modified Capabilities
220
+ <!-- If modifying existing behavior -->
221
+
222
+ ## Impact
223
+
224
+ - `src/path/to/file.ts`: [what changes]
225
+ - [other files if applicable]
226
+
227
+ ---
228
+
229
+ Does this capture the intent? I can adjust before we save it.
230
+ ```
231
+
232
+ **PAUSE** - Wait for user approval/feedback.
233
+
234
+ After approval, save the proposal:
235
+ ```bash
236
+ openspec instructions proposal --change "<name>" --json
237
+ ```
238
+ Then write the content to `openspec/changes/<name>/proposal.md`.
239
+
240
+ ```
241
+ Proposal saved. This is your "why" document—you can always come back and refine it as understanding evolves.
242
+
243
+ Next up: specs.
244
+ ```
245
+
246
+ ---
247
+
248
+ ## Phase 6: Specs
249
+
250
+ **EXPLAIN:**
251
+ ```
252
+ ## Specs
253
+
254
+ Specs define **what** we're building in precise, testable terms. They use a requirement/scenario format that makes expected behavior crystal clear.
255
+
256
+ For a small task like this, we might only need one spec file.
257
+ ```
258
+
259
+ **DO:** Create the spec file:
260
+ ```bash
261
+ mkdir -p openspec/changes/<name>/specs/<capability-name>
262
+ ```
263
+
264
+ Draft the spec content:
265
+
266
+ ```
267
+ Here's the spec:
268
+
269
+ ---
270
+
271
+ ## ADDED Requirements
272
+
273
+ ### Requirement: <Name>
274
+
275
+ <Description of what the system should do>
276
+
277
+ #### Scenario: <Scenario name>
278
+
279
+ - **WHEN** <trigger condition>
280
+ - **THEN** <expected outcome>
281
+ - **AND** <additional outcome if needed>
282
+
283
+ ---
284
+
285
+ This format—WHEN/THEN/AND—makes requirements testable. You can literally read them as test cases.
286
+ ```
287
+
288
+ Save to `openspec/changes/<name>/specs/<capability>/spec.md`.
289
+
290
+ ---
291
+
292
+ ## Phase 7: Design
293
+
294
+ **EXPLAIN:**
295
+ ```
296
+ ## Design
297
+
298
+ The design captures **how** we'll build it—technical decisions, tradeoffs, approach.
299
+
300
+ For small changes, this might be brief. That's fine—not every change needs deep design discussion.
301
+ ```
302
+
303
+ **DO:** Draft design.md:
304
+
305
+ ```
306
+ Here's the design:
307
+
308
+ ---
309
+
310
+ ## Context
311
+
312
+ [Brief context about the current state]
313
+
314
+ ## Goals / Non-Goals
315
+
316
+ **Goals:**
317
+ - [What we're trying to achieve]
318
+
319
+ **Non-Goals:**
320
+ - [What's explicitly out of scope]
321
+
322
+ ## Decisions
323
+
324
+ ### Decision 1: [Key decision]
325
+
326
+ [Explanation of approach and rationale]
327
+
328
+ ---
329
+
330
+ For a small task, this captures the key decisions without over-engineering.
331
+ ```
332
+
333
+ Save to `openspec/changes/<name>/design.md`.
334
+
335
+ ---
336
+
337
+ ## Phase 8: Tasks
338
+
339
+ **EXPLAIN:**
340
+ ```
341
+ ## Tasks
342
+
343
+ Finally, we break the work into implementation tasks—checkboxes that drive the apply phase.
344
+
345
+ These should be small, clear, and in logical order.
346
+ ```
347
+
348
+ **DO:** Generate tasks based on specs and design:
349
+
350
+ ```
351
+ Here are the implementation tasks:
352
+
353
+ ---
354
+
355
+ ## 1. [Category or file]
356
+
357
+ - [ ] 1.1 [Specific task]
358
+ - [ ] 1.2 [Specific task]
359
+
360
+ ## 2. Verify
361
+
362
+ - [ ] 2.1 [Verification step]
363
+
364
+ ---
365
+
366
+ Each checkbox becomes a unit of work in the apply phase. Ready to implement?
367
+ ```
368
+
369
+ **PAUSE** - Wait for user to confirm they're ready to implement.
370
+
371
+ Save to `openspec/changes/<name>/tasks.md`.
372
+
373
+ ---
374
+
375
+ ## Phase 9: Apply (Implementation)
376
+
377
+ **EXPLAIN:**
378
+ ```
379
+ ## Implementation
380
+
381
+ Now we implement each task, checking them off as we go. I'll announce each one and occasionally note how the specs/design informed the approach.
382
+ ```
383
+
384
+ **DO:** For each task:
385
+
386
+ 1. Announce: "Working on task N: [description]"
387
+ 2. Implement the change in the codebase
388
+ 3. Reference specs/design naturally: "The spec says X, so I'm doing Y"
389
+ 4. Mark complete in tasks.md: `- [ ]` → `- [x]`
390
+ 5. Brief status: "✓ Task N complete"
391
+
392
+ Keep narration light—don't over-explain every line of code.
393
+
394
+ After all tasks:
395
+
396
+ ```
397
+ ## Implementation Complete
398
+
399
+ All tasks done:
400
+ - [x] Task 1
401
+ - [x] Task 2
402
+ - [x] ...
403
+
404
+ The change is implemented! One more step—let's archive it.
405
+ ```
406
+
407
+ ---
408
+
409
+ ## Phase 10: Archive
410
+
411
+ **EXPLAIN:**
412
+ ```
413
+ ## Archiving
414
+
415
+ When a change is complete, we archive it. This moves it from `openspec/changes/` to `openspec/changes/archive/YYYY-MM-DD-<name>/`.
416
+
417
+ Archived changes become your project's decision history—you can always find them later to understand why something was built a certain way.
418
+ ```
419
+
420
+ **DO:**
421
+ ```bash
422
+ openspec archive "<name>"
423
+ ```
424
+
425
+ **SHOW:**
426
+ ```
427
+ Archived to: `openspec/changes/archive/YYYY-MM-DD-<name>/`
428
+
429
+ The change is now part of your project's history. The code is in your codebase, the decision record is preserved.
430
+ ```
431
+
432
+ ---
433
+
434
+ ## Phase 11: Recap & Next Steps
435
+
436
+ ```
437
+ ## Congratulations!
438
+
439
+ You just completed a full OpenSpec cycle:
440
+
441
+ 1. **Explore** - Thought through the problem
442
+ 2. **New** - Created a change container
443
+ 3. **Proposal** - Captured WHY
444
+ 4. **Specs** - Defined WHAT in detail
445
+ 5. **Design** - Decided HOW
446
+ 6. **Tasks** - Broke it into steps
447
+ 7. **Apply** - Implemented the work
448
+ 8. **Archive** - Preserved the record
449
+
450
+ This same rhythm works for any size change—a small fix or a major feature.
451
+
452
+ ---
453
+
454
+ ## Command Reference
455
+
456
+ | Command | What it does |
457
+ |---------|--------------|
458
+ | `/opsx:explore` | Think through problems before/during work |
459
+ | `/opsx:new` | Start a new change, step through artifacts |
460
+ | `/opsx:ff` | Fast-forward: create all artifacts at once |
461
+ | `/opsx:continue` | Continue working on an existing change |
462
+ | `/opsx:apply` | Implement tasks from a change |
463
+ | `/opsx:verify` | Verify implementation matches artifacts |
464
+ | `/opsx:archive` | Archive a completed change |
465
+
466
+ ---
467
+
468
+ ## What's Next?
469
+
470
+ Try `/opsx:new` or `/opsx:ff` on something you actually want to build. You've got the rhythm now!
471
+ ```
472
+
473
+ ---
474
+
475
+ ## Graceful Exit Handling
476
+
477
+ ### User wants to stop mid-way
478
+
479
+ If the user says they need to stop, want to pause, or seem disengaged:
480
+
481
+ ```
482
+ No problem! Your change is saved at `openspec/changes/<name>/`.
483
+
484
+ To pick up where we left off later:
485
+ - `/opsx:continue <name>` - Resume artifact creation
486
+ - `/opsx:apply <name>` - Jump to implementation (if tasks exist)
487
+
488
+ The work won't be lost. Come back whenever you're ready.
489
+ ```
490
+
491
+ Exit gracefully without pressure.
492
+
493
+ ### User just wants command reference
494
+
495
+ If the user says they just want to see the commands or skip the tutorial:
496
+
497
+ ```
498
+ ## OpenSpec Quick Reference
499
+
500
+ | Command | What it does |
501
+ |---------|--------------|
502
+ | `/opsx:explore` | Think through problems (no code changes) |
503
+ | `/opsx:new <name>` | Start a new change, step by step |
504
+ | `/opsx:ff <name>` | Fast-forward: all artifacts at once |
505
+ | `/opsx:continue <name>` | Continue an existing change |
506
+ | `/opsx:apply <name>` | Implement tasks |
507
+ | `/opsx:verify <name>` | Verify implementation |
508
+ | `/opsx:archive <name>` | Archive when done |
509
+
510
+ Try `/opsx:new` to start your first change, or `/opsx:ff` if you want to move fast.
511
+ ```
512
+
513
+ Exit gracefully.
514
+
515
+ ---
516
+
517
+ ## Guardrails
518
+
519
+ - **Follow the EXPLAIN → DO → SHOW → PAUSE pattern** at key transitions (after explore, after proposal draft, after tasks, after archive)
520
+ - **Keep narration light** during implementation—teach without lecturing
521
+ - **Don't skip phases** even if the change is small—the goal is teaching the workflow
522
+ - **Pause for acknowledgment** at marked points, but don't over-pause
523
+ - **Handle exits gracefully**—never pressure the user to continue
524
+ - **Use real codebase tasks**—don't simulate or use fake examples
525
+ - **Adjust scope gently**—guide toward smaller tasks but respect user choice