dual-brain 4.0.0 → 4.0.1
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/CLAUDE.md +33 -2
- package/README.md +26 -1
- package/package.json +1 -1
package/CLAUDE.md
CHANGED
|
@@ -64,18 +64,49 @@ Profile persists to `.claude/dual-brain.profile.json` (gitignored).
|
|
|
64
64
|
Switch profiles: `npx dual-brain mode cost-saver`
|
|
65
65
|
Check status: `npx dual-brain status`
|
|
66
66
|
|
|
67
|
+
Natural language aliases work everywhere: "go aggressive", "be careful", "cheap mode", "fast", "thorough", "smart". The system strips prefixes like "go"/"be"/"use" and resolves to the canonical profile name.
|
|
68
|
+
|
|
67
69
|
## Adaptive Routing (Auto Mode)
|
|
68
70
|
|
|
69
71
|
Auto mode classifies risk from file paths and adjusts routing in real-time:
|
|
70
72
|
|
|
71
73
|
- **Risk classification**: auth/secrets→critical, billing/migrations→high, tests/utils→medium, docs→low
|
|
72
|
-
- **Failure detection**: 2+ failures on same prompt in 2 hours → auto-escalate tier or trigger dual-brain
|
|
74
|
+
- **Failure detection**: 2+ failures on same prompt in 2 hours → auto-escalate tier or trigger dual-brain. Uses time-weighted decay (recent failures count more) and ledger pruning for entries >24hrs.
|
|
73
75
|
- **Provider balance**: Routes to underused provider when one subscription is hot
|
|
76
|
+
- **Burst awareness**: Suppresses duplicate warnings and balance hints during agent waves (3+ agents in 90s)
|
|
77
|
+
|
|
78
|
+
## Vibe Coding
|
|
79
|
+
|
|
80
|
+
Casual natural language → structured work. The vibe coding system translates informal requests into properly routed, risk-classified, quality-gated work.
|
|
81
|
+
|
|
82
|
+
**Intent compiler** — decompose multi-task requests:
|
|
83
|
+
```bash
|
|
84
|
+
node .claude/hooks/vibe-router.mjs "fix the login bug and also update the nav"
|
|
85
|
+
```
|
|
86
|
+
Returns structured tasks with tier/risk classification, complexity level, quality gates, and wave strategy.
|
|
87
|
+
|
|
88
|
+
**Plan generator** — Steve-style 3-part markdown plans:
|
|
89
|
+
```bash
|
|
90
|
+
node .claude/hooks/plan-generator.mjs --utterance "..." [--write]
|
|
91
|
+
```
|
|
92
|
+
Generates: (1) dependency-ordered task table, (2) user stories + edge cases, (3) questions with suggested answers. Pass `--write` to save to `.claude/plans/`.
|
|
93
|
+
|
|
94
|
+
**Durable memory** — preferences persist across sessions:
|
|
95
|
+
```bash
|
|
96
|
+
node .claude/hooks/vibe-memory.mjs # show state
|
|
97
|
+
node .claude/hooks/vibe-memory.mjs --set preferences.risk_tolerance=careful
|
|
98
|
+
node .claude/hooks/vibe-memory.mjs --threads # active work
|
|
99
|
+
node .claude/hooks/vibe-memory.mjs --infer # preference suggestions
|
|
100
|
+
```
|
|
101
|
+
Tracks preferred profile, risk tolerance, active threads, and learns from usage patterns.
|
|
74
102
|
|
|
75
103
|
## Available Tools
|
|
76
104
|
|
|
105
|
+
- `node .claude/hooks/vibe-router.mjs "..."` — decompose casual requests into structured work
|
|
106
|
+
- `node .claude/hooks/plan-generator.mjs --utterance "..."` — generate execution plans
|
|
107
|
+
- `node .claude/hooks/vibe-memory.mjs` — persistent preferences and work threads
|
|
77
108
|
- `node .claude/hooks/cost-report.mjs` — activity and cost estimates
|
|
78
109
|
- `node .claude/hooks/health-check.mjs` — verify system health
|
|
79
110
|
- `node .claude/hooks/budget-balancer.mjs` — provider balance status
|
|
80
111
|
- `node .claude/hooks/decision-ledger.mjs` — routing outcome insights
|
|
81
|
-
- `node .claude/hooks/test-orchestrator.mjs` — run self-tests
|
|
112
|
+
- `node .claude/hooks/test-orchestrator.mjs` — run self-tests (40 tests)
|
package/README.md
CHANGED
|
@@ -51,10 +51,35 @@ npx -y dual-brain
|
|
|
51
51
|
|
|
52
52
|
**Dual-brain** is recommended automatically for high-risk decisions — hooks detect the risk level and suggest dual-brain analysis, where both providers think on the same problem independently.
|
|
53
53
|
|
|
54
|
+
## Vibe Coding
|
|
55
|
+
|
|
56
|
+
Speak naturally. The orchestrator handles the structure.
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Decompose a casual request into structured work
|
|
60
|
+
node .claude/hooks/vibe-router.mjs "fix the login bug and also update the nav"
|
|
61
|
+
|
|
62
|
+
# Generate a Steve-style execution plan
|
|
63
|
+
node .claude/hooks/plan-generator.mjs --utterance "refactor the auth flow" --write
|
|
64
|
+
|
|
65
|
+
# Switch profiles with natural language
|
|
66
|
+
npx dual-brain mode "go aggressive"
|
|
67
|
+
npx dual-brain mode "be careful"
|
|
68
|
+
npx dual-brain mode "cheap"
|
|
69
|
+
|
|
70
|
+
# Check persistent preferences and work threads
|
|
71
|
+
node .claude/hooks/vibe-memory.mjs --threads
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The vibe-router splits multi-task requests, classifies risk, assigns tiers, and recommends quality gates. The plan-generator produces 3-part plans (dependency-ordered tasks, user stories, questions with suggested answers). Vibe-memory learns your preferences over time.
|
|
75
|
+
|
|
54
76
|
## Scripts
|
|
55
77
|
|
|
56
78
|
| Script | Purpose |
|
|
57
79
|
|--------|---------|
|
|
80
|
+
| `hooks/vibe-router.mjs` | Decompose casual language into structured work orders |
|
|
81
|
+
| `hooks/plan-generator.mjs` | Generate Steve-style 3-part execution plans |
|
|
82
|
+
| `hooks/vibe-memory.mjs` | Persistent preferences, work threads, preference inference |
|
|
58
83
|
| `hooks/cost-report.mjs` | Activity & cost estimates by model tier |
|
|
59
84
|
| `hooks/dual-brain-review.mjs` | Send git diff to GPT for independent review |
|
|
60
85
|
| `hooks/dual-brain-think.mjs` | Dual-perspective analysis on architecture decisions |
|
|
@@ -63,7 +88,7 @@ npx -y dual-brain
|
|
|
63
88
|
| `hooks/gpt-work-dispatcher.mjs` | Dispatch execution tasks to GPT via Codex CLI |
|
|
64
89
|
| `hooks/session-report.mjs` | Session-end summary: activity, compliance, quality |
|
|
65
90
|
| `hooks/health-check.mjs` | Verify all hooks and dependencies are working |
|
|
66
|
-
| `hooks/test-orchestrator.mjs` | Self-test harness (
|
|
91
|
+
| `hooks/test-orchestrator.mjs` | Self-test harness (40 tests) |
|
|
67
92
|
| `hooks/setup-wizard.mjs` | Interactive config (optional — for custom plans) |
|
|
68
93
|
| `hooks/install-git-hooks.mjs` | Git pre-commit hook for quality gate |
|
|
69
94
|
|
package/package.json
CHANGED