opencode-goopspec 0.1.0
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/LICENSE +21 -0
- package/README.md +650 -0
- package/agents/goop-debugger.md +265 -0
- package/agents/goop-designer.md +244 -0
- package/agents/goop-executor.md +217 -0
- package/agents/goop-explorer.md +252 -0
- package/agents/goop-librarian.md +197 -0
- package/agents/goop-orchestrator.md +224 -0
- package/agents/goop-planner.md +231 -0
- package/agents/goop-researcher.md +246 -0
- package/agents/goop-tester.md +245 -0
- package/agents/goop-verifier.md +266 -0
- package/agents/goop-writer.md +293 -0
- package/agents/memory-distiller.md +226 -0
- package/commands/goop-accept.md +183 -0
- package/commands/goop-amend.md +175 -0
- package/commands/goop-complete.md +206 -0
- package/commands/goop-debug.md +318 -0
- package/commands/goop-discuss.md +138 -0
- package/commands/goop-execute.md +137 -0
- package/commands/goop-help.md +82 -0
- package/commands/goop-map-codebase.md +501 -0
- package/commands/goop-memory.md +66 -0
- package/commands/goop-milestone.md +213 -0
- package/commands/goop-pause.md +61 -0
- package/commands/goop-plan.md +78 -0
- package/commands/goop-quick.md +165 -0
- package/commands/goop-recall.md +48 -0
- package/commands/goop-remember.md +71 -0
- package/commands/goop-research.md +98 -0
- package/commands/goop-resume.md +57 -0
- package/commands/goop-setup.md +208 -0
- package/commands/goop-specify.md +145 -0
- package/commands/goop-status.md +153 -0
- package/dist/index.js +31017 -0
- package/dist/memory/index.js +48752 -0
- package/package.json +73 -0
- package/references/agent-patterns.md +334 -0
- package/references/boundary-system.md +141 -0
- package/references/deviation-rules.md +80 -0
- package/references/dispatch-patterns.md +176 -0
- package/references/model-profiles.md +109 -0
- package/references/orchestrator-philosophy.md +280 -0
- package/references/security-checklist.md +163 -0
- package/references/subagent-protocol.md +393 -0
- package/references/tdd.md +231 -0
- package/references/ui-brand.md +261 -0
- package/references/workflow-accept.md +325 -0
- package/references/workflow-execute.md +315 -0
- package/references/workflow-plan.md +179 -0
- package/references/workflow-research.md +234 -0
- package/references/workflow-specify.md +278 -0
- package/skills/README.md +362 -0
- package/skills/accessibility/skill.md +41 -0
- package/skills/accessibility-testing/skill.md +47 -0
- package/skills/api-docs/skill.md +50 -0
- package/skills/architecture-design/skill.md +168 -0
- package/skills/atomic-commits/skill.md +53 -0
- package/skills/code-review/skill.md +59 -0
- package/skills/codebase-mapping/skill.md +54 -0
- package/skills/convention-detection/skill.md +68 -0
- package/skills/debugging/skill.md +59 -0
- package/skills/deviation-handling/skill.md +187 -0
- package/skills/documentation/skill.md +213 -0
- package/skills/goop-core/skill.md +383 -0
- package/skills/memory-usage/skill.md +208 -0
- package/skills/parallel-planning/skill.md +170 -0
- package/skills/pattern-extraction/skill.md +73 -0
- package/skills/performance-optimization/skill.md +188 -0
- package/skills/playwright/skill.md +69 -0
- package/skills/playwright-testing/skill.md +93 -0
- package/skills/progress-tracking/skill.md +155 -0
- package/skills/readme-generation/skill.md +87 -0
- package/skills/research/skill.md +161 -0
- package/skills/responsive-design/skill.md +76 -0
- package/skills/scientific-method/skill.md +67 -0
- package/skills/security-audit/skill.md +152 -0
- package/skills/task-decomposition/skill.md +153 -0
- package/skills/task-delegation/skill.md +127 -0
- package/skills/technical-writing/skill.md +69 -0
- package/skills/testing/skill.md +202 -0
- package/skills/ui-design/skill.md +73 -0
- package/skills/ux-patterns/skill.md +82 -0
- package/skills/verification/skill.md +178 -0
- package/skills/visual-regression/skill.md +86 -0
- package/templates/blueprint.md +141 -0
- package/templates/chronicle.md +156 -0
- package/templates/milestone.md +131 -0
- package/templates/research.md +117 -0
- package/templates/retrospective.md +188 -0
- package/templates/spec.md +103 -0
- package/templates/summary.md +202 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Agent Dispatch Patterns
|
|
2
|
+
|
|
3
|
+
GoopSpec supports multiple patterns for spawning and coordinating specialized agents. Choose the right pattern based on task characteristics.
|
|
4
|
+
|
|
5
|
+
## Dispatch Modes
|
|
6
|
+
|
|
7
|
+
### Sequential Dispatch
|
|
8
|
+
|
|
9
|
+
**When:** Tasks have strict dependencies, order matters.
|
|
10
|
+
|
|
11
|
+
**Pattern:**
|
|
12
|
+
```
|
|
13
|
+
Task A → Complete → Task B → Complete → Task C
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
**Use for:**
|
|
17
|
+
- Database migrations before schema-dependent code
|
|
18
|
+
- Build before deploy
|
|
19
|
+
- Test before commit
|
|
20
|
+
- Setup before configuration
|
|
21
|
+
|
|
22
|
+
**Example:**
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mode": "sequential",
|
|
26
|
+
"agents": [
|
|
27
|
+
{ "agent": "planner", "task": "Create migration plan" },
|
|
28
|
+
{ "agent": "executor", "task": "Run migrations" },
|
|
29
|
+
{ "agent": "verifier", "task": "Verify schema" }
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Parallel Dispatch
|
|
35
|
+
|
|
36
|
+
**When:** Tasks are independent, can run concurrently.
|
|
37
|
+
|
|
38
|
+
**Pattern:**
|
|
39
|
+
```
|
|
40
|
+
┌─ Task A ─┐
|
|
41
|
+
Start ─┼─ Task B ─┼─ Merge
|
|
42
|
+
└─ Task C ─┘
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Use for:**
|
|
46
|
+
- Independent feature implementations
|
|
47
|
+
- Multiple test suites
|
|
48
|
+
- Documentation + implementation
|
|
49
|
+
- Research across different domains
|
|
50
|
+
|
|
51
|
+
**Example:**
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"mode": "parallel",
|
|
55
|
+
"max_concurrent": 3,
|
|
56
|
+
"agents": [
|
|
57
|
+
{ "agent": "executor", "task": "Implement auth module" },
|
|
58
|
+
{ "agent": "executor", "task": "Implement user module" },
|
|
59
|
+
{ "agent": "tester", "task": "Write integration tests" }
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Background Dispatch
|
|
65
|
+
|
|
66
|
+
**When:** Long-running tasks that shouldn't block main flow.
|
|
67
|
+
|
|
68
|
+
**Pattern:**
|
|
69
|
+
```
|
|
70
|
+
Main Flow ───────────────────────────────►
|
|
71
|
+
↓
|
|
72
|
+
Background Task ──────► Notify on complete
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Use for:**
|
|
76
|
+
- Research tasks
|
|
77
|
+
- Large test suites
|
|
78
|
+
- Documentation generation
|
|
79
|
+
- Code analysis
|
|
80
|
+
|
|
81
|
+
**Example:**
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"mode": "background",
|
|
85
|
+
"agent": "researcher",
|
|
86
|
+
"task": "Research authentication best practices",
|
|
87
|
+
"notify_on_complete": true
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Agent Selection
|
|
92
|
+
|
|
93
|
+
### By Task Type
|
|
94
|
+
|
|
95
|
+
| Task Type | Primary Agent | Fallback |
|
|
96
|
+
|-----------|--------------|----------|
|
|
97
|
+
| Planning | goop-planner | goop-orchestrator |
|
|
98
|
+
| Implementation | goop-executor | goop-orchestrator |
|
|
99
|
+
| Verification | goop-verifier | goop-tester |
|
|
100
|
+
| Research | goop-researcher | goop-explorer |
|
|
101
|
+
| Documentation | goop-writer | goop-orchestrator |
|
|
102
|
+
| Debugging | goop-debugger | goop-executor |
|
|
103
|
+
| UI/UX | goop-designer | goop-executor |
|
|
104
|
+
| Testing | goop-tester | goop-verifier |
|
|
105
|
+
|
|
106
|
+
### By Complexity
|
|
107
|
+
|
|
108
|
+
| Complexity | Model Profile | Context Budget |
|
|
109
|
+
|------------|--------------|----------------|
|
|
110
|
+
| Simple | budget | 40% |
|
|
111
|
+
| Standard | balanced | 60% |
|
|
112
|
+
| Complex | quality | 80% |
|
|
113
|
+
| Critical | quality + thinking | 90% |
|
|
114
|
+
|
|
115
|
+
## Wave Execution
|
|
116
|
+
|
|
117
|
+
Plans are grouped into waves for efficient parallel execution:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
Wave 1: Foundation (sequential dependencies)
|
|
121
|
+
├─ Plan A (infrastructure)
|
|
122
|
+
└─ Plan B (database setup)
|
|
123
|
+
|
|
124
|
+
Wave 2: Features (parallel, depends on Wave 1)
|
|
125
|
+
├─ Plan C (auth feature)
|
|
126
|
+
├─ Plan D (user feature)
|
|
127
|
+
└─ Plan E (API feature)
|
|
128
|
+
|
|
129
|
+
Wave 3: Integration (depends on Wave 2)
|
|
130
|
+
└─ Plan F (integration tests)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Wave Metadata
|
|
134
|
+
|
|
135
|
+
Each plan specifies its wave in frontmatter:
|
|
136
|
+
```yaml
|
|
137
|
+
---
|
|
138
|
+
wave: 2
|
|
139
|
+
depends_on: [plan-a, plan-b]
|
|
140
|
+
autonomous: true
|
|
141
|
+
---
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Fresh Context Strategy
|
|
145
|
+
|
|
146
|
+
**When to spawn fresh agents:**
|
|
147
|
+
1. Context usage exceeds 70%
|
|
148
|
+
2. Switching to different task domain
|
|
149
|
+
3. Starting a new phase
|
|
150
|
+
4. After checkpoint restoration
|
|
151
|
+
|
|
152
|
+
**Context handoff:**
|
|
153
|
+
- Pass essential state (phase, spec, todos)
|
|
154
|
+
- Include recent ADL decisions
|
|
155
|
+
- Summarize previous progress
|
|
156
|
+
- Exclude verbose logs
|
|
157
|
+
|
|
158
|
+
## Error Handling
|
|
159
|
+
|
|
160
|
+
### On Agent Failure
|
|
161
|
+
|
|
162
|
+
1. Log failure to state
|
|
163
|
+
2. Save checkpoint
|
|
164
|
+
3. Attempt recovery:
|
|
165
|
+
- Retry with fresh context
|
|
166
|
+
- Fallback to different agent
|
|
167
|
+
- Escalate to user
|
|
168
|
+
|
|
169
|
+
### On Timeout
|
|
170
|
+
|
|
171
|
+
1. Check for partial progress
|
|
172
|
+
2. Save checkpoint with partial state
|
|
173
|
+
3. Notify user with options:
|
|
174
|
+
- Resume from checkpoint
|
|
175
|
+
- Retry task
|
|
176
|
+
- Skip and continue
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Model Profiles
|
|
2
|
+
|
|
3
|
+
Model profiles control which model each GoopSpec agent uses. This enables optimal performance by matching cognitive tasks to the best-suited models.
|
|
4
|
+
|
|
5
|
+
## Default Model Assignments
|
|
6
|
+
|
|
7
|
+
| Agent | Model | Rationale |
|
|
8
|
+
|-------|-------|-----------|
|
|
9
|
+
| goop-debugger | openai/gpt-5.2-codex | Best for code-heavy debugging, hypothesis testing, evidence-based analysis |
|
|
10
|
+
| goop-designer | anthropic/claude-opus-4-5 | Best for visual design, UI/UX reasoning, component architecture decisions |
|
|
11
|
+
| goop-executor | openai/gpt-5.2-codex | Best for code implementation, atomic commits, clean patterns |
|
|
12
|
+
| goop-explorer | google/antigravity-gemini-3-flash | Fast codebase mapping, pattern detection, lightweight exploration |
|
|
13
|
+
| goop-librarian | openai/gpt-5.2 | Best for information retrieval, documentation search, code search |
|
|
14
|
+
| goop-orchestrator | anthropic/claude-opus-4-5 | Complex orchestration, task delegation, context management |
|
|
15
|
+
| goop-planner | anthropic/claude-opus-4-5 | Best for complex architecture decisions, goal decomposition, reasoning-heavy planning |
|
|
16
|
+
| goop-researcher | openai/gpt-5.2 | Best for research, technology evaluation, knowledge synthesis |
|
|
17
|
+
| goop-tester | opencode/kimi-k2.5-free | Cost-effective for test writing, quality assurance, coverage thinking |
|
|
18
|
+
| goop-verifier | openai/gpt-5.2-codex | Best for code verification, security analysis, catching subtle bugs |
|
|
19
|
+
| goop-writer | google/antigravity-gemini-3-pro-high | Documentation, structured writing, comprehensive coverage |
|
|
20
|
+
| memory-distiller | anthropic/claude-haiku-3-5 | Fast, lightweight distillation of events into structured memories |
|
|
21
|
+
|
|
22
|
+
## Model Selection Philosophy
|
|
23
|
+
|
|
24
|
+
### Why GPT-5.2-Codex for Code Tasks?
|
|
25
|
+
Code-heavy tasks (debugging, execution, verification) benefit from Codex's specialized training. GPT-5.2-Codex excels at:
|
|
26
|
+
- Deep code understanding and generation
|
|
27
|
+
- Bug detection and hypothesis testing
|
|
28
|
+
- Security vulnerability analysis
|
|
29
|
+
- Clean, production-quality implementation
|
|
30
|
+
- Following coding patterns and conventions
|
|
31
|
+
|
|
32
|
+
### Why Claude Opus 4.5 for Planning & Orchestration?
|
|
33
|
+
Planning and orchestration require complex reasoning and decision-making. Opus 4.5 excels at:
|
|
34
|
+
- Complex reasoning about system design
|
|
35
|
+
- Identifying genuine dependencies vs false ones
|
|
36
|
+
- Creating comprehensive, executable plans
|
|
37
|
+
- Goal-backward verification derivation
|
|
38
|
+
- Task delegation and context management
|
|
39
|
+
- Visual/UI reasoning and component architecture
|
|
40
|
+
|
|
41
|
+
### Why GPT-5.2 for Research & Information Retrieval?
|
|
42
|
+
Research and information tasks benefit from GPT-5.2's broad knowledge and retrieval capabilities:
|
|
43
|
+
- Deep domain research and synthesis
|
|
44
|
+
- Technology evaluation and comparison
|
|
45
|
+
- Documentation and code search
|
|
46
|
+
- Information extraction and organization
|
|
47
|
+
- Knowledge synthesis across sources
|
|
48
|
+
|
|
49
|
+
### Why Gemini 3 Flash for Lightweight Tasks?
|
|
50
|
+
Fast, lightweight tasks benefit from Gemini 3 Flash's speed and efficiency:
|
|
51
|
+
- Fast codebase scanning and mapping
|
|
52
|
+
- Quick pattern extraction
|
|
53
|
+
- Status checks and session management
|
|
54
|
+
- Low cost for frequent operations
|
|
55
|
+
- Excellent speed-to-quality ratio
|
|
56
|
+
|
|
57
|
+
### Why Gemini 3 Pro High for Writing?
|
|
58
|
+
Documentation and writing tasks benefit from Gemini 3 Pro High's comprehensive coverage:
|
|
59
|
+
- Structured documentation generation
|
|
60
|
+
- Technical writing with clarity
|
|
61
|
+
- Comprehensive coverage of topics
|
|
62
|
+
- Memory persistence and note-taking
|
|
63
|
+
- Milestone completion summaries
|
|
64
|
+
|
|
65
|
+
### Why Kimi K2.5 Free for Testing?
|
|
66
|
+
Testing tasks can use cost-effective models while maintaining quality:
|
|
67
|
+
- Test writing and quality assurance
|
|
68
|
+
- Coverage thinking and edge cases
|
|
69
|
+
- Cost-effective for frequent test generation
|
|
70
|
+
- Good enough quality for test scenarios
|
|
71
|
+
|
|
72
|
+
## Override Configuration
|
|
73
|
+
|
|
74
|
+
Users can override models for specific scenarios in goopspec.json:
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"models": {
|
|
79
|
+
"planner": "anthropic/claude-opus-4-5",
|
|
80
|
+
"executor": "openai/gpt-5.2-codex",
|
|
81
|
+
"overrides": {
|
|
82
|
+
"security_review": "openai/gpt-5.2-codex",
|
|
83
|
+
"performance_audit": "openai/gpt-5.2-codex",
|
|
84
|
+
"refactor": "openai/gpt-5.2-codex",
|
|
85
|
+
"quick_fix": "openai/gpt-5.2-codex",
|
|
86
|
+
"research": "openai/gpt-5.2",
|
|
87
|
+
"documentation": "google/antigravity-gemini-3-pro-high"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Resolution Logic
|
|
94
|
+
|
|
95
|
+
1. Check for scenario override (security_review, quick_fix, etc.)
|
|
96
|
+
2. If override exists, use that model
|
|
97
|
+
3. Otherwise, use default agent model
|
|
98
|
+
4. Pass model parameter to Task tool when spawning
|
|
99
|
+
|
|
100
|
+
## Cost vs Quality Trade-offs
|
|
101
|
+
|
|
102
|
+
| Scenario | Recommended Model | Reason |
|
|
103
|
+
|----------|-------------------|--------|
|
|
104
|
+
| Budget constrained | Use Gemini 3 Flash for exploration, Kimi K2.5 Free for testing | Lowest cost while maintaining quality |
|
|
105
|
+
| Maximum quality | Use GPT-5.2-Codex for code, Opus 4.5 for planning | Best performance per task type |
|
|
106
|
+
| Balanced (default) | As per default assignments | Smart allocation per task type |
|
|
107
|
+
| Security critical | Use GPT-5.2-Codex for verification | Strong security analysis capabilities |
|
|
108
|
+
| Research intensive | Use GPT-5.2 for research and information retrieval | Best for knowledge synthesis |
|
|
109
|
+
| Documentation heavy | Use Gemini 3 Pro High for writing | Comprehensive coverage and clarity |
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
# The Orchestrator Philosophy
|
|
2
|
+
|
|
3
|
+
The orchestrator is a **CONDUCTOR** - it coordinates the orchestra but never plays an instrument.
|
|
4
|
+
|
|
5
|
+
## Core Principle
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
╔════════════════════════════════════════════════════════════════╗
|
|
9
|
+
║ THE ORCHESTRATOR NEVER WRITES CODE. ║
|
|
10
|
+
║ It coordinates, delegates, tracks, and decides. ║
|
|
11
|
+
║ All implementation happens in subagent contexts. ║
|
|
12
|
+
╚════════════════════════════════════════════════════════════════╝
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Why This Matters
|
|
16
|
+
|
|
17
|
+
### The Context Problem
|
|
18
|
+
|
|
19
|
+
The orchestrator's context window is PRECIOUS:
|
|
20
|
+
- ~200k tokens total
|
|
21
|
+
- Every line of code consumes context
|
|
22
|
+
- Code details cause "context rot"
|
|
23
|
+
- Orchestration quality degrades as context fills
|
|
24
|
+
|
|
25
|
+
### The Solution: Subagent Contexts
|
|
26
|
+
|
|
27
|
+
Each delegated task runs in a FRESH context:
|
|
28
|
+
- Subagents get full 200k for their task
|
|
29
|
+
- Implementation details stay contained
|
|
30
|
+
- Orchestrator context stays clean
|
|
31
|
+
- Consistent coordination quality throughout
|
|
32
|
+
|
|
33
|
+
### The Orchestra Metaphor
|
|
34
|
+
|
|
35
|
+
A conductor:
|
|
36
|
+
- Reads the score (specification)
|
|
37
|
+
- Directs each section (delegates to agents)
|
|
38
|
+
- Listens for harmony (verifies outcomes)
|
|
39
|
+
- Adjusts tempo (manages flow)
|
|
40
|
+
- NEVER picks up a violin
|
|
41
|
+
|
|
42
|
+
## Hard Rules
|
|
43
|
+
|
|
44
|
+
### NEVER Do
|
|
45
|
+
|
|
46
|
+
| Action | Why |
|
|
47
|
+
|--------|-----|
|
|
48
|
+
| Use Edit tool on code files | That's executor's job |
|
|
49
|
+
| Use Write tool for implementation | Delegate instead |
|
|
50
|
+
| "Quickly fix" something | Creates context debt |
|
|
51
|
+
| Write code in responses | Use delegation |
|
|
52
|
+
| Say "let me just..." and implement | Always delegate |
|
|
53
|
+
| Inline "small" changes | No change is small enough |
|
|
54
|
+
|
|
55
|
+
### ALWAYS Do
|
|
56
|
+
|
|
57
|
+
| Action | Why |
|
|
58
|
+
|--------|-----|
|
|
59
|
+
| Delegate ALL code work | Keeps context clean |
|
|
60
|
+
| Track in CHRONICLE.md | Maintains state |
|
|
61
|
+
| Use memory tools | Persists decisions |
|
|
62
|
+
| Spawn fresh agents | Fresh context per task |
|
|
63
|
+
| Coordinate through files | Async communication |
|
|
64
|
+
| Verify outcomes, not process | Trust but verify |
|
|
65
|
+
|
|
66
|
+
## Permitted Actions
|
|
67
|
+
|
|
68
|
+
The orchestrator CAN directly:
|
|
69
|
+
|
|
70
|
+
### Read Operations
|
|
71
|
+
- Read SPEC.md, BLUEPRINT.md, CHRONICLE.md
|
|
72
|
+
- Search codebase (exploration)
|
|
73
|
+
- Check file existence
|
|
74
|
+
- Read configuration
|
|
75
|
+
- Search memory
|
|
76
|
+
|
|
77
|
+
### Coordination Operations
|
|
78
|
+
- Create/update SPEC.md
|
|
79
|
+
- Create/update BLUEPRINT.md
|
|
80
|
+
- Update CHRONICLE.md status
|
|
81
|
+
- Write to memory
|
|
82
|
+
- Delegate to agents
|
|
83
|
+
- Track todos
|
|
84
|
+
|
|
85
|
+
### Decision Operations
|
|
86
|
+
- Apply deviation rules
|
|
87
|
+
- Route tasks to agents
|
|
88
|
+
- Determine phase transitions
|
|
89
|
+
- Present gates to user
|
|
90
|
+
|
|
91
|
+
## Delegation Protocol
|
|
92
|
+
|
|
93
|
+
### When to Delegate
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
IF task involves writing/modifying code
|
|
97
|
+
→ DELEGATE to appropriate agent
|
|
98
|
+
|
|
99
|
+
IF task involves implementation decisions
|
|
100
|
+
→ DELEGATE to planner or researcher
|
|
101
|
+
|
|
102
|
+
IF task is purely coordination/tracking
|
|
103
|
+
→ HANDLE directly
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### How to Delegate
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
task({
|
|
110
|
+
subagent_type: "general",
|
|
111
|
+
description: "Execute task",
|
|
112
|
+
prompt: `
|
|
113
|
+
## TASK
|
|
114
|
+
[Clear, single task]
|
|
115
|
+
|
|
116
|
+
## CONTEXT
|
|
117
|
+
- SPEC: .goopspec/SPEC.md
|
|
118
|
+
- Task: Wave 2, Task 3
|
|
119
|
+
|
|
120
|
+
## FILES
|
|
121
|
+
- src/auth/login.ts (modify)
|
|
122
|
+
- src/auth/session.ts (create)
|
|
123
|
+
|
|
124
|
+
## REQUIREMENTS
|
|
125
|
+
[Explicit requirements from spec]
|
|
126
|
+
|
|
127
|
+
## CONSTRAINTS
|
|
128
|
+
[Technical constraints]
|
|
129
|
+
|
|
130
|
+
## ACCEPTANCE
|
|
131
|
+
[How to verify completion]
|
|
132
|
+
`
|
|
133
|
+
})
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Delegation Categories
|
|
137
|
+
|
|
138
|
+
| Category | Agent | Use When |
|
|
139
|
+
|----------|-------|----------|
|
|
140
|
+
| `code` | goop-executor | Implementation tasks |
|
|
141
|
+
| `plan` | goop-planner | Architecture, wave design |
|
|
142
|
+
| `research` | goop-researcher | Deep domain exploration |
|
|
143
|
+
| `explore` | goop-explorer | Codebase mapping |
|
|
144
|
+
| `search` | goop-librarian | Documentation lookup |
|
|
145
|
+
| `verify` | goop-verifier | Spec compliance checking |
|
|
146
|
+
| `debug` | goop-debugger | Bug investigation |
|
|
147
|
+
| `visual` | goop-designer | UI/UX work |
|
|
148
|
+
| `test` | goop-tester | Test writing |
|
|
149
|
+
| `docs` | goop-writer | Documentation |
|
|
150
|
+
|
|
151
|
+
## Context Management
|
|
152
|
+
|
|
153
|
+
### Signs of Context Rot
|
|
154
|
+
|
|
155
|
+
- Orchestrator starts "helping" with code
|
|
156
|
+
- Responses include implementation details
|
|
157
|
+
- Coordination quality decreasing
|
|
158
|
+
- Forgetting earlier decisions
|
|
159
|
+
- Contradicting previous statements
|
|
160
|
+
|
|
161
|
+
### Prevention
|
|
162
|
+
|
|
163
|
+
1. **Strict delegation** - Never write code
|
|
164
|
+
2. **Minimal responses** - Coordination only
|
|
165
|
+
3. **File-based state** - CHRONICLE.md for tracking
|
|
166
|
+
4. **Memory usage** - Persist decisions, don't repeat
|
|
167
|
+
5. **Fresh agents** - New context for new tasks
|
|
168
|
+
|
|
169
|
+
### Recovery
|
|
170
|
+
|
|
171
|
+
If context becomes polluted:
|
|
172
|
+
1. Save state to CHRONICLE.md
|
|
173
|
+
2. Save key decisions to memory
|
|
174
|
+
3. Start fresh orchestrator session
|
|
175
|
+
4. Load state from files + memory
|
|
176
|
+
|
|
177
|
+
## Orchestrator Mental Model
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
┌─────────────────────────────────────────────────────┐
|
|
181
|
+
│ ORCHESTRATOR │
|
|
182
|
+
│ │
|
|
183
|
+
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
|
|
184
|
+
│ │ SPEC.md │ │BLUEPRINT│ │CHRONICLE│ │
|
|
185
|
+
│ │ (What) │ │ (How) │ │ (State) │ │
|
|
186
|
+
│ └────┬────┘ └────┬────┘ └────┬────┘ │
|
|
187
|
+
│ │ │ │ │
|
|
188
|
+
│ └────────────┼────────────┘ │
|
|
189
|
+
│ │ │
|
|
190
|
+
│ ┌─────▼─────┐ │
|
|
191
|
+
│ │ DECISIONS │ │
|
|
192
|
+
│ └─────┬─────┘ │
|
|
193
|
+
│ │ │
|
|
194
|
+
│ ┌───────────────┼───────────────┐ │
|
|
195
|
+
│ ▼ ▼ ▼ │
|
|
196
|
+
│ delegate() delegate() delegate() │
|
|
197
|
+
│ │ │ │ │
|
|
198
|
+
└────┼───────────────┼───────────────┼──────────────┘
|
|
199
|
+
▼ ▼ ▼
|
|
200
|
+
┌─────────┐ ┌─────────┐ ┌─────────┐
|
|
201
|
+
│Executor │ │Researcher│ │Verifier │
|
|
202
|
+
│ (Code) │ │ (Learn) │ │ (Check) │
|
|
203
|
+
└─────────┘ └─────────┘ └─────────┘
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Common Mistakes
|
|
207
|
+
|
|
208
|
+
### Mistake 1: "Quick Fix"
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
❌ WRONG:
|
|
212
|
+
"Let me just fix that typo in the config..."
|
|
213
|
+
[Uses Edit tool]
|
|
214
|
+
|
|
215
|
+
✓ RIGHT:
|
|
216
|
+
"I'll delegate this fix to the executor."
|
|
217
|
+
[Uses delegate()]
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Mistake 2: "Showing Code"
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
❌ WRONG:
|
|
224
|
+
"Here's how the auth should look:
|
|
225
|
+
```typescript
|
|
226
|
+
export async function login() { ... }
|
|
227
|
+
```"
|
|
228
|
+
|
|
229
|
+
✓ RIGHT:
|
|
230
|
+
"The executor will implement login following the spec.
|
|
231
|
+
See SPEC.md for requirements."
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Mistake 3: "Helping Implementation"
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
❌ WRONG:
|
|
238
|
+
"The executor returned the code. Let me review and adjust..."
|
|
239
|
+
[Makes inline edits]
|
|
240
|
+
|
|
241
|
+
✓ RIGHT:
|
|
242
|
+
"Executor completed the task. Running verification.
|
|
243
|
+
If issues: delegate fixes back to executor."
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Trust the Orchestra
|
|
247
|
+
|
|
248
|
+
The orchestrator's power comes from:
|
|
249
|
+
- Clear specifications (the score)
|
|
250
|
+
- Quality delegation (clear instructions)
|
|
251
|
+
- Proper verification (listening to the result)
|
|
252
|
+
- Memory persistence (institutional knowledge)
|
|
253
|
+
|
|
254
|
+
NOT from:
|
|
255
|
+
- Doing the work itself
|
|
256
|
+
- Micromanaging implementation
|
|
257
|
+
- Having "all the context"
|
|
258
|
+
- Being "helpful" with code
|
|
259
|
+
|
|
260
|
+
## Summary
|
|
261
|
+
|
|
262
|
+
```
|
|
263
|
+
ORCHESTRATOR = CONDUCTOR
|
|
264
|
+
|
|
265
|
+
Does:
|
|
266
|
+
- Coordinate
|
|
267
|
+
- Delegate
|
|
268
|
+
- Track
|
|
269
|
+
- Decide
|
|
270
|
+
|
|
271
|
+
Does NOT:
|
|
272
|
+
- Code
|
|
273
|
+
- Implement
|
|
274
|
+
- "Help"
|
|
275
|
+
- "Fix"
|
|
276
|
+
|
|
277
|
+
Context is precious.
|
|
278
|
+
Keep it clean.
|
|
279
|
+
Trust your agents.
|
|
280
|
+
```
|