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.
- package/README.md +255 -331
- package/agents/goop-debugger.md +175 -172
- package/agents/goop-designer.md +232 -160
- package/agents/goop-executor.md +197 -127
- package/agents/goop-explorer.md +148 -150
- package/agents/goop-librarian.md +218 -164
- package/agents/goop-orchestrator.md +392 -280
- package/agents/goop-planner.md +331 -153
- package/agents/goop-researcher.md +198 -126
- package/agents/goop-tester.md +277 -202
- package/agents/goop-verifier.md +191 -201
- package/agents/goop-writer.md +241 -133
- package/agents/memory-distiller.md +228 -136
- package/commands/goop-accept.md +434 -160
- package/commands/goop-amend.md +35 -151
- package/commands/goop-complete.md +39 -183
- package/commands/goop-debug.md +33 -298
- package/commands/goop-discuss.md +381 -85
- package/commands/goop-execute.md +391 -108
- package/commands/goop-help.md +11 -0
- package/commands/goop-map-codebase.md +16 -3
- package/commands/goop-memory.md +11 -0
- package/commands/goop-milestone.md +29 -192
- package/commands/goop-pause.md +31 -40
- package/commands/goop-plan.md +458 -46
- package/commands/goop-quick.md +38 -142
- package/commands/goop-recall.md +11 -0
- package/commands/goop-remember.md +12 -0
- package/commands/goop-research.md +52 -73
- package/commands/goop-resume.md +28 -37
- package/commands/goop-setup.md +225 -124
- package/commands/goop-specify.md +321 -121
- package/commands/goop-status.md +256 -110
- package/dist/index.js +6289 -2820
- package/package.json +1 -1
- package/references/context-injection.md +307 -0
- package/references/discovery-interview.md +278 -0
- package/references/enforcement-system.md +213 -0
- package/references/handoff-protocol.md +290 -0
- package/references/interactive-questioning.md +122 -0
- package/references/model-profiles.md +1 -1
- package/references/phase-gates.md +360 -0
- package/references/plugin-architecture.md +212 -0
- package/references/response-format.md +41 -9
- package/references/subagent-protocol.md +83 -33
- package/references/ui-interaction-patterns.md +133 -0
- package/references/visual-style.md +199 -0
- package/references/workflow-accept.md +60 -273
- package/references/workflow-execute.md +63 -274
- package/references/workflow-plan.md +86 -133
- package/references/workflow-research.md +78 -186
- package/references/workflow-specify.md +64 -221
- package/references/xml-response-schema.md +236 -0
- package/templates/blueprint.md +88 -41
- package/templates/chronicle.md +130 -16
- package/templates/handoff.md +140 -0
- package/templates/project.md +114 -0
- package/templates/requirements.md +121 -0
- package/templates/spec.md +85 -20
- package/templates/state.md +103 -0
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
# Phase Gates
|
|
2
|
+
|
|
3
|
+
Phase Gates are mandatory checkpoints that ensure quality and prevent premature progression through the GoopSpec workflow.
|
|
4
|
+
|
|
5
|
+
## Core Principle
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
+================================================================+
|
|
9
|
+
| GATES ENFORCE QUALITY. NO SHORTCUTS. |
|
|
10
|
+
| Each phase must satisfy its gate before proceeding. |
|
|
11
|
+
| Gates prevent scope creep, rework, and missed requirements. |
|
|
12
|
+
+================================================================+
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Gate Overview
|
|
16
|
+
|
|
17
|
+
| Gate | Location | Purpose | Enforced By |
|
|
18
|
+
|------|----------|---------|-------------|
|
|
19
|
+
| **Discovery Gate** | Before /goop-plan | Ensure requirements understood | Orchestrator |
|
|
20
|
+
| **Spec Gate** | Before /goop-execute | Lock contract with user | /goop-specify |
|
|
21
|
+
| **Execution Gate** | Before /goop-accept | Verify all tasks complete | Orchestrator |
|
|
22
|
+
| **Acceptance Gate** | Before /goop-complete | User accepts deliverable | /goop-accept |
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Gate 1: Discovery Gate
|
|
27
|
+
|
|
28
|
+
### Location
|
|
29
|
+
Between discussion and planning (`/goop-discuss` → `/goop-plan`)
|
|
30
|
+
|
|
31
|
+
### Purpose
|
|
32
|
+
Ensure the six discovery questions are answered before any planning begins.
|
|
33
|
+
|
|
34
|
+
### Requirements
|
|
35
|
+
| Requirement | Validation |
|
|
36
|
+
|-------------|------------|
|
|
37
|
+
| Vision defined | Non-empty, > 2 sentences |
|
|
38
|
+
| Must-haves listed | At least 1 item |
|
|
39
|
+
| Constraints documented | Non-empty |
|
|
40
|
+
| Out of scope defined | At least 1 item |
|
|
41
|
+
| Assumptions listed | Non-empty |
|
|
42
|
+
| Risks identified | At least 1 with mitigation |
|
|
43
|
+
|
|
44
|
+
### State Check
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"interview_complete": true
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### File Check
|
|
52
|
+
```
|
|
53
|
+
.goopspec/REQUIREMENTS.md exists
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Enforcement
|
|
57
|
+
```
|
|
58
|
+
/goop-plan invoked:
|
|
59
|
+
IF state.interview_complete != true:
|
|
60
|
+
REFUSE: "Discovery interview required. Run /goop-discuss first."
|
|
61
|
+
IF REQUIREMENTS.md does not exist:
|
|
62
|
+
REFUSE: "No requirements found. Run /goop-discuss first."
|
|
63
|
+
ELSE:
|
|
64
|
+
PROCEED with planning
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Bypass Conditions
|
|
68
|
+
- `/goop-quick` for small tasks (single file, < 30 min)
|
|
69
|
+
- Bug fixes with clear reproduction
|
|
70
|
+
- Documentation-only changes
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Gate 2: Spec Gate
|
|
75
|
+
|
|
76
|
+
### Location
|
|
77
|
+
Between planning and execution (`/goop-plan` → `/goop-execute`)
|
|
78
|
+
|
|
79
|
+
### Purpose
|
|
80
|
+
Lock the specification contract with explicit user confirmation.
|
|
81
|
+
|
|
82
|
+
### Requirements
|
|
83
|
+
| Requirement | Validation |
|
|
84
|
+
|-------------|------------|
|
|
85
|
+
| SPEC.md exists | File present |
|
|
86
|
+
| Must-haves defined | At least 1 item |
|
|
87
|
+
| Out of scope defined | At least 1 item |
|
|
88
|
+
| BLUEPRINT.md exists | File present |
|
|
89
|
+
| Traceability mapping | Every must-have maps to task(s) |
|
|
90
|
+
| User confirmation | Explicit "confirm" or equivalent |
|
|
91
|
+
|
|
92
|
+
### State Check
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"spec_locked": true,
|
|
96
|
+
"locked_at": "[timestamp]",
|
|
97
|
+
"locked_by": "[user]"
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Enforcement
|
|
102
|
+
```
|
|
103
|
+
/goop-execute invoked:
|
|
104
|
+
IF state.spec_locked != true:
|
|
105
|
+
REFUSE: "Specification not locked. Run /goop-specify first."
|
|
106
|
+
IF SPEC.md traceability incomplete:
|
|
107
|
+
REFUSE: "Traceability incomplete. Every must-have needs mapped tasks."
|
|
108
|
+
ELSE:
|
|
109
|
+
PROCEED with execution
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Lock Process
|
|
113
|
+
1. Display SPEC.md must-haves and out-of-scope
|
|
114
|
+
2. Display BLUEPRINT.md wave summary
|
|
115
|
+
3. Show traceability matrix
|
|
116
|
+
4. Request user confirmation: "Type 'confirm' to lock specification"
|
|
117
|
+
5. On confirm: Set `spec_locked: true`, log to memory, proceed
|
|
118
|
+
|
|
119
|
+
### Amendment After Lock
|
|
120
|
+
Once locked, changes require `/goop-amend`:
|
|
121
|
+
1. Document requested change
|
|
122
|
+
2. Assess impact on BLUEPRINT.md
|
|
123
|
+
3. Get user approval for change
|
|
124
|
+
4. Update SPEC.md with amendment history
|
|
125
|
+
5. Update BLUEPRINT.md if needed
|
|
126
|
+
6. Continue execution
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Gate 3: Execution Gate
|
|
131
|
+
|
|
132
|
+
### Location
|
|
133
|
+
Between execution and acceptance (`/goop-execute` → `/goop-accept`)
|
|
134
|
+
|
|
135
|
+
### Purpose
|
|
136
|
+
Verify all planned tasks are complete before verification.
|
|
137
|
+
|
|
138
|
+
### Requirements
|
|
139
|
+
| Requirement | Validation |
|
|
140
|
+
|-------------|------------|
|
|
141
|
+
| All waves complete | CHRONICLE.md shows all waves done |
|
|
142
|
+
| All tasks complete | No pending tasks in BLUEPRINT.md |
|
|
143
|
+
| Verification passing | Tests pass, typecheck clean |
|
|
144
|
+
| No blockers | No unresolved BLOCKED status |
|
|
145
|
+
|
|
146
|
+
### State Check
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"phase": "execute",
|
|
150
|
+
"waves_complete": true,
|
|
151
|
+
"all_tasks_done": true
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### File Check
|
|
156
|
+
```
|
|
157
|
+
CHRONICLE.md shows:
|
|
158
|
+
- All waves marked complete
|
|
159
|
+
- All tasks checked off
|
|
160
|
+
- Final verification results
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Enforcement
|
|
164
|
+
```
|
|
165
|
+
/goop-accept invoked:
|
|
166
|
+
IF CHRONICLE.md shows incomplete waves:
|
|
167
|
+
REFUSE: "Execution incomplete. [N] tasks remaining in Wave [M]."
|
|
168
|
+
IF blockers exist:
|
|
169
|
+
REFUSE: "Blockers unresolved: [list]"
|
|
170
|
+
ELSE:
|
|
171
|
+
PROCEED with acceptance
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Partial Completion Handling
|
|
175
|
+
If some tasks are optional (nice-to-haves):
|
|
176
|
+
1. Must-haves MUST all be complete
|
|
177
|
+
2. Nice-to-haves MAY be deferred
|
|
178
|
+
3. Deferred items logged in CHRONICLE.md
|
|
179
|
+
4. User confirms proceeding without nice-to-haves
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Gate 4: Acceptance Gate
|
|
184
|
+
|
|
185
|
+
### Location
|
|
186
|
+
Between acceptance and completion (`/goop-accept` → `/goop-complete`)
|
|
187
|
+
|
|
188
|
+
### Purpose
|
|
189
|
+
User explicitly accepts the deliverable as meeting requirements.
|
|
190
|
+
|
|
191
|
+
### Requirements
|
|
192
|
+
| Requirement | Validation |
|
|
193
|
+
|-------------|------------|
|
|
194
|
+
| Verification report | goop-verifier produced report |
|
|
195
|
+
| All must-haves PASS | Requirement matrix shows all green |
|
|
196
|
+
| Security check | Security checklist reviewed |
|
|
197
|
+
| User acceptance | Explicit "accept" from user |
|
|
198
|
+
|
|
199
|
+
### State Check
|
|
200
|
+
```json
|
|
201
|
+
{
|
|
202
|
+
"phase": "accept",
|
|
203
|
+
"verification_passed": true,
|
|
204
|
+
"user_accepted": true,
|
|
205
|
+
"accepted_at": "[timestamp]"
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Verification Report
|
|
210
|
+
goop-verifier produces:
|
|
211
|
+
```markdown
|
|
212
|
+
## Verification Report
|
|
213
|
+
|
|
214
|
+
### Must-Have Matrix
|
|
215
|
+
|
|
216
|
+
| Requirement | Status | Evidence |
|
|
217
|
+
|-------------|--------|----------|
|
|
218
|
+
| [MH1] | PASS | [test/file/commit] |
|
|
219
|
+
| [MH2] | PASS | [test/file/commit] |
|
|
220
|
+
|
|
221
|
+
### Test Results
|
|
222
|
+
- Unit: 42/42 passing
|
|
223
|
+
- Integration: 8/8 passing
|
|
224
|
+
- E2E: 3/3 passing
|
|
225
|
+
|
|
226
|
+
### Security Review
|
|
227
|
+
- [x] No hardcoded secrets
|
|
228
|
+
- [x] Input validation present
|
|
229
|
+
- [x] Auth checks on protected routes
|
|
230
|
+
|
|
231
|
+
### Recommendation
|
|
232
|
+
ACCEPT / REJECT with [reasons]
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Enforcement
|
|
236
|
+
```
|
|
237
|
+
/goop-complete invoked:
|
|
238
|
+
IF verification_passed != true:
|
|
239
|
+
REFUSE: "Verification not passed. Review report."
|
|
240
|
+
IF user_accepted != true:
|
|
241
|
+
REFUSE: "User acceptance required. Type 'accept' to proceed."
|
|
242
|
+
IF must-haves have FAIL status:
|
|
243
|
+
REFUSE: "Must-haves incomplete: [list]"
|
|
244
|
+
ELSE:
|
|
245
|
+
PROCEED with completion
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Acceptance Process
|
|
249
|
+
1. Present verification report
|
|
250
|
+
2. Highlight any concerns
|
|
251
|
+
3. Request user acceptance: "Type 'accept' to complete this milestone"
|
|
252
|
+
4. On accept: Archive milestone, extract learnings, reset for next
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Gate Bypass Protocol
|
|
257
|
+
|
|
258
|
+
### When Bypass is Allowed
|
|
259
|
+
|
|
260
|
+
| Gate | Bypass Allowed | Conditions |
|
|
261
|
+
|------|----------------|------------|
|
|
262
|
+
| Discovery | Yes | /goop-quick, bug fixes, docs-only |
|
|
263
|
+
| Spec | No | Never - spec lock is fundamental |
|
|
264
|
+
| Execution | Partial | Nice-to-haves may be deferred |
|
|
265
|
+
| Acceptance | No | Never - user must accept |
|
|
266
|
+
|
|
267
|
+
### Bypass Logging
|
|
268
|
+
|
|
269
|
+
All bypasses MUST be logged:
|
|
270
|
+
```typescript
|
|
271
|
+
goop_adl({
|
|
272
|
+
action: "append",
|
|
273
|
+
type: "deviation",
|
|
274
|
+
description: "Discovery gate bypassed for quick task",
|
|
275
|
+
rule: 0, // No rule applies
|
|
276
|
+
entry_action: "Proceeded with /goop-quick without interview"
|
|
277
|
+
})
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Gate State Machine
|
|
283
|
+
|
|
284
|
+
```
|
|
285
|
+
[idle]
|
|
286
|
+
│
|
|
287
|
+
▼
|
|
288
|
+
/goop-discuss
|
|
289
|
+
│
|
|
290
|
+
▼
|
|
291
|
+
[interview] ──── DISCOVERY GATE ────┐
|
|
292
|
+
│ │
|
|
293
|
+
│ (interview_complete) │ (bypass: /goop-quick)
|
|
294
|
+
▼ ▼
|
|
295
|
+
/goop-plan [quick-execute]
|
|
296
|
+
│ │
|
|
297
|
+
▼ ▼
|
|
298
|
+
[plan] ────── SPEC GATE ───────────[done]
|
|
299
|
+
│
|
|
300
|
+
│ (spec_locked + user confirm)
|
|
301
|
+
▼
|
|
302
|
+
/goop-specify
|
|
303
|
+
│
|
|
304
|
+
▼
|
|
305
|
+
/goop-execute
|
|
306
|
+
│
|
|
307
|
+
▼
|
|
308
|
+
[execute] ─── EXECUTION GATE ──────┐
|
|
309
|
+
│ │
|
|
310
|
+
│ (all tasks complete) │ (blockers)
|
|
311
|
+
▼ ▼
|
|
312
|
+
/goop-accept [blocked]
|
|
313
|
+
│
|
|
314
|
+
▼
|
|
315
|
+
[accept] ──── ACCEPTANCE GATE ─────┐
|
|
316
|
+
│ │
|
|
317
|
+
│ (user accepts) │ (verification fails)
|
|
318
|
+
▼ ▼
|
|
319
|
+
/goop-complete [rework]
|
|
320
|
+
│
|
|
321
|
+
▼
|
|
322
|
+
[done] → archive → [idle]
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## Gate Failure Handling
|
|
328
|
+
|
|
329
|
+
### Discovery Gate Failure
|
|
330
|
+
```
|
|
331
|
+
Message: "Discovery interview incomplete."
|
|
332
|
+
Action: Run /goop-discuss to complete interview
|
|
333
|
+
Recovery: Answer remaining questions
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Spec Gate Failure
|
|
337
|
+
```
|
|
338
|
+
Message: "Specification not ready for lock."
|
|
339
|
+
Action: Review SPEC.md and BLUEPRINT.md
|
|
340
|
+
Recovery: Complete traceability, get user confirm
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Execution Gate Failure
|
|
344
|
+
```
|
|
345
|
+
Message: "Execution incomplete."
|
|
346
|
+
Action: Review CHRONICLE.md for remaining tasks
|
|
347
|
+
Recovery: Complete tasks or defer nice-to-haves
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### Acceptance Gate Failure
|
|
351
|
+
```
|
|
352
|
+
Message: "Verification failed."
|
|
353
|
+
Action: Review verification report
|
|
354
|
+
Recovery: Fix failing requirements, re-verify
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
*Phase Gates Protocol v0.1.4*
|
|
360
|
+
*"Quality requires discipline."*
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# GoopSpec Plugin Architecture
|
|
2
|
+
|
|
3
|
+
This reference documents the plugin's tools, hooks, and features. Load this to understand how the plugin supports your work.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Design Philosophy
|
|
8
|
+
|
|
9
|
+
- **Memory-First**: Search before acting, save after completing
|
|
10
|
+
- **State-Aware**: Check phase and gates before executing
|
|
11
|
+
- **Phase Enforcement**: Actions are validated against workflow state
|
|
12
|
+
- **Context Injection**: Relevant memory injected into every LLM call
|
|
13
|
+
|
|
14
|
+
## Workflow Phases
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
idle → plan → research → specify → execute → accept → archive
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Key Directories
|
|
21
|
+
|
|
22
|
+
| Directory | Purpose |
|
|
23
|
+
|-----------|---------|
|
|
24
|
+
| `.goopspec/` | Project state, specs, blueprints, chronicles |
|
|
25
|
+
| `src/tools/` | MCP tool implementations |
|
|
26
|
+
| `src/hooks/` | Event handlers for lifecycle |
|
|
27
|
+
| `src/features/` | Feature modules (state, memory, enforcement) |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Available Tools
|
|
32
|
+
|
|
33
|
+
### Workflow/State Tools
|
|
34
|
+
|
|
35
|
+
| Tool | Purpose | Key Parameters |
|
|
36
|
+
|------|---------|----------------|
|
|
37
|
+
| `goop_status` | Shows workflow state, phase, progress, pending tasks | `verbose` (boolean) |
|
|
38
|
+
| `goop_setup` | Configures plugin, initializes projects | `action` (detect/init/plan/apply/verify/reset/models/status), `scope`, `projectName` |
|
|
39
|
+
| `goop_adl` | Manages Automated Decision Log entries | `action` (read/append), `type` (decision/deviation/observation), `description`, `entry_action`, `rule`, `files` |
|
|
40
|
+
| `goop_checkpoint` | Manages execution checkpoints for pause/resume | `action` (save/load/list), `id`, `context` (JSON) |
|
|
41
|
+
| `goop_spec` | Reads/validates SPEC.md and PLAN.md files | `action` (read/list/validate), `phase`, `file` (spec/plan/both) |
|
|
42
|
+
|
|
43
|
+
### Agent/Resource Tools
|
|
44
|
+
|
|
45
|
+
| Tool | Purpose | Key Parameters |
|
|
46
|
+
|------|---------|----------------|
|
|
47
|
+
| `goop_delegate` | Prepares task for specialized agent with context injection | `agent`, `prompt`, `context`, `list` (boolean), `session_id` |
|
|
48
|
+
| `goop_skill` | Loads step-by-step skill guidance | `name`, `list` (boolean) |
|
|
49
|
+
| `goop_reference` | Loads protocols, checklists, templates | `name`, `type` (reference/template/all), `section`, `list` (boolean) |
|
|
50
|
+
| `slashcommand` | Executes GoopSpec slash commands | `command` (string, e.g., "/goop-plan help") |
|
|
51
|
+
|
|
52
|
+
### Memory Tools
|
|
53
|
+
|
|
54
|
+
| Tool | Purpose | Key Parameters |
|
|
55
|
+
|------|---------|----------------|
|
|
56
|
+
| `memory_save` | Saves structured info to persistent memory | `title` (required), `content` (required), `type` (observation/decision/note/todo), `facts`, `concepts`, `importance` (1-10), `sourceFiles` |
|
|
57
|
+
| `memory_search` | Hybrid semantic+keyword search across memories | `query` (required), `limit` (1-20), `types`, `concepts`, `minImportance` |
|
|
58
|
+
| `memory_note` | Quick observation capture (simplified save) | `note` (required), `concepts` |
|
|
59
|
+
| `memory_decision` | Records architectural decisions with structure | `decision` (required), `reasoning` (required), `alternatives`, `impact` (low/medium/high), `concepts` |
|
|
60
|
+
| `memory_forget` | Deletes memories by ID or query | `id`, `query`, `confirm` (required for query-based) |
|
|
61
|
+
| `session_search` | Searches past session history logs | `query`, `recent` (boolean), `limit`, `types` (tool_call/phase_change/etc), `startDate`, `endDate` |
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Hook System
|
|
66
|
+
|
|
67
|
+
| Hook | Trigger | Effect |
|
|
68
|
+
|------|---------|--------|
|
|
69
|
+
| `chat.message` | User sends message | Updates `workflow.lastActivity`, captures significant prompts to memory |
|
|
70
|
+
| `tool.execute.before` | Before tool runs | Caches arguments for post-execution analysis, tracks file states |
|
|
71
|
+
| `tool.execute.after` | After tool completes | **Phase transitions**, memory capture, orchestrator enforcement, auto-progression, code quality warnings |
|
|
72
|
+
| `event` | Session lifecycle (created/idle/deleted) | Continuation enforcer, session summaries, idle detection |
|
|
73
|
+
| `permission.ask` | File permission request | **Blocks orchestrator from writing code** - denies file modifications in protected dirs |
|
|
74
|
+
| `experimental.chat.system.transform` | Before LLM call | **Injects phase rules and relevant memories into system prompt** |
|
|
75
|
+
|
|
76
|
+
### Critical Behaviors
|
|
77
|
+
|
|
78
|
+
- **`tool.execute.after`**: Auto-progresses phases when conditions met (e.g., execute → accept when all waves complete)
|
|
79
|
+
- **`permission.ask`**: Enforces the "Orchestrator vs Executor" boundary - orchestrator CANNOT write implementation files
|
|
80
|
+
- **`system.transform`**: Injects `<goopspec_context>` block with current state, phase rules, and relevant memories
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Feature Modules
|
|
85
|
+
|
|
86
|
+
| Feature | Location | Purpose |
|
|
87
|
+
|---------|----------|---------|
|
|
88
|
+
| **State Manager** | `src/features/state-manager/` | Central workflow persistence - phases, waves, ADL, checkpoints |
|
|
89
|
+
| **Memory System** | `src/features/memory/` | Persistent semantic memory with SQLite + vector storage |
|
|
90
|
+
| **Enforcement** | `src/features/enforcement/` | Phase-based action validation, file write blocking, required docs |
|
|
91
|
+
| **Parallel Research** | `src/features/parallel-research/` | Concurrent multi-agent research orchestration |
|
|
92
|
+
| **Mode Detection** | `src/features/mode-detection/` | Analyzes prompts to suggest quick/standard/comprehensive mode |
|
|
93
|
+
| **Routing** | `src/features/routing/` | Maps task descriptions to appropriate agent categories |
|
|
94
|
+
| **Archive** | `src/features/archive/` | Milestone archival, learnings extraction, retrospectives |
|
|
95
|
+
| **Workflow Memory** | `src/features/workflow-memory/` | Phase-specific memory retrieval optimization |
|
|
96
|
+
| **Setup** | `src/features/setup/` | Environment detection, config management, MCP setup |
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Integration Patterns
|
|
101
|
+
|
|
102
|
+
### Memory-First Pattern
|
|
103
|
+
|
|
104
|
+
Always search memory before starting work, save learnings after:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
1. memory_search({ query: "[current task]", limit: 5 }) # Check what we know
|
|
108
|
+
2. ... do work ...
|
|
109
|
+
3. memory_save/memory_decision/memory_note({ ... }) # Persist learnings
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### State-Aware Pattern
|
|
113
|
+
|
|
114
|
+
Check state before taking actions:
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
1. goop_status() # Know current phase, gates, progress
|
|
118
|
+
2. Read(".goopspec/state.json") # Direct state access if needed
|
|
119
|
+
3. Check phase allows intended action
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Phase Enforcement
|
|
123
|
+
|
|
124
|
+
Hooks automatically enforce what's allowed in each phase:
|
|
125
|
+
|
|
126
|
+
| Phase | Allowed Actions |
|
|
127
|
+
|-------|-----------------|
|
|
128
|
+
| `idle` | Any action allowed |
|
|
129
|
+
| `plan` | Can create plans, cannot execute |
|
|
130
|
+
| `specify` | Can lock spec, cannot execute |
|
|
131
|
+
| `execute` | Can write code, must align to spec |
|
|
132
|
+
| `accept` | Verification only, no new features |
|
|
133
|
+
|
|
134
|
+
### Delegation Lifecycle
|
|
135
|
+
|
|
136
|
+
How orchestrator delegates to specialized agents:
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
1. goop_delegate({ agent: "goop-executor", prompt: "...", context: "..." })
|
|
140
|
+
2. Returns <goop_delegation> with prepared payload
|
|
141
|
+
3. Orchestrator uses task() tool with the delegation
|
|
142
|
+
4. Subagent executes, returns XML envelope response
|
|
143
|
+
5. Orchestrator parses response, updates state/chronicle
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Tool Quick Reference by Role
|
|
149
|
+
|
|
150
|
+
| Agent | Primary Tools | When to Use |
|
|
151
|
+
|-------|---------------|-------------|
|
|
152
|
+
| **Orchestrator** | `goop_status`, `goop_checkpoint`, `slashcommand`, `goop_delegate` | Coordination, delegation, phase management |
|
|
153
|
+
| **Executor** | `goop_spec`, `goop_adl`, `memory_save`, `memory_note` | Implementation, deviation logging, discovery capture |
|
|
154
|
+
| **Planner** | `goop_spec`, `goop_reference`, `memory_decision` | Architecture decisions, template loading |
|
|
155
|
+
| **Researcher** | `memory_save`, `memory_search`, `goop_skill`, `session_search` | Research persistence, prior work discovery |
|
|
156
|
+
| **Verifier** | `goop_spec`, `goop_reference`, `memory_save`, `goop_adl` | Spec validation, security checklist, gap logging |
|
|
157
|
+
| **Explorer** | `memory_save`, `memory_note`, `session_search` | Pattern cataloging, codebase insights |
|
|
158
|
+
| **Debugger** | `goop_checkpoint`, `memory_search`, `memory_decision` | State snapshots, prior bugs, fix decisions |
|
|
159
|
+
| **Designer** | `memory_search`, `memory_save`, `goop_skill` | Design patterns, component specs |
|
|
160
|
+
| **Tester** | `memory_search`, `memory_save`, `goop_skill` | Test patterns, coverage findings |
|
|
161
|
+
| **Writer** | `memory_search`, `memory_save`, `goop_reference` | Doc conventions, templates |
|
|
162
|
+
| **Librarian** | `memory_search`, `memory_save`, `session_search` | Prior findings, synthesized results |
|
|
163
|
+
| **Memory Distiller** | `session_search`, `memory_save` | Raw events → structured memories |
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Common Tool Patterns
|
|
168
|
+
|
|
169
|
+
### Starting a Session
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
goop_status() # Current state
|
|
173
|
+
memory_search({ query: "[task]", limit: 5 }) # Prior context
|
|
174
|
+
Read(".goopspec/SPEC.md") # Requirements
|
|
175
|
+
Read(".goopspec/BLUEPRINT.md") # Plan
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Ending a Session
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
memory_save({ title: "...", content: "...", type: "observation" })
|
|
182
|
+
goop_checkpoint({ action: "save", id: "session-end" })
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Recording a Decision
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
memory_decision({
|
|
189
|
+
decision: "Use Vitest for testing",
|
|
190
|
+
reasoning: "Better Bun integration, faster execution",
|
|
191
|
+
alternatives: ["Jest", "Mocha"],
|
|
192
|
+
impact: "high"
|
|
193
|
+
})
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Logging a Deviation
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
goop_adl({
|
|
200
|
+
action: "append",
|
|
201
|
+
type: "deviation",
|
|
202
|
+
description: "Changed API structure from spec",
|
|
203
|
+
entry_action: "Modified endpoint to accept array instead of object",
|
|
204
|
+
files: ["src/api/handler.ts"]
|
|
205
|
+
})
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## Version
|
|
211
|
+
|
|
212
|
+
Plugin Architecture Reference v0.1.4
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
# Agent Response Format
|
|
2
2
|
|
|
3
|
-
All GoopSpec subagents MUST return structured responses to the orchestrator. This enables clean handoffs, progress tracking, and next-step clarity.
|
|
3
|
+
All GoopSpec subagents MUST return structured responses to the orchestrator using XML envelopes. This enables clean handoffs, progress tracking, and machine-parseable next-step clarity.
|
|
4
4
|
|
|
5
|
-
## Core
|
|
5
|
+
## Core Principles
|
|
6
6
|
|
|
7
7
|
```
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
+================================================================+
|
|
9
|
+
| EVERY RESPONSE MUST ANSWER THREE QUESTIONS: |
|
|
10
|
+
| 1. What did I do? |
|
|
11
|
+
| 2. What is the current state? |
|
|
12
|
+
| 3. What should happen next? |
|
|
13
|
+
+================================================================+
|
|
14
|
+
|
|
15
|
+
+================================================================+
|
|
16
|
+
| USE XML ENVELOPE FOR MACHINE PARSING. |
|
|
17
|
+
| Keep Markdown content inside for human readability. |
|
|
18
|
+
| See references/xml-response-schema.md for full specification. |
|
|
19
|
+
+================================================================+
|
|
14
20
|
```
|
|
15
21
|
|
|
16
22
|
## Response Structure
|
|
@@ -369,18 +375,44 @@ When a checkpoint is needed (user decision, verification, or manual action):
|
|
|
369
375
|
**[For action]:** Type "done" when complete
|
|
370
376
|
```
|
|
371
377
|
|
|
378
|
+
## XML Envelope Requirement
|
|
379
|
+
|
|
380
|
+
**All responses MUST end with an XML envelope.** The Markdown content provides human readability; the XML provides machine-parseable structure for the orchestrator.
|
|
381
|
+
|
|
382
|
+
See `references/xml-response-schema.md` for the complete specification.
|
|
383
|
+
|
|
384
|
+
**Minimal XML envelope:**
|
|
385
|
+
|
|
386
|
+
```xml
|
|
387
|
+
<goop_report version="0.1.4">
|
|
388
|
+
<status>COMPLETE</status>
|
|
389
|
+
<agent>goop-[type]</agent>
|
|
390
|
+
<summary>Brief summary</summary>
|
|
391
|
+
<handoff>
|
|
392
|
+
<ready>true</ready>
|
|
393
|
+
<next_action agent="goop-[type]">Next task</next_action>
|
|
394
|
+
</handoff>
|
|
395
|
+
</goop_report>
|
|
396
|
+
```
|
|
397
|
+
|
|
372
398
|
## Anti-Patterns
|
|
373
399
|
|
|
374
400
|
**NEVER return:**
|
|
375
401
|
- "Done" (no context)
|
|
376
402
|
- "It works now" (no verification)
|
|
403
|
+
- Responses without XML envelope
|
|
377
404
|
- Responses without NEXT STEPS
|
|
378
405
|
- Unstructured text walls
|
|
379
406
|
- Missing status indicators
|
|
380
407
|
|
|
381
408
|
**ALWAYS include:**
|
|
382
|
-
- Clear status header
|
|
409
|
+
- Clear status header (Markdown)
|
|
383
410
|
- Summary of work
|
|
384
411
|
- Files touched
|
|
385
412
|
- Memory persistence
|
|
386
413
|
- NEXT STEPS section
|
|
414
|
+
- XML envelope at the end
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
*Response Format v0.1.4*
|