mindforge-cc 1.0.5 → 2.0.0-alpha.6

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 (119) hide show
  1. package/.agent/CLAUDE.md +83 -0
  2. package/.agent/mindforge/auto.md +22 -0
  3. package/.agent/mindforge/browse.md +26 -0
  4. package/.agent/mindforge/costs.md +11 -0
  5. package/.agent/mindforge/cross-review.md +17 -0
  6. package/.agent/mindforge/dashboard.md +98 -0
  7. package/.agent/mindforge/execute-phase.md +5 -3
  8. package/.agent/mindforge/init-project.md +12 -0
  9. package/.agent/mindforge/qa.md +16 -0
  10. package/.agent/mindforge/remember.md +14 -0
  11. package/.agent/mindforge/research.md +11 -0
  12. package/.agent/mindforge/steer.md +13 -0
  13. package/.agent/workflows/publish-release.md +36 -0
  14. package/.claude/CLAUDE.md +83 -0
  15. package/.claude/commands/mindforge/auto.md +22 -0
  16. package/.claude/commands/mindforge/browse.md +26 -0
  17. package/.claude/commands/mindforge/costs.md +11 -0
  18. package/.claude/commands/mindforge/cross-review.md +17 -0
  19. package/.claude/commands/mindforge/dashboard.md +98 -0
  20. package/.claude/commands/mindforge/execute-phase.md +5 -3
  21. package/.claude/commands/mindforge/qa.md +16 -0
  22. package/.claude/commands/mindforge/remember.md +14 -0
  23. package/.claude/commands/mindforge/research.md +11 -0
  24. package/.claude/commands/mindforge/steer.md +13 -0
  25. package/.mindforge/MINDFORGE-V2-SCHEMA.json +47 -0
  26. package/.mindforge/browser/daemon-protocol.md +24 -0
  27. package/.mindforge/browser/qa-engine.md +16 -0
  28. package/.mindforge/browser/session-manager.md +18 -0
  29. package/.mindforge/browser/visual-verify-spec.md +31 -0
  30. package/.mindforge/dashboard/api-reference.md +122 -0
  31. package/.mindforge/dashboard/dashboard-spec.md +96 -0
  32. package/.mindforge/engine/autonomous/auto-executor.md +266 -0
  33. package/.mindforge/engine/autonomous/headless-adapter.md +66 -0
  34. package/.mindforge/engine/autonomous/node-repair.md +190 -0
  35. package/.mindforge/engine/autonomous/progress-reporter.md +58 -0
  36. package/.mindforge/engine/autonomous/steering-manager.md +64 -0
  37. package/.mindforge/engine/autonomous/stuck-detector.md +89 -0
  38. package/.mindforge/memory/MEMORY-SCHEMA.md +155 -0
  39. package/.mindforge/memory/decision-library.jsonl +0 -0
  40. package/.mindforge/memory/engine/capture-protocol.md +36 -0
  41. package/.mindforge/memory/engine/global-sync-spec.md +42 -0
  42. package/.mindforge/memory/engine/retrieval-spec.md +44 -0
  43. package/.mindforge/memory/knowledge-base.jsonl +7 -0
  44. package/.mindforge/memory/pattern-library.jsonl +1 -0
  45. package/.mindforge/memory/team-preferences.jsonl +4 -0
  46. package/.mindforge/models/model-registry.md +48 -0
  47. package/.mindforge/models/model-router.md +30 -0
  48. package/.mindforge/personas/research-agent.md +24 -0
  49. package/.planning/approvals/v2-architecture-approval.json +15 -0
  50. package/.planning/browser-daemon.log +32 -0
  51. package/.planning/decisions/ADR-021-autonomy-boundary.md +17 -0
  52. package/.planning/decisions/ADR-022-node-repair-hierarchy.md +19 -0
  53. package/.planning/decisions/ADR-023-gate-3-timing.md +15 -0
  54. package/CHANGELOG.md +81 -0
  55. package/MINDFORGE.md +26 -3
  56. package/README.md +70 -18
  57. package/bin/autonomous/auto-runner.js +95 -0
  58. package/bin/autonomous/headless.js +36 -0
  59. package/bin/autonomous/progress-stream.js +49 -0
  60. package/bin/autonomous/repair-operator.js +213 -0
  61. package/bin/autonomous/steer.js +71 -0
  62. package/bin/autonomous/stuck-monitor.js +77 -0
  63. package/bin/browser/browser-daemon.js +139 -0
  64. package/bin/browser/daemon-manager.js +91 -0
  65. package/bin/browser/qa-engine.js +47 -0
  66. package/bin/browser/qa-report-writer.js +32 -0
  67. package/bin/browser/regression-writer.js +27 -0
  68. package/bin/browser/screenshot-store.js +49 -0
  69. package/bin/browser/session-manager.js +93 -0
  70. package/bin/browser/visual-verify-executor.js +89 -0
  71. package/bin/change-classifier.js +86 -0
  72. package/bin/dashboard/api-router.js +198 -0
  73. package/bin/dashboard/approval-handler.js +134 -0
  74. package/bin/dashboard/frontend/index.html +511 -0
  75. package/bin/dashboard/metrics-aggregator.js +296 -0
  76. package/bin/dashboard/server.js +135 -0
  77. package/bin/dashboard/sse-bridge.js +178 -0
  78. package/bin/dashboard/team-tracker.js +0 -0
  79. package/bin/governance/approve.js +60 -0
  80. package/bin/install.js +4 -4
  81. package/bin/installer-core.js +91 -35
  82. package/bin/memory/cli.js +99 -0
  83. package/bin/memory/global-sync.js +107 -0
  84. package/bin/memory/knowledge-capture.js +278 -0
  85. package/bin/memory/knowledge-indexer.js +172 -0
  86. package/bin/memory/knowledge-store.js +319 -0
  87. package/bin/memory/session-memory-loader.js +137 -0
  88. package/bin/migrations/0.1.0-to-0.5.0.js +2 -3
  89. package/bin/migrations/0.5.0-to-0.6.0.js +1 -1
  90. package/bin/migrations/0.6.0-to-1.0.0.js +3 -3
  91. package/bin/migrations/migrate.js +15 -11
  92. package/bin/mindforge-cli.js +87 -0
  93. package/bin/models/anthropic-provider.js +77 -0
  94. package/bin/models/cost-tracker.js +118 -0
  95. package/bin/models/gemini-provider.js +79 -0
  96. package/bin/models/model-client.js +98 -0
  97. package/bin/models/model-router.js +111 -0
  98. package/bin/models/openai-provider.js +78 -0
  99. package/bin/research/research-engine.js +115 -0
  100. package/bin/review/cross-review-engine.js +81 -0
  101. package/bin/review/finding-synthesizer.js +116 -0
  102. package/bin/review/review-report-writer.js +49 -0
  103. package/bin/updater/self-update.js +13 -13
  104. package/bin/wizard/setup-wizard.js +5 -1
  105. package/docs/adr/ADR-024-browser-localhost-only.md +17 -0
  106. package/docs/adr/ADR-025-visual-verify-failure-treatment.md +19 -0
  107. package/docs/adr/ADR-026-session-persistence-security.md +20 -0
  108. package/docs/architecture/README.md +6 -2
  109. package/docs/ci-cd.md +92 -0
  110. package/docs/commands-reference.md +1 -0
  111. package/docs/feature-dashboard.md +52 -0
  112. package/docs/publishing-guide.md +43 -0
  113. package/docs/reference/commands.md +17 -2
  114. package/docs/reference/sdk-api.md +6 -1
  115. package/docs/testing-current-version.md +130 -0
  116. package/docs/user-guide.md +115 -9
  117. package/docs/usp-features.md +70 -8
  118. package/docs/workflow-atlas.md +57 -0
  119. package/package.json +7 -3
