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,213 @@
|
|
|
1
|
+
# Orchestration Enforcement System
|
|
2
|
+
|
|
3
|
+
GoopSpec enforces workflow rules through a layered enforcement system. This document describes how enforcement works and how to configure it.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The enforcement system transforms GoopSpec from a "suggestions-based" system into an **enforced workflow** where:
|
|
8
|
+
- Commands trigger actual state transitions
|
|
9
|
+
- Documents are scaffolded automatically
|
|
10
|
+
- Phase gates block progression until requirements are met
|
|
11
|
+
- The orchestrator is forced to delegate code work
|
|
12
|
+
|
|
13
|
+
## Components
|
|
14
|
+
|
|
15
|
+
### 1. Phase Context Builder
|
|
16
|
+
|
|
17
|
+
**Location:** `src/features/enforcement/phase-context.ts`
|
|
18
|
+
|
|
19
|
+
Generates phase-specific enforcement rules for injection into system prompts.
|
|
20
|
+
|
|
21
|
+
**Key Functions:**
|
|
22
|
+
- `buildPhaseEnforcement(phase, state)` - Generates MUST DO / MUST NOT DO lists
|
|
23
|
+
- `buildStateContext(state)` - Generates current state information
|
|
24
|
+
- `buildEnforcementContext(state)` - Combines both for system prompt injection
|
|
25
|
+
- `isOperationAllowed(phase, operation)` - Checks if operation is valid in phase
|
|
26
|
+
|
|
27
|
+
### 2. Document Scaffolder
|
|
28
|
+
|
|
29
|
+
**Location:** `src/features/enforcement/scaffolder.ts`
|
|
30
|
+
|
|
31
|
+
Automatically creates phase directory structure with templated documents.
|
|
32
|
+
|
|
33
|
+
**Key Functions:**
|
|
34
|
+
- `scaffoldPhaseDocuments(ctx, phaseName, phase)` - Creates `.goopspec/phases/[name]/` with documents
|
|
35
|
+
- `checkPhaseDocuments(ctx, phaseName, phase)` - Validates required documents exist
|
|
36
|
+
- `getPhaseDir(ctx, phaseName)` - Returns phase directory path
|
|
37
|
+
|
|
38
|
+
**Document Types:**
|
|
39
|
+
| Type | File | Required In |
|
|
40
|
+
|------|------|-------------|
|
|
41
|
+
| spec | SPEC.md | plan, research, specify, execute, accept |
|
|
42
|
+
| blueprint | BLUEPRINT.md | specify, execute, accept |
|
|
43
|
+
| chronicle | CHRONICLE.md | plan, research, specify, execute, accept |
|
|
44
|
+
| research | RESEARCH.md | research, specify |
|
|
45
|
+
|
|
46
|
+
### 3. Validators
|
|
47
|
+
|
|
48
|
+
**Location:** `src/features/enforcement/validators.ts`
|
|
49
|
+
|
|
50
|
+
Validates operations against current workflow phase.
|
|
51
|
+
|
|
52
|
+
**Key Functions:**
|
|
53
|
+
- `validateWriteOperation(phase, filePath)` - Checks if file write is allowed
|
|
54
|
+
- `validatePhaseTransition(ctx, from, to)` - Validates transition preconditions
|
|
55
|
+
- `isImplementationFile(filePath)` - Detects code vs config files
|
|
56
|
+
|
|
57
|
+
**Protected Directories:**
|
|
58
|
+
- `src/`, `lib/`, `app/`, `apps/`
|
|
59
|
+
- `packages/`, `server/`, `client/`
|
|
60
|
+
|
|
61
|
+
## Hooks
|
|
62
|
+
|
|
63
|
+
### System Transform Hook
|
|
64
|
+
|
|
65
|
+
**Location:** `src/hooks/system-transform.ts`
|
|
66
|
+
|
|
67
|
+
Injects enforcement context into every system prompt:
|
|
68
|
+
- Current phase and state information
|
|
69
|
+
- Phase-specific MUST DO / MUST NOT DO rules
|
|
70
|
+
- Delegation reminders in execute phase
|
|
71
|
+
- Memory context for continuity
|
|
72
|
+
|
|
73
|
+
### Command Processor Hook
|
|
74
|
+
|
|
75
|
+
**Location:** `src/hooks/command-processor.ts`
|
|
76
|
+
|
|
77
|
+
Processes `/goop-*` slash commands:
|
|
78
|
+
- Triggers state transitions (e.g., `/goop-plan` → plan phase)
|
|
79
|
+
- Scaffolds phase documents automatically
|
|
80
|
+
- Logs command processing to ADL
|
|
81
|
+
|
|
82
|
+
**Command Mappings:**
|
|
83
|
+
| Command | Target Phase |
|
|
84
|
+
|---------|--------------|
|
|
85
|
+
| /goop-plan | plan |
|
|
86
|
+
| /goop-discuss | plan |
|
|
87
|
+
| /goop-research | research |
|
|
88
|
+
| /goop-specify | specify |
|
|
89
|
+
| /goop-execute | execute |
|
|
90
|
+
| /goop-accept | accept |
|
|
91
|
+
| /goop-complete | idle |
|
|
92
|
+
|
|
93
|
+
### Orchestrator Enforcement Hook
|
|
94
|
+
|
|
95
|
+
**Location:** `src/hooks/orchestrator-enforcement.ts`
|
|
96
|
+
|
|
97
|
+
Enforces delegation rules for the orchestrator agent:
|
|
98
|
+
|
|
99
|
+
**Code Blocking:**
|
|
100
|
+
- Blocks `edit`/`write` on code files for orchestrator
|
|
101
|
+
- Allows planning files (`.goopspec/`, `.md`, `.json`)
|
|
102
|
+
- Injects delegation guidance when blocked
|
|
103
|
+
|
|
104
|
+
**Delegation Enforcement:**
|
|
105
|
+
- Detects `goop_delegate` calls
|
|
106
|
+
- Injects `task()` invocation reminders
|
|
107
|
+
- Tracks pending delegations per session
|
|
108
|
+
|
|
109
|
+
## Phase Rules
|
|
110
|
+
|
|
111
|
+
### Plan Phase
|
|
112
|
+
**MUST DO:**
|
|
113
|
+
- Ask clarifying questions
|
|
114
|
+
- Create SPEC.md with must-haves, nice-to-haves, out-of-scope
|
|
115
|
+
- Get user confirmation before proceeding
|
|
116
|
+
|
|
117
|
+
**MUST NOT DO:**
|
|
118
|
+
- Write ANY implementation code
|
|
119
|
+
- Use write/edit tools on src/ files
|
|
120
|
+
- Skip requirement gathering
|
|
121
|
+
|
|
122
|
+
### Research Phase
|
|
123
|
+
**MUST DO:**
|
|
124
|
+
- Read SPEC.md to understand requirements
|
|
125
|
+
- Create RESEARCH.md with findings
|
|
126
|
+
- Document trade-offs and recommendations
|
|
127
|
+
|
|
128
|
+
**MUST NOT DO:**
|
|
129
|
+
- Write implementation code
|
|
130
|
+
- Modify source files
|
|
131
|
+
|
|
132
|
+
### Specify Phase
|
|
133
|
+
**MUST DO:**
|
|
134
|
+
- Create BLUEPRINT.md with wave-based plan
|
|
135
|
+
- Map all must-haves to specific tasks
|
|
136
|
+
- Get user confirmation to lock specification
|
|
137
|
+
|
|
138
|
+
**MUST NOT DO:**
|
|
139
|
+
- Write implementation code
|
|
140
|
+
- Proceed without locked specification
|
|
141
|
+
|
|
142
|
+
### Execute Phase
|
|
143
|
+
**MUST DO:**
|
|
144
|
+
- DELEGATE all code work using `task()` tool
|
|
145
|
+
- Track progress in CHRONICLE.md
|
|
146
|
+
- Follow wave order
|
|
147
|
+
- Save checkpoints at wave boundaries
|
|
148
|
+
|
|
149
|
+
**MUST NOT DO:**
|
|
150
|
+
- Write code directly
|
|
151
|
+
- Use 'delegate' tool (use 'task' instead)
|
|
152
|
+
- Skip verification steps
|
|
153
|
+
|
|
154
|
+
### Accept Phase
|
|
155
|
+
**MUST DO:**
|
|
156
|
+
- Verify ALL must-haves from SPEC.md
|
|
157
|
+
- Run all tests
|
|
158
|
+
- Get explicit user acceptance
|
|
159
|
+
|
|
160
|
+
**MUST NOT DO:**
|
|
161
|
+
- Mark complete without verification
|
|
162
|
+
- Skip user confirmation
|
|
163
|
+
|
|
164
|
+
## Configuration
|
|
165
|
+
|
|
166
|
+
Enforcement is enabled by default. No configuration currently required.
|
|
167
|
+
|
|
168
|
+
Future configuration options (planned):
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"enforcement": {
|
|
172
|
+
"level": "strict", // assist | warn | strict
|
|
173
|
+
"codeBlocking": true,
|
|
174
|
+
"delegationEnforcement": true
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Troubleshooting
|
|
180
|
+
|
|
181
|
+
### "Cannot write to file" errors
|
|
182
|
+
The orchestrator is blocked from writing code files. Delegate to goop-executor:
|
|
183
|
+
```
|
|
184
|
+
task({
|
|
185
|
+
subagent_type: "goop-executor",
|
|
186
|
+
description: "Implement feature X",
|
|
187
|
+
prompt: "..."
|
|
188
|
+
})
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Phase transition rejected
|
|
192
|
+
Ensure required documents exist before transitioning:
|
|
193
|
+
- `execute` requires SPEC.md
|
|
194
|
+
- `accept` requires SPEC.md, BLUEPRINT.md, CHRONICLE.md
|
|
195
|
+
|
|
196
|
+
### Commands not triggering state changes
|
|
197
|
+
Verify the command is processed by checking ADL.md for logged entries.
|
|
198
|
+
|
|
199
|
+
### Enforcement context not appearing
|
|
200
|
+
Ensure memory injection is enabled in config:
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"memory": {
|
|
204
|
+
"injection": {
|
|
205
|
+
"enabled": true
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
*GoopSpec v0.1.0 - Enforcement System Documentation*
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
# Handoff Protocol
|
|
2
|
+
|
|
3
|
+
The Handoff Protocol ensures clean context transitions between sessions. Following the GSD pattern, each phase ends with full documentation enabling a fresh agent to continue with a clean 200k context window.
|
|
4
|
+
|
|
5
|
+
## Core Principle
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
+================================================================+
|
|
9
|
+
| CONTEXT IS PRECIOUS. FRESH CONTEXT = QUALITY WORK. |
|
|
10
|
+
| At natural boundaries, generate HANDOFF.md and suggest |
|
|
11
|
+
| starting a new session for clean context. |
|
|
12
|
+
+================================================================+
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## When to Generate Handoff
|
|
16
|
+
|
|
17
|
+
### Mandatory Handoff Points
|
|
18
|
+
1. **Phase completion** - After plan, specify, execute, accept
|
|
19
|
+
2. **Wave completion** - After each wave in execution
|
|
20
|
+
3. **Checkpoint reached** - User decision needed
|
|
21
|
+
4. **Context getting full** - Long session with many files read
|
|
22
|
+
|
|
23
|
+
### Optional Handoff Points
|
|
24
|
+
1. **Natural pause** - User stepping away
|
|
25
|
+
2. **Complex task boundary** - Before major implementation
|
|
26
|
+
3. **Research complete** - Before acting on findings
|
|
27
|
+
|
|
28
|
+
## HANDOFF.md Structure
|
|
29
|
+
|
|
30
|
+
```markdown
|
|
31
|
+
# Session Handoff
|
|
32
|
+
|
|
33
|
+
**Generated:** [timestamp]
|
|
34
|
+
**Phase:** [current phase]
|
|
35
|
+
**Session:** [session_id if available]
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Accomplished This Session
|
|
40
|
+
|
|
41
|
+
### Completed
|
|
42
|
+
- [x] [Task/milestone 1]
|
|
43
|
+
- [x] [Task/milestone 2]
|
|
44
|
+
- [x] [Task/milestone 3]
|
|
45
|
+
|
|
46
|
+
### Key Outcomes
|
|
47
|
+
- [Significant outcome 1]
|
|
48
|
+
- [Significant outcome 2]
|
|
49
|
+
|
|
50
|
+
### Decisions Made
|
|
51
|
+
- **[Decision 1]**: [Choice made] - [Rationale]
|
|
52
|
+
- **[Decision 2]**: [Choice made] - [Rationale]
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Current State
|
|
57
|
+
|
|
58
|
+
### Workflow Position
|
|
59
|
+
- **Phase:** [plan|specify|execute|accept]
|
|
60
|
+
- **Spec Locked:** [yes|no]
|
|
61
|
+
- **Wave:** [N of M] (if executing)
|
|
62
|
+
- **Task:** [X of Y] (if executing)
|
|
63
|
+
|
|
64
|
+
### Files Modified
|
|
65
|
+
- `path/to/file1.ts` - [what changed]
|
|
66
|
+
- `path/to/file2.ts` - [what changed]
|
|
67
|
+
|
|
68
|
+
### Commits Made
|
|
69
|
+
- `abc1234` - type(scope): message
|
|
70
|
+
- `def5678` - type(scope): message
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Next Session Instructions
|
|
75
|
+
|
|
76
|
+
### Command to Run
|
|
77
|
+
```
|
|
78
|
+
/goop-[command]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Files to Read First
|
|
82
|
+
1. `.goopspec/SPEC.md` - Requirements contract
|
|
83
|
+
2. `.goopspec/BLUEPRINT.md` - Execution plan
|
|
84
|
+
3. `.goopspec/CHRONICLE.md` - Progress log
|
|
85
|
+
4. [Additional relevant files]
|
|
86
|
+
|
|
87
|
+
### Context Summary
|
|
88
|
+
[2-4 sentences of essential context the next session needs to know.
|
|
89
|
+
Focus on decisions made, patterns established, and gotchas discovered.]
|
|
90
|
+
|
|
91
|
+
### Immediate Next Task
|
|
92
|
+
**Task:** [Exact task description]
|
|
93
|
+
**Files:** `path/to/files`
|
|
94
|
+
**Action:** [What needs to be done]
|
|
95
|
+
**Verify:** [How to verify completion]
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Warnings & Blockers
|
|
100
|
+
|
|
101
|
+
### Active Blockers
|
|
102
|
+
[None | List of blockers with context]
|
|
103
|
+
|
|
104
|
+
### Gotchas Discovered
|
|
105
|
+
- [Pattern or issue to be aware of]
|
|
106
|
+
- [Dependency or integration concern]
|
|
107
|
+
|
|
108
|
+
### Pending Decisions
|
|
109
|
+
[None | Decisions that need user input]
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
*Start a new session for fresh context.*
|
|
114
|
+
*Run the command above to continue.*
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Handoff Generation Rules
|
|
118
|
+
|
|
119
|
+
### What to Include
|
|
120
|
+
- All tasks completed this session
|
|
121
|
+
- Key decisions with rationale
|
|
122
|
+
- Exact workflow position
|
|
123
|
+
- Files modified with descriptions
|
|
124
|
+
- Critical context for continuation
|
|
125
|
+
- Explicit next steps
|
|
126
|
+
|
|
127
|
+
### What NOT to Include
|
|
128
|
+
- Full file contents (just paths)
|
|
129
|
+
- Detailed implementation code
|
|
130
|
+
- Speculation about future work
|
|
131
|
+
- Information already in SPEC/BLUEPRINT/CHRONICLE
|
|
132
|
+
|
|
133
|
+
### Context Summary Guidelines
|
|
134
|
+
The context summary should be:
|
|
135
|
+
- **Concise**: 2-4 sentences max
|
|
136
|
+
- **Actionable**: Focus on what matters for next task
|
|
137
|
+
- **Specific**: Mention actual file names, patterns, decisions
|
|
138
|
+
- **Fresh**: Don't repeat what's in planning files
|
|
139
|
+
|
|
140
|
+
**Good example**:
|
|
141
|
+
> "Auth service implemented in src/auth/ using jose for JWT. Decided to use 24h expiry with refresh tokens stored in httpOnly cookies. Note: existing session.ts has a conflict with our middleware - need to refactor the order in next session."
|
|
142
|
+
|
|
143
|
+
**Bad example**:
|
|
144
|
+
> "Made good progress on auth. Some things were implemented. There might be some issues to look at."
|
|
145
|
+
|
|
146
|
+
## Integration with Other Files
|
|
147
|
+
|
|
148
|
+
### CHRONICLE.md Update
|
|
149
|
+
Before generating HANDOFF.md:
|
|
150
|
+
```markdown
|
|
151
|
+
## Session [date]
|
|
152
|
+
|
|
153
|
+
### Completed
|
|
154
|
+
- Task 2.1: [description] (commit: abc123)
|
|
155
|
+
- Task 2.2: [description] (commit: def456)
|
|
156
|
+
|
|
157
|
+
### State
|
|
158
|
+
- Wave 2: 2/4 tasks complete
|
|
159
|
+
- Next: Task 2.3
|
|
160
|
+
|
|
161
|
+
### Handoff Generated
|
|
162
|
+
See: .goopspec/HANDOFF.md
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### STATE.md Update
|
|
166
|
+
Human-readable state mirror:
|
|
167
|
+
```markdown
|
|
168
|
+
# Current State
|
|
169
|
+
|
|
170
|
+
**Phase:** execute
|
|
171
|
+
**Wave:** 2 of 3
|
|
172
|
+
**Task:** 3 of 4
|
|
173
|
+
**Last Updated:** [timestamp]
|
|
174
|
+
|
|
175
|
+
## Quick Resume
|
|
176
|
+
Run `/goop-execute` to continue Wave 2.
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Memory Persistence
|
|
180
|
+
Before handoff:
|
|
181
|
+
```typescript
|
|
182
|
+
memory_save({
|
|
183
|
+
type: "observation",
|
|
184
|
+
title: "Session handoff: [feature]",
|
|
185
|
+
content: "[key context for future sessions]",
|
|
186
|
+
concepts: ["handoff", "feature-name", "phase"],
|
|
187
|
+
importance: 0.7
|
|
188
|
+
})
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Agent Responsibilities
|
|
192
|
+
|
|
193
|
+
### Orchestrator
|
|
194
|
+
- Detect handoff points
|
|
195
|
+
- Generate HANDOFF.md
|
|
196
|
+
- Update CHRONICLE.md
|
|
197
|
+
- Suggest new session to user
|
|
198
|
+
|
|
199
|
+
### Subagents
|
|
200
|
+
- Return `suggest_new_session: true` in XML when:
|
|
201
|
+
- Complex task completed
|
|
202
|
+
- Significant context accumulated
|
|
203
|
+
- Natural pause point reached
|
|
204
|
+
- Include handoff-ready summary in response
|
|
205
|
+
|
|
206
|
+
## User Communication
|
|
207
|
+
|
|
208
|
+
### At Handoff Point
|
|
209
|
+
```markdown
|
|
210
|
+
## Session Checkpoint
|
|
211
|
+
|
|
212
|
+
I've completed [summary of work] and saved the state.
|
|
213
|
+
|
|
214
|
+
**Current position:** Phase [X], Wave [N], Task [M]
|
|
215
|
+
|
|
216
|
+
### To Continue
|
|
217
|
+
1. Start a **new session** for fresh context
|
|
218
|
+
2. Run: `/goop-execute`
|
|
219
|
+
|
|
220
|
+
The new session will have:
|
|
221
|
+
- Full 200k context window
|
|
222
|
+
- All state from HANDOFF.md
|
|
223
|
+
- Clear next steps
|
|
224
|
+
|
|
225
|
+
### Files Saved
|
|
226
|
+
- `.goopspec/HANDOFF.md` - Session handoff
|
|
227
|
+
- `.goopspec/CHRONICLE.md` - Progress log
|
|
228
|
+
- `.goopspec/STATE.md` - Current state
|
|
229
|
+
|
|
230
|
+
Ready to continue in new session!
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Quick Resume (Same Session)
|
|
234
|
+
If user wants to continue without new session:
|
|
235
|
+
```markdown
|
|
236
|
+
Continuing in current session.
|
|
237
|
+
|
|
238
|
+
**Note:** Context is at [X]% - quality may degrade with complex tasks.
|
|
239
|
+
Consider starting fresh if encountering issues.
|
|
240
|
+
|
|
241
|
+
Proceeding with Task [N]...
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Anti-Patterns
|
|
245
|
+
|
|
246
|
+
### Bad: No Context in Handoff
|
|
247
|
+
```markdown
|
|
248
|
+
## Next Session
|
|
249
|
+
Run /goop-execute
|
|
250
|
+
```
|
|
251
|
+
**Problem**: Next session has no context about what happened.
|
|
252
|
+
|
|
253
|
+
### Bad: Too Much Detail
|
|
254
|
+
```markdown
|
|
255
|
+
## Context Summary
|
|
256
|
+
[500 lines of implementation details]
|
|
257
|
+
```
|
|
258
|
+
**Problem**: Defeats the purpose of clean handoff.
|
|
259
|
+
|
|
260
|
+
### Bad: Missing Next Steps
|
|
261
|
+
```markdown
|
|
262
|
+
## Completed
|
|
263
|
+
- Task 1
|
|
264
|
+
- Task 2
|
|
265
|
+
```
|
|
266
|
+
**Problem**: Next session doesn't know what to do.
|
|
267
|
+
|
|
268
|
+
### Good: Clean and Actionable
|
|
269
|
+
```markdown
|
|
270
|
+
## Next Session Instructions
|
|
271
|
+
|
|
272
|
+
### Command to Run
|
|
273
|
+
/goop-execute
|
|
274
|
+
|
|
275
|
+
### Context Summary
|
|
276
|
+
Completed auth service with JWT. Using jose library, 24h expiry.
|
|
277
|
+
Middleware in src/auth/middleware.ts protects routes.
|
|
278
|
+
Next: Add refresh token logic to extend sessions.
|
|
279
|
+
|
|
280
|
+
### Immediate Next Task
|
|
281
|
+
**Task:** W2.T3 - Implement refresh tokens
|
|
282
|
+
**Files:** src/auth/refresh.ts, src/auth/service.ts
|
|
283
|
+
**Action:** Add refresh endpoint and token rotation
|
|
284
|
+
**Verify:** bun test src/auth/
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
*Handoff Protocol v0.1.4*
|
|
290
|
+
*"Fresh context, quality work."*
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Interactive Questioning Protocol
|
|
2
|
+
|
|
3
|
+
**GoopSpec Voice:** Direct, Purposeful, Memory-First.
|
|
4
|
+
|
|
5
|
+
We use interactive questioning to trade ambiguity for clarity without halting momentum. Every question must earn its right to interrupt the user.
|
|
6
|
+
|
|
7
|
+
## Core Philosophy
|
|
8
|
+
|
|
9
|
+
1. **Memory First:** Never ask what you already know.
|
|
10
|
+
2. **Gate-Oriented:** Questions should drive towards a Decision Gate (Contract, Checkpoint, Acceptance).
|
|
11
|
+
3. **Skill-Backed:** Use skills to frame questions intelligently, not just to gather data.
|
|
12
|
+
4. **Progressive:** Start high-level; drill down only when necessary.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 1. Memory-Aware Questioning
|
|
17
|
+
|
|
18
|
+
Before formulating a question, you **MUST** search memory.
|
|
19
|
+
|
|
20
|
+
### The Protocol
|
|
21
|
+
1. **Search:** `memory_search({ query: "[topic] preference" })`
|
|
22
|
+
2. **Evaluate:** Do I have a high-confidence answer (Importance > 7)?
|
|
23
|
+
3. **Action:**
|
|
24
|
+
* **High Confidence:** Use it. Inform user: "Using saved preference for X."
|
|
25
|
+
* **Medium Confidence:** Confirm. "I recall you prefer X. Still true?"
|
|
26
|
+
* **No Data:** Ask. Then **SAVE** the answer.
|
|
27
|
+
|
|
28
|
+
### Examples
|
|
29
|
+
|
|
30
|
+
**❌ Bad (Amnesic):**
|
|
31
|
+
> "What database should we use?"
|
|
32
|
+
*(User has answered this 5 times before)*
|
|
33
|
+
|
|
34
|
+
**✅ Good (Memory-Aware):**
|
|
35
|
+
> ⬢ **Memory Recall:** You prefer **PostgreSQL** for new services.
|
|
36
|
+
> Proceeding with Postgres? [Y/n]
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 2. Skill-Aware Questioning
|
|
41
|
+
|
|
42
|
+
Don't just ask "What do you want?". Use loaded skills to provide *informed options*.
|
|
43
|
+
|
|
44
|
+
### The Protocol
|
|
45
|
+
1. **Consult Skill:** Use `research` or `security` or `architecture` skills to analyze the situation.
|
|
46
|
+
2. **Frame Options:** Present choices based on expert analysis.
|
|
47
|
+
3. **Ask:** specific, constrained questions.
|
|
48
|
+
|
|
49
|
+
### Examples
|
|
50
|
+
|
|
51
|
+
**❌ Bad (Generic):**
|
|
52
|
+
> "How should we handle authentication?"
|
|
53
|
+
|
|
54
|
+
**✅ Good (Skill-Backed - Security):**
|
|
55
|
+
> ⬢ **Security Skill Analysis:**
|
|
56
|
+
> For this stack, I recommend **OAuth2 with PKCE** for these reasons:
|
|
57
|
+
> 1. Matches your security baseline.
|
|
58
|
+
> 2. Best support for mobile clients.
|
|
59
|
+
>
|
|
60
|
+
> **Decision:** Implement OAuth2? [Y/n] or "Explain alternatives"
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 3. Decision Gates
|
|
65
|
+
|
|
66
|
+
Use formal Gates for high-impact questions. Stop the world.
|
|
67
|
+
|
|
68
|
+
### Contract Gate (Planning Phase)
|
|
69
|
+
*Must resolve scope before work begins.*
|
|
70
|
+
|
|
71
|
+
> **Question:** "Are these MUST-HAVES correct and complete?"
|
|
72
|
+
> **Trigger:** `/goop-specify`
|
|
73
|
+
> **Action:** Lock SPEC.md upon confirmation.
|
|
74
|
+
|
|
75
|
+
### Checkpoint Gate (Execution Phase)
|
|
76
|
+
*Stop for architectural forks in the road.*
|
|
77
|
+
|
|
78
|
+
> **Question:** "I found two valid patterns. A is faster, B is more scalable. Which path?"
|
|
79
|
+
> **Trigger:** Rule 4 (Architectural Decision).
|
|
80
|
+
> **Action:** Wait for user selection.
|
|
81
|
+
|
|
82
|
+
### Acceptance Gate (Completion Phase)
|
|
83
|
+
*Verify completion against the contract.*
|
|
84
|
+
|
|
85
|
+
> **Question:** "I have verified requirements A, B, and C. Ready to accept?"
|
|
86
|
+
> **Trigger:** `/goop-accept`
|
|
87
|
+
> **Action:** Archive task and update memory.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 4. Progressive Disclosure
|
|
92
|
+
|
|
93
|
+
Don't wall-of-text the user. Reveal complexity in layers.
|
|
94
|
+
|
|
95
|
+
### Level 1: The "Happy Path" Proposal
|
|
96
|
+
State the most likely path and ask for confirmation.
|
|
97
|
+
> "I plan to use **React Hook Form** for this form. Proceed?"
|
|
98
|
+
|
|
99
|
+
### Level 2: The Fork
|
|
100
|
+
If rejected or ambiguous, offer distinct high-level options.
|
|
101
|
+
> "Okay. Options:
|
|
102
|
+
> 1. **React Hook Form** (Standard, performant)
|
|
103
|
+
> 2. **Formik** (Legacy compatibility)
|
|
104
|
+
> 3. **Raw State** (Simple forms only)"
|
|
105
|
+
|
|
106
|
+
### Level 3: The Deep Dive
|
|
107
|
+
Only if requested, show full tradeoffs.
|
|
108
|
+
> "Here is the detailed comparison of bundle size, re-render performance, and API surface..."
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Checklist: Before You Ask
|
|
113
|
+
|
|
114
|
+
- [ ] **Did I search memory?** (Don't be amnesic)
|
|
115
|
+
- [ ] **Is this a "One-Way Door" decision?** (If yes, use a Gate)
|
|
116
|
+
- [ ] **Can I propose a default instead?** (Bias for action)
|
|
117
|
+
- [ ] **Is the question binary or multiple choice?** (Reduce cognitive load)
|
|
118
|
+
- [ ] **Am I ready to save the answer?** (Build the knowledge base)
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
**Remember:** Every question is a context switch. Make it count.
|
|
@@ -14,7 +14,7 @@ Model profiles control which model each GoopSpec agent uses. This enables optima
|
|
|
14
14
|
| goop-orchestrator | anthropic/claude-opus-4-5 | Complex orchestration, task delegation, context management |
|
|
15
15
|
| goop-planner | anthropic/claude-opus-4-5 | Best for complex architecture decisions, goal decomposition, reasoning-heavy planning |
|
|
16
16
|
| goop-researcher | openai/gpt-5.2 | Best for research, technology evaluation, knowledge synthesis |
|
|
17
|
-
| goop-tester |
|
|
17
|
+
| goop-tester | kimi-for-coding/k2p5 | Cost-effective for test writing, quality assurance, coverage thinking |
|
|
18
18
|
| goop-verifier | openai/gpt-5.2-codex | Best for code verification, security analysis, catching subtle bugs |
|
|
19
19
|
| goop-writer | google/antigravity-gemini-3-pro-high | Documentation, structured writing, comprehensive coverage |
|
|
20
20
|
| memory-distiller | anthropic/claude-haiku-3-5 | Fast, lightweight distillation of events into structured memories |
|