hail-hydra-cc 2.3.1 → 2.3.2
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 +99 -99
- package/bin/cli.js +105 -105
- package/files/SKILL.md +1217 -1174
- package/files/agents/hydra-analyst.md +159 -145
- package/files/agents/hydra-coder.md +137 -123
- package/files/agents/hydra-git.md +148 -130
- package/files/agents/hydra-guard.md +153 -135
- package/files/agents/hydra-preflight.md +22 -0
- package/files/agents/hydra-runner.md +107 -93
- package/files/agents/hydra-scout.md +241 -227
- package/files/agents/hydra-scribe.md +98 -84
- package/files/agents/hydra-sentinel-scan.md +242 -236
- package/files/agents/hydra-sentinel.md +210 -192
- package/files/commands/hydra/config.md +37 -37
- package/files/commands/hydra/guard.md +71 -71
- package/files/commands/hydra/help.md +47 -46
- package/files/commands/hydra/quiet.md +16 -16
- package/files/commands/hydra/status.md +85 -85
- package/files/commands/hydra/stfu.md +21 -0
- package/files/commands/hydra/verbose.md +29 -29
- package/files/hooks/hydra-auto-guard.js +54 -54
- package/files/hooks/hydra-check-update.js +99 -99
- package/files/hooks/hydra-statusline.js +128 -128
- package/files/hooks/hydra-token-math.js +1 -1
- package/files/references/model-capabilities.md +164 -164
- package/files/references/routing-guide.md +303 -303
- package/files/skills/stfu-agents/SKILL.md +59 -0
- package/package.json +1 -1
- package/src/files.js +106 -106
- package/src/installer.js +393 -393
- package/src/prompts.js +80 -80
|
@@ -1,303 +1,303 @@
|
|
|
1
|
-
# Routing Guide — Mandatory Delegation Examples
|
|
2
|
-
|
|
3
|
-
This reference provides concrete examples to see mandatory delegation in action.
|
|
4
|
-
Read this when you need to see how delegation rules apply to real tasks.
|
|
5
|
-
|
|
6
|
-
## Table of Contents
|
|
7
|
-
1. [ALWAYS Delegate — Haiku 4.5 Agents](#always-delegate-haiku)
|
|
8
|
-
2. [ALWAYS Delegate — Sonnet 4.6 Agents](#always-delegate-sonnet)
|
|
9
|
-
3. [ALWAYS Handle Yourself — Opus 4.6](#always-handle-yourself-opus)
|
|
10
|
-
4. [Compound Task Decomposition](#compound-tasks)
|
|
11
|
-
5. [Common Misclassifications](#common-misclassifications)
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## ALWAYS Delegate — Haiku 4.5 Agents
|
|
16
|
-
|
|
17
|
-
### hydra-scout (Haiku 4.5) examples
|
|
18
|
-
| User says | Route to | Why |
|
|
19
|
-
|-----------|----------|-----|
|
|
20
|
-
| "What framework is this project using?" | hydra-scout (Haiku 4.5) | Read package.json/config files |
|
|
21
|
-
| "Find where the login endpoint is defined" | hydra-scout (Haiku 4.5) | Grep for routes/endpoints |
|
|
22
|
-
| "How many files are in the src directory?" | hydra-scout (Haiku 4.5) | Glob + count |
|
|
23
|
-
| "Show me the database schema" | hydra-scout (Haiku 4.5) | Find and read schema/migration files |
|
|
24
|
-
| "What does the User model look like?" | hydra-scout (Haiku 4.5) | Find and read model definition |
|
|
25
|
-
| "Is there a rate limiter in this project?" | hydra-scout (Haiku 4.5) | Grep for rate limit patterns |
|
|
26
|
-
| "What version of React are we using?" | hydra-scout (Haiku 4.5) | Read package.json |
|
|
27
|
-
|
|
28
|
-
### hydra-runner (Haiku 4.5) examples
|
|
29
|
-
| User says | Route to | Why |
|
|
30
|
-
|-----------|----------|-----|
|
|
31
|
-
| "Run the tests" | hydra-runner (Haiku 4.5) | Execute test command, report results |
|
|
32
|
-
| "Does the build pass?" | hydra-runner (Haiku 4.5) | Run build, report success/failure |
|
|
33
|
-
| "Check if there are any lint errors" | hydra-runner (Haiku 4.5) | Run linter, report findings |
|
|
34
|
-
| "What's the git status?" | hydra-runner (Haiku 4.5) | Run git status/diff |
|
|
35
|
-
| "Run the migration" | hydra-runner (Haiku 4.5) | Execute migration command |
|
|
36
|
-
| "Check if the server starts" | hydra-runner (Haiku 4.5) | Start server, check for errors |
|
|
37
|
-
|
|
38
|
-
### hydra-scribe (Haiku 4.5) examples
|
|
39
|
-
| User says | Route to | Why |
|
|
40
|
-
|-----------|----------|-----|
|
|
41
|
-
| "Add docstrings to this file" | hydra-scribe (Haiku 4.5) | Read code, write docstrings |
|
|
42
|
-
| "Update the README with the new API endpoints" | hydra-scribe (Haiku 4.5) | Descriptive writing from code |
|
|
43
|
-
| "Write a changelog entry for these changes" | hydra-scribe (Haiku 4.5) | Summarize changes |
|
|
44
|
-
| "Add comments explaining this function" | hydra-scribe (Haiku 4.5) | Read and annotate |
|
|
45
|
-
|
|
46
|
-
### hydra-guard (Haiku 4.5) examples
|
|
47
|
-
| User says | Route to | Why |
|
|
48
|
-
|-----------|----------|-----|
|
|
49
|
-
| "Scan my changes for security issues" | hydra-guard (Haiku 4.5) | Security gate scan |
|
|
50
|
-
| "Are there any secrets in this file?" | hydra-guard (Haiku 4.5) | Pattern scan for credentials |
|
|
51
|
-
| "Check this PR for obvious quality issues" | hydra-guard (Haiku 4.5) | Quality gate on code diff |
|
|
52
|
-
| (auto-invoked after hydra-coder) | hydra-guard (Haiku 4.5) | Auto-guard protocol |
|
|
53
|
-
|
|
54
|
-
### hydra-git (Haiku 4.5) examples
|
|
55
|
-
| User says | Route to | Why |
|
|
56
|
-
|-----------|----------|-----|
|
|
57
|
-
| "Commit these changes" | hydra-git (Haiku 4.5) | Stage + commit with message |
|
|
58
|
-
| "What's the git status?" | hydra-git (Haiku 4.5) | Run git status, summarize |
|
|
59
|
-
| "Create a branch for this feature" | hydra-git (Haiku 4.5) | Branch creation |
|
|
60
|
-
| "Show me the diff for the last commit" | hydra-git (Haiku 4.5) | Diff inspection |
|
|
61
|
-
| "Stash my changes" | hydra-git (Haiku 4.5) | Git stash |
|
|
62
|
-
| "Are there any merge conflicts?" | hydra-git (Haiku 4.5) | Conflict detection (not resolution) |
|
|
63
|
-
| "Cherry-pick commit abc123" | hydra-git (Haiku 4.5) | Cherry-pick execution |
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## ALWAYS Delegate — Sonnet 4.6 Agents
|
|
68
|
-
|
|
69
|
-
### hydra-coder (Sonnet 4.6) examples
|
|
70
|
-
| User says | Route to | Why |
|
|
71
|
-
|-----------|----------|-----|
|
|
72
|
-
| "Add a password reset endpoint" | hydra-coder (Sonnet 4.6) | Feature implementation from spec |
|
|
73
|
-
| "Refactor this class to use composition" | hydra-coder (Sonnet 4.6) | Code transformation, clear goal |
|
|
74
|
-
| "Write tests for the auth module" | hydra-coder (Sonnet 4.6) | Test creation requires comprehension |
|
|
75
|
-
| "Fix this TypeError: cannot read property of undefined" | hydra-coder (Sonnet 4.6) | Bug fix with clear error |
|
|
76
|
-
| "Add pagination to the list API" | hydra-coder (Sonnet 4.6) | Standard pattern implementation |
|
|
77
|
-
| "Convert this JavaScript to TypeScript" | hydra-coder (Sonnet 4.6) | Mechanical but needs type reasoning |
|
|
78
|
-
| "Add input validation to the form" | hydra-coder (Sonnet 4.6) | Implementation with business logic |
|
|
79
|
-
|
|
80
|
-
### hydra-analyst (Sonnet 4.6) examples
|
|
81
|
-
| User says | Route to | Why |
|
|
82
|
-
|-----------|----------|-----|
|
|
83
|
-
| "Review this PR for issues" | hydra-analyst (Sonnet 4.6) | Code review |
|
|
84
|
-
| "Why is this test flaky?" | hydra-analyst (Sonnet 4.6) | Debug analysis with test output |
|
|
85
|
-
| "Are there any security issues in the auth code?" | hydra-analyst (Sonnet 4.6) | Focused security review |
|
|
86
|
-
| "What's causing this memory leak?" | hydra-analyst (Sonnet 4.6) | Performance debugging with symptoms |
|
|
87
|
-
| "How well tested is this module?" | hydra-analyst (Sonnet 4.6) | Coverage analysis |
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## ALWAYS Handle Yourself — Opus 4.6
|
|
92
|
-
|
|
93
|
-
| User says | Why Opus? |
|
|
94
|
-
|-----------|-----------|
|
|
95
|
-
| "Design the database schema for a multi-tenant SaaS" | Novel architecture decisions |
|
|
96
|
-
| "This works in staging but not production and I can't figure out why" | Subtle debugging, no clear clues |
|
|
97
|
-
| "How should we structure the microservices?" | System design requiring tradeoff analysis |
|
|
98
|
-
| "Optimize this algorithm — it's too slow for large inputs" | Algorithmic insight needed |
|
|
99
|
-
| "We need to support both REST and GraphQL — how?" | Architectural decision with implications |
|
|
100
|
-
| "Review the overall architecture and suggest improvements" | Requires deep holistic understanding |
|
|
101
|
-
| "There's a race condition somewhere in the checkout flow" | Subtle concurrency debugging |
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
## Compound Tasks
|
|
106
|
-
|
|
107
|
-
> **Note**: By default, hydra-scout is pre-dispatched in parallel with task classification for
|
|
108
|
-
> any prompt involving codebase context (see Speculative Pre-Dispatch in SKILL.md). The compound
|
|
109
|
-
> task decompositions below show the explicit Wave 1 scout dispatch for clarity, but in practice,
|
|
110
|
-
> scout may already be returning results by the time Wave 1 launches.
|
|
111
|
-
|
|
112
|
-
Many real user requests contain multiple subtasks at different tiers. Decompose them:
|
|
113
|
-
|
|
114
|
-
### Example 1: "Fix the bug in auth.py and add tests"
|
|
115
|
-
1. **hydra-scout (Haiku 4.5)** [BLOCKING] → Find auth.py, read it, understand the context
|
|
116
|
-
2. **hydra-coder (Sonnet 4.6)** [BLOCKING] → Fix the bug and write tests
|
|
117
|
-
3. **hydra-sentinel-scan (Haiku 4.5)** [BLOCKING] → Integration sweep on changed files
|
|
118
|
-
**hydra-guard (Haiku 4.5)** [BLOCKING] → Security scan on changed files
|
|
119
|
-
**hydra-runner (Haiku 4.5)** [BLOCKING] → Run the tests to verify
|
|
120
|
-
4. *(If sentinel-scan flags issues)* **hydra-sentinel (Sonnet 4.6)** [BLOCKING] → Deep analysis
|
|
121
|
-
|
|
122
|
-
### Example 2: "Refactor the API module and update the docs"
|
|
123
|
-
1. **hydra-scout (Haiku 4.5)** [BLOCKING] → Map the current API module structure
|
|
124
|
-
2. **hydra-coder (Sonnet 4.6)** [BLOCKING] → Perform the refactoring
|
|
125
|
-
3. **hydra-sentinel-scan (Haiku 4.5)** [BLOCKING] → Integration sweep on refactored code
|
|
126
|
-
**hydra-guard (Haiku 4.5)** [BLOCKING] → Security scan on changed files
|
|
127
|
-
**hydra-runner (Haiku 4.5)** [BLOCKING] → Run tests to verify nothing broke
|
|
128
|
-
**hydra-scribe (Haiku 4.5)** [NON-BLOCKING] → Update documentation (fire & forget)
|
|
129
|
-
4. *(If sentinel-scan flags issues)* **hydra-sentinel (Sonnet 4.6)** [BLOCKING] → Deep analysis
|
|
130
|
-
|
|
131
|
-
### Example 3: "Review the codebase and suggest architecture improvements"
|
|
132
|
-
1. **hydra-scout (Haiku 4.5)** → Map the project structure and key files
|
|
133
|
-
2. **hydra-analyst (Sonnet 4.6)** → Review code quality and patterns
|
|
134
|
-
3. **Opus 4.6 (you)** → Synthesize findings into architecture recommendations
|
|
135
|
-
|
|
136
|
-
### Example 4: "Set up CI/CD for this project"
|
|
137
|
-
1. **hydra-scout (Haiku 4.5)** → Understand the project structure, build system, test framework
|
|
138
|
-
2. **Opus 4.6 (you)** → Design the CI/CD pipeline (architectural decision)
|
|
139
|
-
3. **hydra-coder (Sonnet 4.6)** → Implement the config files
|
|
140
|
-
4. **hydra-runner (Haiku 4.5)** → Validate the configuration
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## Common Misclassifications
|
|
145
|
-
|
|
146
|
-
These are tasks that look like one tier but are actually another:
|
|
147
|
-
|
|
148
|
-
| Task | Looks like | Actually | Why |
|
|
149
|
-
|------|-----------|----------|-----|
|
|
150
|
-
| "Add a simple button" | Haiku (simple) | hydra-coder (Sonnet) | Needs to match existing component patterns |
|
|
151
|
-
| "Read the logs and find the error" | Haiku (read) | hydra-analyst (Sonnet) | Log analysis requires reasoning |
|
|
152
|
-
| "Fix the typo in line 42" | hydra-coder (Sonnet) | hydra-scribe (Haiku) | Trivial mechanical change |
|
|
153
|
-
| "Add caching" | hydra-coder (Sonnet) | Opus (handle yourself) | Cache invalidation strategy is hard |
|
|
154
|
-
| "Write a migration to add a column" | hydra-coder (Sonnet) | hydra-scribe (Haiku) | Template-level SQL |
|
|
155
|
-
| "Upgrade React from 17 to 18" | Haiku (simple) | Opus (handle yourself) | Breaking changes need careful analysis |
|
|
156
|
-
|
|
157
|
-
---
|
|
158
|
-
|
|
159
|
-
## Map-Aware Routing Examples
|
|
160
|
-
|
|
161
|
-
These examples show how the codebase map changes routing decisions by providing
|
|
162
|
-
risk scores and blast radius data upfront.
|
|
163
|
-
|
|
164
|
-
### "Fix the bug in auth.ts"
|
|
165
|
-
1. Check map: auth.ts has risk=critical, 12 dependents
|
|
166
|
-
2. hydra-scout → verify map is current (incremental update if needed)
|
|
167
|
-
3. hydra-analyst → diagnose the bug
|
|
168
|
-
4. hydra-coder → implement the fix
|
|
169
|
-
5. hydra-sentinel-scan → map shows blast radius of 12 files, check all 12
|
|
170
|
-
(without map, would have to grep the entire codebase)
|
|
171
|
-
6. hydra-sentinel → deep analysis (auto-escalated because risk=critical)
|
|
172
|
-
|
|
173
|
-
### "Add a new utility function"
|
|
174
|
-
1. Check map: new file, risk=low (zero dependents initially)
|
|
175
|
-
2. hydra-coder → write the function
|
|
176
|
-
3. hydra-sentinel-scan → low risk, quick scan, auto-accept if clean
|
|
177
|
-
(without map, would run the same expensive scan as a critical file)
|
|
178
|
-
|
|
179
|
-
### "Refactor the database connection module"
|
|
180
|
-
1. Check map: src/db/connection.ts has risk=critical, 15 dependents
|
|
181
|
-
2. Plan execution with full blast radius awareness
|
|
182
|
-
3. Dispatch parallel hydra-coders for each affected file
|
|
183
|
-
4. Sentinel deep analysis is MANDATORY (critical risk)
|
|
184
|
-
|
|
185
|
-
---
|
|
186
|
-
|
|
187
|
-
## Quick Decision Flowchart
|
|
188
|
-
|
|
189
|
-
```
|
|
190
|
-
Task arrives
|
|
191
|
-
│
|
|
192
|
-
├── In ALWAYS Delegate table? ── YES ──→ Route to specified agent
|
|
193
|
-
│
|
|
194
|
-
├── In ALWAYS Handle Yourself table? ── YES ──→ Opus handles directly
|
|
195
|
-
│
|
|
196
|
-
└── Neither? → JUDGMENT CALLS:
|
|
197
|
-
├── Requires conversation context? ── YES ──→ Opus
|
|
198
|
-
├── Haiku/Sonnet can do equally well? ── NO ──→ Opus
|
|
199
|
-
└── Delegation takes LONGER? ── YES (and truly trivial) ──→ Opus
|
|
200
|
-
└── Otherwise ──→ Delegate to best-fit agent
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
## Routing Examples — Mandatory Delegation
|
|
204
|
-
|
|
205
|
-
These examples show the RIGHT and WRONG way to handle common requests under the mandatory delegation rules.
|
|
206
|
-
|
|
207
|
-
### 1. "Fix the bug in auth.ts"
|
|
208
|
-
|
|
209
|
-
**WRONG** (Opus does it all):
|
|
210
|
-
```
|
|
211
|
-
Read auth.ts yourself → find the bug → fix it → run tests
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
**RIGHT** (mandatory delegation):
|
|
215
|
-
```
|
|
216
|
-
1. hydra-scout → explore auth module, find the bug location
|
|
217
|
-
2. hydra-analyst → analyze the bug, identify root cause
|
|
218
|
-
3. hydra-coder → implement the fix
|
|
219
|
-
4. hydra-sentinel-scan + hydra-guard → verify changes [parallel]
|
|
220
|
-
5. hydra-runner → run tests to confirm fix
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### 2. "What's the project structure?"
|
|
224
|
-
|
|
225
|
-
**WRONG** (Opus runs find/ls itself):
|
|
226
|
-
```
|
|
227
|
-
Run `find . -type f` or `ls -R` yourself
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
**RIGHT** (mandatory delegation):
|
|
231
|
-
```
|
|
232
|
-
1. hydra-scout → map project structure, report back
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
### 3. "Run the tests"
|
|
236
|
-
|
|
237
|
-
**WRONG** (Opus runs npm test itself):
|
|
238
|
-
```
|
|
239
|
-
Run `npm test` yourself
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
**RIGHT** (mandatory delegation):
|
|
243
|
-
```
|
|
244
|
-
1. hydra-runner → execute test suite, report results
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
### 4. "Commit these changes"
|
|
248
|
-
|
|
249
|
-
**WRONG** (Opus runs git add/commit itself):
|
|
250
|
-
```
|
|
251
|
-
Run `git add . && git commit -m "..."` yourself
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
**RIGHT** (mandatory delegation):
|
|
255
|
-
```
|
|
256
|
-
1. hydra-git → stage and commit with well-crafted message
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
### 5. "This function is slow, figure out why"
|
|
260
|
-
|
|
261
|
-
**RIGHT** (Opus orchestrates, delegates execution):
|
|
262
|
-
```
|
|
263
|
-
1. hydra-analyst → profile and diagnose the performance issue
|
|
264
|
-
2. YOU → decide the optimization approach (architectural judgment)
|
|
265
|
-
3. hydra-coder → implement the optimization
|
|
266
|
-
4. hydra-runner → benchmark before and after
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
### 6. "Redesign the auth module to use OAuth2"
|
|
270
|
-
|
|
271
|
-
**RIGHT** (Opus architects, delegates implementation):
|
|
272
|
-
```
|
|
273
|
-
1. hydra-scout → map current auth module structure [parallel with Step 2]
|
|
274
|
-
2. hydra-scout → research OAuth2 patterns in codebase [parallel with Step 1]
|
|
275
|
-
3. YOU → design the new architecture (this is YOUR job)
|
|
276
|
-
4. hydra-coder #1 → implement OAuth2 provider [parallel with Steps 5-6]
|
|
277
|
-
5. hydra-coder #2 → implement token management [parallel with Steps 4, 6]
|
|
278
|
-
6. hydra-coder #3 → update route handlers [parallel with Steps 4-5]
|
|
279
|
-
7. hydra-sentinel-scan → integration sweep on all changes
|
|
280
|
-
8. hydra-runner → run full test suite
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
### 7. "Quick — add a console.log to line 5"
|
|
284
|
-
|
|
285
|
-
**ACCEPTABLE** (trivial <5s edit — uses overhead budget):
|
|
286
|
-
```
|
|
287
|
-
YOU → add the console.log directly (counts as 1 of max 2-3 exceptions per session)
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
## Sentinel Routing
|
|
291
|
-
|
|
292
|
-
Sentinel is NOT manually routed. It triggers AUTOMATICALLY after code changes:
|
|
293
|
-
|
|
294
|
-
| Event | Triggers |
|
|
295
|
-
|-------|----------|
|
|
296
|
-
| hydra-coder writes/edits code | → sentinel-scan (always) |
|
|
297
|
-
| hydra-analyst suggests code changes | → sentinel-scan (always) |
|
|
298
|
-
| Orchestrator makes direct code changes | → sentinel-scan (always) |
|
|
299
|
-
| sentinel-scan finds issues | → sentinel deep analysis |
|
|
300
|
-
| sentinel-scan is clean | → nothing (done) |
|
|
301
|
-
| hydra-scribe writes docs | → nothing (skip) |
|
|
302
|
-
| hydra-git commits | → nothing (skip) |
|
|
303
|
-
| hydra-runner runs tests | → nothing (skip) |
|
|
1
|
+
# Routing Guide — Mandatory Delegation Examples
|
|
2
|
+
|
|
3
|
+
This reference provides concrete examples to see mandatory delegation in action.
|
|
4
|
+
Read this when you need to see how delegation rules apply to real tasks.
|
|
5
|
+
|
|
6
|
+
## Table of Contents
|
|
7
|
+
1. [ALWAYS Delegate — Haiku 4.5 Agents](#always-delegate-haiku)
|
|
8
|
+
2. [ALWAYS Delegate — Sonnet 4.6 Agents](#always-delegate-sonnet)
|
|
9
|
+
3. [ALWAYS Handle Yourself — Opus 4.6](#always-handle-yourself-opus)
|
|
10
|
+
4. [Compound Task Decomposition](#compound-tasks)
|
|
11
|
+
5. [Common Misclassifications](#common-misclassifications)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## ALWAYS Delegate — Haiku 4.5 Agents
|
|
16
|
+
|
|
17
|
+
### hydra-scout (Haiku 4.5) examples
|
|
18
|
+
| User says | Route to | Why |
|
|
19
|
+
|-----------|----------|-----|
|
|
20
|
+
| "What framework is this project using?" | hydra-scout (Haiku 4.5) | Read package.json/config files |
|
|
21
|
+
| "Find where the login endpoint is defined" | hydra-scout (Haiku 4.5) | Grep for routes/endpoints |
|
|
22
|
+
| "How many files are in the src directory?" | hydra-scout (Haiku 4.5) | Glob + count |
|
|
23
|
+
| "Show me the database schema" | hydra-scout (Haiku 4.5) | Find and read schema/migration files |
|
|
24
|
+
| "What does the User model look like?" | hydra-scout (Haiku 4.5) | Find and read model definition |
|
|
25
|
+
| "Is there a rate limiter in this project?" | hydra-scout (Haiku 4.5) | Grep for rate limit patterns |
|
|
26
|
+
| "What version of React are we using?" | hydra-scout (Haiku 4.5) | Read package.json |
|
|
27
|
+
|
|
28
|
+
### hydra-runner (Haiku 4.5) examples
|
|
29
|
+
| User says | Route to | Why |
|
|
30
|
+
|-----------|----------|-----|
|
|
31
|
+
| "Run the tests" | hydra-runner (Haiku 4.5) | Execute test command, report results |
|
|
32
|
+
| "Does the build pass?" | hydra-runner (Haiku 4.5) | Run build, report success/failure |
|
|
33
|
+
| "Check if there are any lint errors" | hydra-runner (Haiku 4.5) | Run linter, report findings |
|
|
34
|
+
| "What's the git status?" | hydra-runner (Haiku 4.5) | Run git status/diff |
|
|
35
|
+
| "Run the migration" | hydra-runner (Haiku 4.5) | Execute migration command |
|
|
36
|
+
| "Check if the server starts" | hydra-runner (Haiku 4.5) | Start server, check for errors |
|
|
37
|
+
|
|
38
|
+
### hydra-scribe (Haiku 4.5) examples
|
|
39
|
+
| User says | Route to | Why |
|
|
40
|
+
|-----------|----------|-----|
|
|
41
|
+
| "Add docstrings to this file" | hydra-scribe (Haiku 4.5) | Read code, write docstrings |
|
|
42
|
+
| "Update the README with the new API endpoints" | hydra-scribe (Haiku 4.5) | Descriptive writing from code |
|
|
43
|
+
| "Write a changelog entry for these changes" | hydra-scribe (Haiku 4.5) | Summarize changes |
|
|
44
|
+
| "Add comments explaining this function" | hydra-scribe (Haiku 4.5) | Read and annotate |
|
|
45
|
+
|
|
46
|
+
### hydra-guard (Haiku 4.5) examples
|
|
47
|
+
| User says | Route to | Why |
|
|
48
|
+
|-----------|----------|-----|
|
|
49
|
+
| "Scan my changes for security issues" | hydra-guard (Haiku 4.5) | Security gate scan |
|
|
50
|
+
| "Are there any secrets in this file?" | hydra-guard (Haiku 4.5) | Pattern scan for credentials |
|
|
51
|
+
| "Check this PR for obvious quality issues" | hydra-guard (Haiku 4.5) | Quality gate on code diff |
|
|
52
|
+
| (auto-invoked after hydra-coder) | hydra-guard (Haiku 4.5) | Auto-guard protocol |
|
|
53
|
+
|
|
54
|
+
### hydra-git (Haiku 4.5) examples
|
|
55
|
+
| User says | Route to | Why |
|
|
56
|
+
|-----------|----------|-----|
|
|
57
|
+
| "Commit these changes" | hydra-git (Haiku 4.5) | Stage + commit with message |
|
|
58
|
+
| "What's the git status?" | hydra-git (Haiku 4.5) | Run git status, summarize |
|
|
59
|
+
| "Create a branch for this feature" | hydra-git (Haiku 4.5) | Branch creation |
|
|
60
|
+
| "Show me the diff for the last commit" | hydra-git (Haiku 4.5) | Diff inspection |
|
|
61
|
+
| "Stash my changes" | hydra-git (Haiku 4.5) | Git stash |
|
|
62
|
+
| "Are there any merge conflicts?" | hydra-git (Haiku 4.5) | Conflict detection (not resolution) |
|
|
63
|
+
| "Cherry-pick commit abc123" | hydra-git (Haiku 4.5) | Cherry-pick execution |
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## ALWAYS Delegate — Sonnet 4.6 Agents
|
|
68
|
+
|
|
69
|
+
### hydra-coder (Sonnet 4.6) examples
|
|
70
|
+
| User says | Route to | Why |
|
|
71
|
+
|-----------|----------|-----|
|
|
72
|
+
| "Add a password reset endpoint" | hydra-coder (Sonnet 4.6) | Feature implementation from spec |
|
|
73
|
+
| "Refactor this class to use composition" | hydra-coder (Sonnet 4.6) | Code transformation, clear goal |
|
|
74
|
+
| "Write tests for the auth module" | hydra-coder (Sonnet 4.6) | Test creation requires comprehension |
|
|
75
|
+
| "Fix this TypeError: cannot read property of undefined" | hydra-coder (Sonnet 4.6) | Bug fix with clear error |
|
|
76
|
+
| "Add pagination to the list API" | hydra-coder (Sonnet 4.6) | Standard pattern implementation |
|
|
77
|
+
| "Convert this JavaScript to TypeScript" | hydra-coder (Sonnet 4.6) | Mechanical but needs type reasoning |
|
|
78
|
+
| "Add input validation to the form" | hydra-coder (Sonnet 4.6) | Implementation with business logic |
|
|
79
|
+
|
|
80
|
+
### hydra-analyst (Sonnet 4.6) examples
|
|
81
|
+
| User says | Route to | Why |
|
|
82
|
+
|-----------|----------|-----|
|
|
83
|
+
| "Review this PR for issues" | hydra-analyst (Sonnet 4.6) | Code review |
|
|
84
|
+
| "Why is this test flaky?" | hydra-analyst (Sonnet 4.6) | Debug analysis with test output |
|
|
85
|
+
| "Are there any security issues in the auth code?" | hydra-analyst (Sonnet 4.6) | Focused security review |
|
|
86
|
+
| "What's causing this memory leak?" | hydra-analyst (Sonnet 4.6) | Performance debugging with symptoms |
|
|
87
|
+
| "How well tested is this module?" | hydra-analyst (Sonnet 4.6) | Coverage analysis |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## ALWAYS Handle Yourself — Opus 4.6
|
|
92
|
+
|
|
93
|
+
| User says | Why Opus? |
|
|
94
|
+
|-----------|-----------|
|
|
95
|
+
| "Design the database schema for a multi-tenant SaaS" | Novel architecture decisions |
|
|
96
|
+
| "This works in staging but not production and I can't figure out why" | Subtle debugging, no clear clues |
|
|
97
|
+
| "How should we structure the microservices?" | System design requiring tradeoff analysis |
|
|
98
|
+
| "Optimize this algorithm — it's too slow for large inputs" | Algorithmic insight needed |
|
|
99
|
+
| "We need to support both REST and GraphQL — how?" | Architectural decision with implications |
|
|
100
|
+
| "Review the overall architecture and suggest improvements" | Requires deep holistic understanding |
|
|
101
|
+
| "There's a race condition somewhere in the checkout flow" | Subtle concurrency debugging |
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Compound Tasks
|
|
106
|
+
|
|
107
|
+
> **Note**: By default, hydra-scout is pre-dispatched in parallel with task classification for
|
|
108
|
+
> any prompt involving codebase context (see Speculative Pre-Dispatch in SKILL.md). The compound
|
|
109
|
+
> task decompositions below show the explicit Wave 1 scout dispatch for clarity, but in practice,
|
|
110
|
+
> scout may already be returning results by the time Wave 1 launches.
|
|
111
|
+
|
|
112
|
+
Many real user requests contain multiple subtasks at different tiers. Decompose them:
|
|
113
|
+
|
|
114
|
+
### Example 1: "Fix the bug in auth.py and add tests"
|
|
115
|
+
1. **hydra-scout (Haiku 4.5)** [BLOCKING] → Find auth.py, read it, understand the context
|
|
116
|
+
2. **hydra-coder (Sonnet 4.6)** [BLOCKING] → Fix the bug and write tests
|
|
117
|
+
3. **hydra-sentinel-scan (Haiku 4.5)** [BLOCKING] → Integration sweep on changed files
|
|
118
|
+
**hydra-guard (Haiku 4.5)** [BLOCKING] → Security scan on changed files
|
|
119
|
+
**hydra-runner (Haiku 4.5)** [BLOCKING] → Run the tests to verify
|
|
120
|
+
4. *(If sentinel-scan flags issues)* **hydra-sentinel (Sonnet 4.6)** [BLOCKING] → Deep analysis
|
|
121
|
+
|
|
122
|
+
### Example 2: "Refactor the API module and update the docs"
|
|
123
|
+
1. **hydra-scout (Haiku 4.5)** [BLOCKING] → Map the current API module structure
|
|
124
|
+
2. **hydra-coder (Sonnet 4.6)** [BLOCKING] → Perform the refactoring
|
|
125
|
+
3. **hydra-sentinel-scan (Haiku 4.5)** [BLOCKING] → Integration sweep on refactored code
|
|
126
|
+
**hydra-guard (Haiku 4.5)** [BLOCKING] → Security scan on changed files
|
|
127
|
+
**hydra-runner (Haiku 4.5)** [BLOCKING] → Run tests to verify nothing broke
|
|
128
|
+
**hydra-scribe (Haiku 4.5)** [NON-BLOCKING] → Update documentation (fire & forget)
|
|
129
|
+
4. *(If sentinel-scan flags issues)* **hydra-sentinel (Sonnet 4.6)** [BLOCKING] → Deep analysis
|
|
130
|
+
|
|
131
|
+
### Example 3: "Review the codebase and suggest architecture improvements"
|
|
132
|
+
1. **hydra-scout (Haiku 4.5)** → Map the project structure and key files
|
|
133
|
+
2. **hydra-analyst (Sonnet 4.6)** → Review code quality and patterns
|
|
134
|
+
3. **Opus 4.6 (you)** → Synthesize findings into architecture recommendations
|
|
135
|
+
|
|
136
|
+
### Example 4: "Set up CI/CD for this project"
|
|
137
|
+
1. **hydra-scout (Haiku 4.5)** → Understand the project structure, build system, test framework
|
|
138
|
+
2. **Opus 4.6 (you)** → Design the CI/CD pipeline (architectural decision)
|
|
139
|
+
3. **hydra-coder (Sonnet 4.6)** → Implement the config files
|
|
140
|
+
4. **hydra-runner (Haiku 4.5)** → Validate the configuration
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Common Misclassifications
|
|
145
|
+
|
|
146
|
+
These are tasks that look like one tier but are actually another:
|
|
147
|
+
|
|
148
|
+
| Task | Looks like | Actually | Why |
|
|
149
|
+
|------|-----------|----------|-----|
|
|
150
|
+
| "Add a simple button" | Haiku (simple) | hydra-coder (Sonnet) | Needs to match existing component patterns |
|
|
151
|
+
| "Read the logs and find the error" | Haiku (read) | hydra-analyst (Sonnet) | Log analysis requires reasoning |
|
|
152
|
+
| "Fix the typo in line 42" | hydra-coder (Sonnet) | hydra-scribe (Haiku) | Trivial mechanical change |
|
|
153
|
+
| "Add caching" | hydra-coder (Sonnet) | Opus (handle yourself) | Cache invalidation strategy is hard |
|
|
154
|
+
| "Write a migration to add a column" | hydra-coder (Sonnet) | hydra-scribe (Haiku) | Template-level SQL |
|
|
155
|
+
| "Upgrade React from 17 to 18" | Haiku (simple) | Opus (handle yourself) | Breaking changes need careful analysis |
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Map-Aware Routing Examples
|
|
160
|
+
|
|
161
|
+
These examples show how the codebase map changes routing decisions by providing
|
|
162
|
+
risk scores and blast radius data upfront.
|
|
163
|
+
|
|
164
|
+
### "Fix the bug in auth.ts"
|
|
165
|
+
1. Check map: auth.ts has risk=critical, 12 dependents
|
|
166
|
+
2. hydra-scout → verify map is current (incremental update if needed)
|
|
167
|
+
3. hydra-analyst → diagnose the bug
|
|
168
|
+
4. hydra-coder → implement the fix
|
|
169
|
+
5. hydra-sentinel-scan → map shows blast radius of 12 files, check all 12
|
|
170
|
+
(without map, would have to grep the entire codebase)
|
|
171
|
+
6. hydra-sentinel → deep analysis (auto-escalated because risk=critical)
|
|
172
|
+
|
|
173
|
+
### "Add a new utility function"
|
|
174
|
+
1. Check map: new file, risk=low (zero dependents initially)
|
|
175
|
+
2. hydra-coder → write the function
|
|
176
|
+
3. hydra-sentinel-scan → low risk, quick scan, auto-accept if clean
|
|
177
|
+
(without map, would run the same expensive scan as a critical file)
|
|
178
|
+
|
|
179
|
+
### "Refactor the database connection module"
|
|
180
|
+
1. Check map: src/db/connection.ts has risk=critical, 15 dependents
|
|
181
|
+
2. Plan execution with full blast radius awareness
|
|
182
|
+
3. Dispatch parallel hydra-coders for each affected file
|
|
183
|
+
4. Sentinel deep analysis is MANDATORY (critical risk)
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Quick Decision Flowchart
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
Task arrives
|
|
191
|
+
│
|
|
192
|
+
├── In ALWAYS Delegate table? ── YES ──→ Route to specified agent
|
|
193
|
+
│
|
|
194
|
+
├── In ALWAYS Handle Yourself table? ── YES ──→ Opus handles directly
|
|
195
|
+
│
|
|
196
|
+
└── Neither? → JUDGMENT CALLS:
|
|
197
|
+
├── Requires conversation context? ── YES ──→ Opus
|
|
198
|
+
├── Haiku/Sonnet can do equally well? ── NO ──→ Opus
|
|
199
|
+
└── Delegation takes LONGER? ── YES (and truly trivial) ──→ Opus
|
|
200
|
+
└── Otherwise ──→ Delegate to best-fit agent
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Routing Examples — Mandatory Delegation
|
|
204
|
+
|
|
205
|
+
These examples show the RIGHT and WRONG way to handle common requests under the mandatory delegation rules.
|
|
206
|
+
|
|
207
|
+
### 1. "Fix the bug in auth.ts"
|
|
208
|
+
|
|
209
|
+
**WRONG** (Opus does it all):
|
|
210
|
+
```
|
|
211
|
+
Read auth.ts yourself → find the bug → fix it → run tests
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**RIGHT** (mandatory delegation):
|
|
215
|
+
```
|
|
216
|
+
1. hydra-scout → explore auth module, find the bug location
|
|
217
|
+
2. hydra-analyst → analyze the bug, identify root cause
|
|
218
|
+
3. hydra-coder → implement the fix
|
|
219
|
+
4. hydra-sentinel-scan + hydra-guard → verify changes [parallel]
|
|
220
|
+
5. hydra-runner → run tests to confirm fix
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### 2. "What's the project structure?"
|
|
224
|
+
|
|
225
|
+
**WRONG** (Opus runs find/ls itself):
|
|
226
|
+
```
|
|
227
|
+
Run `find . -type f` or `ls -R` yourself
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**RIGHT** (mandatory delegation):
|
|
231
|
+
```
|
|
232
|
+
1. hydra-scout → map project structure, report back
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### 3. "Run the tests"
|
|
236
|
+
|
|
237
|
+
**WRONG** (Opus runs npm test itself):
|
|
238
|
+
```
|
|
239
|
+
Run `npm test` yourself
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
**RIGHT** (mandatory delegation):
|
|
243
|
+
```
|
|
244
|
+
1. hydra-runner → execute test suite, report results
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### 4. "Commit these changes"
|
|
248
|
+
|
|
249
|
+
**WRONG** (Opus runs git add/commit itself):
|
|
250
|
+
```
|
|
251
|
+
Run `git add . && git commit -m "..."` yourself
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**RIGHT** (mandatory delegation):
|
|
255
|
+
```
|
|
256
|
+
1. hydra-git → stage and commit with well-crafted message
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### 5. "This function is slow, figure out why"
|
|
260
|
+
|
|
261
|
+
**RIGHT** (Opus orchestrates, delegates execution):
|
|
262
|
+
```
|
|
263
|
+
1. hydra-analyst → profile and diagnose the performance issue
|
|
264
|
+
2. YOU → decide the optimization approach (architectural judgment)
|
|
265
|
+
3. hydra-coder → implement the optimization
|
|
266
|
+
4. hydra-runner → benchmark before and after
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### 6. "Redesign the auth module to use OAuth2"
|
|
270
|
+
|
|
271
|
+
**RIGHT** (Opus architects, delegates implementation):
|
|
272
|
+
```
|
|
273
|
+
1. hydra-scout → map current auth module structure [parallel with Step 2]
|
|
274
|
+
2. hydra-scout → research OAuth2 patterns in codebase [parallel with Step 1]
|
|
275
|
+
3. YOU → design the new architecture (this is YOUR job)
|
|
276
|
+
4. hydra-coder #1 → implement OAuth2 provider [parallel with Steps 5-6]
|
|
277
|
+
5. hydra-coder #2 → implement token management [parallel with Steps 4, 6]
|
|
278
|
+
6. hydra-coder #3 → update route handlers [parallel with Steps 4-5]
|
|
279
|
+
7. hydra-sentinel-scan → integration sweep on all changes
|
|
280
|
+
8. hydra-runner → run full test suite
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### 7. "Quick — add a console.log to line 5"
|
|
284
|
+
|
|
285
|
+
**ACCEPTABLE** (trivial <5s edit — uses overhead budget):
|
|
286
|
+
```
|
|
287
|
+
YOU → add the console.log directly (counts as 1 of max 2-3 exceptions per session)
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
## Sentinel Routing
|
|
291
|
+
|
|
292
|
+
Sentinel is NOT manually routed. It triggers AUTOMATICALLY after code changes:
|
|
293
|
+
|
|
294
|
+
| Event | Triggers |
|
|
295
|
+
|-------|----------|
|
|
296
|
+
| hydra-coder writes/edits code | → sentinel-scan (always) |
|
|
297
|
+
| hydra-analyst suggests code changes | → sentinel-scan (always) |
|
|
298
|
+
| Orchestrator makes direct code changes | → sentinel-scan (always) |
|
|
299
|
+
| sentinel-scan finds issues | → sentinel deep analysis |
|
|
300
|
+
| sentinel-scan is clean | → nothing (done) |
|
|
301
|
+
| hydra-scribe writes docs | → nothing (skip) |
|
|
302
|
+
| hydra-git commits | → nothing (skip) |
|
|
303
|
+
| hydra-runner runs tests | → nothing (skip) |
|