package/.agent/CLAUDE.md CHANGED
@@ -3,6 +3,29 @@
3
3
 
4
4
  ---
5
5
 
6
+ ## MULTI-MODEL INTELLIGENCE LAYER (v2.0.0 — Day 10)
7
+
8
+ ### Model Routing
9
+
10
+ - Resolve model using `bin/models/model-router.js` based on persona and tier.
11
+ - Tier 3 (Security) always uses `SECURITY_MODEL`.
12
+
13
+ ### API Client
14
+ - Always use `bin/models/model-client.js` for API interactions.
15
+ - Fallback chain: unavailable model → next in tier.
16
+
17
+ ### Cost Awareness
18
+ - Record every call using `bin/models/cost-tracker.js`.
19
+ - Block calls if `MODEL_COST_HARD_LIMIT_USD` is reached.
20
+
21
+ ### New Commands
22
+
23
+ - `/mindforge:cross-review` — Adversarial multi-model review.
24
+ - `/mindforge:research` — Deep research via Gemini 1M.
25
+ - `/mindforge:costs` — Cost tracking dashboard.
26
+
27
+ ---
28
+
6
29
  ## DISTRIBUTION & CI LAYER (Day 6)
7
30
 
8
31
  ### CI mode awareness
@@ -93,6 +116,66 @@ Non-breaking additions (new optional fields, new commands) require MINOR.
93
116
 
