mindforge-cc 1.0.5 → 2.0.0-alpha.4

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 (97) hide show
  1. package/.agent/CLAUDE.md +53 -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/execute-phase.md +5 -3
  7. package/.agent/mindforge/qa.md +16 -0
  8. package/.agent/mindforge/remember.md +14 -0
  9. package/.agent/mindforge/research.md +11 -0
  10. package/.agent/mindforge/steer.md +13 -0
  11. package/.agent/workflows/publish-release.md +36 -0
  12. package/.claude/CLAUDE.md +53 -0
  13. package/.claude/commands/mindforge/auto.md +22 -0
  14. package/.claude/commands/mindforge/browse.md +26 -0
  15. package/.claude/commands/mindforge/costs.md +11 -0
  16. package/.claude/commands/mindforge/cross-review.md +17 -0
  17. package/.claude/commands/mindforge/execute-phase.md +5 -3
  18. package/.claude/commands/mindforge/qa.md +16 -0
  19. package/.claude/commands/mindforge/remember.md +14 -0
  20. package/.claude/commands/mindforge/research.md +11 -0
  21. package/.claude/commands/mindforge/steer.md +13 -0
  22. package/.mindforge/MINDFORGE-V2-SCHEMA.json +47 -0
  23. package/.mindforge/browser/daemon-protocol.md +24 -0
  24. package/.mindforge/browser/qa-engine.md +16 -0
  25. package/.mindforge/browser/session-manager.md +18 -0
  26. package/.mindforge/browser/visual-verify-spec.md +31 -0
  27. package/.mindforge/engine/autonomous/auto-executor.md +266 -0
  28. package/.mindforge/engine/autonomous/headless-adapter.md +66 -0
  29. package/.mindforge/engine/autonomous/node-repair.md +190 -0
  30. package/.mindforge/engine/autonomous/progress-reporter.md +58 -0
  31. package/.mindforge/engine/autonomous/steering-manager.md +64 -0
  32. package/.mindforge/engine/autonomous/stuck-detector.md +89 -0
  33. package/.mindforge/memory/MEMORY-SCHEMA.md +155 -0
  34. package/.mindforge/memory/decision-library.jsonl +0 -0
  35. package/.mindforge/memory/engine/capture-protocol.md +36 -0
  36. package/.mindforge/memory/engine/global-sync-spec.md +42 -0
  37. package/.mindforge/memory/engine/retrieval-spec.md +44 -0
  38. package/.mindforge/memory/knowledge-base.jsonl +7 -0
  39. package/.mindforge/memory/pattern-library.jsonl +1 -0
  40. package/.mindforge/memory/team-preferences.jsonl +4 -0
  41. package/.mindforge/models/model-registry.md +48 -0
  42. package/.mindforge/models/model-router.md +30 -0
  43. package/.mindforge/personas/research-agent.md +24 -0
  44. package/.planning/browser-daemon.log +32 -0
  45. package/.planning/decisions/ADR-021-autonomy-boundary.md +17 -0
  46. package/.planning/decisions/ADR-022-node-repair-hierarchy.md +19 -0
  47. package/.planning/decisions/ADR-023-gate-3-timing.md +15 -0
  48. package/CHANGELOG.md +68 -0
  49. package/MINDFORGE.md +26 -3
  50. package/README.md +54 -18
  51. package/bin/autonomous/auto-runner.js +95 -0
  52. package/bin/autonomous/headless.js +36 -0
  53. package/bin/autonomous/progress-stream.js +49 -0
  54. package/bin/autonomous/repair-operator.js +213 -0
  55. package/bin/autonomous/steer.js +71 -0
  56. package/bin/autonomous/stuck-monitor.js +77 -0
  57. package/bin/browser/browser-daemon.js +139 -0
  58. package/bin/browser/daemon-manager.js +91 -0
  59. package/bin/browser/qa-engine.js +47 -0
  60. package/bin/browser/qa-report-writer.js +32 -0
  61. package/bin/browser/regression-writer.js +27 -0
  62. package/bin/browser/screenshot-store.js +49 -0
  63. package/bin/browser/session-manager.js +93 -0
  64. package/bin/browser/visual-verify-executor.js +89 -0
  65. package/bin/install.js +4 -4
  66. package/bin/installer-core.js +24 -24
  67. package/bin/memory/cli.js +99 -0
  68. package/bin/memory/global-sync.js +107 -0
  69. package/bin/memory/knowledge-capture.js +278 -0
  70. package/bin/memory/knowledge-indexer.js +172 -0
  71. package/bin/memory/knowledge-store.js +319 -0
  72. package/bin/memory/session-memory-loader.js +137 -0
  73. package/bin/migrations/0.1.0-to-0.5.0.js +2 -3
  74. package/bin/migrations/0.5.0-to-0.6.0.js +1 -1
  75. package/bin/migrations/0.6.0-to-1.0.0.js +3 -3
  76. package/bin/migrations/migrate.js +15 -11
  77. package/bin/models/anthropic-provider.js +77 -0
  78. package/bin/models/cost-tracker.js +118 -0
  79. package/bin/models/gemini-provider.js +79 -0
  80. package/bin/models/model-client.js +98 -0
  81. package/bin/models/model-router.js +111 -0
  82. package/bin/models/openai-provider.js +78 -0
  83. package/bin/research/research-engine.js +115 -0
  84. package/bin/review/cross-review-engine.js +81 -0
  85. package/bin/review/finding-synthesizer.js +116 -0
  86. package/bin/review/review-report-writer.js +49 -0
  87. package/bin/updater/self-update.js +13 -13
  88. package/docs/adr/ADR-024-browser-localhost-only.md +17 -0
  89. package/docs/adr/ADR-025-visual-verify-failure-treatment.md +19 -0
  90. package/docs/adr/ADR-026-session-persistence-security.md +20 -0
  91. package/docs/architecture/README.md +4 -2
  92. package/docs/publishing-guide.md +78 -0
  93. package/docs/reference/commands.md +17 -2
  94. package/docs/reference/sdk-api.md +6 -1
  95. package/docs/user-guide.md +93 -9
  96. package/docs/usp-features.md +56 -8
  97. package/package.json +3 -2
