superpowers-mcp 6.0.1 → 6.0.3

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.
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env pwsh
2
+ # Extract one task's full text from an implementation plan.
3
+ # Usage: ./task-brief.ps1 PLAN_FILE TASK_NUMBER [OUTFILE]
4
+
5
+ $ErrorActionPreference = "Stop"
6
+
7
+ if ($args.Count -lt 2 -or $args.Count -gt 3) {
8
+ Write-Error "usage: task-brief.ps1 PLAN_FILE TASK_NUMBER [OUTFILE]"
9
+ exit 2
10
+ }
11
+
12
+ $plan = $args[0]
13
+ $taskNumber = $args[1]
14
+ if (-not (Test-Path -LiteralPath $plan -PathType Leaf)) {
15
+ Write-Error "no such plan file: $plan"
16
+ exit 2
17
+ }
18
+
19
+ if ($args.Count -eq 3) {
20
+ $out = $args[2]
21
+ } else {
22
+ $scriptDir = Split-Path -Parent $PSCommandPath
23
+ $dir = (& (Join-Path $scriptDir "sdd-workspace.ps1")).Trim()
24
+ $out = Join-Path $dir "task-$taskNumber-brief.md"
25
+ }
26
+
27
+ $inFence = $false
28
+ $inTask = $false
29
+ $pattern = "^#+[ \t]+Task[ \t]+$([regex]::Escape($taskNumber))([^0-9]|$)"
30
+ $selected = New-Object System.Collections.Generic.List[string]
31
+
32
+ foreach ($line in [System.IO.File]::ReadLines((Resolve-Path -LiteralPath $plan).Path)) {
33
+ if ($line -match '^```') {
34
+ $inFence = -not $inFence
35
+ }
36
+ if (-not $inFence -and $line -match '^#+[ \t]+Task[ \t]+[0-9]+') {
37
+ $inTask = ($line -match $pattern)
38
+ }
39
+ if ($inTask) {
40
+ $selected.Add($line)
41
+ }
42
+ }
43
+
44
+ Set-Content -Path $out -Value $selected -Encoding utf8
45
+ if ((-not (Test-Path -LiteralPath $out)) -or ((Get-Item -LiteralPath $out).Length -eq 0)) {
46
+ Write-Error "task $taskNumber not found in $plan (no heading matching 'Task $taskNumber')"
47
+ exit 3
48
+ }
49
+
50
+ $lineCount = ($selected | Measure-Object).Count
51
+ Write-Output "wrote ${out}: $lineCount lines"
@@ -167,7 +167,8 @@ Subagent (general-purpose):
167
167
 
168
168
  **Placeholders:**
169
169
  - `[MODEL]` — REQUIRED: reviewer model per SKILL.md Model Selection
