dual-brain 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.
Files changed (68) hide show
  1. package/AGENTS.md +97 -0
  2. package/CLAUDE.md +147 -0
  3. package/LICENSE +21 -0
  4. package/README.md +197 -0
  5. package/agents/implementer.md +22 -0
  6. package/agents/researcher.md +25 -0
  7. package/agents/verifier.md +30 -0
  8. package/bin/dual-brain.mjs +2868 -0
  9. package/hooks/auto-update-wrapper.mjs +102 -0
  10. package/hooks/auto-update.sh +67 -0
  11. package/hooks/budget-balancer.mjs +679 -0
  12. package/hooks/control-panel.mjs +1195 -0
  13. package/hooks/cost-logger.mjs +286 -0
  14. package/hooks/cost-report.mjs +351 -0
  15. package/hooks/decision-ledger.mjs +299 -0
  16. package/hooks/dual-brain-review.mjs +404 -0
  17. package/hooks/dual-brain-think.mjs +393 -0
  18. package/hooks/enforce-tier.mjs +469 -0
  19. package/hooks/failure-detector.mjs +138 -0
  20. package/hooks/gpt-work-dispatcher.mjs +512 -0
  21. package/hooks/head-guard.mjs +105 -0
  22. package/hooks/health-check.mjs +444 -0
  23. package/hooks/install-git-hooks.mjs +106 -0
  24. package/hooks/model-registry.mjs +859 -0
  25. package/hooks/plan-generator.mjs +544 -0
  26. package/hooks/profiles.mjs +254 -0
  27. package/hooks/quality-gate.mjs +355 -0
  28. package/hooks/risk-classifier.mjs +41 -0
  29. package/hooks/session-report.mjs +514 -0
  30. package/hooks/setup-wizard.mjs +130 -0
  31. package/hooks/summary-checkpoint.mjs +432 -0
  32. package/hooks/task-classifier.mjs +328 -0
  33. package/hooks/test-orchestrator.mjs +1077 -0
  34. package/hooks/vibe-memory.mjs +463 -0
  35. package/hooks/vibe-router.mjs +387 -0
  36. package/hooks/wave-orchestrator.mjs +1397 -0
  37. package/install.mjs +1541 -0
  38. package/mcp-server/README.md +81 -0
  39. package/mcp-server/index.mjs +388 -0
  40. package/orchestrator.json +215 -0
  41. package/package.json +108 -0
  42. package/playbooks/debug.json +49 -0
  43. package/playbooks/refactor.json +57 -0
  44. package/playbooks/security-audit.json +57 -0
  45. package/playbooks/security.json +38 -0
  46. package/playbooks/test-gen.json +48 -0
  47. package/plugin.json +22 -0
  48. package/review-rules.md +17 -0
  49. package/shell-hook.sh +26 -0
  50. package/skills/go.md +22 -0
  51. package/skills/review.md +19 -0
  52. package/skills/status.md +13 -0
  53. package/skills/think.md +22 -0
  54. package/src/brief.mjs +266 -0
  55. package/src/decide.mjs +635 -0
  56. package/src/decompose.mjs +331 -0
  57. package/src/detect.mjs +345 -0
  58. package/src/dispatch.mjs +942 -0
  59. package/src/health.mjs +253 -0
  60. package/src/index.mjs +44 -0
  61. package/src/install-hooks.mjs +100 -0
  62. package/src/playbook.mjs +257 -0
  63. package/src/profile.mjs +990 -0
  64. package/src/redact.mjs +192 -0
  65. package/src/repo.mjs +292 -0
  66. package/src/session.mjs +1036 -0
  67. package/src/tui.mjs +197 -0
  68. package/src/update-check.mjs +35 -0