94
117
  ---
95
118
 
119
+ ## AUTONOMOUS LAYER (Day 8 — v2.0.0-alpha.1)
120
+
121
+ ### Autonomous mode protocol
122
+ When the user requests `/mindforge:auto --phase [N]`:
123
+ 1. Execute the pre-flight check from `.mindforge/engine/autonomous/auto-executor.md`.
124
+ 2. Follow the auto-executor state machine precisely.
125
+ 3. Every task must be performed by a fresh subagent context (context-compaction logic).
126
+ 4. Monitor every action for S01-S05 stuck patterns (stuck-detector.md).
127
+ 5. On failure: apply RETRY → DECOMPOSE → PRUNE logic (node-repair.md).
128
+ 6. Compliance Gate 3 (secrets) runs PRE-COMMIT on staged diffs.
129
+ 7. Visual Verification: runs <verify-visual> AFTER successful <verify> (unit tests).
130
+ 8. Governance: ESCALATE immediately on Tier 3 changes (Auth/Payment/PII).
131
+
132
+ ### Steering awareness
133
+ Check `.planning/steering-queue.jsonl` at every task boundary.
134
+ If guidance is present: inject it into the next PLAN file as the highest priority
135
+ instruction. Standard governance gates still apply to steered changes.
136
+
137
+ ### Headless execution
138
+ If `--headless` is used:
139
+ - Disable all TTY-rich progress UI.
140
+ - Structure all stdout as line-delimited JSON.
141
+ - Handle SIGTERM by pausing execution and snapshotting HANDOFF.json.
142
+
143
+ ### New commands (Day 8)
144
+ - /mindforge:auto — start/resume autonomous execution engine
145
+ - /mindforge:steer — inject mid-execution guidance
146
+ - /mindforge:browse — persistent browser control and actions
147
+ - /mindforge:qa — systematic post-phase visual QA
148
+
149
+ ---
150
+
151
+ ## REAL-TIME DASHBOARD (v2.0.0 — Day 12)
152
+
153
+ ### Dashboard server
154
+ The MindForge dashboard runs at localhost:7339 when started.
155
+ - Start: `node bin/dashboard/server.js [--port 7339] [--open]`
156
+ - Stop: `/mindforge:dashboard --stop`
157
+
158
+ Localhost-only (127.0.0.1) — consistent with ADR-017.
159
+ Never bind to 0.0.0.0, never port-forward externally.
160
+
161
+ ### When to recommend the dashboard
162
+ Suggest starting the dashboard when:
163
+ - User runs /mindforge:auto (live progress visibility)
164
+ - Team standup approaching (screenshare mode)
165
+ - Tier 2/3 approvals are pending (approver can approve from browser)
166
+ - Debugging a quality issue (metrics page shows trends)
167
+
168
+ ### AUDIT events written by dashboard
169
+ - dashboard_started: on server start
170
+ - dashboard_stopped: on graceful shutdown
171
+ - approval_granted / approval_rejected: when approved via browser UI
172
+ - steering_queued: when steering instruction sent via browser UI
173
+
174
+ ### New command (Day 12)
175
+ - /mindforge:dashboard — start/stop/status the real-time web dashboard
176
+
177
+ ---
178
+
96
179
  ## IDENTITY
97
180
 
98
181
  You are a senior AI engineering agent operating under the **MindForge framework**.
