mindforge-cc 5.0.0 → 5.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.
- package/.agent/CLAUDE.md +14 -12
- package/.agent/hooks/mindforge-session-init_extended.js +42 -0
- package/.agent/settings.json +4 -0
- package/.agent/skills/mindforge-brainstorming/SKILL.md +164 -0
- package/.agent/skills/mindforge-brainstorming/scripts/frame-template.html +214 -0
- package/.agent/skills/mindforge-brainstorming/scripts/helper.js +88 -0
- package/.agent/skills/mindforge-brainstorming/scripts/server.cjs +354 -0
- package/.agent/skills/mindforge-brainstorming/scripts/start-server.sh +148 -0
- package/.agent/skills/mindforge-brainstorming/scripts/stop-server.sh +56 -0
- package/.agent/skills/mindforge-brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/.agent/skills/mindforge-brainstorming/visual-companion.md +287 -0
- package/.agent/skills/mindforge-debug_extended/CREATION-LOG.md +119 -0
- package/.agent/skills/mindforge-debug_extended/SKILL.md +296 -0
- package/.agent/skills/mindforge-debug_extended/condition-based-waiting-example.ts +158 -0
- package/.agent/skills/mindforge-debug_extended/condition-based-waiting.md +115 -0
- package/.agent/skills/mindforge-debug_extended/defense-in-depth.md +122 -0
- package/.agent/skills/mindforge-debug_extended/find-polluter.sh +63 -0
- package/.agent/skills/mindforge-debug_extended/root-cause-tracing.md +169 -0
- package/.agent/skills/mindforge-debug_extended/test-academic.md +14 -0
- package/.agent/skills/mindforge-debug_extended/test-pressure-1.md +58 -0
- package/.agent/skills/mindforge-debug_extended/test-pressure-2.md +68 -0
- package/.agent/skills/mindforge-debug_extended/test-pressure-3.md +69 -0
- package/.agent/skills/mindforge-execute-phase_extended/SKILL.md +70 -0
- package/.agent/skills/mindforge-neural-orchestrator/SKILL.md +115 -0
- package/.agent/skills/mindforge-neural-orchestrator/references/codex-tools.md +100 -0
- package/.agent/skills/mindforge-neural-orchestrator/references/gemini-tools.md +33 -0
- package/.agent/skills/mindforge-parallel-mesh_extended/SKILL.md +182 -0
- package/.agent/skills/mindforge-plan-phase_extended/SKILL.md +152 -0
- package/.agent/skills/mindforge-plan-phase_extended/plan-document-reviewer-prompt.md +49 -0
- package/.agent/skills/mindforge-review-inbound/SKILL.md +213 -0
- package/.agent/skills/mindforge-review-request/SKILL.md +105 -0
- package/.agent/skills/mindforge-review-request/code-reviewer.md +146 -0
- package/.agent/skills/mindforge-ship_extended/SKILL.md +200 -0
- package/.agent/skills/mindforge-skill-creation/SKILL.md +655 -0
- package/.agent/skills/mindforge-skill-creation/anthropic-best-practices.md +1150 -0
- package/.agent/skills/mindforge-skill-creation/examples/CLAUDE_MD_TESTING.md +189 -0
- package/.agent/skills/mindforge-skill-creation/graphviz-conventions.dot +172 -0
- package/.agent/skills/mindforge-skill-creation/persuasion-principles.md +187 -0
- package/.agent/skills/mindforge-skill-creation/render-graphs.js +168 -0
- package/.agent/skills/mindforge-skill-creation/testing-skills-with-subagents.md +384 -0
- package/.agent/skills/mindforge-swarm-execution/SKILL.md +277 -0
- package/.agent/skills/mindforge-swarm-execution/code-quality-reviewer-prompt.md +26 -0
- package/.agent/skills/mindforge-swarm-execution/implementer-prompt.md +113 -0
- package/.agent/skills/mindforge-swarm-execution/spec-reviewer-prompt.md +61 -0
- package/.agent/skills/mindforge-tdd_extended/SKILL.md +371 -0
- package/.agent/skills/mindforge-tdd_extended/testing-anti-patterns.md +299 -0
- package/.agent/skills/mindforge-verify-work_extended/SKILL.md +139 -0
- package/.agent/skills/mindforge-workspace-isolated/SKILL.md +218 -0
- package/.agent/workflows/mindforge-verify-work.md +5 -0
- package/.agent/workflows/mindforge:brainstorming.md +16 -0
- package/.agent/workflows/mindforge:debug.md +4 -2
- package/.agent/workflows/mindforge:execute-phase.md +12 -0
- package/.agent/workflows/mindforge:plan-phase.md +11 -0
- package/.agent/workflows/mindforge:ship.md +6 -1
- package/.agent/workflows/mindforge:tdd.md +7 -2
- package/CHANGELOG.md +243 -115
- package/MINDFORGE.md +17 -9
- package/README.md +2 -2
- package/RELEASENOTES.md +16 -7
- package/docs/INTELLIGENCE-MESH.md +1 -1
- package/docs/PERSONAS.md +150 -2
- package/docs/architecture/V5-ENTERPRISE.md +8 -7
- package/docs/commands-reference.md +20 -1
- package/docs/governance-guide.md +13 -7
- package/docs/troubleshooting.md +24 -4
- package/docs/user-guide.md +37 -19
- package/package.json +1 -1
package/.agent/CLAUDE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MindForge — Unified Protocol Engine (v4.0.0-alpha.swarm)
|
|
2
2
|
|
|
3
|
-
# MASTER DIRECTIVE: Every session MUST begin by loading the Parameter Registry (MINDFORGE.md).
|
|
3
|
+
# MASTER DIRECTIVE: Every session MUST begin by loading the Parameter Registry (MINDFORGE.md) and activating the `mindforge-neural-orchestrator` layer.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -13,35 +13,36 @@ You are a **Dynamic Multi-Agent Swarm (Agentic Mesh)**. Your mission is to execu
|
|
|
13
13
|
## 🛠️ CORE PROTOCOLS (The "How")
|
|
14
14
|
|
|
15
15
|
### 1. Swarm Dynamic Orchestration (V4)
|
|
16
|
-
|
|
17
16
|
**IF** task complexity/impact is high **OR** cross-disciplinary logic is required:
|
|
18
|
-
|
|
19
|
-
1. Invoke `SwarmController`.
|
|
17
|
+
1. Invoke `SwarmController` and activate `mindforge-swarm-execution`.
|
|
20
18
|
2. Spawn task-specific ephemeral specialist cluster (AIEngineering, Security, etc.).
|
|
21
19
|
3. Inject knowledge patches via `PersonaFactory` (Context7).
|
|
22
|
-
4. Execute parallel mesh waves via `WaveExecutor`.
|
|
20
|
+
4. Execute parallel mesh waves via `WaveExecutor` guided by `mindforge-parallel-mesh_extended`.
|
|
23
21
|
5. Consolidate mesh findings into a single `SWARM-SUMMARY`.
|
|
24
22
|
|
|
25
23
|
### 2. The Sharded Memory Loop (SRD)
|
|
26
|
-
|
|
27
24
|
**IF** context ≥ 70% **OR** starting a new task:
|
|
28
|
-
|
|
29
25
|
1. Initialize `shard-controller.js`.
|
|
30
26
|
2. Rotate context per the Tri-Tier strategy (Hot/Warm/Cold).
|
|
31
27
|
3. Inject only sharded relevant data into the active buffer.
|
|
32
28
|
|
|
33
|
-
###
|
|
34
|
-
|
|
29
|
+
### 3. The Adversarial Decision Loop (ADS)
|
|
35
30
|
**BEFORE** committing any architectural change:
|
|
36
|
-
|
|
37
31
|
1. Spawn Red-Team/Blue-Team debate contexts.
|
|
38
32
|
2. Run `soul-engine.js` on the proposed diff.
|
|
39
33
|
3. **STOP** if SOUL Score < `[MIN_SOUL_SCORE]` from MINDFORGE.md.
|
|
40
34
|
|
|
41
|
-
###
|
|
35
|
+
### 4. Standard Extended Protocols (Quality Gates)
|
|
36
|
+
**MANDATORY**: For specific workflows, activate the corresponding `_extended` protocol:
|
|
37
|
+
- **Planning**: `mindforge-plan-phase_extended` + `mindforge-brainstorming`.
|
|
38
|
+
- **Execution**: `mindforge-execute-phase_extended`.
|
|
39
|
+
- **Debugging**: `mindforge-debug_extended` (Scientific RCA).
|
|
40
|
+
- **TDD**: `mindforge-tdd_extended` (Red-Green-Refactor).
|
|
41
|
+
- **Shipping**: `mindforge-ship_extended`.
|
|
42
|
+
- **Verification**: `mindforge-verify-work_extended`.
|
|
42
43
|
|
|
44
|
+
### 5. The Temporal Vision Loop (Hindsight)
|
|
43
45
|
**IF** verification fails **OR** deep bug suspected:
|
|
44
|
-
|
|
45
46
|
1. Invoke `hindsight-injector.js`.
|
|
46
47
|
2. Pull the "Last Known Good" state from the Temporal Hub.
|
|
47
48
|
3. Execute `mindforge:repair` if drift is detected.
|
|
@@ -63,6 +64,7 @@ Prioritize based on `[REACTIVE_MODE]` in MINDFORGE.md. These are the **Quality g
|
|
|
63
64
|
|
|
64
65
|
- `/mindforge:next` — Primary auto-discovery.
|
|
65
66
|
- `/mindforge:auto` — Reactive engine start.
|
|
67
|
+
- `/mindforge:brainstorming` — Creative & architectural exploration.
|
|
66
68
|
- `/mindforge:history` — Temporal Hub access.
|
|
67
69
|
- `/mindforge:status` — Project health & sharding state.
|
|
68
70
|
- `/mindforge:audit` — Day 4 governance access.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
// Determine project root (CWD is usually the project root)
|
|
5
|
+
const projectRoot = process.cwd();
|
|
6
|
+
const skillPath = path.join(projectRoot, '.agent', 'skills', 'mindforge-neural-orchestrator', 'SKILL.md');
|
|
7
|
+
|
|
8
|
+
function run() {
|
|
9
|
+
try {
|
|
10
|
+
if (!fs.existsSync(skillPath)) {
|
|
11
|
+
// Exit silently if the skill isn't there
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const skillContent = fs.readFileSync(skillPath, 'utf8');
|
|
16
|
+
|
|
17
|
+
// Check for MindForge registry for additional info if needed
|
|
18
|
+
const registryPath = path.join(projectRoot, 'MINDFORGE.md');
|
|
19
|
+
let registryWarning = "";
|
|
20
|
+
if (!fs.existsSync(registryPath)) {
|
|
21
|
+
registryWarning = "\n\n[WARNING]: MINDFORGE.md Parameter Registry not found. Architectural integrity may be degraded.";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const sessionContext = "<EXTREMELY_IMPORTANT>\nYou have MindForge Swarm Intelligence.\n\n**Below is the full content of your 'mindforge-neural-orchestrator' skill - your introduction to using skills. For all other skills, use the 'Skill' tool:**\n\n" + skillContent + registryWarning + "\n</EXTREMELY_IMPORTANT>";
|
|
25
|
+
|
|
26
|
+
const output = {
|
|
27
|
+
hookSpecificOutput: {
|
|
28
|
+
hookEventName: "SessionStart",
|
|
29
|
+
additionalContext: sessionContext
|
|
30
|
+
},
|
|
31
|
+
// Fallback for other platforms
|
|
32
|
+
additional_context: sessionContext
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
console.log(JSON.stringify(output, null, 2));
|
|
36
|
+
} catch (err) {
|
|
37
|
+
// Fail silently in production hooks to avoid blocking the user
|
|
38
|
+
// console.error(err);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
run();
|
package/.agent/settings.json
CHANGED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brainstorming
|
|
3
|
+
description: "You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Brainstorming Ideas Into Designs
|
|
7
|
+
|
|
8
|
+
Help turn ideas into fully formed designs and specs through natural collaborative dialogue.
|
|
9
|
+
|
|
10
|
+
Start by understanding the current project context, then ask questions one at a time to refine the idea. Once you understand what you're building, present the design and get user approval.
|
|
11
|
+
|
|
12
|
+
<HARD-GATE>
|
|
13
|
+
Do NOT invoke any implementation skill, write any code, scaffold any project, or take any implementation action until you have presented a design and the user has approved it. This applies to EVERY project regardless of perceived simplicity.
|
|
14
|
+
</HARD-GATE>
|
|
15
|
+
|
|
16
|
+
## Anti-Pattern: "This Is Too Simple To Need A Design"
|
|
17
|
+
|
|
18
|
+
Every project goes through this process. A todo list, a single-function utility, a config change — all of them. "Simple" projects are where unexamined assumptions cause the most wasted work. The design can be short (a few sentences for truly simple projects), but you MUST present it and get approval.
|
|
19
|
+
|
|
20
|
+
## Checklist
|
|
21
|
+
|
|
22
|
+
You MUST create a task for each of these items and complete them in order:
|
|
23
|
+
|
|
24
|
+
1. **Explore project context** — check files, docs, recent commits
|
|
25
|
+
2. **Offer visual companion** (if topic will involve visual questions) — this is its own message, not combined with a clarifying question. See the Visual Companion section below.
|
|
26
|
+
3. **Ask clarifying questions** — one at a time, understand purpose/constraints/success criteria
|
|
27
|
+
4. **Propose 2-3 approaches** — with trade-offs and your recommendation
|
|
28
|
+
5. **Present design** — in sections scaled to their complexity, get user approval after each section
|
|
29
|
+
6. **Write design doc** — save to `docs/mindforge/specs/YYYY-MM-DD-<topic>-design.md` and commit
|
|
30
|
+
7. **Spec self-review** — quick inline check for placeholders, contradictions, ambiguity, scope (see below)
|
|
31
|
+
8. **User reviews written spec** — ask user to review the spec file before proceeding
|
|
32
|
+
9. **Transition to implementation** — invoke mindforge-plan-phase_extended skill to create implementation plan
|
|
33
|
+
|
|
34
|
+
## Process Flow
|
|
35
|
+
|
|
36
|
+
```dot
|
|
37
|
+
digraph brainstorming {
|
|
38
|
+
"Explore project context" [shape=box];
|
|
39
|
+
"Visual questions ahead?" [shape=diamond];
|
|
40
|
+
"Offer Visual Companion\n(own message, no other content)" [shape=box];
|
|
41
|
+
"Ask clarifying questions" [shape=box];
|
|
42
|
+
"Propose 2-3 approaches" [shape=box];
|
|
43
|
+
"Present design sections" [shape=box];
|
|
44
|
+
"User approves design?" [shape=diamond];
|
|
45
|
+
"Write design doc" [shape=box];
|
|
46
|
+
"Spec self-review\n(fix inline)" [shape=box];
|
|
47
|
+
"User reviews spec?" [shape=diamond];
|
|
48
|
+
"Invoke mindforge-plan-phase_extended skill" [shape=doublecircle];
|
|
49
|
+
|
|
50
|
+
"Explore project context" -> "Visual questions ahead?";
|
|
51
|
+
"Visual questions ahead?" -> "Offer Visual Companion\n(own message, no other content)" [label="yes"];
|
|
52
|
+
"Visual questions ahead?" -> "Ask clarifying questions" [label="no"];
|
|
53
|
+
"Offer Visual Companion\n(own message, no other content)" -> "Ask clarifying questions";
|
|
54
|
+
"Ask clarifying questions" -> "Propose 2-3 approaches";
|
|
55
|
+
"Propose 2-3 approaches" -> "Present design sections";
|
|
56
|
+
"Present design sections" -> "User approves design?";
|
|
57
|
+
"User approves design?" -> "Present design sections" [label="no, revise"];
|
|
58
|
+
"User approves design?" -> "Write design doc" [label="yes"];
|
|
59
|
+
"Write design doc" -> "Spec self-review\n(fix inline)";
|
|
60
|
+
"Spec self-review\n(fix inline)" -> "User reviews spec?";
|
|
61
|
+
"User reviews spec?" -> "Write design doc" [label="changes requested"];
|
|
62
|
+
"User reviews spec?" -> "Invoke mindforge-plan-phase_extended skill" [label="approved"];
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**The terminal state is invoking mindforge-plan-phase_extended.** Do NOT invoke frontend-design, mcp-builder, or any other implementation skill. The ONLY skill you invoke after brainstorming is mindforge-plan-phase_extended.
|
|
67
|
+
|
|
68
|
+
## The Process
|
|
69
|
+
|
|
70
|
+
**Understanding the idea:**
|
|
71
|
+
|
|
72
|
+
- Check out the current project state first (files, docs, recent commits)
|
|
73
|
+
- Before asking detailed questions, assess scope: if the request describes multiple independent subsystems (e.g., "build a platform with chat, file storage, billing, and analytics"), flag this immediately. Don't spend questions refining details of a project that needs to be decomposed first.
|
|
74
|
+
- If the project is too large for a single spec, help the user decompose into sub-projects: what are the independent pieces, how do they relate, what order should they be built? Then brainstorm the first sub-project through the normal design flow. Each sub-project gets its own spec → plan → implementation cycle.
|
|
75
|
+
- For appropriately-scoped projects, ask questions one at a time to refine the idea
|
|
76
|
+
- Prefer multiple choice questions when possible, but open-ended is fine too
|
|
77
|
+
- Only one question per message - if a topic needs more exploration, break it into multiple questions
|
|
78
|
+
- Focus on understanding: purpose, constraints, success criteria
|
|
79
|
+
|
|
80
|
+
**Exploring approaches:**
|
|
81
|
+
|
|
82
|
+
- Propose 2-3 different approaches with trade-offs
|
|
83
|
+
- Present options conversationally with your recommendation and reasoning
|
|
84
|
+
- Lead with your recommended option and explain why
|
|
85
|
+
|
|
86
|
+
**Presenting the design:**
|
|
87
|
+
|
|
88
|
+
- Once you believe you understand what you're building, present the design
|
|
89
|
+
- Scale each section to its complexity: a few sentences if straightforward, up to 200-300 words if nuanced
|
|
90
|
+
- Ask after each section whether it looks right so far
|
|
91
|
+
- Cover: architecture, components, data flow, error handling, testing
|
|
92
|
+
- Be ready to go back and clarify if something doesn't make sense
|
|
93
|
+
|
|
94
|
+
**Design for isolation and clarity:**
|
|
95
|
+
|
|
96
|
+
- Break the system into smaller units that each have one clear purpose, communicate through well-defined interfaces, and can be understood and tested independently
|
|
97
|
+
- For each unit, you should be able to answer: what does it do, how do you use it, and what does it depend on?
|
|
98
|
+
- Can someone understand what a unit does without reading its internals? Can you change the internals without breaking consumers? If not, the boundaries need work.
|
|
99
|
+
- Smaller, well-bounded units are also easier for you to work with - you reason better about code you can hold in context at once, and your edits are more reliable when files are focused. When a file grows large, that's often a signal that it's doing too much.
|
|
100
|
+
|
|
101
|
+
**Working in existing codebases:**
|
|
102
|
+
|
|
103
|
+
- Explore the current structure before proposing changes. Follow existing patterns.
|
|
104
|
+
- Where existing code has problems that affect the work (e.g., a file that's grown too large, unclear boundaries, tangled responsibilities), include targeted improvements as part of the design - the way a good developer improves code they're working in.
|
|
105
|
+
- Don't propose unrelated refactoring. Stay focused on what serves the current goal.
|
|
106
|
+
|
|
107
|
+
## After the Design
|
|
108
|
+
|
|
109
|
+
**Documentation:**
|
|
110
|
+
|
|
111
|
+
- Write the validated design (spec) to `docs/mindforge/specs/YYYY-MM-DD-<topic>-design.md`
|
|
112
|
+
- (User preferences for spec location override this default)
|
|
113
|
+
- Use mindforge:writing-clearly-and-concisely skill if available
|
|
114
|
+
- Commit the design document to git
|
|
115
|
+
|
|
116
|
+
**Spec Self-Review:**
|
|
117
|
+
After writing the spec document, look at it with fresh eyes:
|
|
118
|
+
|
|
119
|
+
1. **Placeholder scan:** Any "TBD", "TODO", incomplete sections, or vague requirements? Fix them.
|
|
120
|
+
2. **Internal consistency:** Do any sections contradict each other? Does the architecture match the feature descriptions?
|
|
121
|
+
3. **Scope check:** Is this focused enough for a single implementation plan, or does it need decomposition?
|
|
122
|
+
4. **Ambiguity check:** Could any requirement be interpreted two different ways? If so, pick one and make it explicit.
|
|
123
|
+
|
|
124
|
+
Fix any issues inline. No need to re-review — just fix and move on.
|
|
125
|
+
|
|
126
|
+
**User Review Gate:**
|
|
127
|
+
After the spec review loop passes, ask the user to review the written spec before proceeding:
|
|
128
|
+
|
|
129
|
+
> "Spec written and committed to `<path>`. Please review it and let me know if you want to make any changes before we start writing out the implementation plan."
|
|
130
|
+
|
|
131
|
+
Wait for the user's response. If they request changes, make them and re-run the spec review loop. Only proceed once the user approves.
|
|
132
|
+
|
|
133
|
+
**Implementation:**
|
|
134
|
+
|
|
135
|
+
- Invoke the mindforge-plan-phase_extended skill to create a detailed implementation plan
|
|
136
|
+
- Do NOT invoke any other skill. mindforge-plan-phase_extended is the next step.
|
|
137
|
+
|
|
138
|
+
## Key Principles
|
|
139
|
+
|
|
140
|
+
- **One question at a time** - Don't overwhelm with multiple questions
|
|
141
|
+
- **Multiple choice preferred** - Easier to answer than open-ended when possible
|
|
142
|
+
- **YAGNI ruthlessly** - Remove unnecessary features from all designs
|
|
143
|
+
- **Explore alternatives** - Always propose 2-3 approaches before settling
|
|
144
|
+
- **Incremental validation** - Present design, get approval before moving on
|
|
145
|
+
- **Be flexible** - Go back and clarify when something doesn't make sense
|
|
146
|
+
|
|
147
|
+
## Visual Companion
|
|
148
|
+
|
|
149
|
+
A browser-based companion for showing mockups, diagrams, and visual options during brainstorming. Available as a tool — not a mode. Accepting the companion means it's available for questions that benefit from visual treatment; it does NOT mean every question goes through the browser.
|
|
150
|
+
|
|
151
|
+
**Offering the companion:** When you anticipate that upcoming questions will involve visual content (mockups, layouts, diagrams), offer it once for consent:
|
|
152
|
+
> "Some of what we're working on might be easier to explain if I can show it to you in a web browser. I can put together mockups, diagrams, comparisons, and other visuals as we go. This feature is still new and can be token-intensive. Want to try it? (Requires opening a local URL)"
|
|
153
|
+
|
|
154
|
+
**This offer MUST be its own message.** Do not combine it with clarifying questions, context summaries, or any other content. The message should contain ONLY the offer above and nothing else. Wait for the user's response before continuing. If they decline, proceed with text-only brainstorming.
|
|
155
|
+
|
|
156
|
+
**Per-question decision:** Even after the user accepts, decide FOR EACH QUESTION whether to use the browser or the terminal. The test: **would the user understand this better by seeing it than reading it?**
|
|
157
|
+
|
|
158
|
+
- **Use the browser** for content that IS visual — mockups, wireframes, layout comparisons, architecture diagrams, side-by-side visual designs
|
|
159
|
+
- **Use the terminal** for content that is text — requirements questions, conceptual choices, tradeoff lists, A/B/C/D text options, scope decisions
|
|
160
|
+
|
|
161
|
+
A question about a UI topic is not automatically a visual question. "What does personality mean in this context?" is a conceptual question — use the terminal. "Which wizard layout works better?" is a visual question — use the browser.
|
|
162
|
+
|
|
163
|
+
If they agree to the companion, read the detailed guide before proceeding:
|
|
164
|
+
`skills/brainstorming/visual-companion.md`
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>MindForge Brainstorming</title>
|
|
6
|
+
<style>
|
|
7
|
+
/*
|
|
8
|
+
* BRAINSTORM COMPANION FRAME TEMPLATE
|
|
9
|
+
*
|
|
10
|
+
* This template provides a consistent frame with:
|
|
11
|
+
* - OS-aware light/dark theming
|
|
12
|
+
* - Fixed header and selection indicator bar
|
|
13
|
+
* - Scrollable main content area
|
|
14
|
+
* - CSS helpers for common UI patterns
|
|
15
|
+
*
|
|
16
|
+
* Content is injected via placeholder comment in #claude-content.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
20
|
+
html, body { height: 100%; overflow: hidden; }
|
|
21
|
+
|
|
22
|
+
/* ===== THEME VARIABLES ===== */
|
|
23
|
+
:root {
|
|
24
|
+
--bg-primary: #f5f5f7;
|
|
25
|
+
--bg-secondary: #ffffff;
|
|
26
|
+
--bg-tertiary: #e5e5e7;
|
|
27
|
+
--border: #d1d1d6;
|
|
28
|
+
--text-primary: #1d1d1f;
|
|
29
|
+
--text-secondary: #86868b;
|
|
30
|
+
--text-tertiary: #aeaeb2;
|
|
31
|
+
--accent: #0071e3;
|
|
32
|
+
--accent-hover: #0077ed;
|
|
33
|
+
--success: #34c759;
|
|
34
|
+
--warning: #ff9f0a;
|
|
35
|
+
--error: #ff3b30;
|
|
36
|
+
--selected-bg: #e8f4fd;
|
|
37
|
+
--selected-border: #0071e3;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@media (prefers-color-scheme: dark) {
|
|
41
|
+
:root {
|
|
42
|
+
--bg-primary: #1d1d1f;
|
|
43
|
+
--bg-secondary: #2d2d2f;
|
|
44
|
+
--bg-tertiary: #3d3d3f;
|
|
45
|
+
--border: #424245;
|
|
46
|
+
--text-primary: #f5f5f7;
|
|
47
|
+
--text-secondary: #86868b;
|
|
48
|
+
--text-tertiary: #636366;
|
|
49
|
+
--accent: #0a84ff;
|
|
50
|
+
--accent-hover: #409cff;
|
|
51
|
+
--selected-bg: rgba(10, 132, 255, 0.15);
|
|
52
|
+
--selected-border: #0a84ff;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
body {
|
|
57
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
|
|
58
|
+
background: var(--bg-primary);
|
|
59
|
+
color: var(--text-primary);
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
line-height: 1.5;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* ===== FRAME STRUCTURE ===== */
|
|
66
|
+
.header {
|
|
67
|
+
background: var(--bg-secondary);
|
|
68
|
+
padding: 0.5rem 1.5rem;
|
|
69
|
+
display: flex;
|
|
70
|
+
justify-content: space-between;
|
|
71
|
+
align-items: center;
|
|
72
|
+
border-bottom: 1px solid var(--border);
|
|
73
|
+
flex-shrink: 0;
|
|
74
|
+
}
|
|
75
|
+
.header h1 { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
|
|
76
|
+
.header .status { font-size: 0.7rem; color: var(--success); display: flex; align-items: center; gap: 0.4rem; }
|
|
77
|
+
.header .status::before { content: ''; width: 6px; height: 6px; background: var(--success); border-radius: 50%; }
|
|
78
|
+
|
|
79
|
+
.main { flex: 1; overflow-y: auto; }
|
|
80
|
+
#claude-content { padding: 2rem; min-height: 100%; }
|
|
81
|
+
|
|
82
|
+
.indicator-bar {
|
|
83
|
+
background: var(--bg-secondary);
|
|
84
|
+
border-top: 1px solid var(--border);
|
|
85
|
+
padding: 0.5rem 1.5rem;
|
|
86
|
+
flex-shrink: 0;
|
|
87
|
+
text-align: center;
|
|
88
|
+
}
|
|
89
|
+
.indicator-bar span {
|
|
90
|
+
font-size: 0.75rem;
|
|
91
|
+
color: var(--text-secondary);
|
|
92
|
+
}
|
|
93
|
+
.indicator-bar .selected-text {
|
|
94
|
+
color: var(--accent);
|
|
95
|
+
font-weight: 500;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* ===== TYPOGRAPHY ===== */
|
|
99
|
+
h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
|
|
100
|
+
h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
|
|
101
|
+
.subtitle { color: var(--text-secondary); margin-bottom: 1.5rem; }
|
|
102
|
+
.section { margin-bottom: 2rem; }
|
|
103
|
+
.label { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
|
|
104
|
+
|
|
105
|
+
/* ===== OPTIONS (for A/B/C choices) ===== */
|
|
106
|
+
.options { display: flex; flex-direction: column; gap: 0.75rem; }
|
|
107
|
+
.option {
|
|
108
|
+
background: var(--bg-secondary);
|
|
109
|
+
border: 2px solid var(--border);
|
|
110
|
+
border-radius: 12px;
|
|
111
|
+
padding: 1rem 1.25rem;
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
transition: all 0.15s ease;
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: flex-start;
|
|
116
|
+
gap: 1rem;
|
|
117
|
+
}
|
|
118
|
+
.option:hover { border-color: var(--accent); }
|
|
119
|
+
.option.selected { background: var(--selected-bg); border-color: var(--selected-border); }
|
|
120
|
+
.option .letter {
|
|
121
|
+
background: var(--bg-tertiary);
|
|
122
|
+
color: var(--text-secondary);
|
|
123
|
+
width: 1.75rem; height: 1.75rem;
|
|
124
|
+
border-radius: 6px;
|
|
125
|
+
display: flex; align-items: center; justify-content: center;
|
|
126
|
+
font-weight: 600; font-size: 0.85rem; flex-shrink: 0;
|
|
127
|
+
}
|
|
128
|
+
.option.selected .letter { background: var(--accent); color: white; }
|
|
129
|
+
.option .content { flex: 1; }
|
|
130
|
+
.option .content h3 { font-size: 0.95rem; margin-bottom: 0.15rem; }
|
|
131
|
+
.option .content p { color: var(--text-secondary); font-size: 0.85rem; margin: 0; }
|
|
132
|
+
|
|
133
|
+
/* ===== CARDS (for showing designs/mockups) ===== */
|
|
134
|
+
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
|
|
135
|
+
.card {
|
|
136
|
+
background: var(--bg-secondary);
|
|
137
|
+
border: 1px solid var(--border);
|
|
138
|
+
border-radius: 12px;
|
|
139
|
+
overflow: hidden;
|
|
140
|
+
cursor: pointer;
|
|
141
|
+
transition: all 0.15s ease;
|
|
142
|
+
}
|
|
143
|
+
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
|
|
144
|
+
.card.selected { border-color: var(--selected-border); border-width: 2px; }
|
|
145
|
+
.card-image { background: var(--bg-tertiary); aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center; }
|
|
146
|
+
.card-body { padding: 1rem; }
|
|
147
|
+
.card-body h3 { margin-bottom: 0.25rem; }
|
|
148
|
+
.card-body p { color: var(--text-secondary); font-size: 0.85rem; }
|
|
149
|
+
|
|
150
|
+
/* ===== MOCKUP CONTAINER ===== */
|
|
151
|
+
.mockup {
|
|
152
|
+
background: var(--bg-secondary);
|
|
153
|
+
border: 1px solid var(--border);
|
|
154
|
+
border-radius: 12px;
|
|
155
|
+
overflow: hidden;
|
|
156
|
+
margin-bottom: 1.5rem;
|
|
157
|
+
}
|
|
158
|
+
.mockup-header {
|
|
159
|
+
background: var(--bg-tertiary);
|
|
160
|
+
padding: 0.5rem 1rem;
|
|
161
|
+
font-size: 0.75rem;
|
|
162
|
+
color: var(--text-secondary);
|
|
163
|
+
border-bottom: 1px solid var(--border);
|
|
164
|
+
}
|
|
165
|
+
.mockup-body { padding: 1.5rem; }
|
|
166
|
+
|
|
167
|
+
/* ===== SPLIT VIEW (side-by-side comparison) ===== */
|
|
168
|
+
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
|
|
169
|
+
@media (max-width: 700px) { .split { grid-template-columns: 1fr; } }
|
|
170
|
+
|
|
171
|
+
/* ===== PROS/CONS ===== */
|
|
172
|
+
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
|
|
173
|
+
.pros, .cons { background: var(--bg-secondary); border-radius: 8px; padding: 1rem; }
|
|
174
|
+
.pros h4 { color: var(--success); font-size: 0.85rem; margin-bottom: 0.5rem; }
|
|
175
|
+
.cons h4 { color: var(--error); font-size: 0.85rem; margin-bottom: 0.5rem; }
|
|
176
|
+
.pros ul, .cons ul { margin-left: 1.25rem; font-size: 0.85rem; color: var(--text-secondary); }
|
|
177
|
+
.pros li, .cons li { margin-bottom: 0.25rem; }
|
|
178
|
+
|
|
179
|
+
/* ===== PLACEHOLDER (for mockup areas) ===== */
|
|
180
|
+
.placeholder {
|
|
181
|
+
background: var(--bg-tertiary);
|
|
182
|
+
border: 2px dashed var(--border);
|
|
183
|
+
border-radius: 8px;
|
|
184
|
+
padding: 2rem;
|
|
185
|
+
text-align: center;
|
|
186
|
+
color: var(--text-tertiary);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/* ===== INLINE MOCKUP ELEMENTS ===== */
|
|
190
|
+
.mock-nav { background: var(--accent); color: white; padding: 0.75rem 1rem; display: flex; gap: 1.5rem; font-size: 0.9rem; }
|
|
191
|
+
.mock-sidebar { background: var(--bg-tertiary); padding: 1rem; min-width: 180px; }
|
|
192
|
+
.mock-content { padding: 1.5rem; flex: 1; }
|
|
193
|
+
.mock-button { background: var(--accent); color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.85rem; }
|
|
194
|
+
.mock-input { background: var(--bg-primary); border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem; width: 100%; }
|
|
195
|
+
</style>
|
|
196
|
+
</head>
|
|
197
|
+
<body>
|
|
198
|
+
<div class="header">
|
|
199
|
+
<h1><a href="https://github.com/obra/MindForge" style="color: inherit; text-decoration: none;">MindForge Brainstorming</a></h1>
|
|
200
|
+
<div class="status">Connected</div>
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
<div class="main">
|
|
204
|
+
<div id="claude-content">
|
|
205
|
+
<!-- CONTENT -->
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
|
|
209
|
+
<div class="indicator-bar">
|
|
210
|
+
<span id="indicator-text">Click an option above, then return to the terminal</span>
|
|
211
|
+
</div>
|
|
212
|
+
|
|
213
|
+
</body>
|
|
214
|
+
</html>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
const WS_URL = 'ws://' + window.location.host;
|
|
3
|
+
let ws = null;
|
|
4
|
+
let eventQueue = [];
|
|
5
|
+
|
|
6
|
+
function connect() {
|
|
7
|
+
ws = new WebSocket(WS_URL);
|
|
8
|
+
|
|
9
|
+
ws.onopen = () => {
|
|
10
|
+
eventQueue.forEach(e => ws.send(JSON.stringify(e)));
|
|
11
|
+
eventQueue = [];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
ws.onmessage = (msg) => {
|
|
15
|
+
const data = JSON.parse(msg.data);
|
|
16
|
+
if (data.type === 'reload') {
|
|
17
|
+
window.location.reload();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
ws.onclose = () => {
|
|
22
|
+
setTimeout(connect, 1000);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function sendEvent(event) {
|
|
27
|
+
event.timestamp = Date.now();
|
|
28
|
+
if (ws && ws.readyState === WebSocket.OPEN) {
|
|
29
|
+
ws.send(JSON.stringify(event));
|
|
30
|
+
} else {
|
|
31
|
+
eventQueue.push(event);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Capture clicks on choice elements
|
|
36
|
+
document.addEventListener('click', (e) => {
|
|
37
|
+
const target = e.target.closest('[data-choice]');
|
|
38
|
+
if (!target) return;
|
|
39
|
+
|
|
40
|
+
sendEvent({
|
|
41
|
+
type: 'click',
|
|
42
|
+
text: target.textContent.trim(),
|
|
43
|
+
choice: target.dataset.choice,
|
|
44
|
+
id: target.id || null
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// Update indicator bar (defer so toggleSelect runs first)
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
const indicator = document.getElementById('indicator-text');
|
|
50
|
+
if (!indicator) return;
|
|
51
|
+
const container = target.closest('.options') || target.closest('.cards');
|
|
52
|
+
const selected = container ? container.querySelectorAll('.selected') : [];
|
|
53
|
+
if (selected.length === 0) {
|
|
54
|
+
indicator.textContent = 'Click an option above, then return to the terminal';
|
|
55
|
+
} else if (selected.length === 1) {
|
|
56
|
+
const label = selected[0].querySelector('h3, .content h3, .card-body h3')?.textContent?.trim() || selected[0].dataset.choice;
|
|
57
|
+
indicator.innerHTML = '<span class="selected-text">' + label + ' selected</span> — return to terminal to continue';
|
|
58
|
+
} else {
|
|
59
|
+
indicator.innerHTML = '<span class="selected-text">' + selected.length + ' selected</span> — return to terminal to continue';
|
|
60
|
+
}
|
|
61
|
+
}, 0);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// Frame UI: selection tracking
|
|
65
|
+
window.selectedChoice = null;
|
|
66
|
+
|
|
67
|
+
window.toggleSelect = function(el) {
|
|
68
|
+
const container = el.closest('.options') || el.closest('.cards');
|
|
69
|
+
const multi = container && container.dataset.multiselect !== undefined;
|
|
70
|
+
if (container && !multi) {
|
|
71
|
+
container.querySelectorAll('.option, .card').forEach(o => o.classList.remove('selected'));
|
|
72
|
+
}
|
|
73
|
+
if (multi) {
|
|
74
|
+
el.classList.toggle('selected');
|
|
75
|
+
} else {
|
|
76
|
+
el.classList.add('selected');
|
|
77
|
+
}
|
|
78
|
+
window.selectedChoice = el.dataset.choice;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// Expose API for explicit use
|
|
82
|
+
window.brainstorm = {
|
|
83
|
+
send: sendEvent,
|
|
84
|
+
choice: (value, metadata = {}) => sendEvent({ type: 'choice', value, ...metadata })
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
connect();
|
|
88
|
+
})();
|