hail-hydra-cc 2.1.1 → 2.2.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/README.md +8 -4
- package/files/SKILL.md +155 -52
- package/files/agents/hydra-preflight.md +175 -0
- package/files/commands/hydra/help.md +2 -0
- package/files/commands/hydra/preflight.md +94 -0
- package/package.json +1 -1
- package/src/display.js +2 -2
- package/src/files.js +6 -0
- package/src/prompts.js +2 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
npx hail-hydra-cc
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Runs an interactive installer that deploys
|
|
12
|
+
Runs an interactive installer that deploys 10 Hydra agents into your Claude Code setup.
|
|
13
13
|
|
|
14
14
|
## What is Hydra?
|
|
15
15
|
|
|
@@ -26,6 +26,7 @@ Hydra makes Claude Code's Opus model an intelligent **orchestrator** instead of
|
|
|
26
26
|
| `hydra-analyst` | 🔵 Sonnet 4.6 | Code review, debugging, analysis |
|
|
27
27
|
| `hydra-sentinel-scan` | 🟢 Haiku 4.5 | Fast integration sweep |
|
|
28
28
|
| `hydra-sentinel` | 🔵 Sonnet 4.6 | Deep integration analysis |
|
|
29
|
+
| `hydra-preflight` | 🟢 Haiku 4.5 | Environment detection, version probing, dep inventory |
|
|
29
30
|
|
|
30
31
|
**Expected gains:** 2–3× faster tasks, ~50% lower API costs, zero quality loss.
|
|
31
32
|
(Savings calculated against Opus 4.6 at $5/$25 per MTok — February 2026 pricing)
|
|
@@ -46,17 +47,18 @@ npx hail-hydra-cc --help # Show help
|
|
|
46
47
|
|
|
47
48
|
```
|
|
48
49
|
~/.claude/ (or ./.claude/ for local)
|
|
49
|
-
├── agents/ #
|
|
50
|
+
├── agents/ # 10 agent definitions
|
|
50
51
|
│ ├── hydra-scout.md
|
|
51
52
|
│ ├── hydra-runner.md
|
|
52
53
|
│ ├── hydra-scribe.md
|
|
53
54
|
│ ├── hydra-guard.md
|
|
54
55
|
│ ├── hydra-git.md
|
|
55
56
|
│ ├── hydra-sentinel-scan.md
|
|
57
|
+
│ ├── hydra-preflight.md
|
|
56
58
|
│ ├── hydra-coder.md
|
|
57
59
|
│ ├── hydra-analyst.md
|
|
58
60
|
│ └── hydra-sentinel.md
|
|
59
|
-
├── commands/hydra/ #
|
|
61
|
+
├── commands/hydra/ # 10 slash commands
|
|
60
62
|
│ ├── help.md # /hydra:help
|
|
61
63
|
│ ├── status.md # /hydra:status
|
|
62
64
|
│ ├── update.md # /hydra:update
|
|
@@ -64,7 +66,9 @@ npx hail-hydra-cc --help # Show help
|
|
|
64
66
|
│ ├── guard.md # /hydra:guard
|
|
65
67
|
│ ├── quiet.md # /hydra:quiet
|
|
66
68
|
│ ├── verbose.md # /hydra:verbose
|
|
67
|
-
│
|
|
69
|
+
│ ├── report.md # /hydra:report
|
|
70
|
+
│ ├── map.md # /hydra:map
|
|
71
|
+
│ └── preflight.md # /hydra:preflight
|
|
68
72
|
├── hooks/ # 4 lifecycle hooks
|
|
69
73
|
│ ├── hydra-check-update.js # SessionStart — version check
|
|
70
74
|
│ ├── hydra-statusline.js # StatusLine — status bar
|
package/files/SKILL.md
CHANGED
|
@@ -94,18 +94,18 @@ User Request
|
|
|
94
94
|
════════════════════════════════════════════════════════
|
|
95
95
|
Wave N (parallel dispatch, index context injected)
|
|
96
96
|
┌───────────────────┬──────────────────────────────────┐
|
|
97
|
-
│
|
|
97
|
+
│ SEQUENTIAL │ PARALLEL (wait for all) │
|
|
98
98
|
▼ ▼ │
|
|
99
99
|
[coder] [scribe] ──────────────────────────────┘
|
|
100
100
|
│
|
|
101
101
|
▼
|
|
102
|
-
|
|
102
|
+
ALL agents complete (Opus waits for every dispatched agent)
|
|
103
103
|
│
|
|
104
104
|
├── Raw data / clean pass? → AUTO-ACCEPT → (updates Session Index if scout)
|
|
105
105
|
└── Code / analysis / user-facing docs? → Orchestrator verifies
|
|
106
106
|
│
|
|
107
107
|
▼
|
|
108
|
-
User gets result
|
|
108
|
+
User gets result (single response, all agent outputs included)
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
This mirrors speculative decoding's "draft → score → accept/reject" loop, but at task granularity.
|
|
@@ -226,45 +226,145 @@ If you notice the map's git_hash doesn't match HEAD and hydra-scout hasn't
|
|
|
226
226
|
been dispatched yet, dispatch scout to update the map BEFORE running sentinel.
|
|
227
227
|
A stale map is worse than no map — it could have incorrect dependency data.
|
|
228
228
|
|
|
229
|
-
##
|
|
229
|
+
## Preflight Protocol — /hydra:preflight
|
|
230
230
|
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
Run this before starting work on any new project or unfamiliar codebase.
|
|
232
|
+
It catches environment and compatibility issues before they become multi-hour
|
|
233
|
+
debugging sessions.
|
|
233
234
|
|
|
234
|
-
###
|
|
235
|
+
### When to run
|
|
236
|
+
|
|
237
|
+
- User types `hydra preflight` or `/hydra:preflight`
|
|
238
|
+
- User says "check my environment", "validate my setup", "is this project ready to build"
|
|
239
|
+
- You are about to begin a substantial build task on a project you have not seen before
|
|
240
|
+
in this session AND the Session Index has no prior context for this project
|
|
241
|
+
|
|
242
|
+
### Execution — Two Phases, Always in Sequence
|
|
243
|
+
|
|
244
|
+
**Phase 1 (Detection) — dispatch hydra-preflight:**
|
|
245
|
+
|
|
246
|
+
Prompt:
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
Run a full preflight check on this project. Collect runtime versions, run all
|
|
250
|
+
GPU/CUDA probe scripts, inventory installed packages, compare .env.example against
|
|
251
|
+
.env, verify build tools exist, and check service connectivity. Return the full
|
|
252
|
+
structured PREFLIGHT_INVENTORY JSON. Do not make recommendations.
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Wait for hydra-preflight to return `PREFLIGHT_INVENTORY_COMPLETE` before proceeding.
|
|
256
|
+
|
|
257
|
+
**Phase 2 (Analysis) — dispatch hydra-analyst:**
|
|
258
|
+
|
|
259
|
+
Pass the full PREFLIGHT_INVENTORY from Phase 1. Prompt:
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
You are performing a compatibility analysis on the following environment inventory.
|
|
263
|
+
Cross-reference all detected versions against known compatibility matrices.
|
|
264
|
+
Pay special attention to GPU stack combinations (PyTorch/CUDA/cuDNN),
|
|
265
|
+
framework pairs (React/Next, Python/TF), and Node/native addon combinations.
|
|
266
|
+
|
|
267
|
+
For each component or pair, return one of three verdicts:
|
|
268
|
+
✅ COMPATIBLE — versions are known-good together
|
|
269
|
+
⚠️ KNOWN RISK — this combination has known issues or is untested
|
|
270
|
+
❌ CONFIRMED BREAK — probe output or known matrix confirms incompatibility
|
|
271
|
+
|
|
272
|
+
For ❌ verdicts, include the specific fix (e.g. "pin pytorch==2.7.0").
|
|
273
|
+
For ⚠️ verdicts, include what to watch for.
|
|
274
|
+
For unknowns, flag as "UNVERIFIED — test before building" rather than assuming green.
|
|
275
|
+
|
|
276
|
+
INVENTORY:
|
|
277
|
+
[paste full PREFLIGHT_INVENTORY here]
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Presenting Results to User
|
|
281
|
+
|
|
282
|
+
After both phases complete, present a unified report:
|
|
283
|
+
|
|
284
|
+
```
|
|
285
|
+
🐉 Hydra Preflight — [project name]
|
|
286
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
287
|
+
|
|
288
|
+
RUNTIMES
|
|
289
|
+
✅ Node 22.4.0 (matches .nvmrc)
|
|
290
|
+
✅ Python 3.11.9 (matches .python-version)
|
|
291
|
+
|
|
292
|
+
GPU STACK
|
|
293
|
+
❌ PyTorch 2.6.0 + CUDA 13.0 — incompatible
|
|
294
|
+
Fix: pip install torch==2.7.0
|
|
295
|
+
|
|
296
|
+
ENVIRONMENT
|
|
297
|
+
⚠️ Missing: DATABASE_URL, REDIS_URL (declared in .env.example)
|
|
298
|
+
|
|
299
|
+
DEPENDENCIES
|
|
300
|
+
✅ node_modules present (1,847 packages)
|
|
301
|
+
✅ venv present
|
|
302
|
+
|
|
303
|
+
SERVICES
|
|
304
|
+
❌ PostgreSQL: unreachable (DATABASE_URL not set)
|
|
305
|
+
✅ Redis: reachable
|
|
306
|
+
|
|
307
|
+
BUILD TOOLS
|
|
308
|
+
✅ vite, tsc, pytest all found
|
|
309
|
+
|
|
310
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
311
|
+
2 confirmed breaks, 1 known risk, 1 warning
|
|
312
|
+
Fix the ❌ items before building.
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
Auto-apply trivial fixes (e.g. updating a pin in requirements.txt) only if the user
|
|
316
|
+
says "fix it" or "apply fixes". Never auto-apply without being asked.
|
|
317
|
+
|
|
318
|
+
### Three-State Verdict Reference
|
|
319
|
+
|
|
320
|
+
| State | Meaning | Source |
|
|
321
|
+
|-------|---------|--------|
|
|
322
|
+
| ✅ COMPATIBLE | Versions are known-good together | Analyst matrix knowledge |
|
|
323
|
+
| ⚠️ KNOWN RISK | Combination has known issues or limited testing | Analyst matrix knowledge |
|
|
324
|
+
| ❌ CONFIRMED BREAK | Probe output OR known matrix confirms failure | Probe output (ground truth) or analyst |
|
|
325
|
+
| ❓ UNVERIFIED | Combination not in training data | Analyst — flag and move on |
|
|
326
|
+
|
|
327
|
+
Ground truth from probes always beats matrix knowledge. If `torch.cuda.is_available()`
|
|
328
|
+
returns False, that is a ❌ regardless of what the version matrix says.
|
|
329
|
+
|
|
330
|
+
## Sequential vs Parallel Dispatch
|
|
331
|
+
|
|
332
|
+
Not all agents need to be dispatched one-by-one. When agents are independent,
|
|
333
|
+
dispatch them simultaneously and wait for ALL to complete before responding.
|
|
334
|
+
|
|
335
|
+
> ⚠️ **NEVER use fire-and-forget or background dispatch.** Background agent
|
|
336
|
+
> completion triggers an empty user turn in Claude Code, causing Claude to respond
|
|
337
|
+
> to nothing. Every dispatched agent MUST be awaited before presenting results.
|
|
338
|
+
|
|
339
|
+
### Sequential Dispatch (one wave at a time)
|
|
235
340
|
Use when downstream agents DEPEND on this agent's output:
|
|
236
341
|
- hydra-scout exploring files that hydra-coder needs to edit
|
|
237
342
|
- hydra-analyst diagnosing a bug that hydra-coder needs to fix
|
|
238
343
|
- hydra-coder making changes that hydra-runner needs to test
|
|
239
344
|
|
|
240
|
-
###
|
|
241
|
-
Use when
|
|
242
|
-
- hydra-scribe writing docs
|
|
243
|
-
- hydra-
|
|
244
|
-
- hydra-scout exploring supplementary context
|
|
345
|
+
### Parallel Dispatch (all at once — wait for ALL before responding)
|
|
346
|
+
Use when agents are INDEPENDENT of each other:
|
|
347
|
+
- hydra-scribe writing docs + hydra-runner running final tests
|
|
348
|
+
- hydra-guard scanning + hydra-sentinel-scan sweeping (already enforced by Protocol 1)
|
|
349
|
+
- hydra-scout exploring supplementary context + any other independent agent
|
|
245
350
|
|
|
246
|
-
### Execution Flow
|
|
351
|
+
### Execution Flow
|
|
247
352
|
|
|
248
353
|
```
|
|
249
|
-
Wave 1 (
|
|
250
|
-
Wave 2 (
|
|
251
|
-
Wave 3 (
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
Wave 3 completes when: runner returns (don't wait for scribe)
|
|
256
|
-
Present results to user. Scribe's docs are appended when ready.
|
|
354
|
+
Wave 1 (sequential): scout explores → returns file paths
|
|
355
|
+
Wave 2 (sequential): coder implements fix → returns changed files
|
|
356
|
+
Wave 3 (parallel): dispatch runner AND scribe simultaneously
|
|
357
|
+
WAIT for BOTH to complete
|
|
358
|
+
Present single response to user (all outputs included)
|
|
257
359
|
```
|
|
258
360
|
|
|
259
361
|
### Rules
|
|
260
|
-
1. A wave completes when
|
|
261
|
-
2.
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
6. hydra-runner is non-blocking ONLY when it's the final validation step
|
|
267
|
-
7. If in doubt, make it blocking — correctness over speed
|
|
362
|
+
1. A wave completes when ALL agents in it return — no exceptions
|
|
363
|
+
2. NEVER present results while any dispatched agent is still running
|
|
364
|
+
3. NEVER dispatch hydra-coder without awaiting the result — code changes always need verification
|
|
365
|
+
4. NEVER dispatch hydra-analyst without awaiting the result — diagnoses feed into fixes
|
|
366
|
+
5. hydra-scribe runs IN PARALLEL with hydra-runner by default (not after)
|
|
367
|
+
6. If in doubt, wait for everything — correctness over speed
|
|
268
368
|
|
|
269
369
|
## Integrated Execution Model
|
|
270
370
|
|
|
@@ -284,7 +384,7 @@ User Prompt arrives
|
|
|
284
384
|
│ "Find files relevant to: [prompt]" │
|
|
285
385
|
│ │
|
|
286
386
|
├── IN PARALLEL: Classify task, plan waves, │
|
|
287
|
-
│ decide
|
|
387
|
+
│ decide sequential/parallel per agent │
|
|
288
388
|
│ │
|
|
289
389
|
▼ │
|
|
290
390
|
Scout returns │
|
|
@@ -299,10 +399,10 @@ Scout returns
|
|
|
299
399
|
(index context injected into each agent prompt)
|
|
300
400
|
│
|
|
301
401
|
┌────────────────────┴───────────────────────┐
|
|
302
|
-
│
|
|
303
|
-
│ (
|
|
402
|
+
│ SEQUENTIAL agents ◄── Opt 3: Parallel │ PARALLEL agents
|
|
403
|
+
│ (one wave at a time) │ (dispatched together)
|
|
304
404
|
▼ ▼
|
|
305
|
-
Results arrive
|
|
405
|
+
Results arrive All complete together
|
|
306
406
|
│ │
|
|
307
407
|
┌──────┴──────┐ │
|
|
308
408
|
│ │ │
|
|
@@ -332,7 +432,7 @@ Scout returns
|
|
|
332
432
|
→ Wait → Decision tree → Present to user │
|
|
333
433
|
│
|
|
334
434
|
Next wave OR present result ◄──────────────────────────►┘
|
|
335
|
-
(
|
|
435
|
+
(all parallel agents completed before this point)
|
|
336
436
|
```
|
|
337
437
|
|
|
338
438
|
### Optimization Interaction Rules
|
|
@@ -347,27 +447,27 @@ New prompt arrives → Check Session Index coverage
|
|
|
347
447
|
└── Not covered: Pre-dispatch scout → Update index → Wave 1 starts
|
|
348
448
|
```
|
|
349
449
|
|
|
350
|
-
#### Rule 2:
|
|
351
|
-
When an agent
|
|
352
|
-
- Dispatch it
|
|
450
|
+
#### Rule 2: Parallel + Auto-Accept = Zero-Overhead Path
|
|
451
|
+
When an agent runs in parallel with others AND its output qualifies for auto-accept:
|
|
452
|
+
- Dispatch it alongside other parallel agents
|
|
353
453
|
- When it returns: auto-accept without orchestrator review
|
|
354
|
-
- Append result to response
|
|
454
|
+
- Append result to response (all parallel agents finish before the response is sent)
|
|
355
455
|
- **Total orchestrator overhead: 0 seconds**
|
|
356
456
|
|
|
357
457
|
This is the highest-throughput path. Common cases:
|
|
358
|
-
-
|
|
359
|
-
-
|
|
360
|
-
-
|
|
458
|
+
- Parallel hydra-runner (final validation) reporting all-pass → zero overhead
|
|
459
|
+
- Parallel hydra-scribe (internal docstrings) → zero overhead
|
|
460
|
+
- Parallel hydra-scout (supplementary context) → zero overhead, index updated
|
|
361
461
|
|
|
362
462
|
#### Rule 3: Auto-Accepted Scout Output ALWAYS Updates Session Index
|
|
363
463
|
Every scout output that passes auto-accept is immediately folded into the Session Index.
|
|
364
464
|
No separate step. The act of auto-accepting IS the index update.
|
|
365
465
|
|
|
366
|
-
#### Rule 4:
|
|
367
|
-
|
|
466
|
+
#### Rule 4: Parallel Dispatch Does Not Override Verification Requirements
|
|
467
|
+
Parallel dispatch governs TIMING (run together), not VERIFICATION (do review).
|
|
368
468
|
If scribe writes user-facing docs (README, API docs), verification is still required —
|
|
369
|
-
it happens when
|
|
370
|
-
|
|
469
|
+
it happens when all parallel agents complete, before the response is sent.
|
|
470
|
+
Opus always waits for every dispatched agent before presenting results.
|
|
371
471
|
|
|
372
472
|
### Timing Profile: Optimized vs Baseline
|
|
373
473
|
|
|
@@ -388,11 +488,11 @@ OPTIMIZED (all 4 optimizations active):
|
|
|
388
488
|
t=3s Scout auto-accepted, index built [0s overhead]
|
|
389
489
|
t=3s Dispatch coder (index context injected), wait [5s]
|
|
390
490
|
t=8s Quick-scan coder (code → verify) [1s]
|
|
391
|
-
t=9s Dispatch runner (
|
|
392
|
-
Scribe
|
|
393
|
-
t=12s Runner: all-pass → auto-accept
|
|
394
|
-
|
|
395
|
-
|
|
491
|
+
t=9s Dispatch runner (parallel) + scribe (parallel) [3s — both run at once]
|
|
492
|
+
Scribe and runner run simultaneously, Opus waits for both
|
|
493
|
+
t=12s Runner: all-pass → auto-accept [0s overhead]
|
|
494
|
+
Scribe: internal docs → auto-accept [0s overhead]
|
|
495
|
+
t=12s Present result to user (single response, all outputs included)
|
|
396
496
|
Total wall-clock: ~12 seconds (33% faster, zero quality loss)
|
|
397
497
|
```
|
|
398
498
|
|
|
@@ -964,15 +1064,16 @@ If the user types any of these exact phrases, respond with the corresponding act
|
|
|
964
1064
|
|
|
965
1065
|
| Command | Action |
|
|
966
1066
|
|---------|--------|
|
|
967
|
-
| `hydra status` | List all
|
|
1067
|
+
| `hydra status` | List all 10 heads by name, model, and whether they appear to be installed (check `agents/` dir) |
|
|
968
1068
|
| `hydra config` | Show current configuration settings (mode, dispatch_log, auto_guard) and their source (default/project/user) |
|
|
969
1069
|
| `hydra help` | Show available commands and a brief one-line description of each head |
|
|
970
1070
|
| `hydra quiet` | Suppress dispatch logs for the rest of the session (equivalent to stealth mode) |
|
|
971
1071
|
| `hydra verbose` | Enable verbose dispatch logs with per-agent detail for the rest of the session |
|
|
972
1072
|
| `hydra reset` | Clear session index, treat next turn as Turn 1 (rebuild from fresh scout) |
|
|
973
1073
|
| `hydra map` | Show codebase map summary, or query a specific file's blast radius |
|
|
1074
|
+
| `hydra preflight` | Run two-phase environment and compatibility check before starting a new project build |
|
|
974
1075
|
|
|
975
|
-
## The
|
|
1076
|
+
## The Ten Heads
|
|
976
1077
|
|
|
977
1078
|
| Head | Model | Role | Tools |
|
|
978
1079
|
|------|-------|------|-------|
|
|
@@ -982,6 +1083,7 @@ If the user types any of these exact phrases, respond with the corresponding act
|
|
|
982
1083
|
| `hydra-guard` | 🟢 Haiku 4.5 | Security/quality gate after code changes | Read, Grep, Glob, Bash |
|
|
983
1084
|
| `hydra-git` | 🟢 Haiku 4.5 | Git operations: commit, branch, diff, log | Read, Bash, Glob, Grep |
|
|
984
1085
|
| `hydra-sentinel-scan` | 🟢 Haiku 4.5 | Fast integration sweep after code changes | Read, Grep, Glob |
|
|
1086
|
+
| `hydra-preflight` | 🟢 Haiku 4.5 | Environment detection, version probing, dep inventory | Read, Bash, Glob |
|
|
985
1087
|
| `hydra-coder` | 🔵 Sonnet 4.6 | Code writing, implementation, refactoring | Read, Write, Edit, Bash, Glob, Grep |
|
|
986
1088
|
| `hydra-analyst` | 🔵 Sonnet 4.6 | Code review, debugging, architecture analysis | Read, Grep, Glob, Bash |
|
|
987
1089
|
| `hydra-sentinel` | 🔵 Sonnet 4.6 | Deep integration analysis (when scan flags issues) | Read, Grep, Glob, Write |
|
|
@@ -991,6 +1093,7 @@ If the user types any of these exact phrases, respond with the corresponding act
|
|
|
991
1093
|
Track these mentally to calibrate:
|
|
992
1094
|
|
|
993
1095
|
- **Delegation rate**: What % of tasks go to heads? Target: 60–70%.
|
|
1096
|
+
- **Preflight rate**: Are you running `/hydra:preflight` on new projects? Target: 100% of new project sessions.
|
|
994
1097
|
- **Rejection rate**: How often does a draft need Opus intervention? Target: <15%.
|
|
995
1098
|
- **User complaints**: Zero. If the user notices quality issues, tune the classification.
|
|
996
1099
|
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hydra-preflight
|
|
3
|
+
description: >
|
|
4
|
+
Environment and dependency preflight check for new projects. Detects runtime
|
|
5
|
+
versions, runs compatibility probe scripts, collects the full dependency tree,
|
|
6
|
+
and returns a structured inventory for cross-component analysis. Use when the
|
|
7
|
+
user runs /hydra:preflight or when starting work on a new or unfamiliar project.
|
|
8
|
+
tools: Read, Bash, Glob
|
|
9
|
+
model: haiku
|
|
10
|
+
color: "#10B981"
|
|
11
|
+
memory: project
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# hydra-preflight
|
|
15
|
+
|
|
16
|
+
You are the preflight detection head. Your job is pure detection — no judgment,
|
|
17
|
+
no recommendations. Collect facts, run probes, return a structured inventory.
|
|
18
|
+
The analyst will handle compatibility reasoning.
|
|
19
|
+
|
|
20
|
+
## Your Task
|
|
21
|
+
|
|
22
|
+
Run ALL of the following checks. Do not skip any. Report every finding, including
|
|
23
|
+
nulls and failures — a missing value is as important as a present one.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 1. Runtime Versions
|
|
28
|
+
|
|
29
|
+
Detect and record the exact installed version of every runtime present:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
node --version 2>/dev/null || echo "NOT_FOUND"
|
|
33
|
+
python --version 2>/dev/null || python3 --version 2>/dev/null || echo "NOT_FOUND"
|
|
34
|
+
python -c "import sys; print(sys.version_info)" 2>/dev/null || echo "NOT_FOUND"
|
|
35
|
+
bun --version 2>/dev/null || echo "NOT_FOUND"
|
|
36
|
+
deno --version 2>/dev/null || echo "NOT_FOUND"
|
|
37
|
+
ruby --version 2>/dev/null || echo "NOT_FOUND"
|
|
38
|
+
go version 2>/dev/null || echo "NOT_FOUND"
|
|
39
|
+
rustc --version 2>/dev/null || echo "NOT_FOUND"
|
|
40
|
+
java -version 2>/dev/null || echo "NOT_FOUND"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Also check for version lock files and declared version requirements:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
cat .nvmrc 2>/dev/null || echo "NO_NVMRC"
|
|
47
|
+
cat .python-version 2>/dev/null || echo "NO_PYTHON_VERSION"
|
|
48
|
+
cat .tool-versions 2>/dev/null || echo "NO_TOOL_VERSIONS"
|
|
49
|
+
cat package.json 2>/dev/null | grep -A5 '"engines"' || echo "NO_ENGINES_FIELD"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 2. Package Manager and Dependencies
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Node
|
|
58
|
+
ls node_modules 2>/dev/null | wc -l || echo "node_modules: NOT_FOUND"
|
|
59
|
+
cat package.json 2>/dev/null | grep -E '"dependencies"|"devDependencies"' | head -5
|
|
60
|
+
|
|
61
|
+
# Python
|
|
62
|
+
pip list 2>/dev/null | head -30 || pip3 list 2>/dev/null | head -30 || echo "pip: NOT_FOUND"
|
|
63
|
+
cat requirements.txt 2>/dev/null || cat requirements/*.txt 2>/dev/null || echo "NO_REQUIREMENTS"
|
|
64
|
+
cat pyproject.toml 2>/dev/null | head -40 || echo "NO_PYPROJECT"
|
|
65
|
+
ls -la venv/ 2>/dev/null || ls -la .venv/ 2>/dev/null || echo "NO_VENV"
|
|
66
|
+
|
|
67
|
+
# Others
|
|
68
|
+
cat Cargo.toml 2>/dev/null | head -20 || echo "NO_CARGO"
|
|
69
|
+
cat go.mod 2>/dev/null | head -10 || echo "NO_GOMOD"
|
|
70
|
+
cat Gemfile 2>/dev/null | head -10 || echo "NO_GEMFILE"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 3. GPU / CUDA Stack (run if Python is present)
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
nvidia-smi 2>/dev/null || echo "nvidia-smi: NOT_FOUND"
|
|
79
|
+
nvcc --version 2>/dev/null || echo "nvcc: NOT_FOUND"
|
|
80
|
+
python -c "import torch; print('torch:', torch.__version__); print('cuda_available:', torch.cuda.is_available()); print('cuda_version:', torch.version.cuda); print('cudnn_version:', torch.backends.cudnn.version())" 2>/dev/null || echo "torch: NOT_INSTALLED"
|
|
81
|
+
python -c "import tensorflow as tf; print('tf:', tf.__version__); print('gpu_devices:', tf.config.list_physical_devices('GPU'))" 2>/dev/null || echo "tensorflow: NOT_INSTALLED"
|
|
82
|
+
python -c "import jax; print('jax:', jax.__version__); print('jax_devices:', jax.devices())" 2>/dev/null || echo "jax: NOT_INSTALLED"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 4. Environment Variables
|
|
88
|
+
|
|
89
|
+
Scan for required env vars by comparing .env.example (or .env.sample) against .env:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# What vars are declared as required
|
|
93
|
+
cat .env.example 2>/dev/null || cat .env.sample 2>/dev/null || echo "NO_ENV_EXAMPLE"
|
|
94
|
+
|
|
95
|
+
# What vars are actually set (keys only, never values)
|
|
96
|
+
cat .env 2>/dev/null | grep -v '^#' | grep '=' | cut -d'=' -f1 || echo "NO_ENV_FILE"
|
|
97
|
+
|
|
98
|
+
# Check for common required vars in environment
|
|
99
|
+
echo "CHECKING ENV:"
|
|
100
|
+
for var in DATABASE_URL REDIS_URL API_KEY SECRET_KEY OPENAI_API_KEY ANTHROPIC_API_KEY PORT NODE_ENV PYTHON_ENV; do
|
|
101
|
+
if [ -n "${!var}" ]; then echo "$var: SET"; else echo "$var: NOT_SET"; fi
|
|
102
|
+
done
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## 5. Build and Test Commands
|
|
108
|
+
|
|
109
|
+
Check if declared commands actually resolve (do NOT run them, just verify they exist):
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# From package.json scripts
|
|
113
|
+
cat package.json 2>/dev/null | python -c "import sys,json; d=json.load(sys.stdin); print(json.dumps(d.get('scripts',{}), indent=2))" 2>/dev/null || echo "NO_SCRIPTS"
|
|
114
|
+
|
|
115
|
+
# Check if build tools exist
|
|
116
|
+
which webpack 2>/dev/null || npx --no webpack --version 2>/dev/null || echo "webpack: NOT_FOUND"
|
|
117
|
+
which vite 2>/dev/null || npx --no vite --version 2>/dev/null || echo "vite: NOT_FOUND"
|
|
118
|
+
which tsc 2>/dev/null || npx --no tsc --version 2>/dev/null || echo "tsc: NOT_FOUND"
|
|
119
|
+
which pytest 2>/dev/null || echo "pytest: NOT_FOUND"
|
|
120
|
+
which jest 2>/dev/null || npx --no jest --version 2>/dev/null || echo "jest: NOT_FOUND"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 6. Git Status
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
git status --short 2>/dev/null || echo "NOT_A_GIT_REPO"
|
|
129
|
+
git log --oneline -3 2>/dev/null || echo "NO_COMMITS"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 7. Database / Service Connectivity (if applicable)
|
|
135
|
+
|
|
136
|
+
Only run these if config files suggest they are needed:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# PostgreSQL
|
|
140
|
+
psql $DATABASE_URL -c "SELECT 1;" 2>/dev/null && echo "postgres: REACHABLE" || echo "postgres: UNREACHABLE_OR_NOT_CONFIGURED"
|
|
141
|
+
|
|
142
|
+
# Redis
|
|
143
|
+
redis-cli ping 2>/dev/null || echo "redis: NOT_REACHABLE"
|
|
144
|
+
|
|
145
|
+
# MongoDB
|
|
146
|
+
mongosh --eval "db.runCommand({ping:1})" 2>/dev/null && echo "mongo: REACHABLE" || echo "mongo: UNREACHABLE_OR_NOT_CONFIGURED"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Output Format
|
|
152
|
+
|
|
153
|
+
Return your findings as a structured JSON block followed by a plain-text summary:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
PREFLIGHT_INVENTORY:
|
|
157
|
+
{
|
|
158
|
+
"runtimes": { ... },
|
|
159
|
+
"declared_requirements": { ... },
|
|
160
|
+
"deps_installed": { ... },
|
|
161
|
+
"gpu_stack": { ... },
|
|
162
|
+
"env_vars": { "required": [...], "present": [...], "missing": [...] },
|
|
163
|
+
"build_tools": { ... },
|
|
164
|
+
"services": { ... },
|
|
165
|
+
"git": { ... },
|
|
166
|
+
"probe_outputs": { ... }
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
PROBE_FAILURES:
|
|
170
|
+
[list any probe that threw an error, with the raw error message]
|
|
171
|
+
|
|
172
|
+
PREFLIGHT_INVENTORY_COMPLETE
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Do not add recommendations, compatibility judgments, or fixes. That is the analyst's job.
|
|
@@ -19,6 +19,7 @@ COMMANDS
|
|
|
19
19
|
/hydra:map View, rebuild, or query the codebase map
|
|
20
20
|
/hydra:verbose Enable verbose dispatch logs with timing
|
|
21
21
|
/hydra:report Report a bug, request a feature, or share feedback
|
|
22
|
+
/hydra:preflight Two-phase environment & compatibility check before new projects
|
|
22
23
|
|
|
23
24
|
AGENTS
|
|
24
25
|
🟢 hydra-scout (Haiku 4.5) — Explore codebase, find files, map structure
|
|
@@ -26,6 +27,7 @@ AGENTS
|
|
|
26
27
|
🟢 hydra-scribe (Haiku 4.5) — Write docs, comments, READMEs
|
|
27
28
|
🟢 hydra-guard (Haiku 4.5) — Security scan, quality gate
|
|
28
29
|
🟢 hydra-git (Haiku 4.5) — Git operations, commits, branches
|
|
30
|
+
🟢 hydra-preflight (Haiku 4.5) — Environment detection, version probing, dep inventory
|
|
29
31
|
🔵 hydra-coder (Sonnet 4.6) — Write and edit code
|
|
30
32
|
🔵 hydra-analyst (Sonnet 4.6) — Debug, diagnose, review
|
|
31
33
|
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run two-phase environment and compatibility check before starting a new project build
|
|
3
|
+
allowed-tools: Task
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Hydra Preflight
|
|
7
|
+
|
|
8
|
+
Run the two-phase environment and compatibility check before starting work on a
|
|
9
|
+
new or unfamiliar project. Catches broken GPU stacks, missing env vars, and
|
|
10
|
+
incompatible dependency pairs before they cost hours of debugging.
|
|
11
|
+
|
|
12
|
+
## Execute the Preflight Protocol
|
|
13
|
+
|
|
14
|
+
Follow the **Preflight Protocol** defined in SKILL.md — two phases, always
|
|
15
|
+
dispatched in sequence. Never skip Phase 2.
|
|
16
|
+
|
|
17
|
+
### Phase 1 — Detection (dispatch hydra-preflight, Haiku 4.5)
|
|
18
|
+
|
|
19
|
+
Dispatch the `hydra-preflight` agent with this prompt:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
Run a full preflight check on this project. Collect runtime versions, run all
|
|
23
|
+
GPU/CUDA probe scripts, inventory installed packages, compare .env.example
|
|
24
|
+
against .env, verify build tools exist, and check service connectivity. Return
|
|
25
|
+
the full structured PREFLIGHT_INVENTORY JSON. Do not make recommendations.
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Wait for the agent to return `PREFLIGHT_INVENTORY_COMPLETE` before proceeding.
|
|
29
|
+
|
|
30
|
+
### Phase 2 — Analysis (dispatch hydra-analyst, Sonnet 4.6)
|
|
31
|
+
|
|
32
|
+
Pass the full PREFLIGHT_INVENTORY from Phase 1 as context and dispatch
|
|
33
|
+
`hydra-analyst` with this prompt:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
You are performing a compatibility analysis on the following environment inventory.
|
|
37
|
+
Cross-reference all detected versions against known compatibility matrices.
|
|
38
|
+
Pay special attention to GPU stack combinations (PyTorch/CUDA/cuDNN),
|
|
39
|
+
framework pairs (React/Next, Python/TF), and Node/native addon combinations.
|
|
40
|
+
|
|
41
|
+
For each component or pair, return one of three verdicts:
|
|
42
|
+
✅ COMPATIBLE — versions are known-good together
|
|
43
|
+
⚠️ KNOWN RISK — this combination has known issues or is untested
|
|
44
|
+
❌ CONFIRMED BREAK — probe output or known matrix confirms incompatibility
|
|
45
|
+
|
|
46
|
+
For ❌ verdicts, include the specific fix (e.g. "pin pytorch==2.7.0").
|
|
47
|
+
For ⚠️ verdicts, include what to watch for.
|
|
48
|
+
For unknowns, flag as "UNVERIFIED — test before building" rather than assuming green.
|
|
49
|
+
|
|
50
|
+
Probe output from Phase 1 is ground truth — it always beats matrix knowledge.
|
|
51
|
+
If torch.cuda.is_available() returned False, that is a ❌ regardless of what
|
|
52
|
+
the version matrix says.
|
|
53
|
+
|
|
54
|
+
INVENTORY:
|
|
55
|
+
[paste full PREFLIGHT_INVENTORY here]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Present the Unified Report
|
|
59
|
+
|
|
60
|
+
After both phases return, present a unified report in this format:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
🐉 Hydra Preflight — [project name]
|
|
64
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
65
|
+
|
|
66
|
+
RUNTIMES
|
|
67
|
+
✅ Node 22.4.0 (matches .nvmrc)
|
|
68
|
+
✅ Python 3.11.9 (matches .python-version)
|
|
69
|
+
|
|
70
|
+
GPU STACK
|
|
71
|
+
❌ PyTorch 2.6.0 + CUDA 13.0 — incompatible
|
|
72
|
+
Fix: pip install torch==2.7.0
|
|
73
|
+
|
|
74
|
+
ENVIRONMENT
|
|
75
|
+
⚠️ Missing: DATABASE_URL, REDIS_URL (declared in .env.example)
|
|
76
|
+
|
|
77
|
+
DEPENDENCIES
|
|
78
|
+
✅ node_modules present (1,847 packages)
|
|
79
|
+
✅ venv present
|
|
80
|
+
|
|
81
|
+
SERVICES
|
|
82
|
+
❌ PostgreSQL: unreachable (DATABASE_URL not set)
|
|
83
|
+
✅ Redis: reachable
|
|
84
|
+
|
|
85
|
+
BUILD TOOLS
|
|
86
|
+
✅ vite, tsc, pytest all found
|
|
87
|
+
|
|
88
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
89
|
+
X confirmed breaks, Y known risks, Z warnings
|
|
90
|
+
Fix the ❌ items before building.
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Auto-suggest pinned-version fixes for ❌ verdicts. **Never** auto-apply fixes
|
|
94
|
+
unless the user says "fix it" or "apply fixes".
|
package/package.json
CHANGED
package/src/display.js
CHANGED
|
@@ -41,8 +41,8 @@ function showInstallComplete(statusLineConfigured = true) {
|
|
|
41
41
|
console.log();
|
|
42
42
|
console.log(chalk.cyan.bold(' \uD83D\uDC09 Hail Hydra! Framework deployed and ready.'));
|
|
43
43
|
console.log(chalk.gray(' ' + '\u2500'.repeat(45)));
|
|
44
|
-
console.log(chalk.green(` \u2714
|
|
45
|
-
console.log(chalk.green(` \u2714
|
|
44
|
+
console.log(chalk.green(` \u2714 10 agents installed`));
|
|
45
|
+
console.log(chalk.green(` \u2714 10 slash commands installed`));
|
|
46
46
|
console.log(chalk.green(` \u2714 4 hooks registered`));
|
|
47
47
|
if (statusLineConfigured) {
|
|
48
48
|
console.log(chalk.green(` \u2714 StatusLine configured`));
|
package/src/files.js
CHANGED
|
@@ -63,6 +63,11 @@ const agents = {
|
|
|
63
63
|
model: 'Sonnet',
|
|
64
64
|
display: 'hydra-sentinel (Sonnet) — Deep integration analysis',
|
|
65
65
|
},
|
|
66
|
+
'hydra-preflight': {
|
|
67
|
+
content: readBundled('agents/hydra-preflight.md'),
|
|
68
|
+
model: 'Haiku',
|
|
69
|
+
display: 'hydra-preflight (Haiku) — Environment preflight check',
|
|
70
|
+
},
|
|
66
71
|
};
|
|
67
72
|
|
|
68
73
|
const skill = readBundled('SKILL.md');
|
|
@@ -82,6 +87,7 @@ const commands = {
|
|
|
82
87
|
'verbose': readBundled('commands/hydra/verbose.md'),
|
|
83
88
|
'report': readBundled('commands/hydra/report.md'),
|
|
84
89
|
'map': readBundled('commands/hydra/map.md'),
|
|
90
|
+
'preflight': readBundled('commands/hydra/preflight.md'),
|
|
85
91
|
};
|
|
86
92
|
|
|
87
93
|
const hooks = {
|
package/src/prompts.js
CHANGED
|
@@ -36,7 +36,7 @@ async function runPrompts() {
|
|
|
36
36
|
// ── Prompt 2: Confirmation with agent preview ─────────────────────────────
|
|
37
37
|
|
|
38
38
|
console.log();
|
|
39
|
-
console.log(chalk.bold(' This will install
|
|
39
|
+
console.log(chalk.bold(' This will install 10 Hydra agents + SKILL.md + reference docs.'));
|
|
40
40
|
console.log();
|
|
41
41
|
console.log(' Agents:');
|
|
42
42
|
|
|
@@ -47,6 +47,7 @@ async function runPrompts() {
|
|
|
47
47
|
{ dot: chalk.green('🟢'), name: 'hydra-guard (Haiku) ', role: 'Auto-protection & safety' },
|
|
48
48
|
{ dot: chalk.green('🟢'), name: 'hydra-git (Haiku) ', role: 'Git operations' },
|
|
49
49
|
{ dot: chalk.green('🟢'), name: 'hydra-sentinel-scan (Haiku) ', role: 'Fast integration sweep' },
|
|
50
|
+
{ dot: chalk.green('🟢'), name: 'hydra-preflight (Haiku) ', role: 'Environment preflight check' },
|
|
50
51
|
{ dot: chalk.blue('🔵'), name: 'hydra-coder (Sonnet) ', role: 'Code implementation' },
|
|
51
52
|
{ dot: chalk.blue('🔵'), name: 'hydra-analyst (Sonnet) ', role: 'Code review & debugging' },
|
|
52
53
|
{ dot: chalk.blue('🔵'), name: 'hydra-sentinel (Sonnet) ', role: 'Deep integration analysis' },
|