@@ -0,0 +1,22 @@
1
+ # /mindforge:auto [Phase N]
2
+
3
+ **Purpose**: Starts the MindForge Autonomous Execution Engine for the
4
+ specified phase. The agent will execute all waves, handle repairs, and
5
+ perform compliance gates without requiring human confirmation.
6
+
7
+ ## Usage
8
+ - `/mindforge:auto --phase 3` (Standard unattended mode)
9
+ - `/mindforge:auto --resume` (Resumes from last checkpoint)
10
+ - `/mindforge:auto --headless` (CI/CD optimized output)
11
+ - `/mindforge:auto --dry-run` (Show the wave DAG and plan without executing)
12
+
13
+ ## Behavior
14
+ - **Zero-Interaction**: Auto-approves Tier 1/2 changes if gates pass.
15
+ - **Self-Repair**: Tries RETRY/DECOMPOSE before asking for help.
16
+ - **Checkpointing**: Constant state persistence in `HANDOFF.json`.
17
+ - **Governance**: ESCALATES on Tier 3 changes (Auth/Payment/PII).
18
+
19
+ ## Environment Variables
20
+ - `AUTO_MODE_TIMEOUT_MINUTES`: Default 120.
21
+ - `AUTO_PUSH_ON_WAVE_COMPLETE`: Default false.
22
+ - `SLACK_WEBHOOK_URL`: Required for notifications.
@@ -0,0 +1,26 @@
1
+ # /mindforge:browse
2
+
3
+ ## Usage
4
+ `@mindforge browse <url | action>`
5
+
6
+ ## Description
7
+ Controls the persistent MindForge browser daemon.
8
+ Maintains session state (cookies/localStorage) for the AI.
9
+
10
+ ## Actions
11
+ | Action | Description |
12
+ |---|---|
13
+ | `--start` | Initialize browser daemon |
14
+ | `--stop` | Kill browser daemon |
15
+ | `--status` | Show daemon health and active sessions |
16
+ | `--session <name>` | Switch browser context |
17
+ | `--import-session <name> --from <browser>` | Import cookies from host browser (chrome, arc, etc) |
18
+ | `<url>` | Navigate the current page to URL |
19
+ | `click <selector>` | Trigger click event |
20
+ | `type <sel> <text>` | Fill input field |
21
+ | `screenshot` | Capture current viewport |
22
+
23
+ ## Security
24
+ - Daemon binds to `127.0.0.1` only.
25
+ - Session files are gitignored.
26
+ - Use only for debugging and visual verification.
@@ -0,0 +1,11 @@
1
+ # MindForge v2 — Costs Command
2
+ # Usage: /mindforge:costs [--phase N] [--session ID] [--window 7d]
3
+
4
+ ## Purpose
5
+ Real-time cost tracking for all AI model usage.
6
+ Enforce daily budgets and see per-model spend.
7
+
8
+ ## Metrics
9
+ - Total spend: $X.XX
10
+ - Daily limit usage: XX%
11
+ - Per-model breakdown (Tokens/Cost)
@@ -0,0 +1,17 @@
1
+ # MindForge v2 — Cross-Review Command
2
+ # Usage: /mindforge:cross-review [--phase N] [--models list] [--focus area]
3
+
4
+ ## Purpose
5
+ Get the same code diff reviewed by multiple AI models simultaneously.
6
+ Claude finds what Claude finds. GPT-4o finds what GPT-4o finds.
7
+ Consensus findings = high confidence issues.
8
+
9
+ ## Round 1: Primary (Claude)
10
+ Senior architect review.
11
+
12
+ ## Round 2: Adversarial (GPT-4o)
13
+ Critical security and edge case review.
14
+
15
+ ## Synthesis
16
+ Consensus detector filters findings.
17
+ Verdict is gating for `/mindforge:ship`.
@@ -0,0 +1,98 @@
1
+ # MindForge v2 — Dashboard Command
2
+ # Usage: /mindforge:dashboard [--port 7339] [--open] [--stop] [--status]
3
+ # Version: v2.0.0-alpha.5
4
+
5
+ ## Purpose
6
+ Start the MindForge real-time web dashboard — a live observability UI for the
7
+ entire team. Shows execution progress, quality metrics, pending approvals,
8
+ knowledge graph, and team activity without requiring CLI access.
9
+
10
+ ## Design
11
+ The dashboard is a localhost-only web server:
12
+ - No build step — single HTML file, no bundler, no npm packages on client
13
+ - No authentication — binding to 127.0.0.1 is the security model
14
+ - Live updates via Server-Sent Events — no WebSocket library needed
15
+ - Designed for screensharing at standups, not external access
16
+
17
+ ## Usage
18
+
19
+ ### Start the dashboard
20
+ ```
21
+ /mindforge:dashboard
22
+ → Dashboard running at: http://localhost:7339
23
+ → Press CTRL+C to stop (or /mindforge:dashboard --stop)
24
+ ```
25
+
26
+ ### Start and open in browser
27
+ ```
28
+ /mindforge:dashboard --open
29
+ → Opens http://localhost:7339 in your default browser
30
+ ```
31
+
32
+ ### Custom port
33
+ ```
34
+ /mindforge:dashboard --port 7340
35
+ → Useful if 7339 is already in use
36
+ ```
37
+
38
+ ### Stop the dashboard
39
+ ```
40
+ /mindforge:dashboard --stop
41
+ → Finds the running dashboard process (from PID file) and sends SIGTERM
42
+ ```
43
+
44
+ ### Check dashboard status
45
+ ```
46
+ /mindforge:dashboard --status
47
+ → Checks if dashboard is running, shows port and PID
48
+ → Also shows: http://localhost:7339/api/status
49
+ ```
50
+
51
+ ## Dashboard pages
52
+
53
+ ### Activity (default)
54
+ - Phase name, auto mode status (RUNNING/PAUSED/ESCALATED/IDLE)
55
+ - Wave progress bar (tasks completed / total)
56
+ - Live AUDIT event feed with color-coded event types
57
+ - Steering input: send guidance to auto mode without touching the CLI
58
+
59
+ ### Quality Metrics
60
+ - Session quality score trend (last 20 sessions)
61
+ - Verify pass rate over time
62
+ - Security findings by severity (CRITICAL/HIGH/MEDIUM/LOW)
63
+ - Cost per session trend
64
+
65
+ ### Approvals
66
+ - All pending Tier 2/3 governance requests
67
+ - [Approve] and [Reject] buttons — no CLI needed for approval
68
+ - Tier, phase/plan, description, time since requested, expiry warning
69
+ - Recent approval history
70
+
71
+ ### Knowledge
72
+ - Search the knowledge graph from the browser
73
+ - Entries filtered by confidence, type, tags
74
+ - Color-coded by knowledge type
75
+
76
+ ### Team
77
+ - Active developers (by git email, from AUDIT.jsonl)
78
+ - What each person is working on (last task)
79
+ - File conflict warnings (two developers recently touching the same file)
80
+
81
+ ## Security rules
82
+ 1. Never expose the dashboard on 0.0.0.0 — localhost only
83
+ 2. Never forward the port externally (no ngrok, no port forwarding)
84
+ 3. For remote team visibility: screenshare your browser instead
85
+ 4. The dashboard shows project details including code patterns and decisions
86
+
87
+ ## Integration with auto mode
88
+ When `/mindforge:auto` is running and the dashboard is open:
89
+ - Activity feed updates live as tasks complete
90
+ - Wave progress bar advances in real-time
91
+ - Any escalations appear immediately with red indicator
92
+ - The Steering input is active — inject guidance without a second terminal
93
+
94
+ ## AUDIT entry
95
+ ```json
96
+ { "event": "dashboard_started", "port": 7339, "pid": 12345 }
97
+ { "event": "dashboard_stopped", "pid": 12345 }
98
+ ```
@@ -76,9 +76,11 @@ Write to console:
76
76
  For each plan in the wave:
