workerssuper 5.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/.claude-plugin/marketplace.json +20 -0
  2. package/.claude-plugin/plugin.json +13 -0
  3. package/.codex/INSTALL.md +67 -0
  4. package/.cursor-plugin/plugin.json +18 -0
  5. package/.gitattributes +18 -0
  6. package/.github/FUNDING.yml +3 -0
  7. package/.github/ISSUE_TEMPLATE/bug_report.md +52 -0
  8. package/.github/ISSUE_TEMPLATE/config.yml +5 -0
  9. package/.github/ISSUE_TEMPLATE/feature_request.md +34 -0
  10. package/.github/ISSUE_TEMPLATE/platform_support.md +23 -0
  11. package/.github/PULL_REQUEST_TEMPLATE.md +87 -0
  12. package/.opencode/INSTALL.md +83 -0
  13. package/.opencode/plugins/superpowers.js +107 -0
  14. package/CHANGELOG.md +13 -0
  15. package/CODE_OF_CONDUCT.md +128 -0
  16. package/GEMINI.md +2 -0
  17. package/LICENSE +21 -0
  18. package/README.md +187 -0
  19. package/RELEASE-NOTES.md +1057 -0
  20. package/agents/code-reviewer.md +48 -0
  21. package/commands/brainstorm.md +5 -0
  22. package/commands/execute-plan.md +5 -0
  23. package/commands/write-plan.md +5 -0
  24. package/docs/README.codex.md +126 -0
  25. package/docs/README.opencode.md +130 -0
  26. package/docs/plans/2025-11-22-opencode-support-design.md +294 -0
  27. package/docs/plans/2025-11-22-opencode-support-implementation.md +1095 -0
  28. package/docs/plans/2025-11-28-skills-improvements-from-user-feedback.md +711 -0
  29. package/docs/plans/2026-01-17-visual-brainstorming.md +571 -0
  30. package/docs/superpowers/plans/2026-01-22-document-review-system.md +301 -0
  31. package/docs/superpowers/plans/2026-02-19-visual-brainstorming-refactor.md +523 -0
  32. package/docs/superpowers/plans/2026-03-11-zero-dep-brainstorm-server.md +479 -0
  33. package/docs/superpowers/specs/2026-01-22-document-review-system-design.md +136 -0
  34. package/docs/superpowers/specs/2026-02-19-visual-brainstorming-refactor-design.md +162 -0
  35. package/docs/superpowers/specs/2026-03-11-zero-dep-brainstorm-server-design.md +118 -0
  36. package/docs/testing.md +303 -0
  37. package/docs/windows/polyglot-hooks.md +212 -0
  38. package/gemini-extension.json +6 -0
  39. package/hooks/hooks-cursor.json +10 -0
  40. package/hooks/hooks.json +16 -0
  41. package/hooks/run-hook.cmd +46 -0
  42. package/hooks/session-start +57 -0
  43. package/package.json +5 -0
  44. package/skills/brainstorming/SKILL.md +164 -0
  45. package/skills/brainstorming/scripts/frame-template.html +214 -0
  46. package/skills/brainstorming/scripts/helper.js +88 -0
  47. package/skills/brainstorming/scripts/server.cjs +338 -0
  48. package/skills/brainstorming/scripts/start-server.sh +153 -0
  49. package/skills/brainstorming/scripts/stop-server.sh +55 -0
  50. package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  51. package/skills/brainstorming/visual-companion.md +286 -0
  52. package/skills/dispatching-parallel-agents/SKILL.md +182 -0
  53. package/skills/executing-plans/SKILL.md +70 -0
  54. package/skills/finishing-a-development-branch/SKILL.md +200 -0
  55. package/skills/receiving-code-review/SKILL.md +213 -0
  56. package/skills/requesting-code-review/SKILL.md +105 -0
  57. package/skills/requesting-code-review/code-reviewer.md +146 -0
  58. package/skills/subagent-driven-development/SKILL.md +277 -0
  59. package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
  60. package/skills/subagent-driven-development/implementer-prompt.md +113 -0
  61. package/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  62. package/skills/systematic-debugging/CREATION-LOG.md +119 -0
  63. package/skills/systematic-debugging/SKILL.md +296 -0
  64. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  65. package/skills/systematic-debugging/condition-based-waiting.md +115 -0
  66. package/skills/systematic-debugging/defense-in-depth.md +122 -0
  67. package/skills/systematic-debugging/find-polluter.sh +63 -0
  68. package/skills/systematic-debugging/root-cause-tracing.md +169 -0
  69. package/skills/systematic-debugging/test-academic.md +14 -0
  70. package/skills/systematic-debugging/test-pressure-1.md +58 -0
  71. package/skills/systematic-debugging/test-pressure-2.md +68 -0
  72. package/skills/systematic-debugging/test-pressure-3.md +69 -0
  73. package/skills/test-driven-development/SKILL.md +371 -0
  74. package/skills/test-driven-development/testing-anti-patterns.md +299 -0
  75. package/skills/using-git-worktrees/SKILL.md +218 -0
  76. package/skills/using-superpowers/SKILL.md +115 -0
  77. package/skills/using-superpowers/references/codex-tools.md +25 -0
  78. package/skills/using-superpowers/references/gemini-tools.md +33 -0
  79. package/skills/verification-before-completion/SKILL.md +139 -0
  80. package/skills/writing-plans/SKILL.md +145 -0
  81. package/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  82. package/skills/writing-skills/SKILL.md +655 -0
  83. package/skills/writing-skills/anthropic-best-practices.md +1150 -0
  84. package/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  85. package/skills/writing-skills/graphviz-conventions.dot +172 -0
  86. package/skills/writing-skills/persuasion-principles.md +187 -0
  87. package/skills/writing-skills/render-graphs.js +168 -0
  88. package/skills/writing-skills/testing-skills-with-subagents.md +384 -0
  89. package/tests/brainstorm-server/package-lock.json +36 -0
  90. package/tests/brainstorm-server/package.json +10 -0
  91. package/tests/brainstorm-server/server.test.js +424 -0
  92. package/tests/brainstorm-server/windows-lifecycle.test.sh +351 -0
  93. package/tests/brainstorm-server/ws-protocol.test.js +392 -0
  94. package/tests/claude-code/README.md +158 -0
  95. package/tests/claude-code/analyze-token-usage.py +168 -0
  96. package/tests/claude-code/run-skill-tests.sh +187 -0
  97. package/tests/claude-code/test-document-review-system.sh +177 -0
  98. package/tests/claude-code/test-helpers.sh +202 -0
  99. package/tests/claude-code/test-subagent-driven-development-integration.sh +314 -0
  100. package/tests/claude-code/test-subagent-driven-development.sh +165 -0
  101. package/tests/explicit-skill-requests/prompts/action-oriented.txt +3 -0
  102. package/tests/explicit-skill-requests/prompts/after-planning-flow.txt +17 -0
  103. package/tests/explicit-skill-requests/prompts/claude-suggested-it.txt +11 -0
  104. package/tests/explicit-skill-requests/prompts/i-know-what-sdd-means.txt +8 -0
  105. package/tests/explicit-skill-requests/prompts/mid-conversation-execute-plan.txt +3 -0
  106. package/tests/explicit-skill-requests/prompts/please-use-brainstorming.txt +1 -0
  107. package/tests/explicit-skill-requests/prompts/skip-formalities.txt +3 -0
  108. package/tests/explicit-skill-requests/prompts/subagent-driven-development-please.txt +1 -0
  109. package/tests/explicit-skill-requests/prompts/use-systematic-debugging.txt +1 -0
  110. package/tests/explicit-skill-requests/run-all.sh +70 -0
  111. package/tests/explicit-skill-requests/run-claude-describes-sdd.sh +100 -0
  112. package/tests/explicit-skill-requests/run-extended-multiturn-test.sh +113 -0
  113. package/tests/explicit-skill-requests/run-haiku-test.sh +144 -0
  114. package/tests/explicit-skill-requests/run-multiturn-test.sh +143 -0
  115. package/tests/explicit-skill-requests/run-test.sh +136 -0
  116. package/tests/opencode/run-tests.sh +163 -0
  117. package/tests/opencode/setup.sh +73 -0
  118. package/tests/opencode/test-plugin-loading.sh +72 -0
  119. package/tests/opencode/test-priority.sh +198 -0
  120. package/tests/opencode/test-tools.sh +104 -0
  121. package/tests/skill-triggering/prompts/dispatching-parallel-agents.txt +8 -0
  122. package/tests/skill-triggering/prompts/executing-plans.txt +1 -0
  123. package/tests/skill-triggering/prompts/requesting-code-review.txt +3 -0
  124. package/tests/skill-triggering/prompts/systematic-debugging.txt +11 -0
  125. package/tests/skill-triggering/prompts/test-driven-development.txt +7 -0
  126. package/tests/skill-triggering/prompts/writing-plans.txt +10 -0
  127. package/tests/skill-triggering/run-all.sh +60 -0
  128. package/tests/skill-triggering/run-test.sh +88 -0
  129. package/tests/subagent-driven-dev/go-fractals/design.md +81 -0
  130. package/tests/subagent-driven-dev/go-fractals/plan.md +172 -0
  131. package/tests/subagent-driven-dev/go-fractals/scaffold.sh +45 -0
  132. package/tests/subagent-driven-dev/run-test.sh +106 -0
  133. package/tests/subagent-driven-dev/svelte-todo/design.md +70 -0
  134. package/tests/subagent-driven-dev/svelte-todo/plan.md +222 -0
  135. package/tests/subagent-driven-dev/svelte-todo/scaffold.sh +46 -0
