claude-everything-workflow 0.1.8 → 0.2.2
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 +19 -20
- package/README.md +112 -104
- package/agents/code-reviewer.md +15 -44
- package/agents/harness-optimizer.md +3 -2
- package/agents/planner.md +23 -107
- package/commands/code-review.md +25 -9
- package/commands/learn.md +97 -0
- package/commands/pr.md +4 -0
- package/commands/to-spec.md +11 -0
- package/hooks/check-code-size.js +33 -12
- package/hooks/check-console-log.js +72 -24
- package/package.json +5 -2
- package/rules/01-base.md +19 -42
- package/rules/02-code-size.md +6 -17
- package/rules/03-architecture.md +16 -54
- package/rules/04-error-handling.md +4 -25
- package/rules/05-git-workflow.md +9 -37
- package/rules/06-comments.md +3 -37
- package/rules/07-forbidden.md +6 -30
- package/rules/08-specialty-rules-index.md +18 -0
- package/rules/09-first-principles-adversarial-testing.md +6 -18
- package/rules/common/agent-orchestration.md +10 -47
- package/rules/common/context-hygiene.md +9 -72
- package/rules/common/harness-engineering.md +11 -38
- package/rules/common/hooks.md +11 -82
- package/rules/common/performance.md +8 -71
- package/rules/common/pr-automation.md +7 -68
- package/rules/common/skills-learning.md +12 -36
- package/rules/common/testing.md +15 -59
- package/scripts/cleanup-retired-skills.js +214 -0
- package/scripts/install.ps1 +73 -85
- package/scripts/install.sh +54 -77
- package/scripts/learning/review-confidence.js +1 -4
- package/scripts/merge-claude-settings.cjs +75 -0
- package/scripts/retired-skill-files.json +37 -0
- package/scripts/upstream-capability-baseline.json +27 -0
- package/scripts/upstream-capability-map.json +150 -0
- package/scripts/verify/core.js +91 -0
- package/scripts/verify/grilling-spec-gate-checks.js +260 -0
- package/scripts/verify/metadata-checks.js +724 -0
- package/scripts/verify/repository-checks.js +435 -0
- package/scripts/verify/runtime-checks.js +593 -0
- package/scripts/verify/workflow-checks.js +741 -0
- package/scripts/verify/workflow-ownership-fixtures.js +371 -0
- package/scripts/verify/workflow-ownership.js +780 -0
- package/scripts/verify-harness.js +16 -1075
- package/scripts/verify-upstream-capability-map.js +117 -0
- package/skills/README.md +24 -10
- package/skills/code-review/SKILL.md +50 -0
- package/skills/code-review/references/spec-reviewer-prompt.md +24 -0
- package/skills/code-review/references/standards-reviewer-prompt.md +35 -0
- package/skills/codebase-design/SKILL.md +63 -0
- package/skills/codebase-design/references/deepening.md +27 -0
- package/skills/codebase-design/references/design-it-twice.md +17 -0
- package/skills/continuous-learning-v2/SKILL.md +7 -7
- package/skills/continuous-learning-v2/config.json +0 -4
- package/skills/domain-modeling/SKILL.md +100 -0
- package/skills/feature-acceptance/SKILL.md +89 -0
- package/skills/grilling/SKILL.md +83 -0
- package/skills/handoff/SKILL.md +56 -0
- package/skills/implement/SKILL.md +97 -0
- package/skills/improve-codebase-architecture/SKILL.md +48 -0
- package/skills/iterative-retrieval/SKILL.md +10 -1
- package/skills/learn/README.md +2 -2
- package/skills/project-context/SKILL.md +94 -0
- package/skills/project-context/agents/openai.yaml +6 -0
- package/skills/project-context/references/project-context-template.md +61 -0
- package/skills/prototype/SKILL.md +50 -0
- package/skills/prototype/references/logic.md +28 -0
- package/skills/prototype/references/ui.md +30 -0
- package/skills/research/SKILL.md +48 -0
- package/skills/resolving-merge-conflicts/SKILL.md +27 -0
- package/skills/spec-gate/SKILL.md +149 -0
- package/skills/spec-gate/agents/openai.yaml +4 -0
- package/skills/spec-gate/references/spec-document-reviewer-prompt.md +31 -0
- package/skills/subagent-driven-development/SKILL.md +95 -414
- package/skills/systematic-debugging/SKILL.md +7 -51
- package/skills/systematic-debugging/references/diagnosing-bugs.upstream.md +129 -0
- package/skills/systematic-debugging/scripts/hitl-loop.template.js +75 -0
- package/skills/systematic-debugging/scripts/hitl-loop.template.sh +41 -0
- package/skills/test-driven-development/SKILL.md +18 -2
- package/skills/to-tickets/SKILL.md +94 -0
- package/skills/triage/SKILL.md +53 -0
- package/skills/triage/references/agent-brief.md +32 -0
- package/skills/triage/references/out-of-scope.md +14 -0
- package/skills/using-superpowers/SKILL.md +140 -40
- package/skills/visual-companion/SKILL.md +62 -0
- package/skills/visual-companion/agents/openai.yaml +4 -0
- package/skills/{brainstorming/visual-companion.md → visual-companion/references/guide.md} +1 -1
- package/skills/{brainstorming → visual-companion}/scripts/frame-template.html +42 -12
- package/skills/visual-companion/scripts/pages.cjs +28 -0
- package/skills/visual-companion/scripts/server-utils.cjs +82 -0
- package/skills/{brainstorming → visual-companion}/scripts/server.cjs +108 -248
- package/skills/{brainstorming → visual-companion}/scripts/start-server.sh +18 -4
- package/skills/visual-companion/scripts/websocket.cjs +86 -0
- package/skills/wayfinder/SKILL.md +57 -0
- package/commands/e2e.md +0 -28
- package/commands/evolve.md +0 -42
- package/commands/harness-audit.md +0 -27
- package/commands/instinct-status.md +0 -38
- package/commands/learn-eval.md +0 -91
- package/commands/projects.md +0 -27
- package/commands/promote.md +0 -29
- package/commands/prune.md +0 -46
- package/commands/tdd.md +0 -27
- package/homunculus/instincts/personal/always-test-first.md +0 -28
- package/homunculus/instincts/personal/pr-ci-quality-gate.md +0 -30
- package/rules/08-ecc-integration.md +0 -46
- package/rules/common/implementation.md +0 -25
- package/rules/common/security.md +0 -19
- package/skills/brainstorming/SKILL.md +0 -185
- package/skills/brainstorming/agents/openai.yaml +0 -3
- package/skills/brainstorming/spec-document-reviewer-prompt.md +0 -49
- package/skills/context-budget/SKILL.md +0 -59
- package/skills/documentation-lookup/SKILL.md +0 -90
- package/skills/executing-plans/SKILL.md +0 -66
- package/skills/skill-creator/LICENSE.txt +0 -202
- package/skills/skill-creator/SKILL.md +0 -356
- package/skills/skill-creator/references/output-patterns.md +0 -82
- package/skills/skill-creator/references/workflows.md +0 -28
- package/skills/skill-creator/scripts/init_skill.py +0 -303
- package/skills/skill-creator/scripts/package_skill.py +0 -110
- package/skills/skill-creator/scripts/quick_validate.py +0 -95
- package/skills/subagent-driven-development/implementer-prompt.md +0 -139
- package/skills/subagent-driven-development/scripts/review-package +0 -44
- package/skills/subagent-driven-development/scripts/sdd-workspace +0 -22
- package/skills/subagent-driven-development/scripts/task-brief +0 -40
- package/skills/subagent-driven-development/task-reviewer-prompt.md +0 -188
- package/skills/writing-plans/SKILL.md +0 -206
- package/skills/writing-plans/plan-document-reviewer-prompt.md +0 -49
- /package/skills/{brainstorming → visual-companion}/scripts/helper.js +0 -0
- /package/skills/{brainstorming → visual-companion}/scripts/stop-server.sh +0 -0
|
@@ -1,33 +1,58 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: using-superpowers
|
|
3
|
-
description: "
|
|
3
|
+
description: "Route delivery work through an agent-selected direct, serial-ticket, or safe SDD topology; use grilling for unresolved user-owned decisions and Spec Gate for explicitly requested or costly-to-reverse work. Use at task start, after a process Skill returns an outcome, and whenever continuation ownership is unclear."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Using Superpowers
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Own routing and continuation for the workflow harness. Skills return outcomes here instead of directly invoking one another.
|
|
9
9
|
|
|
10
10
|
## Priority
|
|
11
11
|
|
|
12
12
|
Follow instructions in this order:
|
|
13
13
|
|
|
14
|
-
1. User instructions,
|
|
15
|
-
2. Applicable
|
|
16
|
-
3.
|
|
14
|
+
1. User instructions, `AGENTS.md`, `CLAUDE.md`, and repository rules.
|
|
15
|
+
2. Applicable process Skills, commands, agents, and hooks.
|
|
16
|
+
3. Implementation Skills and default agent behavior.
|
|
17
17
|
|
|
18
|
-
If a
|
|
18
|
+
If a Skill conflicts with an explicit higher-priority instruction, follow the higher-priority instruction and explain any material impact.
|
|
19
19
|
|
|
20
20
|
## Skill Invocation Rule
|
|
21
21
|
|
|
22
|
-
Before
|
|
22
|
+
Before acting on a non-trivial task:
|
|
23
23
|
|
|
24
|
-
1.
|
|
25
|
-
2. Load the applicable
|
|
26
|
-
3. Announce briefly which
|
|
27
|
-
4. Follow
|
|
28
|
-
5.
|
|
24
|
+
1. Classify explicit intent, high-risk boundaries, discoverable facts, and unresolved user-owned decisions.
|
|
25
|
+
2. Load the narrowest applicable process Skill before exploration, implementation, clarification, or a final claim.
|
|
26
|
+
3. Announce briefly which Skill is being used and why.
|
|
27
|
+
4. Follow its gates, outcome contract, and verification requirements.
|
|
28
|
+
5. Return here whenever continuation needs another Skill or path.
|
|
29
29
|
|
|
30
|
-
Do not rely on memory of a
|
|
30
|
+
Do not rely on memory of a Skill. Skills evolve; read the current `SKILL.md`.
|
|
31
|
+
|
|
32
|
+
Primary process definitions include `skills/grilling/SKILL.md`, `skills/spec-gate/SKILL.md`, `skills/systematic-debugging/SKILL.md`, and `skills/verification-before-completion/SKILL.md`.
|
|
33
|
+
|
|
34
|
+
## Three Lanes
|
|
35
|
+
|
|
36
|
+
The workflow has three lanes:
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
direct
|
|
40
|
+
clear low-risk task -> implement -> proportionate verification
|
|
41
|
+
|
|
42
|
+
needs-decision
|
|
43
|
+
unresolved user-owned decision -> grilling inline -> route again
|
|
44
|
+
|
|
45
|
+
formal-spec
|
|
46
|
+
explicit formal Spec or high-risk boundary
|
|
47
|
+
-> grilling inline first only when a consequential decision is unresolved
|
|
48
|
+
-> spec-gate -> user review -> approved Spec
|
|
49
|
+
-> router selects delivery topology
|
|
50
|
+
-> durable ticket graph -> to-tickets -> user approves ticket contract
|
|
51
|
+
-> one coherent scope -> implement
|
|
52
|
+
-> independent frontier tickets without write overlap -> subagent-driven-development
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
File count, a new-feature label, ordinary behavior change, and normal code complexity do not upgrade a task. They affect implementation and verification intensity only.
|
|
31
56
|
|
|
32
57
|
## Routing
|
|
33
58
|
|
|
@@ -35,40 +60,115 @@ Use process skills before implementation skills:
|
|
|
35
60
|
|
|
36
61
|
```text
|
|
37
62
|
Task arrives
|
|
38
|
-
->
|
|
39
|
-
->
|
|
40
|
-
->
|
|
41
|
-
->
|
|
42
|
-
->
|
|
43
|
-
|
|
44
|
-
->
|
|
45
|
-
->
|
|
46
|
-
->
|
|
63
|
+
-> explicit workflow advice? -> workflow advice mode
|
|
64
|
+
-> explicit project-context setup request? -> project-context
|
|
65
|
+
-> explicit documented grilling request? -> grilling explicit + domain-modeling persistent mode
|
|
66
|
+
-> explicit grilling request? -> grilling explicit
|
|
67
|
+
-> explicit handoff or fresh session or prototype branch?
|
|
68
|
+
-> skills/handoff/SKILL.md
|
|
69
|
+
-> explicit triage request? -> skills/triage/SKILL.md
|
|
70
|
+
-> explicit TDD request? -> skills/test-driven-development/SKILL.md + agents/tdd-guide.md
|
|
71
|
+
-> explicit E2E or Playwright request? -> skills/e2e-testing/SKILL.md + agents/e2e-runner.md
|
|
72
|
+
-> explicit harness audit? -> agents/harness-optimizer.md
|
|
73
|
+
-> huge effort beyond one session? -> skills/wayfinder/SKILL.md
|
|
74
|
+
-> explicit architecture-health audit? -> skills/improve-codebase-architecture/SKILL.md
|
|
75
|
+
-> merge or rebase conflict? -> skills/resolving-merge-conflicts/SKILL.md
|
|
76
|
+
-> bug, failing test, or unexpected result? -> systematic-debugging
|
|
77
|
+
-> discoverable fact? -> inspect it; do not ask
|
|
78
|
+
-> primary-source research or cited research artifact? -> skills/research/SKILL.md
|
|
79
|
+
-> systematic evidence or blind-spot gap? -> iterative-retrieval
|
|
80
|
+
-> explicit prototype or runnable design question? -> skills/prototype/SKILL.md
|
|
81
|
+
-> unresolved user-owned decision? -> grilling inline
|
|
82
|
+
high-risk or explicit formal Spec context? -> resume_target: spec-gate
|
|
83
|
+
-> explicit formal Spec or high-risk boundary? -> spec-gate
|
|
84
|
+
-> delivery request in defined scope? -> select delivery topology
|
|
85
|
+
-> durable multi-session/tracker graph? -> skills/to-tickets/SKILL.md
|
|
86
|
+
-> independent frontier tickets with no overlapping write surface?
|
|
87
|
+
-> skills/subagent-driven-development/SKILL.md
|
|
88
|
+
-> otherwise -> skills/implement/SKILL.md
|
|
89
|
+
-> behavior change with a test path? -> test-driven-development
|
|
90
|
+
-> dirty worktree or risky branch work? -> consider using-git-worktrees
|
|
91
|
+
-> completion, fixed, or ready claim? -> verification-before-completion
|
|
92
|
+
-> skill discovery or install request? -> find-skills
|
|
93
|
+
-> external skill learning or edit? -> rules/common/skills-learning.md
|
|
94
|
+
-> otherwise -> shortest applicable loop
|
|
47
95
|
```
|
|
48
96
|
|
|
49
|
-
-
|
|
50
|
-
- Approved spec that needs an implementation plan: use `skills/writing-plans/SKILL.md`.
|
|
51
|
-
- Approved plan with independent tasks and approved commit/PR/SDD handling: use `skills/subagent-driven-development/SKILL.md`.
|
|
52
|
-
- Approved plan without commit handling or with tightly coupled tasks: use `skills/executing-plans/SKILL.md`.
|
|
53
|
-
- Bug, failing test, flaky behavior, or unexpected result: use `skills/systematic-debugging/SKILL.md` before proposing a fix.
|
|
54
|
-
- Behavior-changing implementation with a viable test path: use `skills/test-driven-development/SKILL.md`.
|
|
55
|
-
- Risky branch work, dirty worktree, parallel effort, or PR cleanup: consider `skills/using-git-worktrees/SKILL.md`.
|
|
56
|
-
- Completion, fixed, passing, ready, or PR-readiness claims: use `skills/verification-before-completion/SKILL.md`.
|
|
57
|
-
- External skill learning or skill edits: use `skills/skill-creator/SKILL.md` and `rules/common/skills-learning.md`.
|
|
97
|
+
A high-risk boundary is a costly-to-reverse architecture or service boundary, public-contract compatibility, authentication or authorization boundary, persistent data/schema migration, or irreversible external side effect. Record this classification before grilling so its handoff can resume `spec-gate`.
|
|
58
98
|
|
|
59
|
-
|
|
99
|
+
## Process Outcomes
|
|
60
100
|
|
|
61
|
-
|
|
101
|
+
### Workflow advice mode
|
|
102
|
+
|
|
103
|
+
只返回推荐入口与原因、前置条件、需要补齐的用户决策或 Spec/tickets/map/handoff,以及直到
|
|
104
|
+
审查和验证的闭环路径。不要调用下一 Skill、写文件或修改 tracker。
|
|
105
|
+
|
|
106
|
+
### Agent-selected Delivery Topology
|
|
107
|
+
|
|
108
|
+
用户要求完成一个定义明确的交付范围后,router 自行选择 `implement`、`to-tickets` 或
|
|
109
|
+
`subagent-driven-development`;选择依据是持续性、依赖图、写入面和验证成本,而不是用户是否记得某个
|
|
110
|
+
Skill 名称。开始时用一行说明所选拓扑及理由,然后继续执行。
|
|
111
|
+
|
|
112
|
+
- 一个可在当前上下文完成的连贯范围,使用 `implement`。
|
|
113
|
+
- 需要跨会话、tracker 或可恢复依赖图时,使用 `to-tickets`。这仍必须展示 ticket 的行为、验收标准与
|
|
114
|
+
blocker,并在发布前获得用户对 ticket contract 的批准。
|
|
115
|
+
- 只有至少两张已批准、无 blocker、写入面不重叠的 frontier tickets,才使用 SDD。不能安全并行时选择
|
|
116
|
+
串行 `implement`,不要为了使用 subagent 人为拆票。
|
|
117
|
+
|
|
118
|
+
用户的交付授权覆盖已批准范围内的本地实现与拓扑选择,不覆盖新的产品范围、未决用户决策、外部 tracker
|
|
119
|
+
mutation、commit、push、PR 或不可逆副作用。新的 frontier 只有仍在该授权范围内时才能由 router 再次选择
|
|
120
|
+
执行拓扑。
|
|
121
|
+
|
|
122
|
+
### Grilling handoff
|
|
62
123
|
|
|
63
|
-
|
|
124
|
+
Read `Risk classification` and `Resume target`. A non-formal task returns to direct or another narrow process. A high-risk/formal task with `resume_target: spec-gate` enters a fresh Spec Gate call.
|
|
64
125
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
-
|
|
69
|
-
|
|
126
|
+
### Spec Gate ready
|
|
127
|
+
|
|
128
|
+
`READY_FOR_USER_REVIEW` means the local artifact passed self-review but is not approved. Present the
|
|
129
|
+
path and wait for explicit approval. Approval returns control here; the router then selects a delivery
|
|
130
|
+
topology from the approved scope instead of waiting for the user to name the next Skill.
|
|
131
|
+
|
|
132
|
+
### Cross-session handoff
|
|
133
|
+
|
|
134
|
+
When a prototype detour needs isolation or the current context is leaving its reliable reasoning zone,
|
|
135
|
+
recommend the `handoff` Skill and wait for explicit approval before creating the temporary document.
|
|
136
|
+
The handoff ends the current flow; a fresh session references the returned path and enters this router
|
|
137
|
+
again. Do not use handoff as a substitute for durable Specs, ADRs, tickets, or verification evidence.
|
|
138
|
+
|
|
139
|
+
### Spec Gate blocked
|
|
140
|
+
|
|
141
|
+
`BLOCKED_BY_UNRESOLVED_DECISION` is terminal for the current call chain:
|
|
142
|
+
|
|
143
|
+
1. Stop without drafting, guessing, or automatically invoking another Skill.
|
|
144
|
+
2. Present a decision map: confirmed decisions, unresolved decision, and blocking point.
|
|
145
|
+
3. Let the user choose to continue clarification, reduce scope, or exit the formal flow.
|
|
146
|
+
4. Only an explicit choice to continue starts a new grilling session.
|
|
147
|
+
5. After that session completes, route again into a new Spec Gate; do not resume the old call stack.
|
|
148
|
+
|
|
149
|
+
If the same confirmed `decision_id` blocks again with unchanged evidence, report a `Spec Gate contract conflict`. Do not repeat the question. Only reversal evidence or an invalidated premise can reopen the decision.
|
|
150
|
+
|
|
151
|
+
### Spec Gate not applicable
|
|
152
|
+
|
|
153
|
+
`NOT_APPLICABLE` returns control here. Select the shortest applicable path without asking the originating Skill to recommend a successor.
|
|
154
|
+
|
|
155
|
+
## Compatibility Alias
|
|
156
|
+
|
|
157
|
+
For one release cycle, interpret a user explicitly asking for the old name `brainstorming` as a formal Spec request. Explain that the entry moved to `/to-spec`; route through the same optional grilling and `spec-gate` path. Do not expose an old Skill shim or a second protocol source.
|
|
158
|
+
|
|
159
|
+
## Red Flags
|
|
70
160
|
|
|
71
|
-
|
|
161
|
+
Stop and reassess if you are about to:
|
|
162
|
+
|
|
163
|
+
- ask for a fact that tools can discover;
|
|
164
|
+
- add grilling because a task is merely complex or multi-file;
|
|
165
|
+
- enter formal Spec Gate for an ordinary reversible change;
|
|
166
|
+
- let Spec Gate interview the user;
|
|
167
|
+
- automatically bounce from a blocked Spec Gate to grilling;
|
|
168
|
+
- select SDD without at least two safe, independent frontier tickets;
|
|
169
|
+
- treat a topology choice as approval for a ticket contract or an external mutation;
|
|
170
|
+
- continue implementation without an approved required Spec;
|
|
171
|
+
- claim completion without fresh verification evidence.
|
|
72
172
|
|
|
73
173
|
## Completion
|
|
74
174
|
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: visual-companion
|
|
3
|
+
description: "Present mockups, diagrams, spatial relationships, and side-by-side visual options in a secured local browser companion. Use only when seeing the content materially improves understanding; require explicit user consent before starting the server or opening a URL, and combine with grilling when visual feedback represents a consequential user decision."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Visual Companion
|
|
7
|
+
|
|
8
|
+
Use the browser as a visual aid, not as a workflow mode or a second requirements engine.
|
|
9
|
+
|
|
10
|
+
## Boundary
|
|
11
|
+
|
|
12
|
+
Use this Skill for UI mockups, architecture diagrams, visual hierarchy, spatial relationships, and side-by-side visual comparisons. Keep requirements, scope, technical trade-offs, text options, and discoverable facts in the terminal.
|
|
13
|
+
|
|
14
|
+
A task being visual, complex, or design-related is not sufficient. Use the companion only when seeing the content materially improves understanding over concise text.
|
|
15
|
+
|
|
16
|
+
## Consent Gate
|
|
17
|
+
|
|
18
|
+
Obtain explicit user consent before starting the local server or opening a browser URL. The consent request must state what will be shown and that a local authenticated URL will open.
|
|
19
|
+
|
|
20
|
+
Without user consent, continue with text or static in-conversation visuals. Do not treat prior use in another task as current consent.
|
|
21
|
+
|
|
22
|
+
## Ownership
|
|
23
|
+
|
|
24
|
+
- `grilling owns the decision loop` when browser feedback selects a consequential user-owned option.
|
|
25
|
+
- Spec Gate may show an already resolved design, support artifact review, or render a diagram with no new decision.
|
|
26
|
+
- Visual Companion does not own continuation, routing, requirements interviews, or approval gates.
|
|
27
|
+
- Return browser events and terminal feedback to the currently routed Skill.
|
|
28
|
+
|
|
29
|
+
## Workflow
|
|
30
|
+
|
|
31
|
+
1. Decide whether the next item is materially clearer when seen.
|
|
32
|
+
2. Obtain user consent if the server is not already approved for this task.
|
|
33
|
+
3. Read `references/guide.md` completely before starting or operating the companion.
|
|
34
|
+
4. Start the server with `scripts/start-server.sh`, preserving the returned complete URL and state paths.
|
|
35
|
+
5. Write one fresh visual screen, describe it briefly in the terminal, and wait for user feedback.
|
|
36
|
+
6. Merge terminal feedback with authenticated browser events.
|
|
37
|
+
7. Return the result to grilling, Spec Gate, or the current caller.
|
|
38
|
+
8. Stop or leave a waiting screen when visual work ends.
|
|
39
|
+
|
|
40
|
+
## Safety Invariants
|
|
41
|
+
|
|
42
|
+
- Always share the complete URL including `?key=`; never expose a bare host and port.
|
|
43
|
+
- Keep session key, HTTP/WebSocket authorization, restrictive response headers, owner-only state files, and same-origin checks enabled.
|
|
44
|
+
- Preserve the default four-hour idle timeout and same-port restart behavior.
|
|
45
|
+
- Do not bind a non-loopback host unless the user needs remote access and understands the exposure.
|
|
46
|
+
- Treat `.superpowers/brainstorm/` as local runtime state; do not stage or commit it.
|
|
47
|
+
- Fall back to the terminal when the server or browser is unavailable.
|
|
48
|
+
|
|
49
|
+
## Outputs
|
|
50
|
+
|
|
51
|
+
Return only:
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
Visual result:
|
|
55
|
+
- screen shown
|
|
56
|
+
- terminal feedback
|
|
57
|
+
- relevant browser events
|
|
58
|
+
- confirmed visual choice, if any
|
|
59
|
+
- unresolved decision owner
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Do not infer approval from a click without reconciling it with the user's terminal response.
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8">
|
|
5
|
-
<title>Superpowers
|
|
5
|
+
<title>Superpowers Visual Companion</title>
|
|
6
6
|
<style>
|
|
7
7
|
/*
|
|
8
|
-
*
|
|
8
|
+
* VISUAL COMPANION FRAME TEMPLATE
|
|
9
9
|
*
|
|
10
10
|
* This template provides a consistent frame with:
|
|
11
11
|
* - OS-aware light/dark theming
|
|
@@ -63,15 +63,30 @@
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/* ===== FRAME STRUCTURE ===== */
|
|
66
|
-
.brand {
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
.brand {
|
|
67
|
+
display: flex; align-items: center; min-width: 0; overflow: hidden;
|
|
68
|
+
color: var(--text-secondary); line-height: 1;
|
|
69
|
+
}
|
|
70
|
+
.brand a {
|
|
71
|
+
color: inherit; text-decoration: none; display: flex; align-items: center;
|
|
72
|
+
gap: 0.5rem; min-width: 0; max-width: 100%; line-height: 1;
|
|
73
|
+
}
|
|
74
|
+
.brand-copy {
|
|
75
|
+
display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis;
|
|
76
|
+
white-space: nowrap; line-height: 1; transform: translateY(-1px);
|
|
77
|
+
}
|
|
69
78
|
.brand-logo { display: block; height: 1em; width: auto; max-width: 180px; flex-shrink: 0; filter: invert(1); }
|
|
70
79
|
@media (prefers-color-scheme: dark) {
|
|
71
80
|
.brand-logo { filter: none; }
|
|
72
81
|
}
|
|
73
|
-
.status {
|
|
74
|
-
|
|
82
|
+
.status {
|
|
83
|
+
font-size: 0.7rem; color: var(--status-color, var(--success)); display: flex;
|
|
84
|
+
align-items: center; gap: 0.4rem; justify-self: end; white-space: nowrap; line-height: 1;
|
|
85
|
+
}
|
|
86
|
+
.status::before {
|
|
87
|
+
content: ''; width: 6px; height: 6px;
|
|
88
|
+
background: var(--status-color, var(--success)); border-radius: 50%;
|
|
89
|
+
}
|
|
75
90
|
|
|
76
91
|
.main { flex: 1; overflow-y: auto; }
|
|
77
92
|
#frame-content { padding: 2rem; min-height: 100%; }
|
|
@@ -103,7 +118,10 @@
|
|
|
103
118
|
h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
|
|
104
119
|
.subtitle { color: var(--text-secondary); margin-bottom: 1.5rem; }
|
|
105
120
|
.section { margin-bottom: 2rem; }
|
|
106
|
-
.label {
|
|
121
|
+
.label {
|
|
122
|
+
font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase;
|
|
123
|
+
letter-spacing: 0.05em; margin-bottom: 0.5rem;
|
|
124
|
+
}
|
|
107
125
|
|
|
108
126
|
/* ===== OPTIONS (for A/B/C choices) ===== */
|
|
109
127
|
.options { display: flex; flex-direction: column; gap: 0.75rem; }
|
|
@@ -145,7 +163,10 @@
|
|
|
145
163
|
}
|
|
146
164
|
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
|
|
147
165
|
.card.selected { border-color: var(--selected-border); border-width: 2px; }
|
|
148
|
-
.card-image {
|
|
166
|
+
.card-image {
|
|
167
|
+
background: var(--bg-tertiary); aspect-ratio: 16/10;
|
|
168
|
+
display: flex; align-items: center; justify-content: center;
|
|
169
|
+
}
|
|
149
170
|
.card-body { padding: 1rem; }
|
|
150
171
|
.card-body h3 { margin-bottom: 0.25rem; }
|
|
151
172
|
.card-body p { color: var(--text-secondary); font-size: 0.85rem; }
|
|
@@ -190,11 +211,20 @@
|
|
|
190
211
|
}
|
|
191
212
|
|
|
192
213
|
/* ===== INLINE MOCKUP ELEMENTS ===== */
|
|
193
|
-
.mock-nav {
|
|
214
|
+
.mock-nav {
|
|
215
|
+
background: var(--accent); color: white; padding: 0.75rem 1rem;
|
|
216
|
+
display: flex; gap: 1.5rem; font-size: 0.9rem;
|
|
217
|
+
}
|
|
194
218
|
.mock-sidebar { background: var(--bg-tertiary); padding: 1rem; min-width: 180px; }
|
|
195
219
|
.mock-content { padding: 1.5rem; flex: 1; }
|
|
196
|
-
.mock-button {
|
|
197
|
-
|
|
220
|
+
.mock-button {
|
|
221
|
+
background: var(--accent); color: white; border: none;
|
|
222
|
+
padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.85rem;
|
|
223
|
+
}
|
|
224
|
+
.mock-input {
|
|
225
|
+
background: var(--bg-primary); border: 1px solid var(--border);
|
|
226
|
+
border-radius: 6px; padding: 0.5rem; width: 100%;
|
|
227
|
+
}
|
|
198
228
|
</style>
|
|
199
229
|
</head>
|
|
200
230
|
<body>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const FORBIDDEN_PAGE = `<!DOCTYPE html>
|
|
4
|
+
<html>
|
|
5
|
+
<head><meta charset="utf-8"><title>Session key required</title>
|
|
6
|
+
<style>body { font-family: system-ui, sans-serif; padding: 2rem; max-width: 800px; margin: 0 auto; }
|
|
7
|
+
h1 { color: #333; } p { color: #666; } code { background: #f0f0f0; padding: 0.1em 0.3em;
|
|
8
|
+
border-radius: 4px; }</style>
|
|
9
|
+
</head>
|
|
10
|
+
<body><h1>Session key required</h1>
|
|
11
|
+
<p>This page needs the full URL your coding agent gave you, including the
|
|
12
|
+
<code>?key=…</code> part. Copy the complete URL and open it again.</p></body></html>`;
|
|
13
|
+
|
|
14
|
+
function bootstrapPage(key) {
|
|
15
|
+
const jsonKey = JSON.stringify(String(key));
|
|
16
|
+
return `<!DOCTYPE html>
|
|
17
|
+
<html>
|
|
18
|
+
<head><meta charset="utf-8"><title>Opening Brainstorm Companion</title></head>
|
|
19
|
+
<body>
|
|
20
|
+
<script>
|
|
21
|
+
try { sessionStorage.setItem('brainstorm-session-key', ${jsonKey}); } catch (e) {}
|
|
22
|
+
location.replace('/');
|
|
23
|
+
</script>
|
|
24
|
+
</body>
|
|
25
|
+
</html>`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
module.exports = { FORBIDDEN_PAGE, bootstrapPage };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const crypto = require('crypto');
|
|
4
|
+
|
|
5
|
+
function urlHostForHttp(host) {
|
|
6
|
+
const normalized = String(host);
|
|
7
|
+
if (normalized.startsWith('[') && normalized.endsWith(']')) return normalized;
|
|
8
|
+
return normalized.includes(':') ? '[' + normalized + ']' : normalized;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function browserLauncherForPlatform(url, options = {}) {
|
|
12
|
+
const platform = options.platform || process.platform;
|
|
13
|
+
const osRelease = options.osRelease || require('os').release();
|
|
14
|
+
const env = options.env || process.env;
|
|
15
|
+
const isWSL = platform === 'linux' && /microsoft/i.test(osRelease);
|
|
16
|
+
|
|
17
|
+
if (platform === 'darwin') return { bin: 'open', args: [url] };
|
|
18
|
+
if (platform === 'win32' || isWSL) {
|
|
19
|
+
return { bin: 'rundll32.exe', args: ['url.dll,FileProtocolHandler', url] };
|
|
20
|
+
}
|
|
21
|
+
if (env.DISPLAY || env.WAYLAND_DISPLAY) return { bin: 'xdg-open', args: [url] };
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function timingSafeEqualStr(left, right) {
|
|
26
|
+
const leftBuffer = Buffer.from(String(left));
|
|
27
|
+
const rightBuffer = Buffer.from(String(right));
|
|
28
|
+
if (leftBuffer.length !== rightBuffer.length) return false;
|
|
29
|
+
return crypto.timingSafeEqual(leftBuffer, rightBuffer);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function parseCookies(header) {
|
|
33
|
+
const output = {};
|
|
34
|
+
if (!header) return output;
|
|
35
|
+
for (const part of header.split(';')) {
|
|
36
|
+
const separator = part.indexOf('=');
|
|
37
|
+
if (separator < 0) continue;
|
|
38
|
+
output[part.slice(0, separator).trim()] = part.slice(separator + 1).trim();
|
|
39
|
+
}
|
|
40
|
+
return output;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function pathnameOf(url) {
|
|
44
|
+
const queryIndex = url.indexOf('?');
|
|
45
|
+
return queryIndex >= 0 ? url.slice(0, queryIndex) : url;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function queryKey(url) {
|
|
49
|
+
const queryIndex = url.indexOf('?');
|
|
50
|
+
if (queryIndex < 0) return null;
|
|
51
|
+
return new URLSearchParams(url.slice(queryIndex + 1)).get('key');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function securityHeaders(headers = {}) {
|
|
55
|
+
return {
|
|
56
|
+
'Referrer-Policy': 'no-referrer',
|
|
57
|
+
'Cache-Control': 'no-store',
|
|
58
|
+
'X-Frame-Options': 'DENY',
|
|
59
|
+
'Content-Security-Policy': "frame-ancestors 'none'",
|
|
60
|
+
'Cross-Origin-Resource-Policy': 'same-origin',
|
|
61
|
+
...headers,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function isAllowedWebSocketOrigin(req) {
|
|
66
|
+
const origin = req.headers.origin;
|
|
67
|
+
if (!origin) return true;
|
|
68
|
+
const host = req.headers.host;
|
|
69
|
+
if (!host) return false;
|
|
70
|
+
return origin === 'http://' + host;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
module.exports = {
|
|
74
|
+
urlHostForHttp,
|
|
75
|
+
browserLauncherForPlatform,
|
|
76
|
+
timingSafeEqualStr,
|
|
77
|
+
parseCookies,
|
|
78
|
+
pathnameOf,
|
|
79
|
+
queryKey,
|
|
80
|
+
securityHeaders,
|
|
81
|
+
isAllowedWebSocketOrigin,
|
|
82
|
+
};
|