Compare commits

..
7 Commits
Author SHA1 Message Date
Ahmad Othman Ammar Adi. 17029df2f0 docs: add raykuo998 to contributors (PR #86, PR #88) 2026-02-28 01:08:22 +01:00
Ahmad Othman Ammar Adi. d8e7837d2b docs: add v2.18.3 changelog entry (Windows hook fixes by raykuo998) 2026-02-28 01:08:21 +01:00
Ahmad Othman Ammar Adi. 65e0fcf42d fix: Stop hook multiline YAML command not parsed by Git Bash on Windows
fix: Stop hook fails on Windows — multiline YAML command not parsed by Git Bash
2026-02-28 01:07:08 +01:00
Ahmad Othman Ammar Adi. 5f41ac00fe Merge pull request #88 from raykuo998/fix/check-complete-ps1-parsing 2026-02-27 10:48:27 +01:00
guo-feng-rui 7cfa786e35 fix: check-complete.ps1 fails to parse on PowerShell due to special characters
PowerShell's parser fails on three categories of special characters inside
double-quoted strings in check-complete.ps1:

1. UTF-8 em-dash (U+2014) in comments — misinterpreted as code tokens
2. Square brackets [planning-with-files] — parsed as array index syntax
3. Parentheses ($COMPLETE/$TOTAL) and phase(s) — parsed as subexpressions

Fix: replace double-quoted Write-Host strings with single-quoted strings
and string concatenation, and replace em-dashes with ASCII double-hyphens.

Applied to all 12 tool variant copies (adal, codebuddy, codex, continue,
gemini, kiro, mastracode, openclaw, opencode, pi, scripts, skills).

Verified on Windows 11 with PowerShell 5.1 — all scenarios pass.

Closes #87
2026-02-27 16:17:24 +08:00
guo-feng-rui 6cc1584671 fix: restore mastracode relative-path fallback for project-local installs
The original mastracode variant had a two-step path resolution that fell
back to a project-relative path if the $HOME-based path didn't exist.
This was dropped in the previous commit. Restore it to preserve support
for project-local mastracode installations.
2026-02-27 12:09:35 +08:00
guo-feng-rui f2f05478bb fix: Stop hook fails on Windows — multiline YAML command not parsed by Git Bash
The Stop hook used a YAML multiline block (command: |) with a 25-line bash
script for OS detection and script dispatch. On Windows, Claude Code passes
hook commands through Git Bash, which fails to parse the multiline content —
the SCRIPT_DIR=... variable assignment is interpreted as a command name rather
than a shell assignment, producing:

  bash: SCRIPT_DIR=/c/Users/.../scripts: No such file or directory
  sh: /check-complete.sh: No such file or directory

Replace the multiline block with a single-line command that:
1. Sets SD variable inline (works in all sh-compatible shells)
2. Tries powershell.exe first (covers Windows)
3. Falls back to sh (covers Linux/macOS)

This eliminates the OS-detection logic entirely — the fallback chain handles
platform differences implicitly. Applied to all 7 tool variants (claude,
cursor, codex, codebuddy, kilocode, mastracode, opencode).
2026-02-27 12:04:16 +08:00
21 changed files with 115 additions and 261 deletions
@@ -1,5 +1,5 @@
# Check if all phases in task_plan.md are complete
# Always exits 0 — uses stdout for status reporting
# Always exits 0 -- uses stdout for status reporting
# Used by Stop hook to report task completion status
param(
@@ -7,7 +7,7 @@ param(
)
if (-not (Test-Path $PlanFile)) {
Write-Host "[planning-with-files] No task_plan.md found — no active planning session."
Write-Host '[planning-with-files] No task_plan.md found -- no active planning session.'
exit 0
}
@@ -29,16 +29,16 @@ if ($COMPLETE -eq 0 -and $IN_PROGRESS -eq 0 -and $PENDING -eq 0) {
$PENDING = ([regex]::Matches($content, "\[pending\]")).Count
}
# Report status (always exit 0 — incomplete task is a normal state)
# Report status -- always exit 0, incomplete task is a normal state
if ($COMPLETE -eq $TOTAL -and $TOTAL -gt 0) {
Write-Host "[planning-with-files] ALL PHASES COMPLETE ($COMPLETE/$TOTAL)"
Write-Host ('[planning-with-files] ALL PHASES COMPLETE (' + $COMPLETE + '/' + $TOTAL + ')')
} else {
Write-Host "[planning-with-files] Task in progress ($COMPLETE/$TOTAL phases complete)"
Write-Host ('[planning-with-files] Task in progress (' + $COMPLETE + '/' + $TOTAL + ' phases complete)')
if ($IN_PROGRESS -gt 0) {
Write-Host "[planning-with-files] $IN_PROGRESS phase(s) still in progress."
Write-Host ('[planning-with-files] ' + $IN_PROGRESS + ' phase(s) still in progress.')
}
if ($PENDING -gt 0) {
Write-Host "[planning-with-files] $PENDING phase(s) pending."
Write-Host ('[planning-with-files] ' + $PENDING + ' phase(s) pending.')
}
}
exit 0
+1 -25
View File
@@ -17,31 +17,7 @@ hooks:
Stop:
- hooks:
- type: command
command: |
SCRIPT_DIR="${CODEBUDDY_PLUGIN_ROOT:-$HOME/.codebuddy/skills/planning-with-files}/scripts"
IS_WINDOWS=0
if [ "${OS-}" = "Windows_NT" ]; then
IS_WINDOWS=1
else
UNAME_S="$(uname -s 2>/dev/null || echo '')"
case "$UNAME_S" in
CYGWIN*|MINGW*|MSYS*) IS_WINDOWS=1 ;;
esac
fi
if [ "$IS_WINDOWS" -eq 1 ]; then
if command -v pwsh >/dev/null 2>&1; then
pwsh -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
powershell -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
sh "$SCRIPT_DIR/check-complete.sh"
else
powershell -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
sh "$SCRIPT_DIR/check-complete.sh"
fi
else
sh "$SCRIPT_DIR/check-complete.sh"
fi
command: "SD=\"${CODEBUDDY_PLUGIN_ROOT:-$HOME/.codebuddy/skills/planning-with-files}/scripts\"; powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"$SD/check-complete.ps1\" 2>/dev/null || sh \"$SD/check-complete.sh\""
metadata:
version: "2.16.1"
---
@@ -1,5 +1,5 @@
# Check if all phases in task_plan.md are complete
# Always exits 0 — uses stdout for status reporting
# Always exits 0 -- uses stdout for status reporting
# Used by Stop hook to report task completion status
param(
@@ -7,7 +7,7 @@ param(
)
if (-not (Test-Path $PlanFile)) {
Write-Host "[planning-with-files] No task_plan.md found — no active planning session."
Write-Host '[planning-with-files] No task_plan.md found -- no active planning session.'
exit 0
}
@@ -29,16 +29,16 @@ if ($COMPLETE -eq 0 -and $IN_PROGRESS -eq 0 -and $PENDING -eq 0) {
$PENDING = ([regex]::Matches($content, "\[pending\]")).Count
}
# Report status (always exit 0 — incomplete task is a normal state)
# Report status -- always exit 0, incomplete task is a normal state
if ($COMPLETE -eq $TOTAL -and $TOTAL -gt 0) {
Write-Host "[planning-with-files] ALL PHASES COMPLETE ($COMPLETE/$TOTAL)"
Write-Host ('[planning-with-files] ALL PHASES COMPLETE (' + $COMPLETE + '/' + $TOTAL + ')')
} else {
Write-Host "[planning-with-files] Task in progress ($COMPLETE/$TOTAL phases complete)"
Write-Host ('[planning-with-files] Task in progress (' + $COMPLETE + '/' + $TOTAL + ' phases complete)')
if ($IN_PROGRESS -gt 0) {
Write-Host "[planning-with-files] $IN_PROGRESS phase(s) still in progress."
Write-Host ('[planning-with-files] ' + $IN_PROGRESS + ' phase(s) still in progress.')
}
if ($PENDING -gt 0) {
Write-Host "[planning-with-files] $PENDING phase(s) pending."
Write-Host ('[planning-with-files] ' + $PENDING + ' phase(s) pending.')
}
}
exit 0
+1 -25
View File
@@ -17,31 +17,7 @@ hooks:
Stop:
- hooks:
- type: command
command: |
SCRIPT_DIR="${CODEX_SKILL_ROOT:-$HOME/.codex/skills/planning-with-files}/scripts"
IS_WINDOWS=0
if [ "${OS-}" = "Windows_NT" ]; then
IS_WINDOWS=1
else
UNAME_S="$(uname -s 2>/dev/null || echo '')"
case "$UNAME_S" in
CYGWIN*|MINGW*|MSYS*) IS_WINDOWS=1 ;;
esac
fi
if [ "$IS_WINDOWS" -eq 1 ]; then
if command -v pwsh >/dev/null 2>&1; then
pwsh -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
powershell -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
sh "$SCRIPT_DIR/check-complete.sh"
else
powershell -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
sh "$SCRIPT_DIR/check-complete.sh"
fi
else
sh "$SCRIPT_DIR/check-complete.sh"
fi
command: "SD=\"${CODEX_SKILL_ROOT:-$HOME/.codex/skills/planning-with-files}/scripts\"; powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"$SD/check-complete.ps1\" 2>/dev/null || sh \"$SD/check-complete.sh\""
metadata:
version: "2.16.1"
---
@@ -1,5 +1,5 @@
# Check if all phases in task_plan.md are complete
# Always exits 0 — uses stdout for status reporting
# Always exits 0 -- uses stdout for status reporting
# Used by Stop hook to report task completion status
param(
@@ -7,7 +7,7 @@ param(
)
if (-not (Test-Path $PlanFile)) {
Write-Host "[planning-with-files] No task_plan.md found — no active planning session."
Write-Host '[planning-with-files] No task_plan.md found -- no active planning session.'
exit 0
}
@@ -29,16 +29,16 @@ if ($COMPLETE -eq 0 -and $IN_PROGRESS -eq 0 -and $PENDING -eq 0) {
$PENDING = ([regex]::Matches($content, "\[pending\]")).Count
}
# Report status (always exit 0 — incomplete task is a normal state)
# Report status -- always exit 0, incomplete task is a normal state
if ($COMPLETE -eq $TOTAL -and $TOTAL -gt 0) {
Write-Host "[planning-with-files] ALL PHASES COMPLETE ($COMPLETE/$TOTAL)"
Write-Host ('[planning-with-files] ALL PHASES COMPLETE (' + $COMPLETE + '/' + $TOTAL + ')')
} else {
Write-Host "[planning-with-files] Task in progress ($COMPLETE/$TOTAL phases complete)"
Write-Host ('[planning-with-files] Task in progress (' + $COMPLETE + '/' + $TOTAL + ' phases complete)')
if ($IN_PROGRESS -gt 0) {
Write-Host "[planning-with-files] $IN_PROGRESS phase(s) still in progress."
Write-Host ('[planning-with-files] ' + $IN_PROGRESS + ' phase(s) still in progress.')
}
if ($PENDING -gt 0) {
Write-Host "[planning-with-files] $PENDING phase(s) pending."
Write-Host ('[planning-with-files] ' + $PENDING + ' phase(s) pending.')
}
}
exit 0
@@ -1,5 +1,5 @@
# Check if all phases in task_plan.md are complete
# Always exits 0 — uses stdout for status reporting
# Always exits 0 -- uses stdout for status reporting
# Used by Stop hook to report task completion status
param(
@@ -7,7 +7,7 @@ param(
)
if (-not (Test-Path $PlanFile)) {
Write-Host "[planning-with-files] No task_plan.md found — no active planning session."
Write-Host '[planning-with-files] No task_plan.md found -- no active planning session.'
exit 0
}
@@ -29,16 +29,16 @@ if ($COMPLETE -eq 0 -and $IN_PROGRESS -eq 0 -and $PENDING -eq 0) {
$PENDING = ([regex]::Matches($content, "\[pending\]")).Count
}
# Report status (always exit 0 — incomplete task is a normal state)
# Report status -- always exit 0, incomplete task is a normal state
if ($COMPLETE -eq $TOTAL -and $TOTAL -gt 0) {
Write-Host "[planning-with-files] ALL PHASES COMPLETE ($COMPLETE/$TOTAL)"
Write-Host ('[planning-with-files] ALL PHASES COMPLETE (' + $COMPLETE + '/' + $TOTAL + ')')
} else {
Write-Host "[planning-with-files] Task in progress ($COMPLETE/$TOTAL phases complete)"
Write-Host ('[planning-with-files] Task in progress (' + $COMPLETE + '/' + $TOTAL + ' phases complete)')
if ($IN_PROGRESS -gt 0) {
Write-Host "[planning-with-files] $IN_PROGRESS phase(s) still in progress."
Write-Host ('[planning-with-files] ' + $IN_PROGRESS + ' phase(s) still in progress.')
}
if ($PENDING -gt 0) {
Write-Host "[planning-with-files] $PENDING phase(s) pending."
Write-Host ('[planning-with-files] ' + $PENDING + ' phase(s) pending.')
}
}
exit 0
+1 -25
View File
@@ -17,31 +17,7 @@ hooks:
Stop:
- hooks:
- type: command
command: |
SCRIPT_DIR="${CURSOR_SKILL_ROOT:-.cursor/skills/planning-with-files}/scripts"
IS_WINDOWS=0
if [ "${OS-}" = "Windows_NT" ]; then
IS_WINDOWS=1
else
UNAME_S="$(uname -s 2>/dev/null || echo '')"
case "$UNAME_S" in
CYGWIN*|MINGW*|MSYS*) IS_WINDOWS=1 ;;
esac
fi
if [ "$IS_WINDOWS" -eq 1 ]; then
if command -v pwsh >/dev/null 2>&1; then
pwsh -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
powershell -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
sh "$SCRIPT_DIR/check-complete.sh"
else
powershell -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
sh "$SCRIPT_DIR/check-complete.sh"
fi
else
sh "$SCRIPT_DIR/check-complete.sh"
fi
command: "SD=\"${CURSOR_SKILL_ROOT:-.cursor/skills/planning-with-files}/scripts\"; powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"$SD/check-complete.ps1\" 2>/dev/null || sh \"$SD/check-complete.sh\""
metadata:
version: "2.16.1"
---
@@ -1,5 +1,5 @@
# Check if all phases in task_plan.md are complete
# Always exits 0 — uses stdout for status reporting
# Always exits 0 -- uses stdout for status reporting
# Used by Stop hook to report task completion status
param(
@@ -7,7 +7,7 @@ param(
)
if (-not (Test-Path $PlanFile)) {
Write-Host "[planning-with-files] No task_plan.md found — no active planning session."
Write-Host '[planning-with-files] No task_plan.md found -- no active planning session.'
exit 0
}
@@ -29,16 +29,16 @@ if ($COMPLETE -eq 0 -and $IN_PROGRESS -eq 0 -and $PENDING -eq 0) {
$PENDING = ([regex]::Matches($content, "\[pending\]")).Count
}
# Report status (always exit 0 — incomplete task is a normal state)
# Report status -- always exit 0, incomplete task is a normal state
if ($COMPLETE -eq $TOTAL -and $TOTAL -gt 0) {
Write-Host "[planning-with-files] ALL PHASES COMPLETE ($COMPLETE/$TOTAL)"
Write-Host ('[planning-with-files] ALL PHASES COMPLETE (' + $COMPLETE + '/' + $TOTAL + ')')
} else {
Write-Host "[planning-with-files] Task in progress ($COMPLETE/$TOTAL phases complete)"
Write-Host ('[planning-with-files] Task in progress (' + $COMPLETE + '/' + $TOTAL + ' phases complete)')
if ($IN_PROGRESS -gt 0) {
Write-Host "[planning-with-files] $IN_PROGRESS phase(s) still in progress."
Write-Host ('[planning-with-files] ' + $IN_PROGRESS + ' phase(s) still in progress.')
}
if ($PENDING -gt 0) {
Write-Host "[planning-with-files] $PENDING phase(s) pending."
Write-Host ('[planning-with-files] ' + $PENDING + ' phase(s) pending.')
}
}
exit 0
+1 -25
View File
@@ -17,31 +17,7 @@ hooks:
Stop:
- hooks:
- type: command
command: |
SCRIPT_DIR="${KILOCODE_SKILL_ROOT:-$HOME/.kilocode/skills/planning-with-files}/scripts"
IS_WINDOWS=0
if [ "${OS-}" = "Windows_NT" ]; then
IS_WINDOWS=1
else
UNAME_S="$(uname -s 2>/dev/null || echo '')"
case "$UNAME_S" in
CYGWIN*|MINGW*|MSYS*) IS_WINDOWS=1 ;;
esac
fi
if [ "$IS_WINDOWS" -eq 1 ]; then
if command -v pwsh >/dev/null 2>&1; then
pwsh -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
powershell -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
sh "$SCRIPT_DIR/check-complete.sh"
else
powershell -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
sh "$SCRIPT_DIR/check-complete.sh"
fi
else
sh "$SCRIPT_DIR/check-complete.sh"
fi
command: "SD=\"${KILOCODE_SKILL_ROOT:-$HOME/.kilocode/skills/planning-with-files}/scripts\"; powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"$SD/check-complete.ps1\" 2>/dev/null || sh \"$SD/check-complete.sh\""
metadata:
version: "2.16.1"
---
+7 -7
View File
@@ -1,5 +1,5 @@
# Check if all phases in task_plan.md are complete
# Always exits 0 — uses stdout for status reporting
# Always exits 0 -- uses stdout for status reporting
# Used by Stop hook to report task completion status
param(
@@ -7,7 +7,7 @@ param(
)
if (-not (Test-Path $PlanFile)) {
Write-Host "[planning-with-files] No task_plan.md found — no active planning session."
Write-Host '[planning-with-files] No task_plan.md found -- no active planning session.'
exit 0
}
@@ -29,16 +29,16 @@ if ($COMPLETE -eq 0 -and $IN_PROGRESS -eq 0 -and $PENDING -eq 0) {
$PENDING = ([regex]::Matches($content, "\[pending\]")).Count
}
# Report status (always exit 0 — incomplete task is a normal state)
# Report status -- always exit 0, incomplete task is a normal state
if ($COMPLETE -eq $TOTAL -and $TOTAL -gt 0) {
Write-Host "[planning-with-files] ALL PHASES COMPLETE ($COMPLETE/$TOTAL)"
Write-Host ('[planning-with-files] ALL PHASES COMPLETE (' + $COMPLETE + '/' + $TOTAL + ')')
} else {
Write-Host "[planning-with-files] Task in progress ($COMPLETE/$TOTAL phases complete)"
Write-Host ('[planning-with-files] Task in progress (' + $COMPLETE + '/' + $TOTAL + ' phases complete)')
if ($IN_PROGRESS -gt 0) {
Write-Host "[planning-with-files] $IN_PROGRESS phase(s) still in progress."
Write-Host ('[planning-with-files] ' + $IN_PROGRESS + ' phase(s) still in progress.')
}
if ($PENDING -gt 0) {
Write-Host "[planning-with-files] $PENDING phase(s) pending."
Write-Host ('[planning-with-files] ' + $PENDING + ' phase(s) pending.')
}
}
exit 0
@@ -17,32 +17,7 @@ hooks:
Stop:
- hooks:
- type: command
command: |
SCRIPT_DIR="${HOME}/.mastracode/skills/planning-with-files/scripts"
[ -f "$SCRIPT_DIR/check-complete.sh" ] || SCRIPT_DIR=".mastracode/skills/planning-with-files/scripts"
IS_WINDOWS=0
if [ "${OS-}" = "Windows_NT" ]; then
IS_WINDOWS=1
else
UNAME_S="$(uname -s 2>/dev/null || echo '')"
case "$UNAME_S" in
CYGWIN*|MINGW*|MSYS*) IS_WINDOWS=1 ;;
esac
fi
if [ "$IS_WINDOWS" -eq 1 ]; then
if command -v pwsh >/dev/null 2>&1; then
pwsh -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
powershell -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
sh "$SCRIPT_DIR/check-complete.sh"
else
powershell -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
sh "$SCRIPT_DIR/check-complete.sh"
fi
else
sh "$SCRIPT_DIR/check-complete.sh"
fi
command: "SD=\"$HOME/.mastracode/skills/planning-with-files/scripts\"; [ -f \"$SD/check-complete.sh\" ] || SD=\".mastracode/skills/planning-with-files/scripts\"; powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"$SD/check-complete.ps1\" 2>/dev/null || sh \"$SD/check-complete.sh\""
metadata:
version: "2.18.1"
---
@@ -1,5 +1,5 @@
# Check if all phases in task_plan.md are complete
# Always exits 0 — uses stdout for status reporting
# Always exits 0 -- uses stdout for status reporting
# Used by Stop hook to report task completion status
param(
@@ -7,7 +7,7 @@ param(
)
if (-not (Test-Path $PlanFile)) {
Write-Host "[planning-with-files] No task_plan.md found — no active planning session."
Write-Host '[planning-with-files] No task_plan.md found -- no active planning session.'
exit 0
}
@@ -29,16 +29,16 @@ if ($COMPLETE -eq 0 -and $IN_PROGRESS -eq 0 -and $PENDING -eq 0) {
$PENDING = ([regex]::Matches($content, "\[pending\]")).Count
}
# Report status (always exit 0 — incomplete task is a normal state)
# Report status -- always exit 0, incomplete task is a normal state
if ($COMPLETE -eq $TOTAL -and $TOTAL -gt 0) {
Write-Host "[planning-with-files] ALL PHASES COMPLETE ($COMPLETE/$TOTAL)"
Write-Host ('[planning-with-files] ALL PHASES COMPLETE (' + $COMPLETE + '/' + $TOTAL + ')')
} else {
Write-Host "[planning-with-files] Task in progress ($COMPLETE/$TOTAL phases complete)"
Write-Host ('[planning-with-files] Task in progress (' + $COMPLETE + '/' + $TOTAL + ' phases complete)')
if ($IN_PROGRESS -gt 0) {
Write-Host "[planning-with-files] $IN_PROGRESS phase(s) still in progress."
Write-Host ('[planning-with-files] ' + $IN_PROGRESS + ' phase(s) still in progress.')
}
if ($PENDING -gt 0) {
Write-Host "[planning-with-files] $PENDING phase(s) pending."
Write-Host ('[planning-with-files] ' + $PENDING + ' phase(s) pending.')
}
}
exit 0
@@ -1,5 +1,5 @@
# Check if all phases in task_plan.md are complete
# Always exits 0 — uses stdout for status reporting
# Always exits 0 -- uses stdout for status reporting
# Used by Stop hook to report task completion status
param(
@@ -7,7 +7,7 @@ param(
)
if (-not (Test-Path $PlanFile)) {
Write-Host "[planning-with-files] No task_plan.md found — no active planning session."
Write-Host '[planning-with-files] No task_plan.md found -- no active planning session.'
exit 0
}
@@ -29,16 +29,16 @@ if ($COMPLETE -eq 0 -and $IN_PROGRESS -eq 0 -and $PENDING -eq 0) {
$PENDING = ([regex]::Matches($content, "\[pending\]")).Count
}
# Report status (always exit 0 — incomplete task is a normal state)
# Report status -- always exit 0, incomplete task is a normal state
if ($COMPLETE -eq $TOTAL -and $TOTAL -gt 0) {
Write-Host "[planning-with-files] ALL PHASES COMPLETE ($COMPLETE/$TOTAL)"
Write-Host ('[planning-with-files] ALL PHASES COMPLETE (' + $COMPLETE + '/' + $TOTAL + ')')
} else {
Write-Host "[planning-with-files] Task in progress ($COMPLETE/$TOTAL phases complete)"
Write-Host ('[planning-with-files] Task in progress (' + $COMPLETE + '/' + $TOTAL + ' phases complete)')
if ($IN_PROGRESS -gt 0) {
Write-Host "[planning-with-files] $IN_PROGRESS phase(s) still in progress."
Write-Host ('[planning-with-files] ' + $IN_PROGRESS + ' phase(s) still in progress.')
}
if ($PENDING -gt 0) {
Write-Host "[planning-with-files] $PENDING phase(s) pending."
Write-Host ('[planning-with-files] ' + $PENDING + ' phase(s) pending.')
}
}
exit 0
+1 -25
View File
@@ -17,31 +17,7 @@ hooks:
Stop:
- hooks:
- type: command
command: |
SCRIPT_DIR="${OPENCODE_SKILL_ROOT:-$HOME/.config/opencode/skills/planning-with-files}/scripts"
IS_WINDOWS=0
if [ "${OS-}" = "Windows_NT" ]; then
IS_WINDOWS=1
else
UNAME_S="$(uname -s 2>/dev/null || echo '')"
case "$UNAME_S" in
CYGWIN*|MINGW*|MSYS*) IS_WINDOWS=1 ;;
esac
fi
if [ "$IS_WINDOWS" -eq 1 ]; then
if command -v pwsh >/dev/null 2>&1; then
pwsh -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
powershell -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
sh "$SCRIPT_DIR/check-complete.sh"
else
powershell -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
sh "$SCRIPT_DIR/check-complete.sh"
fi
else
sh "$SCRIPT_DIR/check-complete.sh"
fi
command: "SD=\"${OPENCODE_SKILL_ROOT:-$HOME/.config/opencode/skills/planning-with-files}/scripts\"; powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"$SD/check-complete.ps1\" 2>/dev/null || sh \"$SD/check-complete.sh\""
metadata:
version: "2.16.1"
---
@@ -1,5 +1,5 @@
# Check if all phases in task_plan.md are complete
# Always exits 0 — uses stdout for status reporting
# Always exits 0 -- uses stdout for status reporting
# Used by Stop hook to report task completion status
param(
@@ -7,7 +7,7 @@ param(
)
if (-not (Test-Path $PlanFile)) {
Write-Host "[planning-with-files] No task_plan.md found — no active planning session."
Write-Host '[planning-with-files] No task_plan.md found -- no active planning session.'
exit 0
}
@@ -29,16 +29,16 @@ if ($COMPLETE -eq 0 -and $IN_PROGRESS -eq 0 -and $PENDING -eq 0) {
$PENDING = ([regex]::Matches($content, "\[pending\]")).Count
}
# Report status (always exit 0 — incomplete task is a normal state)
# Report status -- always exit 0, incomplete task is a normal state
if ($COMPLETE -eq $TOTAL -and $TOTAL -gt 0) {
Write-Host "[planning-with-files] ALL PHASES COMPLETE ($COMPLETE/$TOTAL)"
Write-Host ('[planning-with-files] ALL PHASES COMPLETE (' + $COMPLETE + '/' + $TOTAL + ')')
} else {
Write-Host "[planning-with-files] Task in progress ($COMPLETE/$TOTAL phases complete)"
Write-Host ('[planning-with-files] Task in progress (' + $COMPLETE + '/' + $TOTAL + ' phases complete)')
if ($IN_PROGRESS -gt 0) {
Write-Host "[planning-with-files] $IN_PROGRESS phase(s) still in progress."
Write-Host ('[planning-with-files] ' + $IN_PROGRESS + ' phase(s) still in progress.')
}
if ($PENDING -gt 0) {
Write-Host "[planning-with-files] $PENDING phase(s) pending."
Write-Host ('[planning-with-files] ' + $PENDING + ' phase(s) pending.')
}
}
exit 0
@@ -1,5 +1,5 @@
# Check if all phases in task_plan.md are complete
# Always exits 0 — uses stdout for status reporting
# Always exits 0 -- uses stdout for status reporting
# Used by Stop hook to report task completion status
param(
@@ -7,7 +7,7 @@ param(
)
if (-not (Test-Path $PlanFile)) {
Write-Host "[planning-with-files] No task_plan.md found — no active planning session."
Write-Host '[planning-with-files] No task_plan.md found -- no active planning session.'
exit 0
}
@@ -29,16 +29,16 @@ if ($COMPLETE -eq 0 -and $IN_PROGRESS -eq 0 -and $PENDING -eq 0) {
$PENDING = ([regex]::Matches($content, "\[pending\]")).Count
}
# Report status (always exit 0 — incomplete task is a normal state)
# Report status -- always exit 0, incomplete task is a normal state
if ($COMPLETE -eq $TOTAL -and $TOTAL -gt 0) {
Write-Host "[planning-with-files] ALL PHASES COMPLETE ($COMPLETE/$TOTAL)"
Write-Host ('[planning-with-files] ALL PHASES COMPLETE (' + $COMPLETE + '/' + $TOTAL + ')')
} else {
Write-Host "[planning-with-files] Task in progress ($COMPLETE/$TOTAL phases complete)"
Write-Host ('[planning-with-files] Task in progress (' + $COMPLETE + '/' + $TOTAL + ' phases complete)')
if ($IN_PROGRESS -gt 0) {
Write-Host "[planning-with-files] $IN_PROGRESS phase(s) still in progress."
Write-Host ('[planning-with-files] ' + $IN_PROGRESS + ' phase(s) still in progress.')
}
if ($PENDING -gt 0) {
Write-Host "[planning-with-files] $PENDING phase(s) pending."
Write-Host ('[planning-with-files] ' + $PENDING + ' phase(s) pending.')
}
}
exit 0
+19
View File
@@ -2,6 +2,25 @@
All notable changes to this project will be documented in this file.
## [2.18.3] - 2026-02-28
### Fixed
- **Stop hook multiline YAML command fails under Git Bash on Windows** (PR #86 by @raykuo998)
- Root cause: YAML `command: |` multiline blocks are not reliably parsed by Git Bash on Windows. The shell received the first line (`SCRIPT_DIR=...`) as a command name rather than a variable assignment, crashing the hook before it could do anything.
- Replaced 25-line OS detection scripts with a single-line implicit platform fallback chain: `powershell.exe` first, `sh` as fallback. Applied to all 7 SKILL.md variants with Stop hooks.
- Added `-NoProfile` to PowerShell invocation for faster startup
- **`check-complete.ps1` completely failing on PowerShell 5.1** (PR #88 by @raykuo998)
- Root cause: Special characters inside double-quoted `Write-Host` strings (`[`, `(`, em-dash) caused parse errors in Windows PowerShell 5.1
- Replaced double-quoted strings with single-quoted strings plus explicit concatenation for variable interpolation. Applied to all 12 platform copies.
### Thanks
- @raykuo998 for both Windows compatibility fixes (PR #86, PR #88)
---
## [2.18.2] - 2026-02-26
### Fixed
+5 -1
View File
@@ -61,6 +61,10 @@ These amazing people have contributed code, documentation, or significant improv
### Other Contributors
- **[@raykuo998](https://github.com/raykuo998)** - [PR #88](https://github.com/OthmanAdi/planning-with-files/pull/88), [PR #86](https://github.com/OthmanAdi/planning-with-files/pull/86)
- Fixed `check-complete.ps1` completely failing on PowerShell 5.1 due to special character parse errors in double-quoted strings; switched to single-quoted strings with concatenation across all 12 platform copies (PR #88)
- Fixed Stop hook YAML multiline command block failing under Git Bash on Windows; collapsed 25-line OS detection to single-line implicit platform fallback chain across all 7 SKILL.md variants (PR #86)
- **[@gydx6](https://github.com/gydx6)** - [PR #79](https://github.com/OthmanAdi/planning-with-files/pull/79)
- Fixed session-catchup false positives in all 9 skill-distributed copies
- Added early return guards for non-planning projects
@@ -121,4 +125,4 @@ If you've contributed and don't see your name here, please open an issue! We wan
**Total Contributors:** 13+ and growing!
*Last updated: February 26, 2026*
*Last updated: February 28, 2026*
+7 -7
View File
@@ -1,5 +1,5 @@
# Check if all phases in task_plan.md are complete
# Always exits 0 — uses stdout for status reporting
# Always exits 0 -- uses stdout for status reporting
# Used by Stop hook to report task completion status
param(
@@ -7,7 +7,7 @@ param(
)
if (-not (Test-Path $PlanFile)) {
Write-Host "[planning-with-files] No task_plan.md found — no active planning session."
Write-Host '[planning-with-files] No task_plan.md found -- no active planning session.'
exit 0
}
@@ -29,16 +29,16 @@ if ($COMPLETE -eq 0 -and $IN_PROGRESS -eq 0 -and $PENDING -eq 0) {
$PENDING = ([regex]::Matches($content, "\[pending\]")).Count
}
# Report status (always exit 0 — incomplete task is a normal state)
# Report status -- always exit 0, incomplete task is a normal state
if ($COMPLETE -eq $TOTAL -and $TOTAL -gt 0) {
Write-Host "[planning-with-files] ALL PHASES COMPLETE ($COMPLETE/$TOTAL)"
Write-Host ('[planning-with-files] ALL PHASES COMPLETE (' + $COMPLETE + '/' + $TOTAL + ')')
} else {
Write-Host "[planning-with-files] Task in progress ($COMPLETE/$TOTAL phases complete)"
Write-Host ('[planning-with-files] Task in progress (' + $COMPLETE + '/' + $TOTAL + ' phases complete)')
if ($IN_PROGRESS -gt 0) {
Write-Host "[planning-with-files] $IN_PROGRESS phase(s) still in progress."
Write-Host ('[planning-with-files] ' + $IN_PROGRESS + ' phase(s) still in progress.')
}
if ($PENDING -gt 0) {
Write-Host "[planning-with-files] $PENDING phase(s) pending."
Write-Host ('[planning-with-files] ' + $PENDING + ' phase(s) pending.')
}
}
exit 0
+1 -25
View File
@@ -17,31 +17,7 @@ hooks:
Stop:
- hooks:
- type: command
command: |
SCRIPT_DIR="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/plugins/planning-with-files}/scripts"
IS_WINDOWS=0
if [ "${OS-}" = "Windows_NT" ]; then
IS_WINDOWS=1
else
UNAME_S="$(uname -s 2>/dev/null || echo '')"
case "$UNAME_S" in
CYGWIN*|MINGW*|MSYS*) IS_WINDOWS=1 ;;
esac
fi
if [ "$IS_WINDOWS" -eq 1 ]; then
if command -v pwsh >/dev/null 2>&1; then
pwsh -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
powershell -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
sh "$SCRIPT_DIR/check-complete.sh"
else
powershell -ExecutionPolicy Bypass -File "$SCRIPT_DIR/check-complete.ps1" 2>/dev/null ||
sh "$SCRIPT_DIR/check-complete.sh"
fi
else
sh "$SCRIPT_DIR/check-complete.sh"
fi
command: "SD=\"${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/plugins/planning-with-files}/scripts\"; powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"$SD/check-complete.ps1\" 2>/dev/null || sh \"$SD/check-complete.sh\""
metadata:
version: "2.16.1"
---
@@ -1,5 +1,5 @@
# Check if all phases in task_plan.md are complete
# Always exits 0 — uses stdout for status reporting
# Always exits 0 -- uses stdout for status reporting
# Used by Stop hook to report task completion status
param(
@@ -7,7 +7,7 @@ param(
)
if (-not (Test-Path $PlanFile)) {
Write-Host "[planning-with-files] No task_plan.md found — no active planning session."
Write-Host '[planning-with-files] No task_plan.md found -- no active planning session.'
exit 0
}
@@ -29,16 +29,16 @@ if ($COMPLETE -eq 0 -and $IN_PROGRESS -eq 0 -and $PENDING -eq 0) {
$PENDING = ([regex]::Matches($content, "\[pending\]")).Count
}
# Report status (always exit 0 — incomplete task is a normal state)
# Report status -- always exit 0, incomplete task is a normal state
if ($COMPLETE -eq $TOTAL -and $TOTAL -gt 0) {
Write-Host "[planning-with-files] ALL PHASES COMPLETE ($COMPLETE/$TOTAL)"
Write-Host ('[planning-with-files] ALL PHASES COMPLETE (' + $COMPLETE + '/' + $TOTAL + ')')
} else {
Write-Host "[planning-with-files] Task in progress ($COMPLETE/$TOTAL phases complete)"
Write-Host ('[planning-with-files] Task in progress (' + $COMPLETE + '/' + $TOTAL + ' phases complete)')
if ($IN_PROGRESS -gt 0) {
Write-Host "[planning-with-files] $IN_PROGRESS phase(s) still in progress."
Write-Host ('[planning-with-files] ' + $IN_PROGRESS + ' phase(s) still in progress.')
}
if ($PENDING -gt 0) {
Write-Host "[planning-with-files] $PENDING phase(s) pending."
Write-Host ('[planning-with-files] ' + $PENDING + ' phase(s) pending.')
}
}
exit 0