77
77
  1. Load context package (per `context-injector.md`)
78
78
  2. Execute the plan instructions
79
- 3. Run `<verify>` — capture exact output
80
- 4. If verify PASSES:
81
- - Write SUMMARY-[N]-[M].md
79
+ - Run `<verify>` — capture exact output
80
+ - If verify PASSES:
81
+ - Run `<verify-visual>` via `visual-verify-executor.js`
82
+ - If visual verify FAILS: stop and report (treat as verify failure)
83
+ - Write SUMMARY-[N]-[M].md
82
84
  - Execute commit: `git add [files] && git commit -m "[type]([scope]): [task name]"`
83
85
  - Capture git SHA
84
86
  - Write AUDIT entry for task completion
@@ -5,6 +5,18 @@ Read `.planning/PROJECT.md`. If it already exists and contains content,
5
5
  ask: "A project is already initialised. Do you want to reinitialise? (yes/no)"
6
6
  Stop if the user says no.
7
7
 
8
+ ## Pre-flight Environment Check
9
+ Verify that `CLAUDE.md` exists at the root of the project and `.claude/commands/mindforge/` is populated. If not, silently run the following to enable zero-config IDE autocomplete (Cursor, Windsurf, Claude Code):
10
+ ```bash
11
+ mkdir -p .claude/commands/mindforge
12
+ cp -r .agent/mindforge/* .claude/commands/mindforge/ 2>/dev/null || true
13
+ cp -r agents/mindforge/* .claude/commands/mindforge/ 2>/dev/null || true
14
+ cp .agent/CLAUDE.md ./CLAUDE.md 2>/dev/null || true
15
+ cp agents/CLAUDE.md ./CLAUDE.md 2>/dev/null || true
16
+ cp ./CLAUDE.md ./.cursorrules 2>/dev/null || true
17
+ cp ./CLAUDE.md ./.windsurfrules 2>/dev/null || true
18
+ ```
19
+
8
20
  ## Step 1 — Requirements interview
