opencode-goopspec 0.1.2 → 0.1.4

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 (60) hide show
  1. package/README.md +255 -331
  2. package/agents/goop-debugger.md +175 -172
  3. package/agents/goop-designer.md +232 -160
  4. package/agents/goop-executor.md +197 -127
  5. package/agents/goop-explorer.md +148 -150
  6. package/agents/goop-librarian.md +218 -164
  7. package/agents/goop-orchestrator.md +392 -280
  8. package/agents/goop-planner.md +331 -153
  9. package/agents/goop-researcher.md +198 -126
  10. package/agents/goop-tester.md +277 -202
  11. package/agents/goop-verifier.md +191 -201
  12. package/agents/goop-writer.md +241 -133
  13. package/agents/memory-distiller.md +228 -136
  14. package/commands/goop-accept.md +434 -160
  15. package/commands/goop-amend.md +35 -151
  16. package/commands/goop-complete.md +39 -183
  17. package/commands/goop-debug.md +33 -298
  18. package/commands/goop-discuss.md +381 -85
  19. package/commands/goop-execute.md +391 -108
  20. package/commands/goop-help.md +11 -0
  21. package/commands/goop-map-codebase.md +16 -3
  22. package/commands/goop-memory.md +11 -0
  23. package/commands/goop-milestone.md +29 -192
  24. package/commands/goop-pause.md +31 -40
  25. package/commands/goop-plan.md +458 -46
  26. package/commands/goop-quick.md +38 -142
  27. package/commands/goop-recall.md +11 -0
  28. package/commands/goop-remember.md +12 -0
  29. package/commands/goop-research.md +52 -73
  30. package/commands/goop-resume.md +28 -37
  31. package/commands/goop-setup.md +225 -124
  32. package/commands/goop-specify.md +321 -121
  33. package/commands/goop-status.md +256 -110
  34. package/dist/index.js +6289 -2820
  35. package/package.json +1 -1
  36. package/references/context-injection.md +307 -0
  37. package/references/discovery-interview.md +278 -0
  38. package/references/enforcement-system.md +213 -0
  39. package/references/handoff-protocol.md +290 -0
  40. package/references/interactive-questioning.md +122 -0
  41. package/references/model-profiles.md +1 -1
  42. package/references/phase-gates.md +360 -0
  43. package/references/plugin-architecture.md +212 -0
  44. package/references/response-format.md +41 -9
  45. package/references/subagent-protocol.md +83 -33
  46. package/references/ui-interaction-patterns.md +133 -0
  47. package/references/visual-style.md +199 -0
  48. package/references/workflow-accept.md +60 -273
  49. package/references/workflow-execute.md +63 -274
  50. package/references/workflow-plan.md +86 -133
  51. package/references/workflow-research.md +78 -186
  52. package/references/workflow-specify.md +64 -221
  53. package/references/xml-response-schema.md +236 -0
  54. package/templates/blueprint.md +88 -41
  55. package/templates/chronicle.md +130 -16
  56. package/templates/handoff.md +140 -0
  57. package/templates/project.md +114 -0
  58. package/templates/requirements.md +121 -0
  59. package/templates/spec.md +85 -20
  60. package/templates/state.md +103 -0
@@ -1,137 +1,420 @@
1
1
  ---
2
2
  name: goop-execute
3
- description: Start the Execute phase - wave-based implementation
3
+ description: Begin wave-based execution
4
+ phase: execute
5
+ requires: spec_locked
6
+ next-step: "When all waves are complete, verify the work and request acceptance"
7
+ next-command: /goop-accept
8
+ alternatives:
9
+ - command: /goop-status
10
+ when: "To check current progress and wave status"
11
+ - command: /goop-pause
12
+ when: "To save a checkpoint and continue later"
4
13
  ---
5
14
 
6
- # GoopSpec Execute
15
+ # /goop-execute
7
16
 
8
- Implement the specification through wave-based task execution with orchestrated subagents.
17
+ **Start the Execution Phase.** Implement the blueprint using wave-based orchestration.
9
18
 
10
19
  ## Usage
11
20
 
12
- ```
21
+ ```bash
13
22
  /goop-execute
