claude-everything-workflow 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +36 -0
- package/CLAUDE.md +7 -0
- package/LICENSE +22 -0
- package/README.md +369 -0
- package/agents/architect.md +59 -0
- package/agents/code-reviewer.md +57 -0
- package/agents/database-reviewer.md +44 -0
- package/agents/e2e-runner.md +153 -0
- package/agents/harness-optimizer.md +92 -0
- package/agents/planner.md +124 -0
- package/agents/refactor-cleaner.md +54 -0
- package/agents/security-reviewer.md +47 -0
- package/agents/tdd-guide.md +101 -0
- package/bin/claude-everything-workflow.js +91 -0
- package/commands/code-review.md +27 -0
- package/commands/e2e.md +28 -0
- package/commands/evolve.md +42 -0
- package/commands/harness-audit.md +27 -0
- package/commands/instinct-status.md +38 -0
- package/commands/learn-eval.md +91 -0
- package/commands/pr.md +88 -0
- package/commands/projects.md +27 -0
- package/commands/promote.md +29 -0
- package/commands/prune.md +46 -0
- package/commands/tdd.md +27 -0
- package/commands/verify.md +93 -0
- package/homunculus/instincts/personal/always-test-first.md +28 -0
- package/homunculus/instincts/personal/pr-ci-quality-gate.md +30 -0
- package/hooks/check-console-log.js +37 -0
- package/hooks/commit-quality.js +143 -0
- package/hooks/evaluate-session.js +59 -0
- package/hooks/pre-compact.js +92 -0
- package/hooks/runtime/hook-flags.js +40 -0
- package/hooks/runtime/run-with-flags.js +141 -0
- package/hooks/runtime/session-utils.js +45 -0
- package/hooks/session-end.js +62 -0
- package/hooks/session-start.js +60 -0
- package/package.json +48 -0
- package/references/agents/database-reviewer.md +657 -0
- package/references/agents/refactor-cleaner.md +75 -0
- package/references/agents/security-reviewer.md +542 -0
- package/rules/01-base.md +49 -0
- package/rules/02-code-size.md +13 -0
- package/rules/03-architecture.md +64 -0
- package/rules/04-error-handling.md +27 -0
- package/rules/05-git-workflow.md +56 -0
- package/rules/06-comments.md +44 -0
- package/rules/07-forbidden.md +43 -0
- package/rules/08-ecc-integration.md +46 -0
- package/rules/common/agent-orchestration.md +54 -0
- package/rules/common/context-hygiene.md +85 -0
- package/rules/common/harness-engineering.md +46 -0
- package/rules/common/hooks.md +87 -0
- package/rules/common/implementation.md +25 -0
- package/rules/common/performance.md +71 -0
- package/rules/common/pr-automation.md +73 -0
- package/rules/common/security.md +19 -0
- package/rules/common/skills-learning.md +39 -0
- package/rules/common/testing.md +68 -0
- package/scripts/install.ps1 +286 -0
- package/scripts/install.sh +214 -0
- package/scripts/learning/migrate-homunculus.js +93 -0
- package/scripts/learning/project-utils.js +214 -0
- package/scripts/learning/projects.js +60 -0
- package/scripts/learning/promote.js +98 -0
- package/scripts/learning/review-confidence.js +455 -0
- package/scripts/verify-harness.js +868 -0
- package/settings.json +77 -0
- package/skills/brainstorming/SKILL.md +185 -0
- package/skills/brainstorming/agents/openai.yaml +3 -0
- package/skills/brainstorming/scripts/frame-template.html +214 -0
- package/skills/brainstorming/scripts/helper.js +88 -0
- package/skills/brainstorming/scripts/server.cjs +354 -0
- package/skills/brainstorming/scripts/start-server.sh +148 -0
- package/skills/brainstorming/scripts/stop-server.sh +56 -0
- package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/skills/brainstorming/visual-companion.md +287 -0
- package/skills/continuous-learning-v2/SKILL.md +74 -0
- package/skills/continuous-learning-v2/agents/observer.md +129 -0
- package/skills/continuous-learning-v2/agents/start-observer.sh +83 -0
- package/skills/continuous-learning-v2/config.json +58 -0
- package/skills/continuous-learning-v2/hooks/observe-v2.js +144 -0
- package/skills/documentation-lookup/SKILL.md +90 -0
- package/skills/e2e-testing/SKILL.md +326 -0
- package/skills/executing-plans/SKILL.md +66 -0
- package/skills/find-skills/SKILL.md +142 -0
- package/skills/skill-creator/LICENSE.txt +202 -0
- package/skills/skill-creator/SKILL.md +356 -0
- package/skills/skill-creator/references/output-patterns.md +82 -0
- package/skills/skill-creator/references/workflows.md +28 -0
- package/skills/skill-creator/scripts/init_skill.py +303 -0
- package/skills/skill-creator/scripts/package_skill.py +110 -0
- package/skills/skill-creator/scripts/quick_validate.py +95 -0
- package/skills/systematic-debugging/SKILL.md +59 -0
- package/skills/test-driven-development/SKILL.md +71 -0
- package/skills/using-git-worktrees/SKILL.md +64 -0
- package/skills/verification-before-completion/SKILL.md +77 -0
- package/skills/writing-plans/SKILL.md +183 -0
- package/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
package/settings.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
|
3
|
+
"hooks": {
|
|
4
|
+
"SessionStart": [
|
|
5
|
+
{
|
|
6
|
+
"matcher": "*",
|
|
7
|
+
"hooks": [
|
|
8
|
+
{
|
|
9
|
+
"type": "command",
|
|
10
|
+
"command": "node \"$HOME/.claude/hooks/runtime/run-with-flags.js\" session:start \"$HOME/.claude/hooks/session-start.js\" minimal,standard,strict",
|
|
11
|
+
"timeout": 5
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
|
|
17
|
+
"PostToolUse": [
|
|
18
|
+
{
|
|
19
|
+
"matcher": "Edit|Write|MultiEdit",
|
|
20
|
+
"hooks": [
|
|
21
|
+
{
|
|
22
|
+
"type": "command",
|
|
23
|
+
"command": "node \"$HOME/.claude/hooks/runtime/run-with-flags.js\" post:edit:console-log \"$HOME/.claude/hooks/check-console-log.js\" standard,strict",
|
|
24
|
+
"timeout": 5
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"matcher": "*",
|
|
30
|
+
"hooks": [
|
|
31
|
+
{
|
|
32
|
+
"type": "command",
|
|
33
|
+
"command": "node \"$HOME/.claude/hooks/runtime/run-with-flags.js\" post:observe \"$HOME/.claude/skills/continuous-learning-v2/hooks/observe-v2.js\" strict post",
|
|
34
|
+
"async": true,
|
|
35
|
+
"timeout": 10
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"Stop": [
|
|
41
|
+
{
|
|
42
|
+
"matcher": "*",
|
|
43
|
+
"hooks": [
|
|
44
|
+
{
|
|
45
|
+
"type": "command",
|
|
46
|
+
"command": "node \"$HOME/.claude/hooks/runtime/run-with-flags.js\" stop:evaluate-session \"$HOME/.claude/hooks/evaluate-session.js\" strict",
|
|
47
|
+
"timeout": 10
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"SessionEnd": [
|
|
53
|
+
{
|
|
54
|
+
"matcher": "*",
|
|
55
|
+
"hooks": [
|
|
56
|
+
{
|
|
57
|
+
"type": "command",
|
|
58
|
+
"command": "node \"$HOME/.claude/hooks/runtime/run-with-flags.js\" session:end \"$HOME/.claude/hooks/session-end.js\" minimal,standard,strict",
|
|
59
|
+
"timeout": 5
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"PreCompact": [
|
|
65
|
+
{
|
|
66
|
+
"matcher": "*",
|
|
67
|
+
"hooks": [
|
|
68
|
+
{
|
|
69
|
+
"type": "command",
|
|
70
|
+
"command": "node \"$HOME/.claude/hooks/runtime/run-with-flags.js\" precompact:save-context \"$HOME/.claude/hooks/pre-compact.js\" minimal,standard,strict",
|
|
71
|
+
"timeout": 5
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brainstorming
|
|
3
|
+
description: "Use for explicit Brainstorming/design-spec/Spec-Gate requests, or before complex, ambiguous, high-risk, cross-file, architectural, integration, UI/UX, public API, data-flow, or behavior-changing development work. Skip for clearly specified low-risk edits such as button color tweaks, typo fixes, mechanical replacements, straightforward docs/config updates, or obvious single-file changes."
|
|
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 deciding whether the request needs the full brainstorming flow. If it does, understand 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
|
+
Spec Gate: 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
|
+
## Trigger Policy
|
|
17
|
+
|
|
18
|
+
Use the full flow for explicit Brainstorming/design-spec/Spec-Gate requests, or when work is ambiguous, high-risk, cross-file, architecture/API/data/security/integration/UI-workflow changing, or has multiple reasonable designs.
|
|
19
|
+
|
|
20
|
+
Skip the full flow for clear low-risk edits: button/copy/typo/formatting tweaks, mechanical replacements, small docs/config updates, obvious single-file changes, read-only inspection, command output, or explanations.
|
|
21
|
+
|
|
22
|
+
If a simple request hides uncertainty affecting architecture, data, integration, test scope, or release behavior, ask one targeted clarification before deciding.
|
|
23
|
+
|
|
24
|
+
## Repository Spec Profile
|
|
25
|
+
|
|
26
|
+
For this repository, specs default to infrastructure/workflow design: Superpowers gates, skill/command/hook/rule/agent/tool contracts, failure modes, migration, rollback, fixtures, dry-runs, and verification. Avoid product narrative specs unless explicitly requested.
|
|
27
|
+
|
|
28
|
+
## Checklist
|
|
29
|
+
|
|
30
|
+
When this skill applies, you MUST create a task for each of these items and complete them in order:
|
|
31
|
+
|
|
32
|
+
1. **Explore project context** — check files, docs, recent commits
|
|
33
|
+
2. **Offer visual companion** (if task explicitly involves mockups, layouts, wireframes, screenshots, diagrams, or side-by-side visual comparisons) — this is its own message, not combined with a clarifying question. See the Visual Companion section below.
|
|
34
|
+
3. **Ask clarifying questions** — one at a time, understand purpose/constraints/success criteria
|
|
35
|
+
4. **Propose 2-3 approaches** — with trade-offs and your recommendation
|
|
36
|
+
5. **Present design** — in sections scaled to their complexity, get user approval after each section
|
|
37
|
+
6. **Write design doc** — save to `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md` using the required template below
|
|
38
|
+
7. **Spec self-review** — quick inline check for placeholders, contradictions, ambiguity, scope (see below)
|
|
39
|
+
8. **User reviews written spec** — ask user to review the spec file before proceeding
|
|
40
|
+
9. **Transition to implementation** — invoke writing-plans skill to create implementation plan
|
|
41
|
+
|
|
42
|
+
## Process Flow
|
|
43
|
+
|
|
44
|
+
```dot
|
|
45
|
+
digraph brainstorming {
|
|
46
|
+
"Explore project context" [shape=box];
|
|
47
|
+
"Visual questions ahead?" [shape=diamond];
|
|
48
|
+
"Offer Visual Companion\n(own message, no other content)" [shape=box];
|
|
49
|
+
"Ask clarifying questions" [shape=box];
|
|
50
|
+
"Propose 2-3 approaches" [shape=box];
|
|
51
|
+
"Present design sections" [shape=box];
|
|
52
|
+
"User approves design?" [shape=diamond];
|
|
53
|
+
"Write design doc" [shape=box];
|
|
54
|
+
"Spec self-review\n(fix inline)" [shape=box];
|
|
55
|
+
"User reviews spec?" [shape=diamond];
|
|
56
|
+
"Invoke writing-plans skill" [shape=doublecircle];
|
|
57
|
+
|
|
58
|
+
"Explore project context" -> "Visual questions ahead?";
|
|
59
|
+
"Visual questions ahead?" -> "Offer Visual Companion\n(own message, no other content)" [label="yes"];
|
|
60
|
+
"Visual questions ahead?" -> "Ask clarifying questions" [label="no"];
|
|
61
|
+
"Offer Visual Companion\n(own message, no other content)" -> "Ask clarifying questions";
|
|
62
|
+
"Ask clarifying questions" -> "Propose 2-3 approaches";
|
|
63
|
+
"Propose 2-3 approaches" -> "Present design sections";
|
|
64
|
+
"Present design sections" -> "User approves design?";
|
|
65
|
+
"User approves design?" -> "Present design sections" [label="no, revise"];
|
|
66
|
+
"User approves design?" -> "Write design doc" [label="yes"];
|
|
67
|
+
"Write design doc" -> "Spec self-review\n(fix inline)";
|
|
68
|
+
"Spec self-review\n(fix inline)" -> "User reviews spec?";
|
|
69
|
+
"User reviews spec?" -> "Write design doc" [label="changes requested"];
|
|
70
|
+
"User reviews spec?" -> "Invoke writing-plans skill" [label="approved"];
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**The terminal state is invoking writing-plans.** Do NOT invoke frontend-design, mcp-builder, or any other implementation skill. The ONLY skill you invoke after brainstorming is writing-plans.
|
|
75
|
+
|
|
76
|
+
## The Process
|
|
77
|
+
|
|
78
|
+
**Understanding the idea:**
|
|
79
|
+
|
|
80
|
+
- Check out the current project state first (files, docs, recent commits)
|
|
81
|
+
- 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.
|
|
82
|
+
- 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. If estimated scope exceeds 8 major components OR >20 affected files OR >2 weeks estimated effort, automatically propose decomposition into sub-projects with a recommended order and a brief spec for the first sub-project.
|
|
83
|
+
- For appropriately scoped projects, ask questions one at a time to refine the idea
|
|
84
|
+
- Prefer multiple choice questions when possible, but open-ended is fine too
|
|
85
|
+
- Only one question per message - if a topic needs more exploration, break it into multiple questions
|
|
86
|
+
- Focus on understanding: purpose, constraints, success criteria
|
|
87
|
+
|
|
88
|
+
**Exploring approaches:**
|
|
89
|
+
|
|
90
|
+
- Propose 2-3 different approaches with trade-offs
|
|
91
|
+
- Present options conversationally with your recommendation and reasoning
|
|
92
|
+
- Lead with your recommended option and explain why
|
|
93
|
+
|
|
94
|
+
**Presenting the design:**
|
|
95
|
+
|
|
96
|
+
- Once you believe you understand what you're building, present the design
|
|
97
|
+
- Scale each section to its complexity: a few sentences if straightforward, up to 200-300 words if nuanced
|
|
98
|
+
- Ask after each section whether it looks right so far
|
|
99
|
+
- Cover: architecture, components, data flow, error handling, testing
|
|
100
|
+
- Be ready to go back and clarify if something doesn't make sense
|
|
101
|
+
|
|
102
|
+
**Design for isolation and clarity:**
|
|
103
|
+
|
|
104
|
+
- Break the system into smaller units that each have one clear purpose, communicate through well-defined interfaces, and can be understood and tested independently
|
|
105
|
+
- For each unit, you should be able to answer: what does it do, how do you use it, and what does it depend on?
|
|
106
|
+
- 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.
|
|
107
|
+
- 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.
|
|
108
|
+
|
|
109
|
+
**Working in existing codebases:**
|
|
110
|
+
|
|
111
|
+
- Explore the current structure before proposing changes. Follow existing patterns.
|
|
112
|
+
- 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.
|
|
113
|
+
- Don't propose unrelated refactoring. Stay focused on what serves the current goal.
|
|
114
|
+
|
|
115
|
+
## After the Design
|
|
116
|
+
|
|
117
|
+
**Documentation:**
|
|
118
|
+
|
|
119
|
+
- Write the validated design (spec) to `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md`
|
|
120
|
+
- (User preferences for spec location override this default)
|
|
121
|
+
- Use elements-of-style:writing-clearly-and-concisely skill if available
|
|
122
|
+
- Do not commit silently or directly on protected branches; commit only when workflow/user intent allows it.
|
|
123
|
+
|
|
124
|
+
**Required Spec Template:**
|
|
125
|
+
|
|
126
|
+
Use the user's language for spec headings. For Chinese projects, use these headings in order: `背景`, `目标`, `非目标`, `需求`, `现有上下文`, `方案对比` with 2-3 options, `推荐方案`, `架构设计`, `组件与文件`, `数据流 / 接口`, `错误处理`, `测试策略`, `验收标准`, `风险与取舍`, `开放问题`.
|
|
127
|
+
|
|
128
|
+
**Spec Quality Bar:**
|
|
129
|
+
|
|
130
|
+
- Write an engineering design document, not a loose product memo.
|
|
131
|
+
- Make it specific enough for `writing-plans`; do not include implementation checkboxes.
|
|
132
|
+
- Include concrete files/interfaces, alternatives, tests, and acceptance criteria.
|
|
133
|
+
|
|
134
|
+
**Spec Self-Review:**
|
|
135
|
+
After writing the spec document, look at it with fresh eyes:
|
|
136
|
+
|
|
137
|
+
1. **Placeholder scan:** Any "TBD", "TODO", incomplete sections, or vague requirements? Fix them.
|
|
138
|
+
2. **Internal consistency:** Do any sections contradict each other? Does the architecture match the feature descriptions?
|
|
139
|
+
3. **Scope check:** Is this focused enough for a single implementation plan, or does it need decomposition?
|
|
140
|
+
4. **Ambiguity check:** Could any requirement be interpreted two different ways? If so, pick one and make it explicit.
|
|
141
|
+
|
|
142
|
+
Fix any issues inline. No need to re-review — just fix and move on.
|
|
143
|
+
|
|
144
|
+
**User Review Gate:**
|
|
145
|
+
After the spec review loop passes, ask the user to review the written spec before proceeding:
|
|
146
|
+
|
|
147
|
+
> "Spec written to `<path>`. Please review it and let me know if you want to make any changes before we start writing out the implementation plan."
|
|
148
|
+
|
|
149
|
+
Wait for the user's response. If they request changes, make them and re-run the spec review loop. Only proceed once the user has reviewed and approved the saved spec.
|
|
150
|
+
|
|
151
|
+
**Implementation:**
|
|
152
|
+
|
|
153
|
+
- Invoke the writing-plans skill to create a detailed implementation plan
|
|
154
|
+
- Do NOT invoke any other skill. writing-plans is the next step.
|
|
155
|
+
|
|
156
|
+
## Key Principles
|
|
157
|
+
|
|
158
|
+
- **One question at a time** - Don't overwhelm with multiple questions
|
|
159
|
+
- **Multiple choice preferred** - Easier to answer than open-ended when possible
|
|
160
|
+
- **YAGNI ruthlessly** - Remove unnecessary features from all designs
|
|
161
|
+
- **Explore alternatives** - Always propose 2-3 approaches before settling
|
|
162
|
+
- **Incremental validation** - Present design, get approval before moving on
|
|
163
|
+
- **Be flexible** - Go back and clarify when something doesn't make sense
|
|
164
|
+
|
|
165
|
+
## Visual Companion
|
|
166
|
+
|
|
167
|
+
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.
|
|
168
|
+
|
|
169
|
+
**Offering the companion:** When you anticipate that upcoming questions will involve visual content (mockups, layouts, diagrams), offer it once for consent:
|
|
170
|
+
|
|
171
|
+
> "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)"
|
|
172
|
+
|
|
173
|
+
**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.
|
|
174
|
+
|
|
175
|
+
If the user does not respond within 48 hours or a configured timeout, proceed with text-only brainstorming and note that the Visual Companion was not accepted.
|
|
176
|
+
|
|
177
|
+
**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?**
|
|
178
|
+
|
|
179
|
+
- **Use the browser** for content that IS visual — mockups, wireframes, layout comparisons, architecture diagrams, side-by-side visual designs
|
|
180
|
+
- **Use the terminal** for content that is text — requirements questions, conceptual choices, tradeoff lists, A/B/C/D text options, scope decisions
|
|
181
|
+
|
|
182
|
+
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.
|
|
183
|
+
|
|
184
|
+
If they agree to the companion, read the detailed guide before proceeding:
|
|
185
|
+
`skills/brainstorming/visual-companion.md`
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>Superpowers 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/superpowers" style="color: inherit; text-decoration: none;">Superpowers 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
|
+
})();
|