@@ -0,0 +1,212 @@
1
+ # Cross-Platform Polyglot Hooks for Claude Code
2
+
3
+ Claude Code plugins need hooks that work on Windows, macOS, and Linux. This document explains the polyglot wrapper technique that makes this possible.
4
+
5
+ ## The Problem
6
+
7
+ Claude Code runs hook commands through the system's default shell:
8
+ - **Windows**: CMD.exe
9
+ - **macOS/Linux**: bash or sh
10
+
11
+ This creates several challenges:
12
+
13
+ 1. **Script execution**: Windows CMD can't execute `.sh` files directly - it tries to open them in a text editor
14
+ 2. **Path format**: Windows uses backslashes (`C:\path`), Unix uses forward slashes (`/path`)
15
+ 3. **Environment variables**: `$VAR` syntax doesn't work in CMD
16
+ 4. **No `bash` in PATH**: Even with Git Bash installed, `bash` isn't in the PATH when CMD runs
17
+
18
+ ## The Solution: Polyglot `.cmd` Wrapper
19
+
20
+ A polyglot script is valid syntax in multiple languages simultaneously. Our wrapper is valid in both CMD and bash:
21
+
22
+ ```cmd
23
+ : << 'CMDBLOCK'
24
+ @echo off
25
+ "C:\Program Files\Git\bin\bash.exe" -l -c "\"$(cygpath -u \"$CLAUDE_PLUGIN_ROOT\")/hooks/session-start.sh\""
26
+ exit /b
27
+ CMDBLOCK
28
+
29
+ # Unix shell runs from here
30
+ "${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh"
31
+ ```
32
+
33
+ ### How It Works
34
+
35
+ #### On Windows (CMD.exe)
36
+
37
+ 1. `: << 'CMDBLOCK'` - CMD sees `:` as a label (like `:label`) and ignores `<< 'CMDBLOCK'`
38
+ 2. `@echo off` - Suppresses command echoing
39
+ 3. The bash.exe command runs with:
40
+ - `-l` (login shell) to get proper PATH with Unix utilities
41
+ - `cygpath -u` converts Windows path to Unix format (`C:\foo` → `/c/foo`)
42
+ 4. `exit /b` - Exits the batch script, stopping CMD here
43
+ 5. Everything after `CMDBLOCK` is never reached by CMD
44
+
45
+ #### On Unix (bash/sh)
46
+
47
+ 1. `: << 'CMDBLOCK'` - `:` is a no-op, `<< 'CMDBLOCK'` starts a heredoc
48
+ 2. Everything until `CMDBLOCK` is consumed by the heredoc (ignored)
49
+ 3. `# Unix shell runs from here` - Comment
50
+ 4. The script runs directly with the Unix path
51
+
52
+ ## File Structure
53
+
54
+ ```
55
+ hooks/
56
+ ├── hooks.json # Points to the .cmd wrapper
57
+ ├── session-start.cmd # Polyglot wrapper (cross-platform entry point)
58
+ └── session-start.sh # Actual hook logic (bash script)
59
+ ```
60
+
61
+ ### hooks.json
62
+
63
+ ```json
64
+ {
65
+ "hooks": {
66
+ "SessionStart": [
67
+ {
68
+ "matcher": "startup|resume|clear|compact",
69
+ "hooks": [
70
+ {
71
+ "type": "command",
72
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.cmd\""
73
+ }
74
+ ]
75
+ }
76
+ ]
77
+ }
78
+ }
79
+ ```
80
+
81
+ Note: The path must be quoted because `${CLAUDE_PLUGIN_ROOT}` may contain spaces on Windows (e.g., `C:\Program Files\...`).
82
+
83
+ ## Requirements
84
+
85
+ ### Windows
86
+ - **Git for Windows** must be installed (provides `bash.exe` and `cygpath`)
87
+ - Default installation path: `C:\Program Files\Git\bin\bash.exe`
88
+ - If Git is installed elsewhere, the wrapper needs modification
89
+
90
+ ### Unix (macOS/Linux)
91
+ - Standard bash or sh shell
92
+ - The `.cmd` file must have execute permission (`chmod +x`)
93
+
94
+ ## Writing Cross-Platform Hook Scripts
95
+
96
+ Your actual hook logic goes in the `.sh` file. To ensure it works on Windows (via Git Bash):
97
+
98
+ ### Do:
99
+ - Use pure bash builtins when possible
100
+ - Use `$(command)` instead of backticks
101
+ - Quote all variable expansions: `"$VAR"`
102
+ - Use `printf` or here-docs for output
103
+
104
+ ### Avoid:
105
+ - External commands that may not be in PATH (sed, awk, grep)
106
+ - If you must use them, they're available in Git Bash but ensure PATH is set up (use `bash -l`)
107
+
108
+ ### Example: JSON Escaping Without sed/awk
109
+
110
+ Instead of:
111
+ ```bash
112
+ escaped=$(echo "$content" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | awk '{printf "%s\\n", $0}')
113
+ ```
114
+
115
+ Use pure bash:
116
+ ```bash
117
+ escape_for_json() {
118
+ local input="$1"
119
+ local output=""
120
+ local i char
121
+ for (( i=0; i<${#input}; i++ )); do
122
+ char="${input:$i:1}"
123
+ case "$char" in
124
+ $'\\') output+='\\' ;;
125
+ '"') output+='\"' ;;
126
+ $'\n') output+='\n' ;;
127
+ $'\r') output+='\r' ;;
128
+ $'\t') output+='\t' ;;
129
+ *) output+="$char" ;;
130
+ esac
131
+ done
132
+ printf '%s' "$output"
133
+ }
134
+ ```
135
+
136
+ ## Reusable Wrapper Pattern
137
+
138
+ For plugins with multiple hooks, you can create a generic wrapper that takes the script name as an argument:
139
+
140
+ ### run-hook.cmd
141
+ ```cmd
142
+ : << 'CMDBLOCK'
143
+ @echo off
144
+ set "SCRIPT_DIR=%~dp0"
145
+ set "SCRIPT_NAME=%~1"
146
+ "C:\Program Files\Git\bin\bash.exe" -l -c "cd \"$(cygpath -u \"%SCRIPT_DIR%\")\" && \"./%SCRIPT_NAME%\""
147
+ exit /b
148
+ CMDBLOCK
149
+
150
+ # Unix shell runs from here
151
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
152
+ SCRIPT_NAME="$1"
153
+ shift
154
+ "${SCRIPT_DIR}/${SCRIPT_NAME}" "$@"
155
+ ```
156
+
157
+ ### hooks.json using the reusable wrapper
158
+ ```json
159
+ {
160
+ "hooks": {
161
+ "SessionStart": [
162
+ {
163
+ "matcher": "startup",
164
+ "hooks": [
165
+ {
166
+ "type": "command",
167
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start.sh"
168
+ }
169
+ ]
170
+ }
171
+ ],
172
+ "PreToolUse": [
173
+ {
174
+ "matcher": "Bash",
175
+ "hooks": [
176
+ {
177
+ "type": "command",
178
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" validate-bash.sh"
179
+ }
180
+ ]
181
+ }
182
+ ]
183
+ }
184
+ }
185
+ ```
186
+
187
+ ## Troubleshooting
188
+
189
+ ### "bash is not recognized"
190
+ CMD can't find bash. The wrapper uses the full path `C:\Program Files\Git\bin\bash.exe`. If Git is installed elsewhere, update the path.
191
+
192
+ ### "cygpath: command not found" or "dirname: command not found"
193
+ Bash isn't running as a login shell. Ensure `-l` flag is used.
194
+
195
+ ### Path has weird `\/` in it
196
+ `${CLAUDE_PLUGIN_ROOT}` expanded to a Windows path ending with backslash, then `/hooks/...` was appended. Use `cygpath` to convert the entire path.
197
+
198
+ ### Script opens in text editor instead of running
199
+ The hooks.json is pointing directly to the `.sh` file. Point to the `.cmd` wrapper instead.
200
+
201
+ ### Works in terminal but not as hook
202
+ Claude Code may run hooks differently. Test by simulating the hook environment:
203
+ ```powershell
204
+ $env:CLAUDE_PLUGIN_ROOT = "C:\path\to\plugin"
205
+ cmd /c "C:\path\to\plugin\hooks\session-start.cmd"
206
+ ```
207
+
208
+ ## Related Issues
209
+
210
+ - [anthropics/claude-code#9758](https://github.com/anthropics/claude-code/issues/9758) - .sh scripts open in editor on Windows
211
+ - [anthropics/claude-code#3417](https://github.com/anthropics/claude-code/issues/3417) - Hooks don't work on Windows
212
+ - [anthropics/claude-code#6023](https://github.com/anthropics/claude-code/issues/6023) - CLAUDE_PROJECT_DIR not found
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "superpowers",
3
+ "description": "Core skills library: TDD, debugging, collaboration patterns, and proven techniques",
4
+ "version": "5.0.0",
5
+ "contextFileName": "GEMINI.md"
6
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 1,
3
+ "hooks": {
4
+ "sessionStart": [
5
+ {
6
+ "command": "./hooks/session-start"
7
+ }
8
+ ]
9
+ }
10
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "matcher": "startup|clear|compact",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start",
10
+ "async": false
11
+ }
12
+ ]
13
+ }
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,46 @@
1
+ : << 'CMDBLOCK'
2
+ @echo off
3
+ REM Cross-platform polyglot wrapper for hook scripts.
4
+ REM On Windows: cmd.exe runs the batch portion, which finds and calls bash.
5
+ REM On Unix: the shell interprets this as a script (: is a no-op in bash).
6
+ REM
7
+ REM Hook scripts use extensionless filenames (e.g. "session-start" not
8
+ REM "session-start.sh") so Claude Code's Windows auto-detection -- which
9
+ REM prepends "bash" to any command containing .sh -- doesn't interfere.
10
+ REM
11
+ REM Usage: run-hook.cmd <script-name> [args...]
12
+
13
+ if "%~1"=="" (
14
+ echo run-hook.cmd: missing script name >&2
15
+ exit /b 1
16
+ )
17
+
18
+ set "HOOK_DIR=%~dp0"
19
+
20
+ REM Try Git for Windows bash in standard locations
21
+ if exist "C:\Program Files\Git\bin\bash.exe" (
22
+ "C:\Program Files\Git\bin\bash.exe" "%HOOK_DIR%%~1" %2 %3 %4 %5 %6 %7 %8 %9
23
+ exit /b %ERRORLEVEL%
24
+ )
25
+ if exist "C:\Program Files (x86)\Git\bin\bash.exe" (
26
+ "C:\Program Files (x86)\Git\bin\bash.exe" "%HOOK_DIR%%~1" %2 %3 %4 %5 %6 %7 %8 %9
27
+ exit /b %ERRORLEVEL%
28
+ )
29
+
30
+ REM Try bash on PATH (e.g. user-installed Git Bash, MSYS2, Cygwin)
31
+ where bash >nul 2>nul
32
+ if %ERRORLEVEL% equ 0 (
33
+ bash "%HOOK_DIR%%~1" %2 %3 %4 %5 %6 %7 %8 %9
34
+ exit /b %ERRORLEVEL%
35
+ )
36
+
37
+ REM No bash found - exit silently rather than error
38
+ REM (plugin still works, just without SessionStart context injection)
39
+ exit /b 0
40
+ CMDBLOCK
41
+
42
+ # Unix: run the named script directly
43
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
44
+ SCRIPT_NAME="$1"
45
+ shift
46
+ exec bash "${SCRIPT_DIR}/${SCRIPT_NAME}" "$@"
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env bash
2
+ # SessionStart hook for superpowers plugin
3
+
4
+ set -euo pipefail
5
+
6
+ # Determine plugin root directory
7
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
8
+ PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
9
+
10
+ # Check if legacy skills directory exists and build warning
11
+ warning_message=""
12
+ legacy_skills_dir="${HOME}/.config/superpowers/skills"
13
+ if [ -d "$legacy_skills_dir" ]; then
14
+ warning_message="\n\n<important-reminder>IN YOUR FIRST REPLY AFTER SEEING THIS MESSAGE YOU MUST TELL THE USER:⚠️ **WARNING:** Superpowers now uses Claude Code's skills system. Custom skills in ~/.config/superpowers/skills will not be read. Move custom skills to ~/.claude/skills instead. To make this message go away, remove ~/.config/superpowers/skills</important-reminder>"
15
+ fi
16
+
17
+ # Read using-superpowers content
18
+ using_superpowers_content=$(cat "${PLUGIN_ROOT}/skills/using-superpowers/SKILL.md" 2>&1 || echo "Error reading using-superpowers skill")
19
+
20
+ # Escape string for JSON embedding using bash parameter substitution.
21
+ # Each ${s//old/new} is a single C-level pass - orders of magnitude
22
+ # faster than the character-by-character loop this replaces.
23
+ escape_for_json() {
24
+ local s="$1"
25
+ s="${s//\\/\\\\}"
26
+ s="${s//\"/\\\"}"
27
+ s="${s//$'\n'/\\n}"
28
+ s="${s//$'\r'/\\r}"
29
+ s="${s//$'\t'/\\t}"
30
+ printf '%s' "$s"
31
+ }
32
+
33
+ using_superpowers_escaped=$(escape_for_json "$using_superpowers_content")
34
+ warning_escaped=$(escape_for_json "$warning_message")
35
+ session_context="<EXTREMELY_IMPORTANT>\nYou have superpowers.\n\n**Below is the full content of your 'superpowers:using-superpowers' skill - your introduction to using skills. For all other skills, use the 'Skill' tool:**\n\n${using_superpowers_escaped}\n\n${warning_escaped}\n</EXTREMELY_IMPORTANT>"
36
+
37
+ # Output context injection as JSON.
38
+ # Cursor hooks expect additional_context.
39
+ # Claude Code hooks expect hookSpecificOutput.additionalContext.
40
+ # Claude Code reads BOTH fields without deduplication, so we must only
41
+ # emit the field consumed by the current platform to avoid double injection.
42
+ #
43
+ # Uses printf instead of heredoc (cat <<EOF) to work around a bash 5.3+
44
+ # bug where heredoc variable expansion hangs when content exceeds ~512 bytes.
45
+ # See: https://github.com/obra/superpowers/issues/571
46
+ if [ -n "${CURSOR_PLUGIN_ROOT:-}" ]; then
47
+ # Cursor sets CURSOR_PLUGIN_ROOT (may also set CLAUDE_PLUGIN_ROOT) — emit additional_context
48
+ printf '{\n "additional_context": "%s"\n}\n' "$session_context"
49
+ elif [ -n "${CLAUDE_PLUGIN_ROOT:-}" ]; then
50
+ # Claude Code sets CLAUDE_PLUGIN_ROOT — emit only hookSpecificOutput
51
+ printf '{\n "hookSpecificOutput": {\n "hookEventName": "SessionStart",\n "additionalContext": "%s"\n }\n}\n' "$session_context"
52
+ else
53
+ # Other platforms — emit additional_context as fallback
54
+ printf '{\n "additional_context": "%s"\n}\n' "$session_context"
55
+ fi
56
+
57
+ exit 0
package/package.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "workerssuper",
3
+ "version": "5.0.4",
4
+ "type": "module"
5
+ }
@@ -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/superpowers/specs/YYYY-MM-DD-<topic>-design.md` and commit
30
+ 7. **Spec review loop** — dispatch spec-document-reviewer subagent with precisely crafted review context (never your session history); fix issues and re-dispatch until approved (max 3 iterations, then surface to human)
31
+ 8. **User reviews written spec** — ask user to review the spec file before proceeding
32
+ 9. **Transition to implementation** — invoke writing-plans 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 review loop" [shape=box];
47
+ "Spec review passed?" [shape=diamond];
48
+ "User reviews spec?" [shape=diamond];
49
+ "Invoke writing-plans skill" [shape=doublecircle];
50
+
51
+ "Explore project context" -> "Visual questions ahead?";
52
+ "Visual questions ahead?" -> "Offer Visual Companion\n(own message, no other content)" [label="yes"];
53
+ "Visual questions ahead?" -> "Ask clarifying questions" [label="no"];
54
+ "Offer Visual Companion\n(own message, no other content)" -> "Ask clarifying questions";
55
+ "Ask clarifying questions" -> "Propose 2-3 approaches";
56
+ "Propose 2-3 approaches" -> "Present design sections";
57
+ "Present design sections" -> "User approves design?";
58
+ "User approves design?" -> "Present design sections" [label="no, revise"];
59
+ "User approves design?" -> "Write design doc" [label="yes"];
60
+ "Write design doc" -> "Spec review loop";
61
+ "Spec review loop" -> "Spec review passed?";
62
+ "Spec review passed?" -> "Spec review loop" [label="issues found,\nfix and re-dispatch"];
63
+ "Spec review passed?" -> "User reviews spec?" [label="approved"];
64
+ "User reviews spec?" -> "Write design doc" [label="changes requested"];
65
+ "User reviews spec?" -> "Invoke writing-plans skill" [label="approved"];
66
+ }
67
+ ```
68
+
69
+ **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.
70
+
71
+ ## The Process
72
+
73
+ **Understanding the idea:**
74
+
75
+ - Check out the current project state first (files, docs, recent commits)
76
+ - 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.
77
+ - 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.
78
+ - For appropriately-scoped projects, ask questions one at a time to refine the idea
79
+ - Prefer multiple choice questions when possible, but open-ended is fine too
80
+ - Only one question per message - if a topic needs more exploration, break it into multiple questions
81
+ - Focus on understanding: purpose, constraints, success criteria
82
+
83
+ **Exploring approaches:**
84
+
85
+ - Propose 2-3 different approaches with trade-offs
86
+ - Present options conversationally with your recommendation and reasoning
87
+ - Lead with your recommended option and explain why
88
+
89
+ **Presenting the design:**
90
+
91
+ - Once you believe you understand what you're building, present the design
92
+ - Scale each section to its complexity: a few sentences if straightforward, up to 200-300 words if nuanced
93
+ - Ask after each section whether it looks right so far
94
+ - Cover: architecture, components, data flow, error handling, testing
95
+ - Be ready to go back and clarify if something doesn't make sense
96
+
97
+ **Design for isolation and clarity:**
98
+
99
+ - Break the system into smaller units that each have one clear purpose, communicate through well-defined interfaces, and can be understood and tested independently
100
+ - For each unit, you should be able to answer: what does it do, how do you use it, and what does it depend on?
101
+ - 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.
102
+ - 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.
103
+
104
+ **Working in existing codebases:**
105
+
106
+ - Explore the current structure before proposing changes. Follow existing patterns.
107
+ - 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.
108
+ - Don't propose unrelated refactoring. Stay focused on what serves the current goal.
109
+
110
+ ## After the Design
111
+
112
+ **Documentation:**
113
+
114
+ - Write the validated design (spec) to `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md`
115
+ - (User preferences for spec location override this default)
116
+ - Use elements-of-style:writing-clearly-and-concisely skill if available
117
+ - Commit the design document to git
118
+
119
+ **Spec Review Loop:**
120
+ After writing the spec document:
121
+
122
+ 1. Dispatch spec-document-reviewer subagent (see spec-document-reviewer-prompt.md)
123
+ 2. If Issues Found: fix, re-dispatch, repeat until Approved
124
+ 3. If loop exceeds 3 iterations, surface to human for guidance
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 writing-plans skill to create a detailed implementation plan
136
+ - Do NOT invoke any other skill. writing-plans 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`