14
23
  ```
15
24
 
16
- ## Workflow Position
17
-
18
- ```
19
- ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
20
- │ PLAN │ ──▶ │ RESEARCH │ ──▶ │ SPECIFY │
21
- (Intent) │ │ (Explore) │ │ (Contract) │
22
- └─────────────┘ └─────────────┘ └─────────────┘
23
-
24
- ┌──────────────────────────────────────┘
25
-
26
- ┌─────────────┐ ┌─────────────┐
27
- │ EXECUTE │ ──▶ │ ACCEPT │
28
- │ (Build) │ │ (Verify) │
29
- └─────────────┘ └─────────────┘
30
-
31
- (You are here)
32
- ```
33
-
34
- The Execute phase answers: **Build exactly what the spec says.**
35
-
36
- ## What Happens
37
-
38
- 1. **Wave-Based Execution** - Tasks grouped into sequential waves:
39
- - **Wave 1: Foundation** - Setup, configuration, base structures
40
- - **Wave 2: Core** - Main feature, business logic, data handling
41
- - **Wave 3: Integration** - Connect components, wire to existing system
42
- - **Wave 4: Polish** - Error handling, edge cases, documentation
43
-
44
- 2. **Orchestrator Coordination** - Orchestrator acts as CONDUCTOR:
45
- - Delegates tasks to specialized subagents
46
- - Tracks progress in CHRONICLE.md
47
- - Applies deviation rules automatically
48
- - Handles blockers and checkpoints
49
- - **NEVER writes code itself**
50
-
51
- 3. **Task Execution** - For each task:
52
- - Read from BLUEPRINT.md
53
- - Check deviation rules
54
- - Delegate to goop-executor agent
55
- - Agent implements with memory protocol
56
- - Atomic commit per task
57
- - Update CHRONICLE.md
58
- - Verify tests pass
59
-
60
- 4. **Deviation Handling** - Auto-fix without asking:
61
- - **Rule 1:** Bugs (type errors, logic errors, crashes)
62
- - **Rule 2:** Missing critical functionality (validation, error handling)
63
- - **Rule 3:** Blocking issues (missing deps, broken imports)
64
- - **Rule 4:** STOP for architectural decisions (new tables, framework changes)
65
-
66
- 5. **Checkpoint Handling** - Pause for user input when needed:
67
- - `checkpoint:verify` - User verifies functionality
68
- - `checkpoint:decision` - User makes decision
69
- - `checkpoint:action` - User performs action
70
-
71
- ## Wave Principles
72
-
73
- 1. **Sequential waves** - Wave N completes before Wave N+1 starts
74
- 2. **Vertical slices** - Each wave delivers working functionality
75
- 3. **Atomic commits** - Each task = one commit
76
- 4. **Verification gates** - Tests must pass between waves
77
-
78
- ## Artifacts Created/Updated
79
-
80
- - `CHRONICLE.md` - Real-time progress tracking:
81
- - Current wave and task
82
- - Completed tasks with commit hashes
83
- - Deviations logged
84
- - Blockers noted
85
-
86
- - Git commits - One per task:
87
- ```
88
- feat(wave-task): description
25
+ ## Gate Requirement
26
+
27
+ ```
28
+ +================================================================+
29
+ | EXECUTION GATE: Specification must be locked before executing. |
30
+ | This ensures we build what was agreed upon. |
31
+ +================================================================+
32
+ ```
33
+
34
+ **Required before this command:**
35
+ - `specLocked: true` (check via `goop_state({ action: "get" })`)
36
+ - `.goopspec/BLUEPRINT.md` exists with wave structure
37
+
38
+ **If not satisfied:** Refuse and redirect to `/goop-specify`
39
+
40
+ **CRITICAL: Never read or edit .goopspec/state.json directly. Always use `goop_state` tool.**
41
+
42
+ ## Tools Used
43
+
44
+ | Tool | Purpose in This Command |
45
+ |------|------------------------|
46
+ | `goop_status` | Check spec lock status and wave progress |
47
+ | `goop_state` | **ALL state operations** - check spec lock, update wave progress. NEVER edit state.json directly |
48
+ | `goop_spec` | Load blueprint for execution |
49
+ | `goop_checkpoint` | Save state at wave boundaries |
50
+ | `goop_delegate` | Spawn executor agents for implementation |
51
+ | `goop_adl` | Log deviations during execution |
52
+ | `memory_search` | Find relevant patterns and conventions |
53
+
54
+ **Hook Support:** `tool.execute.after` auto-progresses to accept phase when all waves complete.
55
+
56
+ ---
57
+
58
+ ## Process
59
+
60
+ ### Phase 1: Gate Check
61
+
62
+ **Execute BEFORE anything else:**
63
+
64
+ ```
65
+ goop_status()
66
+ goop_state({ action: "get" }) # NEVER read state.json directly
67
+ Read(".goopspec/BLUEPRINT.md")
68
+ ```
69
+
70
+ **1.1 Check specLocked:**
71
+
72
+ ```
73
+ IF state.specLocked != true:
74
+ REFUSE with:
75
+
76
+ ## 🔮 GoopSpec · Gate Blocked
77
+
78
+ Specification must be locked before execution.
79
+
80
+ Run: `/goop-specify`
89
81
 
90
- - Change 1
91
- - Change 2
92
- ```
82
+ ---
83
+ ```
84
+
85
+ **1.2 Gate passed:**
86
+
87
+ ```
88
+ ## 🔮 GoopSpec · Execution
93
89
 
