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,78 +1,490 @@
1
1
  ---
2
2
  name: goop-plan
3
- description: Start the Plan phase - capture intent and requirements
3
+ description: Create specification and blueprint from discovery interview
4
+ phase: plan
5
+ requires: interview_complete
6
+ next-step: "When planning is complete, lock the specification"
7
+ next-command: /goop-specify
8
+ alternatives:
9
+ - command: /goop-discuss
10
+ when: "If discovery interview was not completed"
11
+ - command: /goop-research
12
+ when: "If there are unknowns to investigate"
13
+ - command: /goop-pause
14
+ when: "To save progress and continue later"
4
15
  ---
5
16
 
6
- # GoopSpec Plan
17
+ # /goop-plan
7
18
 
8
- Capture user intent and establish the foundation for all subsequent work.
19
+ **Create Specification and Blueprint.** Transform discovery interview into executable plans.
9
20
 
10
21
  ## Usage
11
22
 
23
+ ```bash
24
+ /goop-plan
12
25
  ```
13
- /goop-plan [brief description]
26
+
27
+ ## Gate Requirement
28
+
29
+ ```
30
+ +================================================================+
31
+ | DISCOVERY GATE: Interview must be complete before planning. |
32
+ | This ensures we build the RIGHT thing. |
33
+ +================================================================+
34
+ ```
35
+
36
+ **Required before this command:**
37
+ - `interviewComplete: true` (check via `goop_state({ action: "get" })`)
38
+ - `.goopspec/REQUIREMENTS.md` exists
39
+
40
+ **If not satisfied:** Refuse and redirect to `/goop-discuss`
41
+
42
+ **CRITICAL: Never read or edit .goopspec/state.json directly. Always use `goop_state` tool.**
43
+
44
+ ## Orchestrator Role
45
+
46
+ **You check the gate, then spawn the planner.** The planner creates SPEC.md and BLUEPRINT.md.
47
+
48
+ ## Tools Used
49
+
50
+ | Tool | Purpose in This Command |
51
+ |------|------------------------|
52
+ | `goop_status` | Check current phase and gate requirements |
53
+ | `goop_spec` | Validate interview complete, load existing specs |
54
+ | `memory_search` | Find prior architecture decisions |
55
+ | `memory_decision` | Record new planning decisions |
56
+ | `goop_reference` | Load spec/blueprint templates |
57
+
58
+ **Hook Support:** `tool.execute.after` may auto-transition to specify phase.
59
+
60
+ ---
61
+
62
+ ## Process
63
+
64
+ ### Phase 1: Gate Check
65
+
66
+ **Execute BEFORE anything else:**
67
+
68
+ ```
69
+ goop_status()
70
+ goop_state({ action: "get" }) # NEVER read state.json directly
71
+ Read(".goopspec/REQUIREMENTS.md")
72
+ ```
73
+
74
+ **1.1 Check interviewComplete:**
75
+
76
+ ```
77
+ IF state.interviewComplete != true:
78
+ REFUSE with:
79
+
80
+ ## 🔮 GoopSpec · Gate Blocked
81
+
82
+ ✗ Discovery interview required before planning.
83
+
84
+ → Run: `/goop-discuss`
85
+
86
+ ---
87
+
88
+ EXIT command.
89
+ ```
90
+
91
+ **1.2 Check REQUIREMENTS.md exists:**
92
+
93
+ ```
94
+ IF .goopspec/REQUIREMENTS.md does not exist:
95
+ REFUSE with:
96
+
97
+ ## 🔮 GoopSpec · Gate Blocked
98
+
99
+ ✗ No discovery output found.
100
+
101
+ → Run: `/goop-discuss`
102
+
103
+ ---
104
+
105
+ EXIT command.
106
+ ```
107
+
108
+ **1.3 Gate passed:**
109
+
110
+ ```
111
+ ## 🔮 GoopSpec · Planning
112
+
113
+ ✓ Discovery gate passed
114
+
115
+ ⏳ Creating specification and blueprint...
116
+
117
+ ---
118
+ ```
119
+
120
+ ### Phase 2: Check for Existing Documents
121
+
122
+ **2.1 Check for existing SPEC.md/BLUEPRINT.md:**
123
+
124
+ ```
125
+ Read(".goopspec/SPEC.md")
126
+ Read(".goopspec/BLUEPRINT.md")
127
+ ```
128
+
129
+ **2.2 If documents exist:**
130
+
131
+ Use `question` tool:
132
+ - header: "Existing Project"
133
+ - question: "I found existing project documents. How would you like to proceed?"
134
+ - options:
135
+ - "Archive and start fresh (Recommended)" — Move current docs to archive, create new
136
+ - "Continue existing project" — Resume work (exit, run /goop-status)
137
+ - "Overwrite without archiving" — Replace documents (loses history)
138
+
139
+ **On "Archive":** Spawn writer to archive, then continue.
140
+ **On "Continue":** Exit, suggest `/goop-status`.
141
+ **On "Overwrite":** Warn, then continue.
142
+
143
+ ### Phase 3: Load Context
144
+
145
+ **3.1 Load discovery interview:**
146
+
147
+ ```
148
+ Read(".goopspec/REQUIREMENTS.md")
149
+ ```
150
+
151
+ Extract:
152
+ - Vision
153
+ - Must-haves (with acceptance criteria)
154
+ - Constraints
155
+ - Out of scope
156
+ - Assumptions
157
+ - Risks
158
+
159
+ **3.2 Search memory:**
160
+
161
+ ```
162
+ memory_search({ query: "[feature] architecture decisions patterns", limit: 5 })
163
+ ```
164
+
165
+ **3.3 Load project knowledge:**
166
+
167
+ ```
168
+ Read(".goopspec/PROJECT_KNOWLEDGE_BASE.md") # If exists
169
+ ```
170
+
171
+ ### Phase 4: Spawn Planner
172
+
173
+ **Display banner:**
174
+ ```
175
+ ## 🔮 GoopSpec · Creating Documents
176
+
177
+ ⏳ Spawning planner to create SPEC.md and BLUEPRINT.md...
178
+
179
+ ---
180
+ ```
181
+
182
+ **Spawn goop-planner with full context:**
183
+
184
+ ```
185
+ task({
186
+ subagent_type: "goop-planner",
187
+ description: "Create SPEC and BLUEPRINT",
188
+ prompt: `
189
+ ## TASK
190
+ Create specification and blueprint from discovery interview.
191
+
192
+ ## PROJECT CONTEXT
193
+ [From PROJECT_KNOWLEDGE_BASE.md if exists]
194
+ - Stack: [technologies]
195
+ - Conventions: [naming, patterns]
196
+
197
+ ## DISCOVERY INTERVIEW OUTPUT
198
+ [Full content of REQUIREMENTS.md]
199
+
200
+ ### Vision
201
+ [Vision section]
202
+
203
+ ### Must-Haves
204
+ [Must-haves with acceptance criteria]
205
+
206
+ ### Constraints
207
+ [Technical and practical constraints]
208
+
209
+ ### Out of Scope
210
+ [Explicit exclusions]
211
+
212
+ ### Assumptions
213
+ [Baseline assumptions]
214
+
215
+ ### Risks
216
+ [Identified risks with mitigations]
217
+
218
+ ## INSTRUCTIONS
219
+
220
+ 1. **Verify discovery completeness:**
221
+ - Vision defined?
222
+ - Must-haves listed with acceptance criteria?
223
+ - Out of scope defined?
224
+ - Risks identified?
225
+
226
+ If missing critical info, return BLOCKED.
227
+
228
+ 2. **Create .goopspec/SPEC.md:**
229
+ - Transform must-haves into formal requirements (MH1, MH2, etc.)
230
+ - Include acceptance criteria for each
231
+ - Add traceability section (will be filled after blueprint)
232
+ - Mark status as "Draft"
233
+
234
+ 3. **Create .goopspec/BLUEPRINT.md:**
235
+ - Design wave architecture
236
+ - Create tasks that cover ALL must-haves
237
+ - Add spec coverage to each task
238
+ - Build traceability matrix
239
+
240
+ 4. **Update .goopspec/SPEC.md:**
241
+ - Fill traceability matrix (must-have → tasks)
242
+ - Verify 100% coverage
243
+
244
+ 5. **Initialize .goopspec/CHRONICLE.md:**
245
+ - Phase: plan → ready for specify
246
+ - Documents created with timestamps
247
+
248
+ 6. **Save to memory:**
249
+ - Key architectural decisions
250
+ - Technology choices with rationale
251
+
252
+ 7. **Return XML response envelope** with:
253
+ - BLUEPRINT COMPLETE status
254
+ - Wave summary
255
+ - Traceability summary
256
+ - Handoff instructions
257
+
258
+ ## VERIFICATION
259
+ Before returning COMPLETE:
260
+ - [ ] Every must-have has mapped tasks
261
+ - [ ] Every task has spec coverage
262
+ - [ ] Traceability matrix shows 100%
263
+ - [ ] SPEC.md has all sections filled
264
+ - [ ] BLUEPRINT.md has verification commands
265
+ `
266
+ })
267
+ ```
268
+
269
+ ### Phase 5: Handle Response
270
+
271
+ **Parse XML response from planner.**
272
+
273
+ **On `COMPLETE` status:**
274
+
275
+ Read created documents:
276
+ ```
277
+ Read(".goopspec/SPEC.md")
278
+ Read(".goopspec/BLUEPRINT.md")
279
+ ```
280
+
281
+ Display completion:
282
+ ```
283
+ ## 🔮 GoopSpec · Planning Complete
284
+
285
+ ✨ Blueprint created successfully
286
+
287
+ **Feature:** [Name from SPEC.md]
288
+
289
+ | Document | Status | Location |
290
+ |----------|--------|----------|
291
+ | Spec | ✓ Created | .goopspec/SPEC.md |
292
+ | Blueprint | ✓ Created | .goopspec/BLUEPRINT.md |
293
+ | Chronicle | ✓ Created | .goopspec/CHRONICLE.md |
294
+
295
+ **[N] must-haves** | **[M] waves** | **[P] tasks**
296
+
297
+ ### Traceability
298
+ | Must-Have | Covered By |
299
+ |-----------|------------|
300
+ | MH1 | Wave X, Tasks Y |
301
+ | MH2 | Wave X, Tasks Y |
302
+
303
+ ✓ Coverage: 100%
304
+
305
+ ### Next Step
306
+
307
+ **Lock the specification** — Confirm requirements before execution
308
+
309
+ → `/goop-specify`
310
+
311
+ ---
312
+
313
+ Start a **new session** for fresh context, then run the command.
314
+
315
+ **Also available:**
316
+ - `cat .goopspec/SPEC.md` — Review specification
317
+ - `cat .goopspec/BLUEPRINT.md` — Review execution plan
318
+ - `/goop-research [topic]` — Investigate unknowns first
319
+ ```
320
+
321
+ **Generate HANDOFF.md:**
322
+
14
323
  ```
324
+ Write(".goopspec/HANDOFF.md", `
325
+ # Session Handoff
326
+
327
+ **Generated:** [timestamp]
328
+ **Phase:** plan
329
+
330
+ ## Accomplished
331
+ - [x] Discovery interview completed
332
+ - [x] SPEC.md created with [N] must-haves
333
+ - [x] BLUEPRINT.md created with [M] waves, [P] tasks
334
+ - [x] 100% traceability achieved
335
+
336
+ ## Current State
337
+ - Phase: plan
338
+ - Interview: complete
339
+ - Spec: draft (not locked)
340
+
341
+ ## Next Session
342
+ Run: /goop-specify
15
343
 