package/package.json ADDED
@@ -0,0 +1,108 @@
1
+ {
2
+ "name": "dual-brain",
3
+ "version": "0.1.0",
4
+ "description": "AI orchestration across Claude + OpenAI subscriptions — smart routing, budget awareness, and dual-brain collaboration",
5
+ "type": "module",
6
+ "bin": {
7
+ "dual-brain": "bin/dual-brain.mjs"
8
+ },
9
+ "main": "./src/index.mjs",
10
+ "exports": {
11
+ ".": "./src/index.mjs",
12
+ "./profile": "./src/profile.mjs",
13
+ "./detect": "./src/detect.mjs",
14
+ "./decide": "./src/decide.mjs",
15
+ "./dispatch": "./src/dispatch.mjs",
16
+ "./playbook": "./src/playbook.mjs",
17
+ "./health": "./src/health.mjs",
18
+ "./repo": "./src/repo.mjs",
19
+ "./session": "./src/session.mjs",
20
+ "./decompose": "./src/decompose.mjs",
21
+ "./brief": "./src/brief.mjs",
22
+ "./redact": "./src/redact.mjs"
23
+ },
24
+ "keywords": [
25
+ "claude-code",
26
+ "orchestrator",
27
+ "model-routing",
28
+ "code-review",
29
+ "dual-brain",
30
+ "gpt",
31
+ "claude",
32
+ "ai-agent"
33
+ ],
34
+ "author": "joshfair2@gmail.com",
35
+ "license": "MIT",
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "git+https://github.com/1xmint/dual-brain.git"
39
+ },
40
+ "scripts": {
41
+ "test": "node .claude/hooks/test-orchestrator.mjs",
42
+ "test:core": "node --test src/test.mjs",
43
+ "postinstall": "echo 'dual-brain installed. Run: dual-brain install (in your project) to set up hooks.'"
44
+ },
45
+ "engines": {
46
+ "node": ">=20.0.0"
47
+ },
48
+ "files": [
49
+ "src/profile.mjs",
50
+ "src/detect.mjs",
51
+ "src/decide.mjs",
52
+ "src/dispatch.mjs",
53
+ "src/playbook.mjs",
54
+ "src/health.mjs",
55
+ "src/repo.mjs",
56
+ "src/session.mjs",
57
+ "src/decompose.mjs",
58
+ "src/brief.mjs",
59
+ "src/redact.mjs",
60
+ "src/index.mjs",
61
+ "src/tui.mjs",
62
+ "src/install-hooks.mjs",
63
+ "src/update-check.mjs",
64
+ "bin/*.mjs",
65
+ "hooks/enforce-tier.mjs",
66
+ "hooks/cost-logger.mjs",
67
+ "hooks/cost-report.mjs",
68
+ "hooks/dual-brain-review.mjs",
69
+ "hooks/dual-brain-think.mjs",
70
+ "hooks/quality-gate.mjs",
71
+ "hooks/test-orchestrator.mjs",
72
+ "hooks/setup-wizard.mjs",
73
+ "hooks/health-check.mjs",
74
+ "hooks/install-git-hooks.mjs",
75
+ "hooks/session-report.mjs",
76
+ "hooks/budget-balancer.mjs",
77
+ "hooks/gpt-work-dispatcher.mjs",
78
+ "hooks/profiles.mjs",
79
+ "hooks/summary-checkpoint.mjs",
80
+ "hooks/decision-ledger.mjs",
81
+ "hooks/control-panel.mjs",
82
+ "hooks/risk-classifier.mjs",
83
+ "hooks/failure-detector.mjs",
84
+ "hooks/vibe-router.mjs",
85
+ "hooks/plan-generator.mjs",
86
+ "hooks/vibe-memory.mjs",
87
+ "hooks/wave-orchestrator.mjs",
88
+ "hooks/task-classifier.mjs",
89
+ "hooks/model-registry.mjs",
90
+ "hooks/auto-update-wrapper.mjs",
91
+ "hooks/head-guard.mjs",
92
+ "hooks/auto-update.sh",
93
+ "mcp-server/*.mjs",
94
+ "mcp-server/README.md",
95
+ "install.mjs",
96
+ "orchestrator.json",
97
+ "review-rules.md",
98
+ "AGENTS.md",
99
+ "CLAUDE.md",
100
+ "README.md",
101
+ "LICENSE",
102
+ "playbooks/*.json",
103
+ "plugin.json",
104
+ "skills/*.md",
105
+ "agents/*.md",
106
+ "shell-hook.sh"
107
+ ]
108
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "debug",
3
+ "description": "Structured bug resolution: reproduce, isolate, hypothesize root cause, fix minimally, verify with tests",
4
+ "matchIntents": ["debug", "fix"],
5
+ "steps": [
6
+ {
7
+ "id": "reproduce",
8
+ "title": "Reproduce the Failure",
9
+ "goal": "Find the failing code path. Identify the error message, stack trace, or unexpected behavior being reported. Locate the relevant source files, the entry point where the failure originates, and any existing tests that exercise this path. Confirm you understand the expected vs actual behavior.",
10
+ "tier": "search",
11
+ "consensus": false,
12
+ "output": { "kind": "analysis", "required": true }
13
+ },
14
+ {
15
+ "id": "isolate",
16
+ "title": "Isolate the Root Cause",
17
+ "goal": "Narrow down the root cause to a specific file, function, or line range. Trace the data flow from the failing callsite back to where the incorrect value or state originates. Check recent git changes to this code path. Identify the single most likely source of the problem before moving on.",
18
+ "tier": "search",
19
+ "consensus": false,
20
+ "output": { "kind": "analysis", "required": true }
21
+ },
22
+ {
23
+ "id": "hypothesize",
24
+ "title": "Form a Root Cause Hypothesis",
25
+ "goal": "Based on the isolated evidence, form a clear hypothesis about why the bug occurs. Consider: edge cases not handled, race conditions or ordering issues, incorrect assumptions about inputs or state, stale or shared mutable state, off-by-one errors, or API contract mismatches. State your hypothesis explicitly and explain what evidence supports it.",
26
+ "tier": "think",
27
+ "consensus": false,
28
+ "output": { "kind": "analysis", "required": true }
29
+ },
30
+ {
31
+ "id": "fix",
32
+ "title": "Implement the Minimal Fix",
33
+ "goal": "Implement the smallest change that fixes the bug according to the hypothesis. Do not refactor surrounding code, rename things, or improve unrelated areas. If a regression test for this bug does not exist, add one. The fix should be easy to review and easy to revert if wrong.",
34
+ "tier": "execute",
35
+ "consensus": false,
36
+ "gate": { "type": "diff-review", "requiredWhen": "high-risk" },
37
+ "output": { "kind": "patch", "required": true }
38
+ },
39
+ {
40
+ "id": "verify",
41
+ "title": "Verify Fix and Check for Regressions",
42
+ "goal": "Run the full test suite. Confirm the bug is no longer reproducible. Confirm no previously passing tests now fail. If regressions are found, determine whether they are related to the fix or pre-existing. Summarize: the root cause in one sentence, the fix applied, and the test evidence that the bug is resolved.",
43
+ "tier": "execute",
44
+ "consensus": false,
45
+ "gate": { "type": "test", "requiredWhen": "always" },
46
+ "output": { "kind": "summary", "required": true }
47
+ }
48
+ ]
49
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "refactor",
3
+ "description": "Safe, verified refactoring: map callers, lock invariants, plan steps, apply, test, and confirm behavior preservation",
4
+ "matchIntents": ["refactor"],
5
+ "steps": [
6
+ {
7
+ "id": "understand",
8
+ "title": "Map the Target Code",
9
+ "goal": "Map the target code: find all callers and call sites, direct and transitive dependencies, existing tests that cover it, and any observable side effects. Document the current behavior contract — what it accepts, what it returns, what it mutates, and what errors it may throw.",
10
+ "tier": "search",
11
+ "consensus": false,
12
+ "output": { "kind": "analysis", "required": true }
13
+ },
14
+ {
15
+ "id": "invariants",
16
+ "title": "Identify Behavioral Invariants",
17
+ "goal": "Based on the code map, identify the behavioral invariants that MUST be preserved through the refactor: public API surface (function signatures, exported names), return types and shapes, error handling contracts, ordering guarantees, and any side effects callers depend on. This list is the acceptance criterion for the refactor.",
18
+ "tier": "think",
19
+ "consensus": false,
20
+ "output": { "kind": "checklist", "required": true }
21
+ },
22
+ {
23
+ "id": "plan",
24
+ "title": "Design the Refactor",
25
+ "goal": "Design the refactoring as a sequence of small, independently verifiable steps. For each step, describe: what changes, what stays the same, and how to verify it didn't break anything. Avoid big-bang rewrites. Each step should leave the codebase in a working state.",
26
+ "tier": "think",
27
+ "consensus": true,
28
+ "gate": { "type": "approval", "requiredWhen": "always" },
29
+ "output": { "kind": "plan", "required": true }
30
+ },
31
+ {
32
+ "id": "apply",
33
+ "title": "Apply the Refactoring",
34
+ "goal": "Implement the refactoring changes following the approved plan. Make minimal edits — do not improve unrelated code, fix unrelated bugs, or change formatting outside the target. Preserve all invariants identified in the invariants step. Commit or stage changes step by step if the plan has multiple stages.",
35
+ "tier": "execute",
36
+ "consensus": false,
37
+ "output": { "kind": "patch", "required": true }
38
+ },
39
+ {
40
+ "id": "verify",
41
+ "title": "Run Tests and Fix Regressions",
42
+ "goal": "Run the full existing test suite. For any failures, determine whether they are real regressions (the refactor broke behavior) or expected test updates (tests were asserting on internal structure that legitimately changed). Fix real regressions immediately. Update tests only where the old test was testing implementation detail, not behavior.",
43
+ "tier": "execute",
44
+ "consensus": false,
45
+ "gate": { "type": "test", "requiredWhen": "always" },
46
+ "output": { "kind": "test", "required": true }
47
+ },
48
+ {
49
+ "id": "confirm",
50
+ "title": "Confirm Behavior Preservation",
51
+ "goal": "Review the final diff against the invariants checklist. Confirm each invariant is still satisfied. Summarize: what structural changes were made, what behavioral aspects are provably unchanged, and whether there are any remaining risks or follow-up tasks.",
52
+ "tier": "think",
53
+ "consensus": false,
54
+ "output": { "kind": "summary", "required": true }
55
+ }
56
+ ]
57
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "security-audit",
3
+ "description": "Systematic security review: inventory, threat model, vulnerability scan, ranked findings, remediation plan",
4
+ "matchIntents": ["security"],
5
+ "steps": [
6
+ {
7
+ "id": "inventory",
8
+ "title": "Inventory Security-Sensitive Files",
9
+ "goal": "Identify all security-sensitive files in the codebase: auth modules, secret storage, .env files, API key usage, token handling, encryption routines, and permission checks. List each file with a one-line note on its security role.",
10
+ "tier": "search",
11
+ "consensus": false,
12
+ "output": { "kind": "checklist", "required": true }
13
+ },
14
+ {
15
+ "id": "threat-model",
16
+ "title": "Threat Model",
17
+ "goal": "Analyze the attack surface of this codebase. Identify threat actors (external users, internal users, third-party services), attack vectors (inputs, APIs, files, network), and trust boundaries. Categorize threats using STRIDE (Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege) or a similar framework. Produce a structured threat model.",
18
+ "tier": "think",
19
+ "consensus": true,
20
+ "gate": { "type": "risk", "requiredWhen": "always" },
21
+ "output": { "kind": "analysis", "required": true }
22
+ },
23
+ {
24
+ "id": "vulnerability-scan",
25
+ "title": "Vulnerability Scan",
26
+ "goal": "Check the identified security-sensitive files for common vulnerabilities: hardcoded secrets or API keys, SQL injection, cross-site scripting (XSS), cross-site request forgery (CSRF), insecure deserialization, path traversal, missing or insufficient input validation, and improper error handling that leaks internals. List each finding with file, line reference, and a brief description.",
27
+ "tier": "search",
28
+ "consensus": false,
29
+ "output": { "kind": "checklist", "required": true }
30
+ },
31
+ {
32
+ "id": "exploitability-rank",
33
+ "title": "Exploitability Ranking",
34
+ "goal": "Rank the findings from the vulnerability scan by exploitability and impact using CVSS-style severity (Critical, High, Medium, Low). For each finding, estimate attack complexity and potential blast radius. Filter out false positives and explain your reasoning. Produce a ranked list with severity labels.",
35
+ "tier": "think",
36
+ "consensus": true,
37
+ "gate": { "type": "risk", "requiredWhen": "always" },
38
+ "output": { "kind": "analysis", "required": true }
39
+ },
40
+ {
41
+ "id": "remediation-plan",
42
+ "title": "Remediation Plan",
43
+ "goal": "For each confirmed vulnerability, propose a specific fix: name the exact file and line range, describe the code change needed, and explain why it closes the vulnerability. Prioritize fixes by severity (Critical first). Where a fix introduces new risk, call it out.",
44
+ "tier": "think",
45
+ "consensus": false,
46
+ "output": { "kind": "plan", "required": true }
47
+ },
48
+ {
49
+ "id": "summary",
50
+ "title": "Risk Assessment Summary",
51
+ "goal": "Produce a final risk assessment: total counts by severity (Critical/High/Medium/Low), top 3 priorities that must be addressed before the next release, and an estimate of residual risk after all proposed fixes are applied. Keep it concise — this is the executive summary.",
52
+ "tier": "think",
53
+ "consensus": false,
54
+ "output": { "kind": "summary", "required": true }
55
+ }
56
+ ]
57
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "security-audit",
3
+ "description": "Structured security audit workflow: inventory, threat model, vulnerability scan, remediation plan",
4
+ "matchIntents": ["security"],
5
+ "steps": [
6
+ {
7
+ "id": "inventory",
8
+ "title": "Asset Inventory",
9
+ "goal": "Identify all security-sensitive files, endpoints, auth flows, and secret storage locations in the codebase",
10
+ "tier": "search",
11
+ "output": { "kind": "analysis", "required": true }
12
+ },
13
+ {
14
+ "id": "threat-model",
15
+ "title": "Threat Model",
16
+ "goal": "Map attack surfaces identified in inventory to STRIDE threat categories; call out critical trust boundaries and privilege escalation paths",
17
+ "tier": "think",
18
+ "consensus": true,
19
+ "output": { "kind": "analysis", "required": true }
20
+ },
21
+ {
22
+ "id": "vuln-scan",
23
+ "title": "Vulnerability Scan",
24
+ "goal": "Review each high-risk file from inventory for concrete vulnerabilities: injection, insecure defaults, secret leakage, broken auth, missing input validation",
25
+ "tier": "execute",
26
+ "output": { "kind": "findings", "required": true }
27
+ },
28
+ {
29
+ "id": "remediation-plan",
30
+ "title": "Remediation Plan",
31
+ "goal": "Produce a prioritised remediation plan: severity, affected file/line, recommended fix, and estimated effort for each finding",
32
+ "tier": "think",
33
+ "consensus": true,
34
+ "gate": "human-review",
35
+ "output": { "kind": "plan", "required": true }
36
+ }
37
+ ]
38
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "test-gen",
3
+ "description": "Targeted test generation: analyze behavior, design test cases, write tests, run them, and report coverage gaps",
4
+ "matchIntents": ["test"],
5
+ "steps": [
6
+ {
7
+ "id": "analyze",
8
+ "title": "Analyze Target Behavior",
9
+ "goal": "Identify the target code's observable behavior: all inputs and their valid ranges, outputs and their shapes, side effects (writes, network calls, mutations), error paths and what triggers them, and edge cases implied by the logic. Check existing test coverage to avoid duplicating what already exists.",
10
+ "tier": "search",
11
+ "consensus": false,
12
+ "output": { "kind": "analysis", "required": true }
13
+ },
14
+ {
15
+ "id": "design",
16
+ "title": "Design the Test Cases",
17
+ "goal": "Choose the appropriate test strategy: unit tests for isolated logic, integration tests for module boundaries, or end-to-end tests for full flows. Enumerate the specific test cases to write: happy path scenarios, edge cases (empty input, max values, nulls), error and exception paths, and boundary value cases. Justify the strategy choice based on what will give the most signal per test.",
18
+ "tier": "think",
19
+ "consensus": false,
20
+ "output": { "kind": "plan", "required": true }
21
+ },
22
+ {
23
+ "id": "generate",
24
+ "title": "Write the Tests",
25
+ "goal": "Write the tests following the design plan. Match the existing test framework, file naming conventions, describe/it or test() structure, assertion style, and helper patterns already used in this project. Each test should have a clear name that describes the scenario, not the implementation. Do not test internal state — test observable behavior.",
26
+ "tier": "execute",
27
+ "consensus": false,
28
+ "output": { "kind": "test", "required": true }
29
+ },
30
+ {
31
+ "id": "run",
32
+ "title": "Run Tests and Fix Test Bugs",
33
+ "goal": "Run the newly generated tests. If any fail, determine whether the failure is a bug in the test (wrong assertion, bad setup, incorrect expectation) or a real bug in the code under test. Fix test bugs only — do not change production code here unless a genuine pre-existing bug is discovered (if so, note it and leave it for a separate fix step). Ensure all generated tests pass.",
34
+ "tier": "execute",
35
+ "consensus": false,
36
+ "gate": { "type": "test", "requiredWhen": "always" },
37
+ "output": { "kind": "test", "required": true }
38
+ },
39
+ {
40
+ "id": "coverage",
41
+ "title": "Coverage Summary and Gap Analysis",
42
+ "goal": "Summarize the test coverage added: how many new test cases, which behaviors are now verified, and which code paths are exercised. Identify remaining gaps: behaviors that are hard to test (external dependencies, time-dependent logic, non-determinism) and explain why. Recommend follow-up tests if any critical paths remain untested.",
43
+ "tier": "think",
44
+ "consensus": false,
45
+ "output": { "kind": "summary", "required": true }
46
+ }
47
+ ]
48
+ }
package/plugin.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "dual-brain",
3
+ "version": "7.1.4",
4
+ "description": "Dual-provider AI orchestration — smart routing between Claude and OpenAI",
5
+ "skills": [
6
+ { "name": "go", "description": "Route and dispatch a task", "file": "skills/go.md" },
7
+ { "name": "status", "description": "Show provider health and budget", "file": "skills/status.md" },
8
+ { "name": "think", "description": "Dual-brain architecture discussion", "file": "skills/think.md" },
9
+ { "name": "review", "description": "Dual-brain code review", "file": "skills/review.md" }
10
+ ],
11
+ "hooks": {
12
+ "PreToolUse": [
13
+ { "matcher": "Edit|Write|NotebookEdit|Bash", "command": "node hooks/head-guard.mjs" },
14
+ { "matcher": "Agent", "command": "node hooks/enforce-tier.mjs" }
15
+ ]
16
+ },
17
+ "agents": [
18
+ { "name": "researcher", "file": "agents/researcher.md" },
19
+ { "name": "implementer", "file": "agents/implementer.md" },
20
+ { "name": "verifier", "file": "agents/verifier.md" }
21
+ ]
22
+ }
@@ -0,0 +1,17 @@
1
+ # Review Rules
2
+
3
+ Project-specific rules for GPT code review. Edit these for your repo.
4
+
5
+ ## Examples (replace with your own)
6
+
7
+ ### Framework & Tooling
8
+ - Must use [your framework], not [alternative]
9
+ - Must use [your package manager]
10
+ - Must use [your database approach]
11
+
12
+ ### Code Patterns
13
+ - Use [your utility function] for [specific math/formatting]
14
+ - Import helpers from [canonical module path]
15
+
16
+ ### Domain Rules
17
+ - [Your domain-specific invariants here]
package/shell-hook.sh ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env bash
2
+ # dual-brain shell integration
3
+ # Add to .bashrc with one command:
4
+ # dual-brain shell-hook >> ~/.bashrc
5
+ # Or source directly:
6
+ # source /path/to/shell-hook.sh
7
+
8
+ # Quick alias
9
+ alias db='dual-brain'
10
+
11
+ # Show session manager on new interactive terminal.
12
+ # Skipped when:
13
+ # - not a TTY (non-interactive shell, CI, pipes)
14
+ # - DUAL_BRAIN_LOADED already set (prevents double-launch in nested shells)
15
+ # - DUAL_BRAIN_SKIP=1 (user opt-out)
16
+ # - DATA_TOOLS_LOADED or CLAUDE_MENU_LOADED is set (data-tools is managing the shell)
17
+ if [ -t 1 ] \
18
+ && [ -z "$DUAL_BRAIN_LOADED" ] \
19
+ && [ -z "$DUAL_BRAIN_SKIP" ] \
20
+ && [ -z "$DATA_TOOLS_LOADED" ] \
21
+ && [ -z "$CLAUDE_MENU_LOADED" ]; then
22
+ export DUAL_BRAIN_LOADED=1
23
+ if command -v dual-brain &>/dev/null; then
24
+ dual-brain
25
+ fi
26
+ fi
package/skills/go.md ADDED
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: go
3
+ description: Route and dispatch a task through dual-brain
4
+ arguments:
5
+ - name: task
6
+ description: The task description to route
7
+ required: true
8
+ - name: dry-run
9
+ description: Show routing without executing
10
+ required: false
11
+ - name: files
12
+ description: Comma-separated file paths for risk classification
13
+ required: false
14
+ ---
15
+
16
+ Run `dual-brain go` with the provided arguments. Execute:
17
+
18
+ ```bash
19
+ dual-brain go [--dry-run] [--files <files>] "<task>"
20
+ ```
21
+
22
+ Report the routing decision (provider, model, tier) and dispatch result to the user.
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: review
3
+ description: Dual-brain code review — two-round Claude + GPT review of the current diff
4
+ arguments: []
5
+ ---
6
+
7
+ Run the dual-brain review flow (2 rounds) on the current git diff:
8
+
9
+ **Round 1** — get GPT's independent review:
10
+ ```bash
11
+ node hooks/dual-brain-review.mjs
12
+ ```
13
+
14
+ Review the same diff independently, then run **Round 2** — share your findings and get GPT's response:
15
+ ```bash
16
+ node hooks/dual-brain-review.mjs --round 2 --claude-review "<your findings>"
17
+ ```
18
+
19
+ Synthesize both rounds into a final review verdict: shared findings, unique catches from each side, and any items that need human attention.
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: status
3
+ description: Show provider health, budget pressure, and enforcement status
4
+ arguments: []
5
+ ---
6
+
7
+ Run `dual-brain status` and report the results to the user:
8
+
9
+ ```bash
10
+ dual-brain status
11
+ ```
12
+
13
+ Show provider health (Claude, OpenAI), current budget pressure for each provider, active profile, and enforcement status.
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: think
3
+ description: Dual-brain architecture discussion — two-round Claude + GPT analysis
4
+ arguments:
5
+ - name: question
6
+ description: The architecture question or decision to analyze
7
+ required: true
8
+ ---
9
+
10
+ Run the dual-brain think flow (2 rounds) using the provided question:
11
+
12
+ **Round 1** — get GPT's independent analysis:
13
+ ```bash
14
+ node hooks/dual-brain-think.mjs --question "<question>"
15
+ ```
16
+
17
+ Analyze the same question independently, then run **Round 2** — share your analysis and get GPT's response:
18
+ ```bash
19
+ node hooks/dual-brain-think.mjs --question "<question>" --round 2 --claude-says "<your analysis>"
20
+ ```
21
+
22
+ Synthesize both rounds into a final decision, noting agreements, disagreements, and the chosen recommendation.