94
- ## Example
90
+ Spec gate passed
95
91
 
96
- After spec locked for authentication:
92
+ Starting wave-based execution...
97
93
 
94
+ ---
98
95
  ```
99
- /goop-execute
96
+
97
+ ### Phase 2: Load Context
98
+
99
+ ```
100
+ Read(".goopspec/SPEC.md") # Must-haves
101
+ Read(".goopspec/BLUEPRINT.md") # Waves and tasks
102
+ Read(".goopspec/CHRONICLE.md") # Progress (if resuming)
103
+ Read(".goopspec/PROJECT_KNOWLEDGE_BASE.md") # Conventions
104
+
105
+ memory_search({ query: "[feature] implementation patterns" })
106
+ ```
107
+
108
+ Identify:
109
+ - Current wave (from CHRONICLE or start at 1)
110
+ - Tasks to execute
111
+ - Dependencies between tasks
112
+
113
+ ### Phase 3: Wave Execution Loop
114
+
115
+ **Display wave start:**
116
+
117
+ ```
118
+ ## 🔮 GoopSpec · Wave [N] of [M]: [Wave Name]
119
+
120
+ **Tasks:** [X] | **Execution:** [Parallel/Sequential]
121
+
122
+ ---
123
+ ```
124
+
125
+ **For each task in wave:**
126
+
127
+ 1. **Delegate to executor:**
128
+ ```
129
+ task({
130
+ subagent_type: "goop-executor",
131
+ description: "Execute Task [N.M]",
132
+ prompt: `
133
+ ## TASK
134
+ Wave [N], Task [M]: [Task Name]
135
+
136
+ ## PROJECT CONTEXT
137
+ [From PROJECT_KNOWLEDGE_BASE.md]
138
+
139
+ ## SPEC REQUIREMENTS
140
+ [Relevant must-have from SPEC.md]
141
+
142
+ ## TASK DETAILS
143
+ [From BLUEPRINT.md]
144
+
145
+ Intent: [intent]
146
+ Deliverables: [list]
147
+ Files: [paths]
148
+ Verification: [command]
149
+ Acceptance: [criteria]
150
+
151
+ ## INSTRUCTIONS
152
+ 1. Implement following existing patterns
153
+ 2. Commit atomically
154
+ 3. Return XML response envelope
155
+ 4. Include spec coverage in response
156
+ `
157
+ })
158
+ ```
159
+
160
+ 2. **Parse XML response:**
161
+ - Extract status (COMPLETE/PARTIAL/BLOCKED)
162
+ - Extract artifacts (files, commits)
163
+ - Extract handoff instructions
164
+
165
+ 3. **Update CHRONICLE.md:**
166
+ ```markdown
167
+ ### Task [N.M]: [Name]
168
+ - Status: [Complete/Partial/Blocked]
169
+ - Commit: [sha]
170
+ - Files: [list]
171
+ - Time: [timestamp]
172
+ ```
173
+
174
+ 4. **Handle status:**
175
+
176
+ | Status | Action |
177
+ |--------|--------|
178
+ | COMPLETE | Continue to next task |
179
+ | PARTIAL | Resume with partial context |
180
+ | BLOCKED | Check deviation rules |
181
+
182
+ ### Phase 4: Deviation Handling
183
+
184
+ **Apply deviation rules:**
185
+
186
+ | Rule | Trigger | Action |
187
+ |------|---------|--------|
188
+ | Rule 1 | Bug found | Auto-fix, document |
189
+ | Rule 2 | Missing critical | Auto-add, document |
190
+ | Rule 3 | Blocking issue | Auto-fix, document |
191
+ | Rule 4 | Architectural | **STOP**, ask user |
192
+
193
+ **On Rule 4:**
194
+ ```
195
+ ## 🔮 GoopSpec · Decision Required
196
+
197
+ ⚠️ **Type:** Architectural Decision
198
+
199
+ **Context:** [From executor response]
200
+
201
+ **Options:**
202
+ - **A)** [option] — [impact]
203
+ - **B)** [option] — [impact]
204
+
205
+ **Recommendation:** [If any]
206
+
207
+ Which option? (A/B/other)
208
+
209
+ ---
210
+ ```
211
+
212
+ Use `question` tool, then resume with decision.
213
+
214
+ ### Phase 5: Wave Completion
215
+
216
+ **At end of each wave:**
217
+
218
+ 1. **Run wave verification:**
219
+ ```
220
+ Spawn goop-verifier for wave-level checks
221
+ ```
222
+
223
+ 2. **Update CHRONICLE.md:**
224
+ ```markdown
225
+ ## Wave [N]: COMPLETE
226
+ - Tasks: [X/X]
227
+ - Commits: [list]
228
+ - Verification: PASSED
229
+ - Time: [timestamp]
230
+ ```
231
+
232
+ 3. **Save checkpoint:**
233
+ ```
234
+ goop_checkpoint({
235
+ action: "save",
236
+ context: { wave: N, phase: "execute" }
237
+ })
238
+ ```
239
+
240
+ 4. **Generate HANDOFF.md:**
241
+ ```markdown
242
+ # Session Handoff
243
+
244
+ **Phase:** execute
245
+ **Wave:** [N] of [M] complete
246
+
247
+ ## Accomplished
248
+ - [x] Task N.1: [description]
249
+ - [x] Task N.2: [description]
250
+
251
+ ## Next Session
252
+ Run: /goop-execute
253
+
254
+ ## Context
255
+ Wave [N] complete. Starting Wave [N+1] next.
256
+ ```
257
+
258
+ 5. **Suggest new session:**
259
+ ```
260
+ ## 🔮 GoopSpec · Wave [N] Complete
261
+
262
+ ✨ Wave finished successfully
263
+
264
+ | Metric | Status |
265
+ |--------|--------|
266
+ | Tasks | ✓ [X/X] complete |
267
+ | Commits | [Y] |
268
+ | Verification | ✓ PASSED |
269
+
270
+ ### Next
271
+
272
+ **Option A:** Continue to Wave [N+1] (current session)
273
+ **Option B:** Start new session for fresh context (Recommended)
274
+
275
+ For Option B:
276
+ 1. Start a new session
277
+ 2. Run: `/goop-execute`
278
+
279
+ ---
100
280
  ```
101
281
 
102
- Orchestrator executes:
103
- - Wave 1: Setup auth directory, install jose library
104
- - Wave 2: Implement login function, session management
105
- - Wave 3: Wire to API routes, connect to user model
106
- - Wave 4: Add error handling, write tests
282
+ ### Phase 6: Execution Complete
107
283
 
108
- Each task delegated to goop-executor, committed atomically.
284
+ **When all waves done:**
109
285
 
110
- ## Continuation Enforcement
286
+ ```
287
+ ## 🔮 GoopSpec · Execution Complete
288
+
289
+ ✨ All waves finished successfully
111
290
 