16
- ## Workflow Position
344
+ ## Files to Read
345
+ 1. .goopspec/SPEC.md — Requirements
346
+ 2. .goopspec/BLUEPRINT.md — Execution plan
17
347
 
348
+ ## Context Summary
349
+ Planning complete for [feature]. [N] must-haves mapped to [P] tasks
350
+ across [M] waves. Ready to lock specification.
351
+ `)
18
352
  ```
19
- ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
20
- │ PLAN │ ──▶ │ RESEARCH │ ──▶ │ SPECIFY │
21
- │ (Intent) │ │ (Explore) │ │ (Contract) │
22
- └─────────────┘ └─────────────┘ └─────────────┘
23
-
24
- (You are here)
353
+
354
+ **On `BLOCKED` status:**
355
+
25
356
  ```
357
+ ## 🔮 GoopSpec · Planning Blocked
358
+
359
+ ✗ Cannot proceed
26
360
 
27
- The Plan phase answers: **What does the user want and why?**
361
+ **Blocker:** [From planner response]
28
362
 
29
- ## What Happens
363
+ **Options:**
364
+ 1. Provide more context → `/goop-discuss`
365
+ 2. Research the unknown → `/goop-research [topic]`
30
366
 
31
- 1. **Intent Capture** - Extract core intent from your request
32
- 2. **Clarifying Questions** - Resolve critical ambiguities
33
- 3. **Requirements Gathering** - Categorize must/should/could/won't haves
34
- 4. **Constraint Identification** - Document technical, time, resource limits
35
- 5. **Success Criteria** - Define observable completion conditions
36
- 6. **Memory Search** - Check for similar past work and preferences
367
+ ---
368
+ ```
37
369
 