package/.agent/CLAUDE.md CHANGED
@@ -3,6 +3,27 @@
3
3
 
4
4
  ---
5
5
 
6
+ ## MULTI-MODEL INTELLIGENCE LAYER (v2.0.0 — Day 10)
7
+
8
+ ### Model Routing
9
+ - Resolve model using `bin/models/model-router.js` based on persona and tier.
10
+ - Tier 3 (Security) always uses `SECURITY_MODEL`.
11
+
12
+ ### API Client
13
+ - Always use `bin/models/model-client.js` for API interactions.
14
+ - Fallback chain: unavailable model → next in tier.
15
+
16
+ ### Cost Awareness
17
+ - Record every call using `bin/models/cost-tracker.js`.
18
+ - Block calls if `MODEL_COST_HARD_LIMIT_USD` is reached.
19
+
20
+ ### New Commands
21
+ - `/mindforge:cross-review` — Adversarial multi-model review.
22
+ - `/mindforge:research` — Deep research via Gemini 1M.
23
+ - `/mindforge:costs` — Cost tracking dashboard.
24
+
25
+ ---
26
+
6
27
  ## DISTRIBUTION & CI LAYER (Day 6)
7
28
 
8
29
  ### CI mode awareness
@@ -93,6 +114,38 @@ Non-breaking additions (new optional fields, new commands) require MINOR.
93
114
 
94
115
  ---
95
116
 