9
21
  Ask these questions one at a time. Wait for the full answer before asking the next.
10
22
  Do not batch them. Do not rush.
@@ -0,0 +1,16 @@
1
+ # /mindforge:qa
2
+
3
+ ## Usage
4
+ `@mindforge qa [--phase N] [--auto]`
5
+
6
+ ## Description
7
+ Runs systematic visual QA on UI surfaces changed in the current phase.
8
+ Analyzes git diff to find pages, navigates to them, and looks for errors.
9
+
10
+ ## Options
11
+ - `--phase N`: Target specific phase for reporting (defaults to current).
12
+ - `--auto`: Automatically run after successful wave execution if configured.
13
+
14
+ ## Output
15
+ - `QA-REPORT-[N].md`: Found bugs with screenshots.
16
+ - `tests/regression/*.test.ts`: Playwright tests to prevent bug recurrence.
@@ -0,0 +1,14 @@
1
+ # /mindforge:remember
2
+
3
+ Manage the MindForge long-term memory (knowledge graph).
4
+
5
+ ## Usage
6
+
7
+ - `/mindforge:remember --add "Your knowledge content"`: Manually add an entry.
8
+ - `/mindforge:remember --search "your query"`: Search the knowledge base.
9
+ - `/mindforge:remember --stats`: View memory statistics.
10
+ - `/mindforge:remember --promote "id"`: Promote a project entry to global memory.
11
+
12
+ ## Description
13
+
14
+ MindForge capture, stores, and retrieves knowledge (architectural decisions, code patterns, team preferences) across all sessions and projects. This command allows for manual management and querying of this data.
@@ -0,0 +1,11 @@
1
+ # MindForge v2 — Research Command
2
+ # Usage: /mindforge:research [topic] [--type general|library|codebase|compliance] [--url URL]
3
+
4
+ ## Purpose
5
+ Deep research using Gemini 1.5 Pro's 1-million-token context window.
6
+ Incorporate local code context and remote documentation simultaneously.
7
+
8
+ ## Capabilities
9
+ - Ingest full library documentation.
10
+ - Codebase-wide architectural analysis.
11
+ - Regulatory compliance audits.
@@ -0,0 +1,13 @@
1
+ # /mindforge:steer "[instruction]"
2
+
3
+ **Purpose**: Injects mid-execution guidance into the running autonomous engine.
4
+ Steering guidance is applied at the next task boundary to course-correct the agent.
5
+
6
+ ## Usage
7
+ - `/mindforge:steer "Use the new logger in all created files"`
8
+ - `/mindforge:steer --task 3-05 "This plan is too broad, focus on login only"`
9
+ - `/mindforge:steer --cancel` (Clears the steering queue)
10
+
11
+ ## Precedence
12
+ - Steering instructions take precedence over the original `PLAN-N-MM.md` actions.
13
+ - Steering cannot override core security constraints or governance gates.
@@ -0,0 +1,36 @@
1
+ ---
2
+ description: Publish a new version of MindForge to npm
3
+ ---
4
+
5
+ # MindForge Publishing Workflow
6
+
7
+ This workflow automates the pre-verification and publishing of MindForge.
8
+
9
+ ## Pre-Flight Checks
10
+
11
+ 1. Verify structural integrity
12
+ // turbo
13
+ npm test
14
+
15
+ 2. Check package contents
16
+ // turbo
17
+ npm pack --dry-run
18
+
19
+ ## Publish Execution
20
+
21
+ **Note**: If this is a prerelease (alpha, beta, rc), you must specify the tag.
22
+
23
+ 3. Publish to npm
24
+ ```bash
25
+ # For stable:
26
+ npm publish --access public
27
+
28
+ # For alpha:
29
+ npm publish --tag alpha --access public
30
+ ```
31
+
32
+ 4. Create Git Tag
33
+ ```bash
34
+ git tag v$(node -p "require('./package.json').version")
35
+ git push origin --tags
36
+ ```
package/.claude/CLAUDE.md CHANGED
@@ -3,6 +3,29 @@
3
3
 