170
- - `[BRIEF_FILE]` — REQUIRED: the task brief file (`scripts/task-brief PLAN N`
170
+ - `[BRIEF_FILE]` — REQUIRED: the task brief file (`scripts/task-brief PLAN N`,
171
+ or `scripts/task-brief.ps1 PLAN N` on Windows PowerShell,
171
172
  prints the path; same file the implementer worked from)
172
173
  - `[GLOBAL_CONSTRAINTS]` — the binding requirements copied verbatim from
173
174
  the plan's Global Constraints section or the spec: exact values, formats,
@@ -178,7 +179,7 @@ Subagent (general-purpose):
178
179
  - `[BASE_SHA]` — commit before this task
179
180
  - `[HEAD_SHA]` — current commit
180
181
  - `[DIFF_FILE]` — REQUIRED: the path the controller wrote the review
181
- package to (`scripts/review-package BASE HEAD` prints the unique path it
182
+ package to (`scripts/review-package BASE HEAD`, or `scripts/review-package.ps1 BASE HEAD` on Windows PowerShell, prints the unique path it
182
183
  wrote; the package never enters the controller's context)
183
184
 
184
185
  **Reviewer returns:** Spec Compliance verdict (✅/❌/⚠️), Strengths, Issues
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env pwsh
2
+ # Bisection script to find which test creates unwanted files/state.
3
+ # Usage: ./find-polluter.ps1 <file_or_dir_to_check> <test_pattern>
4
+
5
+ $ErrorActionPreference = "Stop"
6
+
7
+ if ($args.Count -ne 2) {
8
+ Write-Output "Usage: ./find-polluter.ps1 <file_to_check> <test_pattern>"
9
+ Write-Output "Example: ./find-polluter.ps1 '.git' 'src/**/*.test.ts'"
10
+ exit 1
11
+ }
12
+
13
+ $pollutionCheck = $args[0]
14
+ $testPattern = $args[1]
15
+
16
+ Write-Output "Searching for test that creates: $pollutionCheck"
17
+ Write-Output "Test pattern: $testPattern"
18
+ Write-Output ""
19
+
20
+ $testFiles = @(Get-ChildItem -Path $testPattern -File -Recurse -ErrorAction SilentlyContinue | Sort-Object FullName)
21
+ if ($testFiles.Count -eq 0) {
22
+ $testFiles = @(Get-ChildItem -Path . -File -Recurse | Where-Object { $_.FullName -like (Join-Path (Get-Location) $testPattern) } | Sort-Object FullName)
23
+ }
24
+
25
+ $total = $testFiles.Count
26
+ Write-Output "Found $total test files"
27
+ Write-Output ""
28
+
29
+ $count = 0
30
+ foreach ($testFile in $testFiles) {
31
+ $count++
32
+
33
+ if (Test-Path -LiteralPath $pollutionCheck) {
34
+ Write-Output "Pollution already exists before test $count/$total"
35
+ Write-Output " Skipping: $($testFile.FullName)"
36
+ continue
37
+ }
38
+
39
+ Write-Output "[$count/$total] Testing: $($testFile.FullName)"
40
+ & npm test $testFile.FullName *> $null
41
+
42
+ if (Test-Path -LiteralPath $pollutionCheck) {
43
+ Write-Output ""
44
+ Write-Output "FOUND POLLUTER"
45
+ Write-Output " Test: $($testFile.FullName)"
46
+ Write-Output " Created: $pollutionCheck"
47
+ Write-Output ""
48
+ Write-Output "Pollution details:"
49
+ Get-ChildItem -Force -LiteralPath $pollutionCheck | Format-List
50
+ Write-Output ""
51
+ Write-Output "To investigate:"
52
+ Write-Output " npm test $($testFile.FullName)"
53
+ Write-Output " Get-Content $($testFile.FullName)"
54
+ exit 1
55
+ }
56
+ }
57
+
58
+ Write-Output ""
59
+ Write-Output "No polluter found - all tests clean."
60
+ exit 0
@@ -18,9 +18,18 @@ echo "🔍 Searching for test that creates: $POLLUTION_CHECK"
18
18
  echo "Test pattern: $TEST_PATTERN"
19
19
  echo ""
20
20
 
21
- # Get list of test files
22
- TEST_FILES=$(find . -path "$TEST_PATTERN" | sort)
23
- TOTAL=$(echo "$TEST_FILES" | wc -l | tr -d ' ')
21
+ # Get list of test files (find . emits ./-prefixed paths, so accept the
22
+ # pattern written with or without a leading ./)
23
+ TEST_PATTERN="${TEST_PATTERN#./}"
24
+ # find -path can't match '**/' against zero directory levels, so a pattern
25
+ # like src/**/*.test.ts would skip src/top.test.ts; also try the pattern
26
+ # with '**/' collapsed to cover files directly under the base directory.
27
+ TEST_FILES=$(find . \( -path "./$TEST_PATTERN" -o -path "./${TEST_PATTERN//\*\*\//}" \) | sort -u)
28
+ if [ -z "$TEST_FILES" ]; then
29
+ TOTAL=0
30
+ else
31
+ TOTAL=$(printf '%s\n' "$TEST_FILES" | wc -l | tr -d ' ')
32
+ fi
24
33
 
25
34
  echo "Found $TOTAL test files"
26
35
  echo ""
@@ -102,6 +102,9 @@ Use the bisection script `find-polluter.sh` in this directory:
102
102
 
103
103
  ```bash
104
104
  ./find-polluter.sh '.git' 'src/**/*.test.ts'
105
+
106
+ # Windows PowerShell:
107
+ ./find-polluter.ps1 '.git' 'src/**/*.test.ts'
105
108
  ```
106
109
 
107
110
  Runs tests one-by-one, stops at first polluter. See script for usage.
@@ -198,7 +198,7 @@ Next failing test for next feature.
198
198
  ## Good Tests
199
199
 
200
200
  | Quality | Good | Bad |
201
- |---------|------|---------|
201
+ |---------|------|-----|
202
202
  | **Minimal** | One thing. "and" in name? Split it. | `test('validates email and domain and whitespace')` |
203
203
  | **Clear** | Name describes behavior | `test('test1')` |
204
204
  | **Shows intent** | Demonstrates desired API | Obscures what code should do |
@@ -467,7 +467,7 @@ Before writing guidance, classify the baseline failure. The form that bulletproo
467
467
  | Omits a required element from something they already produce | Structural: REQUIRED field or slot in the template they fill in | Prose reminders near the template |
468
468
  | Behavior should depend on a condition | Conditional keyed to an observable predicate ("if the brief exists, reference it") | Unconditional rule + exemption clauses |
469
469
 
470
- **Why prohibitions backfire on shaping problems:** in head-to-head wording tests on dispatch-prompt guidance, the prohibition arm produced more unwanted content than the recipe arm — and trended worse than the no-guidance control. Micro-test your own case rather than assuming. A recipe leaves nothing to negotiate: the output matches the stated shape or it doesn't.
470
+ **Why prohibitions backfire on shaping problems:** under a competing incentive ("make the prompt self-contained"), agents negotiate with "don't X". In head-to-head wording tests on dispatch-prompt guidance, the prohibition arm produced clearly more of the unwanted content than the recipe arm (fully separated distributions), and trended worse than even the no-guidance control — micro-test your own case rather than assuming, but never reach for the prohibition by default. A recipe leaves nothing to negotiate: the output matches the stated shape or it doesn't.
471
471
 
472
472
  **Rules for whichever form you pick:**
473
473
  - **No nuance clauses.** "Don't X unless it matters" reopens the negotiation — appending a single nuance clause to a winning recipe degraded it from consistent to noisy in the same wording tests. Express a real exception as its own conditional on an observable predicate.
@@ -250,7 +250,7 @@ A basic Skill starts with just a SKILL.md file containing metadata and instructi
250
250
 
251
251
  As your Skill grows, you can bundle additional content that agents load only when needed:
252
252
 
253
- <img src="https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-bundling-content.png?fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=a5e0aa41e3d53985a7e3e43668a33ea3" alt="Bundling additional reference files like reference.md and forms.md." data-og-width="2048" width="2048" data-og-height="1327" height="1327" data-path="images/agent-skills-bundling-content.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-bundling-content.png?w=280&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=f8a0e73783e99b4a643d79eac86b70a2 280w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-bundling-content.png?w=560&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=dc510a2a9d3f14359416b706f067904a 560w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-bundling-content.png?w=840&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=82cd6286c966303f7dd914c28170e385 840w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-bundling-content.png?w=1100&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=56f3be36c77e4fe4b523df209a6824c6 1100w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-bundling-content.png?w=1650&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=d22b5161b2075656417d56f41a74f3dd 1650w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-bundling-content.png?w=2500&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=3dd4bdd6850ffcc26c6c45fcb0acd6eb 2500w" />
253
+ <img src="https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-bundling-content.png?fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=a5e0aa41e3d53985a7e3e43668a33ea3" alt="Bundling additional reference files like reference.md and forms.md." data-og-width="2048" width="2048" data-og-height="1327" height="1327" data-path="images/agent-skills-bundling-content.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-bundling-content.png?w=280&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=f8a0e73783e99b4a643d79eac86b70a2 280w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-bundling-content.png?w=560&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=dc510a2a9d3f14359416b706f067904a 560w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-bundling-content.png?w=840&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=82cd6286c966303f7dd914c28170e385 840w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-bundling-content.png?w=1100&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=56f3be36c77e4fe4b523df209a6824c6 1100w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-bundling-content.png?w=1650&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=d22b5161b2075656417d56f41a74f3dd 1650w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-bundling-content.png?w=2500&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=3dd4bdd6850ffcc96c6c45fcb0acd6eb 2500w" />
254
254
 
255
255
  The complete Skill directory structure might look like this:
256
256
 
@@ -916,7 +916,7 @@ Even if your agent could write a script, pre-made scripts offer advantages:
916
916
  * Save time (no code generation required)
917
917
  * Ensure consistency across uses
918
918
 
919
- <img src="https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-executable-scripts.png?fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=4bbc45f2c2e0bee9f2f0d5da669bad00" alt="Bundling executable scripts alongside instruction files" data-og-width="2048" width="2048" data-og-height="1154" height="1154" data-path="images/agent-skills-executable-scripts.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-executable-scripts.png?w=280&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=9a04e6535a8467bfeea492e517de389f 280w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-executable-scripts.png?w=560&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=e49333ad90141af17c0d7651cca7216b 560w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-executable-scripts.png?w=840&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=954265a5df52223d6572b6214168c428 840w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-executable-scripts.png?w=1100&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=2ff7a2d8f2a83ee8af132b29f10150fd 1100w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-executable-scripts.png?w=1650&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=48ab96245e04077f4d15e9170e094cfb 1650w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-executable-scripts.png?w=2500&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=0301a6c8b3ee879497cc5b5483177c90 2500w" />
919
+ <img src="https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-executable-scripts.png?fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=4bbc45f2c2e0bee9f2f0d5da669bad00" alt="Bundling executable scripts alongside instruction files" data-og-width="2048" width="2048" data-og-height="1154" height="1154" data-path="images/agent-skills-executable-scripts.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-executable-scripts.png?w=280&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=9a04e6535a8467bfeea492e517de389f 280w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-executable-scripts.png?w=560&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=e49333ad90141af17c0d7651cca7216b 560w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-executable-scripts.png?w=840&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=954265a5df52223d6572b6214168c428 840w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-executable-scripts.png?w=1100&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=2ff7a2d8f2a83ee8af132b29f10150fd 1100w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-executable-scripts.png?w=1650&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=48ab96245e04077f4d15e9170e081cfb 1650w, https://mintcdn.com/anthropic-claude-docs/4Bny2bjzuGBK7o00/images/agent-skills-executable-scripts.png?w=2500&fit=max&auto=format&n=4Bny2bjzuGBK7o00&q=85&s=0301a6c8b3ee879497cc5b5483177c90 2500w" />
920
920
 
921
921
  The diagram above shows how executable scripts work alongside instruction files. The instruction file (forms.md) references the script, and the agent can execute it without loading its contents into context.
922
922