112
- The agent **CANNOT stop** with incomplete tasks:
113
- - Incomplete todos = forced continuation
114
- - Only checkpoints allow pause
115
- - User must explicitly confirm completion
116
- - Max continuation prompts before escalation
291
+ | Metric | Status |
292
+ |--------|--------|
293
+ | Waves | [M/M] complete |
294
+ | Tasks | [P/P] complete |
295
+ | Commits | [Q] |
117
296
 
118
- ## Next Steps
297
+ All must-haves implemented and verified.
119
298
 
120
- After execution:
121
- - `/goop-accept` - Verify and accept completion (ACCEPTANCE GATE)
299
+ ### Next Step
122
300
 
123
- During execution:
124
- - `/goop-status` - Check progress
125
- - `/goop-pause` - Save checkpoint manually
301
+ **Verify and accept** — Final verification against spec
126
302
 
127
- ## Quick Mode Execution
303
+ `/goop-accept`
304
+
305
+ ---
306
+
307
+ Start a new session for fresh context.
308
+ ```
309
+
310
+ Update state using goop_state:
311
+ ```
312
+ goop_state({ action: "transition", phase: "accept" })
313
+ ```
314
+
315
+ This atomically updates the workflow state. **NEVER edit state.json directly.**
316
+
317
+ ## Output
318
+
319
+ | File | Purpose |
320
+ |------|---------|
321
+ | Source files | Implementation |
322
+ | Commits | Atomic changes |
323
+ | `.goopspec/CHRONICLE.md` | Progress log |
324
+ | `.goopspec/HANDOFF.md` | Session handoff |
325
+
326
+ ## Transitions
327
+
328
+ | Outcome | Next Step |
329
+ |---------|-----------|
330
+ | All waves complete | `/goop-accept` for verification |
331
+ | Checkpoint reached | `/goop-pause` to save, resume later |
332
+ | Wave complete | Continue or new session |
333
+ | Gate blocked | `/goop-specify` to lock spec |
334
+
335
+ ## Examples
336
+
337
+ **Starting Execution:**
338
+ ```
339
+ User: /goop-execute
340
+
341
+ Orchestrator:
342
+ +--------------------------------------------------------+
343
+ | GOOPSPEC > EXECUTION |
344
+ +--------------------------------------------------------+
345
+ | Spec gate: PASSED |
346
+ | Starting wave-based execution... |
347
+ +--------------------------------------------------------+
348
+
349
+ +--------------------------------------------------------+
350
+ | GOOPSPEC > WAVE 1 of 3: Foundation |
351
+ +--------------------------------------------------------+
352
+
353
+ [Delegating Task 1.1...]
354
+
355
+ goop-executor: Task 1.1 COMPLETE (commit: abc123)
356
+
357
+ [Delegating Task 1.2...]
358
+
359
+ goop-executor: Task 1.2 COMPLETE (commit: def456)
360
+
361
+ +--------------------------------------------------------+
362
+ | GOOPSPEC > WAVE 1 COMPLETE |
363
+ +--------------------------------------------------------+
364
+
365
+ **Recommend:** Start new session for Wave 2
366
+ ```
367
+
368
+ **Checkpoint Reached:**
369
+ ```
370
+ goop-executor: BLOCKED - Rule 4 deviation
371
+
372
+ +--------------------------------------------------------+
373
+ | GOOPSPEC > CHECKPOINT: Decision Required |
374
+ +--------------------------------------------------------+
375
+
376
+ **Context:** Database schema change needed
377
+
378
+ **Options:**
379
+ | A | Add index | Better performance |
380
+ | B | Skip index | Faster deployment |
381
+
382
+ Which option?
383
+
384
+ User: A
385
+
386
+ Orchestrator: Resuming with Option A...
387
+ ```
128
388
 
129
- For Quick tasks:
130
- - Abbreviated waves (often just 1-2)
131
- - Faster delegation
132
- - Less formal tracking
133
- - Direct to Accept phase
389
+ ## Success Criteria
390
+
391
+ - [ ] Gate check performed (spec_locked)
392
+ - [ ] Project context loaded (KNOWLEDGE_BASE, memory)
393
+ - [ ] Each task delegated with full context
394
+ - [ ] XML responses parsed correctly
395
+ - [ ] CHRONICLE.md updated after each task
396
+ - [ ] Deviation rules applied (auto-fix or checkpoint)
397
+ - [ ] Checkpoints saved at wave boundaries
398
+ - [ ] HANDOFF.md generated at natural pauses
399
+ - [ ] User informed of progress throughout
400
+
401
+ ## Anti-Patterns
402
+
403
+ **DON'T:**
404
+ - Skip the spec_locked gate
405
+ - Delegate without full context
406
+ - Ignore XML response status
407
+ - Skip wave-boundary checkpoints
408
+ - Continue indefinitely without handoffs
409
+
410
+ **DO:**
411
+ - Enforce the gate strictly
412
+ - Include PROJECT_KNOWLEDGE_BASE in delegations
413
+ - Parse and act on XML responses
414
+ - Save checkpoints at wave boundaries
415
+ - Suggest new sessions for fresh context
134
416
 
135
417
  ---
136
418
 
137
- **GoopSpec**: Execute with precision, deliver with confidence.
419
+ *Execution Protocol v0.1.4*
420
+ *"Execute in waves. Checkpoint often. Handoff clean."*
@@ -13,6 +13,17 @@ Display help information and available commands.
13
13
  /goop-help
14
14
  ```