4
4
  ---
5
5
 
6
+ ## MULTI-MODEL INTELLIGENCE LAYER (v2.0.0 — Day 10)
7
+
8
+ ### Model Routing
9
+
10
+ - Resolve model using `bin/models/model-router.js` based on persona and tier.
11
+ - Tier 3 (Security) always uses `SECURITY_MODEL`.
12
+
13
+ ### API Client
14
+ - Always use `bin/models/model-client.js` for API interactions.
15
+ - Fallback chain: unavailable model → next in tier.
16
+
17
+ ### Cost Awareness
18
+ - Record every call using `bin/models/cost-tracker.js`.
19
+ - Block calls if `MODEL_COST_HARD_LIMIT_USD` is reached.
20
+
21
+ ### New Commands
22
+
23
+ - `/mindforge:cross-review` — Adversarial multi-model review.
24
+ - `/mindforge:research` — Deep research via Gemini 1M.
25
+ - `/mindforge:costs` — Cost tracking dashboard.
26
+
27
+ ---
28
+
6
29
  ## DISTRIBUTION & CI LAYER (Day 6)
7
30
 
8
31
  ### CI mode awareness
@@ -93,6 +116,66 @@ Non-breaking additions (new optional fields, new commands) require MINOR.
93
116
 
94
117
  ---
95
118
 
119
+ ## AUTONOMOUS LAYER (Day 8 — v2.0.0-alpha.1)
120
+
121
+ ### Autonomous mode protocol
122
+ When the user requests `/mindforge:auto --phase [N]`:
123
+ 1. Execute the pre-flight check from `.mindforge/engine/autonomous/auto-executor.md`.
124
+ 2. Follow the auto-executor state machine precisely.
125
+ 3. Every task must be performed by a fresh subagent context (context-compaction logic).
126
+ 4. Monitor every action for S01-S05 stuck patterns (stuck-detector.md).
127
+ 5. On failure: apply RETRY → DECOMPOSE → PRUNE logic (node-repair.md).
128
+ 6. Compliance Gate 3 (secrets) runs PRE-COMMIT on staged diffs.
129
+ 7. Visual Verification: runs <verify-visual> AFTER successful <verify> (unit tests).
130
+ 8. Governance: ESCALATE immediately on Tier 3 changes (Auth/Payment/PII).
131
+
132
+ ### Steering awareness
133
+ Check `.planning/steering-queue.jsonl` at every task boundary.
134
+ If guidance is present: inject it into the next PLAN file as the highest priority
135
+ instruction. Standard governance gates still apply to steered changes.
136
+
137
+ ### Headless execution
138
+ If `--headless` is used:
139
+ - Disable all TTY-rich progress UI.
140
+ - Structure all stdout as line-delimited JSON.
141
+ - Handle SIGTERM by pausing execution and snapshotting HANDOFF.json.
142
+
143
+ ### New commands (Day 8)
144
+ - /mindforge:auto — start/resume autonomous execution engine
145
+ - /mindforge:steer — inject mid-execution guidance
146
+ - /mindforge:browse — persistent browser control and actions
147
+ - /mindforge:qa — systematic post-phase visual QA
148
+
149
+ ---
150
+
151
+ ## REAL-TIME DASHBOARD (v2.0.0 — Day 12)
152
+
153
+ ### Dashboard server
154
+ The MindForge dashboard runs at localhost:7339 when started.
155
+ - Start: `node bin/dashboard/server.js [--port 7339] [--open]`
156
+ - Stop: `/mindforge:dashboard --stop`
157
+
158
+ Localhost-only (127.0.0.1) — consistent with ADR-017.
159
+ Never bind to 0.0.0.0, never port-forward externally.
160
+
161
+ ### When to recommend the dashboard
162
+ Suggest starting the dashboard when:
163
+ - User runs /mindforge:auto (live progress visibility)
164
+ - Team standup approaching (screenshare mode)
165
+ - Tier 2/3 approvals are pending (approver can approve from browser)
166
+ - Debugging a quality issue (metrics page shows trends)
167
+
168
+ ### AUDIT events written by dashboard
169
+ - dashboard_started: on server start
170
+ - dashboard_stopped: on graceful shutdown
171
+ - approval_granted / approval_rejected: when approved via browser UI
172
+ - steering_queued: when steering instruction sent via browser UI
173
+
174
+ ### New command (Day 12)
175
+ - /mindforge:dashboard — start/stop/status the real-time web dashboard
176
+
177
+ ---
178
+
96
179
  ## IDENTITY