117
+ ## AUTONOMOUS LAYER (Day 8 — v2.0.0-alpha.1)
118
+
119
+ ### Autonomous mode protocol
120
+ When the user requests `/mindforge:auto --phase [N]`:
121
+ 1. Execute the pre-flight check from `.mindforge/engine/autonomous/auto-executor.md`.
122
+ 2. Follow the auto-executor state machine precisely.
123
+ 3. Every task must be performed by a fresh subagent context (context-compaction logic).
124
+ 4. Monitor every action for S01-S05 stuck patterns (stuck-detector.md).
125
+ 5. On failure: apply RETRY → DECOMPOSE → PRUNE logic (node-repair.md).
126
+ 6. Compliance Gate 3 (secrets) runs PRE-COMMIT on staged diffs.
127
+ 7. Visual Verification: runs <verify-visual> AFTER successful <verify> (unit tests).
128
+ 8. Governance: ESCALATE immediately on Tier 3 changes (Auth/Payment/PII).
129
+
130
+ ### Steering awareness
131
+ Check `.planning/steering-queue.jsonl` at every task boundary.
132
+ If guidance is present: inject it into the next PLAN file as the highest priority
133
+ instruction. Standard governance gates still apply to steered changes.
134
+
135
+ ### Headless execution
136
+ If `--headless` is used:
137
+ - Disable all TTY-rich progress UI.
138
+ - Structure all stdout as line-delimited JSON.
139
+ - Handle SIGTERM by pausing execution and snapshotting HANDOFF.json.
140
+
141
+ ### New commands (Day 8)
142
+ - /mindforge:auto — start/resume autonomous execution engine
143
+ - /mindforge:steer — inject mid-execution guidance
144
+ - /mindforge:browse — persistent browser control and actions
145
+ - /mindforge:qa — systematic post-phase visual QA
146
+
147
+ ---
148
+
96
149
  ## IDENTITY
97
150
 
98
151
  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`.
@@ -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
@@ -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,27 @@
3
3
 
4
4
  ---
5
5
 
6
+ ## MULTI-MODEL INTELLIGENCE LAYER (v2.0.0 — Day 10)
7
+
8
+ ### Model Routing
9
+ - Resolve model using `bin/models/model-router.js` based on persona and tier.
10
+ - Tier 3 (Security) always uses `SECURITY_MODEL`.
11
+
12
+ ### API Client
13
+ - Always use `bin/models/model-client.js` for API interactions.
14
+ - Fallback chain: unavailable model → next in tier.
15
+
16
+ ### Cost Awareness
17
+ - Record every call using `bin/models/cost-tracker.js`.
18
+ - Block calls if `MODEL_COST_HARD_LIMIT_USD` is reached.
19
+
20
+ ### New Commands
21
+ - `/mindforge:cross-review` — Adversarial multi-model review.
22
+ - `/mindforge:research` — Deep research via Gemini 1M.
23
+ - `/mindforge:costs` — Cost tracking dashboard.
24
+
25
+ ---
26
+
6
27
  ## DISTRIBUTION & CI LAYER (Day 6)
7
28
 
8
29
  ### CI mode awareness
@@ -93,6 +114,38 @@ Non-breaking additions (new optional fields, new commands) require MINOR.
93
114
 
94
115
  ---
95
116
 
117
+ ## AUTONOMOUS LAYER (Day 8 — v2.0.0-alpha.1)
118
+
119
+ ### Autonomous mode protocol
120
+ When the user requests `/mindforge:auto --phase [N]`:
121
+ 1. Execute the pre-flight check from `.mindforge/engine/autonomous/auto-executor.md`.
122
+ 2. Follow the auto-executor state machine precisely.
123
+ 3. Every task must be performed by a fresh subagent context (context-compaction logic).
124
+ 4. Monitor every action for S01-S05 stuck patterns (stuck-detector.md).
125
+ 5. On failure: apply RETRY → DECOMPOSE → PRUNE logic (node-repair.md).
126
+ 6. Compliance Gate 3 (secrets) runs PRE-COMMIT on staged diffs.
127
+ 7. Visual Verification: runs <verify-visual> AFTER successful <verify> (unit tests).
128
+ 8. Governance: ESCALATE immediately on Tier 3 changes (Auth/Payment/PII).
129
+
130
+ ### Steering awareness
131
+ Check `.planning/steering-queue.jsonl` at every task boundary.
132
+ If guidance is present: inject it into the next PLAN file as the highest priority
133
+ instruction. Standard governance gates still apply to steered changes.
134
+
135
+ ### Headless execution
136
+ If `--headless` is used:
137
+ - Disable all TTY-rich progress UI.
138
+ - Structure all stdout as line-delimited JSON.
139
+ - Handle SIGTERM by pausing execution and snapshotting HANDOFF.json.
140
+
141
+ ### New commands (Day 8)
142
+ - /mindforge:auto — start/resume autonomous execution engine
143
+ - /mindforge:steer — inject mid-execution guidance
144
+ - /mindforge:browse — persistent browser control and actions
145
+ - /mindforge:qa — systematic post-phase visual QA
146
+
147
+ ---
148
+
96
149
  ## IDENTITY
97
150
 
98
151
  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`.
