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,202 @@
1
+ #!/usr/bin/env bash
2
+ # Helper functions for Claude Code skill tests
3
+
4
+ # Run Claude Code with a prompt and capture output
5
+ # Usage: run_claude "prompt text" [timeout_seconds] [allowed_tools]
6
+ run_claude() {
7
+ local prompt="$1"
8
+ local timeout="${2:-60}"
9
+ local allowed_tools="${3:-}"
10
+ local output_file=$(mktemp)
11
+
12
+ # Build command
13
+ local cmd="claude -p \"$prompt\""
14
+ if [ -n "$allowed_tools" ]; then
15
+ cmd="$cmd --allowed-tools=$allowed_tools"
16
+ fi
17
+
18
+ # Run Claude in headless mode with timeout
19
+ if timeout "$timeout" bash -c "$cmd" > "$output_file" 2>&1; then
20
+ cat "$output_file"
21
+ rm -f "$output_file"
22
+ return 0
23
+ else
24
+ local exit_code=$?
25
+ cat "$output_file" >&2
26
+ rm -f "$output_file"
27
+ return $exit_code
28
+ fi
29
+ }
30
+
31
+ # Check if output contains a pattern
32
+ # Usage: assert_contains "output" "pattern" "test name"
33
+ assert_contains() {
34
+ local output="$1"
35
+ local pattern="$2"
36
+ local test_name="${3:-test}"
37
+
38
+ if echo "$output" | grep -q "$pattern"; then
39
+ echo " [PASS] $test_name"
40
+ return 0
41
+ else
42
+ echo " [FAIL] $test_name"
43
+ echo " Expected to find: $pattern"
44
+ echo " In output:"
45
+ echo "$output" | sed 's/^/ /'
46
+ return 1
47
+ fi
48
+ }
49
+
50
+ # Check if output does NOT contain a pattern
51
+ # Usage: assert_not_contains "output" "pattern" "test name"
52
+ assert_not_contains() {
53
+ local output="$1"
54
+ local pattern="$2"
55
+ local test_name="${3:-test}"
56
+
57
+ if echo "$output" | grep -q "$pattern"; then
58
+ echo " [FAIL] $test_name"
59
+ echo " Did not expect to find: $pattern"
60
+ echo " In output:"
61
+ echo "$output" | sed 's/^/ /'
62
+ return 1
63
+ else
64
+ echo " [PASS] $test_name"
65
+ return 0
66
+ fi
67
+ }
68
+
69
+ # Check if output matches a count
70
+ # Usage: assert_count "output" "pattern" expected_count "test name"
71
+ assert_count() {
72
+ local output="$1"
73
+ local pattern="$2"
74
+ local expected="$3"
75
+ local test_name="${4:-test}"
76
+
77
+ local actual=$(echo "$output" | grep -c "$pattern" || echo "0")
78
+
79
+ if [ "$actual" -eq "$expected" ]; then
80
+ echo " [PASS] $test_name (found $actual instances)"
81
+ return 0
82
+ else
83
+ echo " [FAIL] $test_name"
84
+ echo " Expected $expected instances of: $pattern"
85
+ echo " Found $actual instances"
86
+ echo " In output:"
87
+ echo "$output" | sed 's/^/ /'
88
+ return 1
89
+ fi
90
+ }
91
+
92
+ # Check if pattern A appears before pattern B
93
+ # Usage: assert_order "output" "pattern_a" "pattern_b" "test name"
94
+ assert_order() {
95
+ local output="$1"
96
+ local pattern_a="$2"
97
+ local pattern_b="$3"
98
+ local test_name="${4:-test}"
99
+
100
+ # Get line numbers where patterns appear
101
+ local line_a=$(echo "$output" | grep -n "$pattern_a" | head -1 | cut -d: -f1)
102
+ local line_b=$(echo "$output" | grep -n "$pattern_b" | head -1 | cut -d: -f1)
103
+
104
+ if [ -z "$line_a" ]; then
105
+ echo " [FAIL] $test_name: pattern A not found: $pattern_a"
106
+ return 1
107
+ fi
108
+
109
+ if [ -z "$line_b" ]; then
110
+ echo " [FAIL] $test_name: pattern B not found: $pattern_b"
111
+ return 1
112
+ fi
113
+
114
+ if [ "$line_a" -lt "$line_b" ]; then
115
+ echo " [PASS] $test_name (A at line $line_a, B at line $line_b)"
116
+ return 0
117
+ else
118
+ echo " [FAIL] $test_name"
119
+ echo " Expected '$pattern_a' before '$pattern_b'"
120
+ echo " But found A at line $line_a, B at line $line_b"
121
+ return 1
122
+ fi
123
+ }
124
+
125
+ # Create a temporary test project directory
126
+ # Usage: test_project=$(create_test_project)
127
+ create_test_project() {
128
+ local test_dir=$(mktemp -d)
129
+ echo "$test_dir"
130
+ }
131
+
132
+ # Cleanup test project
133
+ # Usage: cleanup_test_project "$test_dir"
134
+ cleanup_test_project() {
135
+ local test_dir="$1"
136
+ if [ -d "$test_dir" ]; then
137
+ rm -rf "$test_dir"
138
+ fi
139
+ }
140
+
141
+ # Create a simple plan file for testing
142
+ # Usage: create_test_plan "$project_dir" "$plan_name"
143
+ create_test_plan() {
144
+ local project_dir="$1"
145
+ local plan_name="${2:-test-plan}"
146
+ local plan_file="$project_dir/docs/superpowers/plans/$plan_name.md"
147
+
148
+ mkdir -p "$(dirname "$plan_file")"
149
+
150
+ cat > "$plan_file" <<'EOF'
151
+ # Test Implementation Plan
152
+
153
+ ## Task 1: Create Hello Function
154
+
155
+ Create a simple hello function that returns "Hello, World!".
156
+
157
+ **File:** `src/hello.js`
158
+
159
+ **Implementation:**
160
+ ```javascript
161
+ export function hello() {
162
+ return "Hello, World!";
163
+ }
164
+ ```
165
+
166
+ **Tests:** Write a test that verifies the function returns the expected string.
167
+
168
+ **Verification:** `npm test`
169
+
170
+ ## Task 2: Create Goodbye Function
171
+
172
+ Create a goodbye function that takes a name and returns a goodbye message.
173
+
174
+ **File:** `src/goodbye.js`
175
+
176
+ **Implementation:**
177
+ ```javascript
178
+ export function goodbye(name) {
179
+ return `Goodbye, ${name}!`;
180
+ }
181
+ ```
182
+
183
+ **Tests:** Write tests for:
184
+ - Default name
185
+ - Custom name
186
+ - Edge cases (empty string, null)
187
+
188
+ **Verification:** `npm test`
189
+ EOF
190
+
191
+ echo "$plan_file"
192
+ }
193
+
194
+ # Export functions for use in tests
195
+ export -f run_claude
196
+ export -f assert_contains
197
+ export -f assert_not_contains
198
+ export -f assert_count
199
+ export -f assert_order
200
+ export -f create_test_project
201
+ export -f cleanup_test_project
202
+ export -f create_test_plan
@@ -0,0 +1,314 @@
1
+ #!/usr/bin/env bash
2
+ # Integration Test: subagent-driven-development workflow
3
+ # Actually executes a plan and verifies the new workflow behaviors
4
+ set -euo pipefail
5
+
6
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
7
+ source "$SCRIPT_DIR/test-helpers.sh"
8
+
9
+ echo "========================================"
10
+ echo " Integration Test: subagent-driven-development"
11
+ echo "========================================"
12
+ echo ""
13
+ echo "This test executes a real plan using the skill and verifies:"
14
+ echo " 1. Plan is read once (not per task)"
15
+ echo " 2. Full task text provided to subagents"
16
+ echo " 3. Subagents perform self-review"
17
+ echo " 4. Spec compliance review before code quality"
18
+ echo " 5. Review loops when issues found"
19
+ echo " 6. Spec reviewer reads code independently"
20
+ echo ""
21
+ echo "WARNING: This test may take 10-30 minutes to complete."
22
+ echo ""
23
+
24
+ # Create test project
25
+ TEST_PROJECT=$(create_test_project)
26
+ echo "Test project: $TEST_PROJECT"
27
+
28
+ # Trap to cleanup
29
+ trap "cleanup_test_project $TEST_PROJECT" EXIT
30
+
31
+ # Set up minimal Node.js project
32
+ cd "$TEST_PROJECT"
33
+
34
+ cat > package.json <<'EOF'
35
+ {
36
+ "name": "test-project",
37
+ "version": "1.0.0",
38
+ "type": "module",
39
+ "scripts": {
40
+ "test": "node --test"
41
+ }
42
+ }
43
+ EOF
44
+
45
+ mkdir -p src test docs/superpowers/plans
46
+
47
+ # Create a simple implementation plan
48
+ cat > docs/superpowers/plans/implementation-plan.md <<'EOF'
49
+ # Test Implementation Plan
50
+
51
+ This is a minimal plan to test the subagent-driven-development workflow.
52
+
53
+ ## Task 1: Create Add Function
54
+
55
+ Create a function that adds two numbers.
56
+
57
+ **File:** `src/math.js`
58
+
59
+ **Requirements:**
60
+ - Function named `add`
61
+ - Takes two parameters: `a` and `b`
62
+ - Returns the sum of `a` and `b`
63
+ - Export the function
64
+
65
+ **Implementation:**
66
+ ```javascript
67
+ export function add(a, b) {
68
+ return a + b;
69
+ }
70
+ ```
71
+
72
+ **Tests:** Create `test/math.test.js` that verifies:
73
+ - `add(2, 3)` returns `5`
74
+ - `add(0, 0)` returns `0`
75
+ - `add(-1, 1)` returns `0`
76
+
77
+ **Verification:** `npm test`
78
+
79
+ ## Task 2: Create Multiply Function
80
+
81
+ Create a function that multiplies two numbers.
82
+
83
+ **File:** `src/math.js` (add to existing file)
84
+
85
+ **Requirements:**
86
+ - Function named `multiply`
87
+ - Takes two parameters: `a` and `b`
88
+ - Returns the product of `a` and `b`
89
+ - Export the function
90
+ - DO NOT add any extra features (like power, divide, etc.)
91
+
92
+ **Implementation:**
93
+ ```javascript
94
+ export function multiply(a, b) {
95
+ return a * b;
96
+ }
97
+ ```
98
+
99
+ **Tests:** Add to `test/math.test.js`:
100
+ - `multiply(2, 3)` returns `6`
101
+ - `multiply(0, 5)` returns `0`
102
+ - `multiply(-2, 3)` returns `-6`
103
+
104
+ **Verification:** `npm test`
105
+ EOF
106
+
107
+ # Initialize git repo
108
+ git init --quiet
109
+ git config user.email "test@test.com"
110
+ git config user.name "Test User"
111
+ git add .
112
+ git commit -m "Initial commit" --quiet
113
+
114
+ echo ""
115
+ echo "Project setup complete. Starting execution..."
116
+ echo ""
117
+
118
+ # Run Claude with subagent-driven-development
119
+ # Capture full output to analyze
120
+ OUTPUT_FILE="$TEST_PROJECT/claude-output.txt"
121
+
122
+ # Create prompt file
123
+ cat > "$TEST_PROJECT/prompt.txt" <<'EOF'
124
+ I want you to execute the implementation plan at docs/superpowers/plans/implementation-plan.md using the subagent-driven-development skill.
125
+
126
+ IMPORTANT: Follow the skill exactly. I will be verifying that you:
127
+ 1. Read the plan once at the beginning
128
+ 2. Provide full task text to subagents (don't make them read files)
129
+ 3. Ensure subagents do self-review before reporting
130
+ 4. Run spec compliance review before code quality review
131
+ 5. Use review loops when issues are found
132
+
133
+ Begin now. Execute the plan.
134
+ EOF
135
+
136
+ # Note: We use a longer timeout since this is integration testing
137
+ # Use --allowed-tools to enable tool usage in headless mode
138
+ # IMPORTANT: Run from superpowers directory so local dev skills are available
139
+ PROMPT="Change to directory $TEST_PROJECT and then execute the implementation plan at docs/superpowers/plans/implementation-plan.md using the subagent-driven-development skill.
140
+
141
+ IMPORTANT: Follow the skill exactly. I will be verifying that you:
142
+ 1. Read the plan once at the beginning
143
+ 2. Provide full task text to subagents (don't make them read files)
144
+ 3. Ensure subagents do self-review before reporting
145
+ 4. Run spec compliance review before code quality review
146
+ 5. Use review loops when issues are found
147
+
148
+ Begin now. Execute the plan."
149
+
150
+ echo "Running Claude (output will be shown below and saved to $OUTPUT_FILE)..."
151
+ echo "================================================================================"
152
+ cd "$SCRIPT_DIR/../.." && timeout 1800 claude -p "$PROMPT" --allowed-tools=all --add-dir "$TEST_PROJECT" --permission-mode bypassPermissions 2>&1 | tee "$OUTPUT_FILE" || {
153
+ echo ""
154
+ echo "================================================================================"
155
+ echo "EXECUTION FAILED (exit code: $?)"
156
+ exit 1
157
+ }
158
+ echo "================================================================================"
159
+
160
+ echo ""
161
+ echo "Execution complete. Analyzing results..."
162
+ echo ""
163
+
164
+ # Find the session transcript
165
+ # Session files are in ~/.claude/projects/-<working-dir>/<session-id>.jsonl
166
+ WORKING_DIR_ESCAPED=$(echo "$SCRIPT_DIR/../.." | sed 's/\//-/g' | sed 's/^-//')
167
+ SESSION_DIR="$HOME/.claude/projects/$WORKING_DIR_ESCAPED"
168
+
169
+ # Find the most recent session file (created during this test run)
170
+ SESSION_FILE=$(find "$SESSION_DIR" -name "*.jsonl" -type f -mmin -60 2>/dev/null | sort -r | head -1)
171
+
172
+ if [ -z "$SESSION_FILE" ]; then
173
+ echo "ERROR: Could not find session transcript file"
174
+ echo "Looked in: $SESSION_DIR"
175
+ exit 1
176
+ fi
177
+
178
+ echo "Analyzing session transcript: $(basename "$SESSION_FILE")"
179
+ echo ""
180
+
181
+ # Verification tests
182
+ FAILED=0
183
+
184
+ echo "=== Verification Tests ==="
185
+ echo ""
186
+
187
+ # Test 1: Skill was invoked
188
+ echo "Test 1: Skill tool invoked..."
189
+ if grep -q '"name":"Skill".*"skill":"superpowers:subagent-driven-development"' "$SESSION_FILE"; then
190
+ echo " [PASS] subagent-driven-development skill was invoked"
191
+ else
192
+ echo " [FAIL] Skill was not invoked"
193
+ FAILED=$((FAILED + 1))
194
+ fi
195
+ echo ""
196
+
197
+ # Test 2: Subagents were used (Task tool)
198
+ echo "Test 2: Subagents dispatched..."
199
+ task_count=$(grep -c '"name":"Task"' "$SESSION_FILE" || echo "0")
200
+ if [ "$task_count" -ge 2 ]; then
201
+ echo " [PASS] $task_count subagents dispatched"
202
+ else
203
+ echo " [FAIL] Only $task_count subagent(s) dispatched (expected >= 2)"
204
+ FAILED=$((FAILED + 1))
205
+ fi
206
+ echo ""
207
+
208
+ # Test 3: TodoWrite was used for tracking
209
+ echo "Test 3: Task tracking..."
210
+ todo_count=$(grep -c '"name":"TodoWrite"' "$SESSION_FILE" || echo "0")
211
+ if [ "$todo_count" -ge 1 ]; then
212
+ echo " [PASS] TodoWrite used $todo_count time(s) for task tracking"
213
+ else
214
+ echo " [FAIL] TodoWrite not used"
215
+ FAILED=$((FAILED + 1))
216
+ fi
217
+ echo ""
218
+
219
+ # Test 6: Implementation actually works
220
+ echo "Test 6: Implementation verification..."
221
+ if [ -f "$TEST_PROJECT/src/math.js" ]; then
222
+ echo " [PASS] src/math.js created"
223
+
224
+ if grep -q "export function add" "$TEST_PROJECT/src/math.js"; then
225
+ echo " [PASS] add function exists"
226
+ else
227
+ echo " [FAIL] add function missing"
228
+ FAILED=$((FAILED + 1))
229
+ fi
230
+
231
+ if grep -q "export function multiply" "$TEST_PROJECT/src/math.js"; then
232
+ echo " [PASS] multiply function exists"
233
+ else
234
+ echo " [FAIL] multiply function missing"
235
+ FAILED=$((FAILED + 1))
236
+ fi
237
+ else
238
+ echo " [FAIL] src/math.js not created"
239
+ FAILED=$((FAILED + 1))
240
+ fi
241
+
242
+ if [ -f "$TEST_PROJECT/test/math.test.js" ]; then
243
+ echo " [PASS] test/math.test.js created"
244
+ else
245
+ echo " [FAIL] test/math.test.js not created"
246
+ FAILED=$((FAILED + 1))
247
+ fi
248
+
249
+ # Try running tests
250
+ if cd "$TEST_PROJECT" && npm test > test-output.txt 2>&1; then
251
+ echo " [PASS] Tests pass"
252
+ else
253
+ echo " [FAIL] Tests failed"
254
+ cat test-output.txt
255
+ FAILED=$((FAILED + 1))
256
+ fi
257
+ echo ""
258
+
259
+ # Test 7: Git commits show proper workflow
260
+ echo "Test 7: Git commit history..."
261
+ commit_count=$(git -C "$TEST_PROJECT" log --oneline | wc -l)
262
+ if [ "$commit_count" -gt 2 ]; then # Initial + at least 2 task commits
263
+ echo " [PASS] Multiple commits created ($commit_count total)"
264
+ else
265
+ echo " [FAIL] Too few commits ($commit_count, expected >2)"
266
+ FAILED=$((FAILED + 1))
267
+ fi
268
+ echo ""
269
+
270
+ # Test 8: Check for extra features (spec compliance should catch)
271
+ echo "Test 8: No extra features added (spec compliance)..."
272
+ if grep -q "export function divide\|export function power\|export function subtract" "$TEST_PROJECT/src/math.js" 2>/dev/null; then
273
+ echo " [WARN] Extra features found (spec review should have caught this)"
274
+ # Not failing on this as it tests reviewer effectiveness
275
+ else
276
+ echo " [PASS] No extra features added"
277
+ fi
278
+ echo ""
279
+
280
+ # Token Usage Analysis
281
+ echo "========================================="
282
+ echo " Token Usage Analysis"
283
+ echo "========================================="
284
+ echo ""
285
+ python3 "$SCRIPT_DIR/analyze-token-usage.py" "$SESSION_FILE"
286
+ echo ""
287
+
288
+ # Summary
289
+ echo "========================================"
290
+ echo " Test Summary"
291
+ echo "========================================"
292
+ echo ""
293
+
294
+ if [ $FAILED -eq 0 ]; then
295
+ echo "STATUS: PASSED"
296
+ echo "All verification tests passed!"
297
+ echo ""
298
+ echo "The subagent-driven-development skill correctly:"
299
+ echo " ✓ Reads plan once at start"
300
+ echo " ✓ Provides full task text to subagents"
301
+ echo " ✓ Enforces self-review"
302
+ echo " ✓ Runs spec compliance before code quality"
303
+ echo " ✓ Spec reviewer verifies independently"
304
+ echo " ✓ Produces working implementation"
305
+ exit 0
306
+ else
307
+ echo "STATUS: FAILED"
308
+ echo "Failed $FAILED verification tests"
309
+ echo ""
310
+ echo "Output saved to: $OUTPUT_FILE"
311
+ echo ""
312
+ echo "Review the output to see what went wrong."
313
+ exit 1
314
+ fi
@@ -0,0 +1,165 @@
1
+ #!/usr/bin/env bash
2
+ # Test: subagent-driven-development skill
3
+ # Verifies that the skill is loaded and follows correct workflow
4
+ set -euo pipefail
5
+
6
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
7
+ source "$SCRIPT_DIR/test-helpers.sh"
8
+
9
+ echo "=== Test: subagent-driven-development skill ==="
10
+ echo ""
11
+
12
+ # Test 1: Verify skill can be loaded
13
+ echo "Test 1: Skill loading..."
14
+
15
+ output=$(run_claude "What is the subagent-driven-development skill? Describe its key steps briefly." 30)
16
+
17
+ if assert_contains "$output" "subagent-driven-development\|Subagent-Driven Development\|Subagent Driven" "Skill is recognized"; then
18
+ : # pass
19
+ else
20
+ exit 1
21
+ fi
22
+
23
+ if assert_contains "$output" "Load Plan\|read.*plan\|extract.*tasks" "Mentions loading plan"; then
24
+ : # pass
25
+ else
26
+ exit 1
27
+ fi
28
+
29
+ echo ""
30
+
31
+ # Test 2: Verify skill describes correct workflow order
32
+ echo "Test 2: Workflow ordering..."
33
+
34
+ output=$(run_claude "In the subagent-driven-development skill, what comes first: spec compliance review or code quality review? Be specific about the order." 30)
35
+
36
+ if assert_order "$output" "spec.*compliance" "code.*quality" "Spec compliance before code quality"; then
37
+ : # pass
38
+ else
39
+ exit 1
40
+ fi
41
+
42
+ echo ""
43
+
44
+ # Test 3: Verify self-review is mentioned
45
+ echo "Test 3: Self-review requirement..."
46
+
47
+ output=$(run_claude "Does the subagent-driven-development skill require implementers to do self-review? What should they check?" 30)
48
+
49
+ if assert_contains "$output" "self-review\|self review" "Mentions self-review"; then
50
+ : # pass
51
+ else
52
+ exit 1
53
+ fi
54
+
55
+ if assert_contains "$output" "completeness\|Completeness" "Checks completeness"; then
56
+ : # pass
57
+ else
58
+ exit 1
59
+ fi
60
+
61
+ echo ""
62
+
63
+ # Test 4: Verify plan is read once
64
+ echo "Test 4: Plan reading efficiency..."
65
+
66
+ output=$(run_claude "In subagent-driven-development, how many times should the controller read the plan file? When does this happen?" 30)
67
+
68
+ if assert_contains "$output" "once\|one time\|single" "Read plan once"; then
69
+ : # pass
70
+ else
71
+ exit 1
72
+ fi
73
+
74
+ if assert_contains "$output" "Step 1\|beginning\|start\|Load Plan" "Read at beginning"; then
75
+ : # pass
76
+ else
77
+ exit 1
78
+ fi
79
+
80
+ echo ""
81
+
82
+ # Test 5: Verify spec compliance reviewer is skeptical
83
+ echo "Test 5: Spec compliance reviewer mindset..."
84
+
85
+ output=$(run_claude "What is the spec compliance reviewer's attitude toward the implementer's report in subagent-driven-development?" 30)
86
+
87
+ if assert_contains "$output" "not trust\|don't trust\|skeptical\|verify.*independently\|suspiciously" "Reviewer is skeptical"; then
88
+ : # pass
89
+ else
90
+ exit 1
91
+ fi
92
+
93
+ if assert_contains "$output" "read.*code\|inspect.*code\|verify.*code" "Reviewer reads code"; then
94
+ : # pass
95
+ else
96
+ exit 1
97
+ fi
98
+
99
+ echo ""
100
+
101
+ # Test 6: Verify review loops
102
+ echo "Test 6: Review loop requirements..."
103
+
104
+ output=$(run_claude "In subagent-driven-development, what happens if a reviewer finds issues? Is it a one-time review or a loop?" 30)
105
+
106
+ if assert_contains "$output" "loop\|again\|repeat\|until.*approved\|until.*compliant" "Review loops mentioned"; then
107
+ : # pass
108
+ else
109
+ exit 1
110
+ fi
111
+
112
+ if assert_contains "$output" "implementer.*fix\|fix.*issues" "Implementer fixes issues"; then
113
+ : # pass
114
+ else
115
+ exit 1
116
+ fi
117
+
118
+ echo ""
119
+
120
+ # Test 7: Verify full task text is provided
121
+ echo "Test 7: Task context provision..."
122
+
123
+ output=$(run_claude "In subagent-driven-development, how does the controller provide task information to the implementer subagent? Does it make them read a file or provide it directly?" 30)
124
+
125
+ if assert_contains "$output" "provide.*directly\|full.*text\|paste\|include.*prompt" "Provides text directly"; then
126
+ : # pass
127
+ else
128
+ exit 1
129
+ fi
130
+
131
+ if assert_not_contains "$output" "read.*file\|open.*file" "Doesn't make subagent read file"; then
132
+ : # pass
133
+ else
134
+ exit 1
135
+ fi
136
+
137
+ echo ""
138
+
139
+ # Test 8: Verify worktree requirement
140
+ echo "Test 8: Worktree requirement..."
141
+
142
+ output=$(run_claude "What workflow skills are required before using subagent-driven-development? List any prerequisites or required skills." 30)
143
+
144
+ if assert_contains "$output" "using-git-worktrees\|worktree" "Mentions worktree requirement"; then
145
+ : # pass
146
+ else
147
+ exit 1
148
+ fi
149
+
150
+ echo ""
151
+
152
+ # Test 9: Verify main branch warning
153
+ echo "Test 9: Main branch red flag..."
154
+
155
+ output=$(run_claude "In subagent-driven-development, is it okay to start implementation directly on the main branch?" 30)
156
+
157
+ if assert_contains "$output" "worktree\|feature.*branch\|not.*main\|never.*main\|avoid.*main\|don't.*main\|consent\|permission" "Warns against main branch"; then
158
+ : # pass
159
+ else
160
+ exit 1
161
+ fi
162
+
163
+ echo ""
164
+
165
+ echo "=== All subagent-driven-development skill tests passed ==="
@@ -0,0 +1,3 @@
1
+ The plan is done. docs/superpowers/plans/auth-system.md has everything.
2
+
3
+ Do subagent-driven development on this - start with Task 1, dispatch a subagent, then we'll review.
@@ -0,0 +1,17 @@
1
+ Great, the plan is complete. I've saved it to docs/superpowers/plans/auth-system.md.
2
+
3
+ Here's a summary of what we designed:
4
+ - Task 1: Add User Model with email/password fields
5
+ - Task 2: Create auth routes for login/register
6
+ - Task 3: Add JWT middleware for protected routes
7
+ - Task 4: Write tests for all auth functionality
8
+
9
+ Two execution options:
10
+ 1. Subagent-Driven (this session) - dispatch a fresh subagent per task
11
+ 2. Parallel Session (separate) - open new Claude Code session
12
+
13
+ Which approach do you want?
14
+
15
+ ---
16
+
17
+ subagent-driven-development, please