97
180
 
98
181
  You are a senior AI engineering agent operating under the **MindForge framework**.
@@ -0,0 +1,22 @@
1
+ # /mindforge:auto [Phase N]
2
+
3
+ **Purpose**: Starts the MindForge Autonomous Execution Engine for the
4
+ specified phase. The agent will execute all waves, handle repairs, and
5
+ perform compliance gates without requiring human confirmation.
6
+
7
+ ## Usage
8
+ - `/mindforge:auto --phase 3` (Standard unattended mode)
9
+ - `/mindforge:auto --resume` (Resumes from last checkpoint)
10
+ - `/mindforge:auto --headless` (CI/CD optimized output)
11
+ - `/mindforge:auto --dry-run` (Show the wave DAG and plan without executing)
12
+
13
+ ## Behavior
14
+ - **Zero-Interaction**: Auto-approves Tier 1/2 changes if gates pass.
15
+ - **Self-Repair**: Tries RETRY/DECOMPOSE before asking for help.
16
+ - **Checkpointing**: Constant state persistence in `HANDOFF.json`.
17
+ - **Governance**: ESCALATES on Tier 3 changes (Auth/Payment/PII).
18
+
19
+ ## Environment Variables
20
+ - `AUTO_MODE_TIMEOUT_MINUTES`: Default 120.
21
+ - `AUTO_PUSH_ON_WAVE_COMPLETE`: Default false.
22
+ - `SLACK_WEBHOOK_URL`: Required for notifications.
@@ -0,0 +1,26 @@
1
+ # /mindforge:browse
2
+
3
+ ## Usage
4
+ `@mindforge browse <url | action>`
5
+
6
+ ## Description
7
+ Controls the persistent MindForge browser daemon.
8
+ Maintains session state (cookies/localStorage) for the AI.
9
+
10
+ ## Actions
11
+ | Action | Description |
12
+ |---|---|
13
+ | `--start` | Initialize browser daemon |
14
+ | `--stop` | Kill browser daemon |
15
+ | `--status` | Show daemon health and active sessions |
16
+ | `--session <name>` | Switch browser context |
17
+ | `--import-session <name> --from <browser>` | Import cookies from host browser (chrome, arc, etc) |
18
+ | `<url>` | Navigate the current page to URL |
19
+ | `click <selector>` | Trigger click event |
20
+ | `type <sel> <text>` | Fill input field |
21
+ | `screenshot` | Capture current viewport |
22
+
23
+ ## Security
24
+ - Daemon binds to `127.0.0.1` only.
25
+ - Session files are gitignored.
26
+ - Use only for debugging and visual verification.
@@ -0,0 +1,11 @@
1
+ # MindForge v2 — Costs Command
2
+ # Usage: /mindforge:costs [--phase N] [--session ID] [--window 7d]
3
+
4
+ ## Purpose
5
+ Real-time cost tracking for all AI model usage.
6
+ Enforce daily budgets and see per-model spend.
7
+
8
+ ## Metrics
9
+ - Total spend: $X.XX
10
+ - Daily limit usage: XX%
11
+ - Per-model breakdown (Tokens/Cost)
@@ -0,0 +1,17 @@
1
+ # MindForge v2 — Cross-Review Command
2
+ # Usage: /mindforge:cross-review [--phase N] [--models list] [--focus area]
3
+
4
+ ## Purpose
5
+ Get the same code diff reviewed by multiple AI models simultaneously.
6
+ Claude finds what Claude finds. GPT-4o finds what GPT-4o finds.
7
+ Consensus findings = high confidence issues.
8
+
9
+ ## Round 1: Primary (Claude)
10
+ Senior architect review.
11
+
12
+ ## Round 2: Adversarial (GPT-4o)
13
+ Critical security and edge case review.
14
+
15
+ ## Synthesis
16
+ Consensus detector filters findings.
17
+ Verdict is gating for `/mindforge:ship`.