15
15
 
16
+ ## Tools Used
17
+
18
+ | Tool | Purpose in This Command |
19
+ |------|------------------------|
20
+ | `goop_reference` | Load reference documentation |
21
+ | `goop_skill` | List available skills |
22
+
23
+ **Hook Support:** None specific - informational command.
24
+
25
+ ---
26
+
16
27
  ## Available Commands
17
28
 
18
29
  **Project Management:**
@@ -15,7 +15,7 @@ Map an existing codebase for brownfield projects.
15
15
 
16
16
  Analyzes codebase with parallel Explore agents. Creates `.goopspec/codebase/` with 7 focused documents covering stack, architecture, structure, conventions, testing, integrations, and concerns.
17
17
 
18
- Use before `/goop-new` on existing codebases. Provides the context needed to extend rather than replace.
18
+ Use before `/goop-setup` on existing codebases. Provides the context needed to extend rather than replace.
19
19
 
20
20
  **Creates:**
21
21
  - `.goopspec/codebase/STACK.md` - Technology stack
@@ -33,6 +33,19 @@ Use before `/goop-new` on existing codebases. Provides the context needed to ext
33
33
  @/home/james/Documents/opencode-goopspec/templates/codebase/conventions.md
34
34
  </execution_context>
35
35
 
36
+ <tools_used>
37
+ ## Tools Used
38
+
39
+ | Tool | Purpose in This Command |
40
+ |------|------------------------|
41
+ | `goop_status` | Check if mapping already exists |
42
+ | `memory_search` | Find prior codebase insights |
43
+ | `memory_save` | Persist discovered patterns |
44
+ | `memory_note` | Quick capture during exploration |
45
+
46
+ **Hook Support:** `system.transform` injects patterns for future sessions.
47
+ </tools_used>
48
+
36
49
  <process>