38
- The agent will ask questions to understand:
39
- - Scope boundaries
40
- - Priority trade-offs
41
- - Performance/security requirements
42
- - Integration with existing features
370
+ Use `question` tool to get user choice.
43
371
 
44
- ## Artifacts Created
372
+ **On `PARTIAL` status:**
45
373
 
46
- - Intent statement (what and why)
47
- - Requirements list (must/should/could/won't)
48
- - Constraints documentation
49
- - Success criteria
374
+ Present what was created, explain gaps, offer to continue or restart.
50
375
 
51
- ## Example
376
+ ### Phase 6: Memory Persistence
52
377
 
378
+ After successful planning:
379
+
380
+ ```
381
+ memory_save({
382
+ type: "note",
383
+ title: "Plan: [Feature Name]",
384
+ content: "Created [N]-wave blueprint. Key decisions: [list]. Must-haves: [summary].",
385
+ concepts: ["planning", "blueprint", "[domain]"],
386
+ importance: 0.7
387
+ })
53
388
  ```
54
- /goop-plan Add user authentication with email/password
389
+
390
+ ## Output
391
+
392
+ | File | Purpose |
393
+ |------|---------|
394
+ | `.goopspec/SPEC.md` | Specification (Draft) |
395
+ | `.goopspec/BLUEPRINT.md` | Wave-based execution plan |
396
+ | `.goopspec/CHRONICLE.md` | Progress tracking |
397
+ | `.goopspec/HANDOFF.md` | Session handoff |
398
+ | State (via goop_state) | Workflow state (phase transitions) |
399
+
400
+ ## Transitions
401
+
402
+ | Outcome | Next Step |
403
+ |---------|-----------|
404
+ | Planning complete | `/goop-specify` to lock |
405
+ | Missing discovery | `/goop-discuss` to interview |
406
+ | Unknowns remain | `/goop-research` to investigate |
407
+ | Need to pause | `/goop-pause` to checkpoint |
408
+
409
+ ## Examples
410
+
411
+ **Gate Passed:**
412
+ ```
413
+ User: /goop-plan
414
+
415
+ Orchestrator:
416
+ +--------------------------------------------------------+
417
+ | GOOPSPEC > PLANNING |
418
+ +--------------------------------------------------------+
419
+ | Discovery gate: PASSED |
420
+ | Creating specification and blueprint... |
421
+ +--------------------------------------------------------+
422
+
423
+ [Spawns goop-planner]
424
+
425
+ ...
426
+
427
+ +--------------------------------------------------------+
428
+ | GOOPSPEC > PLANNING COMPLETE |
429
+ +--------------------------------------------------------+
430
+
431
+ **Feature:** Dark Mode Toggle
432
+
433
+ | Document | Status |
434
+ |------------|---------|
435
+ | Spec | Created |
436
+ | Blueprint | Created |
437
+
438
+ **3 must-haves** | **2 waves** | **5 tasks**
439
+
440
+ ## > Next Step
441
+ `/goop-specify`
442
+ ```
443
+
444
+ **Gate Blocked:**
445
+ ```
446
+ User: /goop-plan
447
+
448
+ Orchestrator:
449
+ +--------------------------------------------------------+
450
+ | GOOPSPEC > GATE BLOCKED |
451
+ +--------------------------------------------------------+
452
+ | Discovery interview required before planning. |
453
+ | |
454
+ | Run: /goop-discuss |
455
+ +--------------------------------------------------------+
55
456
  ```
56
457
 
57
- Agent captures:
58
- - **Intent:** Enable users to create accounts and log in
59
- - **Must haves:** Email/password login, session persistence
60
- - **Success:** User can log in and stay logged in across refresh
458
+ ## Success Criteria
61
459
 
62
- ## Next Steps
460
+ - [ ] Gate check performed (interview_complete + REQUIREMENTS.md)
461
+ - [ ] If gate fails, refused with clear redirect to /goop-discuss
462
+ - [ ] Existing documents handled (archive/continue/overwrite)
463
+ - [ ] goop-planner spawned with full discovery context
464
+ - [ ] SPEC.md created with traceability
465
+ - [ ] BLUEPRINT.md created with spec coverage
466
+ - [ ] 100% must-have coverage achieved
467
+ - [ ] HANDOFF.md generated
468
+ - [ ] User knows next step is `/goop-specify`
469
+ - [ ] Suggested to start new session for fresh context
63
470
 
64
- After planning:
65
- - `/goop-research` - Research implementation approaches
66
- - `/goop-quick` - Skip research for simple tasks (Plan → Execute → Accept)
471
+ ## Anti-Patterns
67
472
 
68
- ## Quick Mode Shortcut
473
+ **DON'T:**
474
+ - Skip the discovery gate check
475
+ - Conduct interview in /goop-plan (that's /goop-discuss)
476
+ - Create documents without traceability
477
+ - Leave user without next steps
478
+ - Skip handoff generation
69
479
 
70
- For small tasks, Plan phase is abbreviated:
71
- - Capture intent in 1-2 sentences
72
- - Skip detailed requirements
73
- - Define one clear success criterion
74
- - Proceed directly to Execute
480
+ **DO:**
481
+ - Enforce the gate strictly
482
+ - Spawn planner with complete context
483
+ - Verify 100% traceability
484
+ - Generate HANDOFF.md
485
+ - Suggest new session for clean context
75
486
 
76
487
  ---
77
488
 
78
- **GoopSpec**: Plan with precision, execute with confidence.
489
+ *Planning Protocol v0.1.4*
490
+ *"Every must-have traces to tasks."*