@@ -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
@@ -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,47 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "MindForge v2 Autonomous Engine Schema",
4
+ "description": "Schema for HANDOFF.json and auto-state.json in v2.0.0-alpha.1",
5
+ "type": "object",
6
+ "properties": {
7
+ "schema_version": { "type": "string", "const": "2.0.0" },
8
+ "auto_mode_active": { "type": "boolean" },
9
+ "phase": { "type": "integer" },
10
+ "wave_current": { "type": "integer" },
11
+ "tasks_completed": { "type": "integer" },
12
+ "PLANNER_MODEL": { "type": "string" },
13
+ "EXECUTOR_MODEL": { "type": "string" },
14
+ "REVIEWER_MODEL": { "type": "string" },
15
+ "SECURITY_MODEL": { "type": "string" },
16
+ "RESEARCH_MODEL": { "type": "string" },
17
+ "QA_MODEL": { "type": "string" },
18
+ "DEBUG_MODEL": { "type": "string" },
19
+ "QUICK_MODEL": { "type": "string" },
20
+ "MODEL_COST_WARN_USD": { "type": "number" },
21
+ "MODEL_COST_HARD_LIMIT_USD": { "type": "number" },
22
+ "MODEL_PREFER_CHEAP_BELOW_DIFFICULTY": { "type": "number" },
23
+ "REQUIRE_CROSS_REVIEW": { "type": "boolean" },
24
+ "status": {
25
+ "type": "string",
26
+ "enum": ["idle", "running", "paused", "completed", "escalated", "timeout"]
27
+ },
28
+ "governance": {
29
+ "type": "object",
30
+ "properties": {
31
+ "tier1_auto_approve": { "type": "boolean" },
32
+ "tier2_auto_approve": { "type": "boolean" },
33
+ "tier3_require_human": { "type": "boolean", "const": true }
34
+ }
35
+ },
36
+ "browser": {
37
+ "type": "object",
38
+ "properties": {
39
+ "port": { "type": "integer", "default": 7338 },
40
+ "headless": { "type": "boolean", "default": true },
41
+ "dev_server_url": { "type": "string" },
42
+ "auto_qa": { "type": "boolean", "default": true }
43
+ }
44
+ }
45
+ },
46
+ "required": ["schema_version", "auto_mode_active", "status"]
47
+ }
@@ -0,0 +1,24 @@
1
+ # MindForge v2 — Browser Daemon Protocol
2
+
3
+ ## Overview
4
+ Small, long-lived Node.js process that manages a Chromium instance via Playwright.
5
+
6
+ ## HTTP API (localhost:7338)
7
+
8
+ | Method | Path | Body | Response |
9
+ |---|---|---|---|
10
+ | GET | /status | - | { alive: bool, sessions: string[], uptime: sec } |
11
+ | POST | /navigate | { url, session, wait_for } | { success: bool, status_code: int, load_time_ms: int } |
12
+ | POST | /click | { selector, text, session } | { success: bool, element_found: bool } |
13
+ | POST | /type | { selector, text, session } | { success: bool } |
14
+ | POST | /screenshot | { session } | { success: bool, screenshot_b64: string } |
15
+ | POST | /evaluate | { script, session } | { success: bool, result: any } |
16
+ | POST | /assert | { type, selector, expected_text, session } | { passed: bool, actual_text: string, error: string } |
17
+ | POST | /session/save | { name } | { success: bool, path: string } |
18
+ | POST | /session/load | { name } | { success: bool, cookies: int } |
19
+ | DELETE | /session/:name | - | { success: bool } |
20
+
21
+ ## State Management
22
+ - Sessions are stored in `.mindforge/browser/sessions/` as JSON.
23
+ - Multiple named sessions can be active (different BrowserContexts).
24
+ - SIGTERM saves all active sessions if --save-on-exit is passed.
@@ -0,0 +1,16 @@
1
+ # MindForge v2 — QA Engine
2
+
3
+ ## Purpose
4
+ Systematic post-phase visual QA.
5
+ Analyzes git diff, extracts UI surfaces (pages, routes), and runs tests.
6
+
7
+ ## Test Strategy
8
+ For each page found:
9
+ 1. Load page -> check for JS errors.
10
+ 2. Verify main content visibility.
11
+ 3. Test authentication redirects.
12
+ 4. Document any rendering or logic bugs.
13
+
14
+ ## Outputs
15
+ - `QA-REPORT-[N].md`: Detailed phase report.
16
+ - `tests/regression/*.test.ts`: Playwright tests for every bug found.
@@ -0,0 +1,18 @@
1
+ # MindForge v2 — Browser Session Manager
2
+
3
+ ## Principles
4
+ 1. **Persistence**: Cookies and localStorage must survive between MindForge waves.
5
+ 2. **Isolation**: Named sessions (admin, user, guest) prevent state leaking.
6
+ 3. **Security**: Session files are GITIGNORED. Never commit auth tokens.
7
+
8
+ ## Methods
9
+
10
+ ### 1. Sequential Manual Logins
11
+ Agent navigates to /login, types credentials, and calls `/session/save name`.
12
+
13
+ ### 2. External Import
14
+ Import cookies from your real browser (Chrome, Arc, Brave, Edge).
15
+ `/mindforge:browse --import-session admin --from chrome`
16
+
17
+ ### 3. Programmatic (CI)
18
+ Sessions can be pre-seeded by writing `.mindforge/browser/sessions/name.json` directly from CI secrets.
@@ -0,0 +1,31 @@
1
+ # MindForge v2 — <verify-visual> Specification
2
+
3
+ ## Overview
4
+ `<verify-visual>` is an optional field in PLAN task XML.
5
+ It runs AFTER `<verify>` (unit/integration tests) passes.
6
+ It confirms the UI looks and behaves correctly via browser automation.
7
+
8
+ ## Syntax
9
+ ```xml
10
+ <verify-visual session="user">
11
+ navigate: /dashboard
12
+ wait: networkidle
13
+ assert-visible: h1 "My Projects"
14
+ screenshot: dashboard.png
15
+ click: "#create-btn"
16
+ assert-visible: .modal
17
+ </verify-visual>
18
+ ```
19
+
20
+ ## Directives
21
+ | Directive | Description |
22
+ |---|---|
23
+ | `navigate: /path` | Navigate to URL (relative to DEV_SERVER_URL) |
24
+ | `wait: N` | Wait N ms or 'networkidle' |
25
+ | `assert-visible: sel ["text"]` | Assert element is visible |
26
+ | `assert-url: /path` | Assert current URL |
27
+ | `screenshot: name.png` | Capture screenshot |
28
+ | `click: selector` | Click element |
29
+ | `type: sel "text"` | Type into field |
30
+ | `evaluate: js` | Evaluate JS expression |
31
+ | `press: Key` | Press keyboard key |