37
50
  ## Phase 1: Setup
38
51
 
@@ -429,7 +442,7 @@ OPTIONAL_VAR=[description]
429
442
 
430
443
  ## Phase 5: Update State
431
444
 
432
- Update STATE.md:
445
+ Update `.goopspec/state.json`:
433
446
  - Mark codebase as mapped
434
447
  - Add timestamp
435
448
  - Link to codebase docs
@@ -467,7 +480,7 @@ Created in .goopspec/codebase/:
467
480
 
468
481
  **Initialize GoopSpec project** with brownfield context
469
482
 
470
- /goop-new [project-name]
483
+ /goop-setup
471
484
 
472
485
  <sub>Will use codebase map to understand existing code</sub>
473
486
 
@@ -11,6 +11,17 @@ View the status and statistics of the persistent memory system.
11
11
  `/goop-memory stats` - Show detailed statistics
12
12
  `/goop-memory clean` - Clean up old/low-importance memories
13
13
 
14
+ ## Tools Used
15
+
16
+ | Tool | Purpose in This Command |
17
+ |------|------------------------|
18
+ | `goop_status` | Check memory worker status |
19
+ | `memory_search` | Query memory statistics |
20
+
21
+ **Hook Support:** None specific - status command.
22
+
23
+ ---
24
+
14
25
  ## Instructions
15
26
 
16
27
  When this command is invoked: