Compare commits

...
10 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
OthmanAdi acfd2f0c74 fix(mastra): add hooks.json, fix SKILL.md path var, correct docs
Mastra Code reads hooks from .mastracode/hooks.json, not SKILL.md
frontmatter. All three hooks (PreToolUse, PostToolUse, Stop) were
silently non-functional. Added hooks.json with proper Mastra format
including matchers and timeouts. Fixed MASTRACODE_SKILL_ROOT env var
(does not exist in Mastra Code). Corrected docs/mastra.md to accurately
describe the hooks.json system and fixed personal install instructions
to include the hooks file.
2026-02-26 19:43:46 +01:00
OthmanAdi 931bb545ab fix: stretch Star History chart to full width 2026-02-26 19:01:16 +01:00
OthmanAdi 15e33d261a fix(copilot): complete PS1 encoding fix - Get-Content UTF8 + no-BOM (Issue #82)
v2.16.1 fixed the output pipe encoding but missed the read side.
Get-Content without -Encoding in PS5 reads files with the system ANSI
code page (Windows-1252), corrupting non-ASCII characters in
task_plan.md and SKILL.md before they reach the output pipe.

Changes to pre-tool-use.ps1, session-start.ps1, agent-stop.ps1:
- All Get-Content calls: added -Encoding UTF8
- [System.Text.Encoding]::UTF8 replaced with
  [System.Text.UTF8Encoding]::new($false) — UTF-8 without BOM,
  preventing stray 0xEF 0xBB 0xBF preamble in JSON output

Closes #82
2026-02-26 18:59:05 +01:00
27 changed files with 213 additions and 284 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
+3 -3
View File
@@ -4,8 +4,8 @@
# Always exits 0 — outputs JSON to stdout.
# Read stdin (required — Copilot pipes JSON to stdin)
$OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$OutputEncoding = [System.Text.UTF8Encoding]::new($false)
[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new($false)
$InputData = [Console]::In.ReadToEnd()
$PlanFile = "task_plan.md"
@@ -15,7 +15,7 @@ if (-not (Test-Path $PlanFile)) {
exit 0
}
$content = Get-Content $PlanFile -Raw
$content = Get-Content $PlanFile -Raw -Encoding UTF8
# Count total phases
$TOTAL = ([regex]::Matches($content, "### Phase")).Count
+3 -3
View File
@@ -4,8 +4,8 @@
# Always exits 0 — outputs JSON to stdout.
# Read stdin (required — Copilot pipes JSON to stdin)
$OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$OutputEncoding = [System.Text.UTF8Encoding]::new($false)
[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new($false)
$InputData = [Console]::In.ReadToEnd()
$PlanFile = "task_plan.md"
@@ -15,7 +15,7 @@ if (-not (Test-Path $PlanFile)) {
exit 0
}
$Context = (Get-Content $PlanFile -TotalCount 30 -ErrorAction SilentlyContinue) -join "`n"
$Context = (Get-Content $PlanFile -TotalCount 30 -Encoding UTF8 -ErrorAction SilentlyContinue) -join "`n"
if (-not $Context) {
Write-Output '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"allow"}}'
+4 -4
View File
@@ -4,8 +4,8 @@
# Always exits 0 — outputs JSON to stdout.
# Read stdin (required — Copilot pipes JSON to stdin)
$OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$OutputEncoding = [System.Text.UTF8Encoding]::new($false)
[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new($false)
$InputData = [Console]::In.ReadToEnd()
$PlanFile = "task_plan.md"
@@ -26,12 +26,12 @@ if (Test-Path $PlanFile) {
if ($Catchup) {
$Context = $Catchup -join "`n"
} else {
$Context = (Get-Content $PlanFile -TotalCount 5 -ErrorAction SilentlyContinue) -join "`n"
$Context = (Get-Content $PlanFile -TotalCount 5 -Encoding UTF8 -ErrorAction SilentlyContinue) -join "`n"
}
} else {
# No plan yet — inject SKILL.md so Copilot knows the planning workflow and templates
if (Test-Path "$SkillDir/SKILL.md") {
$Context = Get-Content "$SkillDir/SKILL.md" -Raw -ErrorAction SilentlyContinue
$Context = Get-Content "$SkillDir/SKILL.md" -Raw -Encoding UTF8 -ErrorAction SilentlyContinue
}
}
+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
+27
View File
@@ -0,0 +1,27 @@
{
"PreToolUse": [
{
"type": "command",
"command": "cat task_plan.md 2>/dev/null | head -30 || true",
"matcher": { "tool_name": "Write|Edit|Bash|Read|Glob|Grep" },
"timeout": 5000,
"description": "Read plan before tool use to keep goals in active context"
}
],
"PostToolUse": [
{
"type": "command",
"command": "echo '[planning-with-files] File updated. If this completes a phase, update task_plan.md status.'",
"matcher": { "tool_name": "Write|Edit" },
"description": "Remind agent to update plan status after file changes"
}
],
"Stop": [
{
"type": "command",
"command": "sh .mastracode/skills/planning-with-files/scripts/check-complete.sh 2>/dev/null || sh ~/.mastracode/skills/planning-with-files/scripts/check-complete.sh 2>/dev/null || true",
"timeout": 10000,
"description": "Check all phases are complete before the agent stops"
}
]
}
@@ -17,33 +17,9 @@ hooks:
Stop:
- hooks:
- type: command
command: |
SCRIPT_DIR="${MASTRACODE_SKILL_ROOT:-$HOME/.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.16.1"
version: "2.18.1"
---
# Planning with Files
@@ -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
+49
View File
@@ -2,6 +2,55 @@
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
- **Mastra Code hooks were silently doing nothing**
- Root cause: Mastra Code reads hooks from `.mastracode/hooks.json`, not from SKILL.md frontmatter. The existing integration had hooks defined only in SKILL.md (Claude Code format), which Mastra Code ignores entirely. All three hooks (PreToolUse, PostToolUse, Stop) were non-functional.
- Added `.mastracode/hooks.json` with proper Mastra Code format including `matcher`, `timeout`, and `description` fields
- Fixed `MASTRACODE_SKILL_ROOT` env var in SKILL.md Stop hook (variable does not exist in Mastra Code, replaced with `$HOME` fallback to local path)
- Bumped `.mastracode/skills/planning-with-files/SKILL.md` metadata version from 2.16.1 to 2.18.1
- Corrected `docs/mastra.md` to accurately describe hooks.json (removed false claim that Mastra Code uses the same hook system as Claude Code)
- Fixed personal installation instructions to include hooks.json copy step
---
## [2.18.1] - 2026-02-26
### Fixed
- **Copilot hooks garbled characters — still broken after v2.16.1** (Issue #82, confirmed by @Hexiaopi)
- Root cause: `Get-Content` in all PS1 scripts had no `-Encoding` parameter — PowerShell 5.x reads files using the system ANSI code page (Windows-1252) by default, corrupting any non-ASCII character in `task_plan.md` or `SKILL.md` before it reaches the output pipe. The v2.16.1 fix was correct but fixed only the output side, not the read side.
- Secondary fix: `[System.Text.Encoding]::UTF8` returns UTF-8 with BOM — replaced with `[System.Text.UTF8Encoding]::new($false)` (UTF-8 without BOM) in all four PS1 scripts to prevent JSON parsers from receiving a stray `0xEF 0xBB 0xBF` preamble
- Fixed files: `pre-tool-use.ps1`, `session-start.ps1`, `agent-stop.ps1`, `post-tool-use.ps1`
- Bash scripts were already correct from v2.16.1
### Thanks
- @Hexiaopi for confirming the issue persisted after v2.16.1 (Issue #82)
---
## [2.18.0] - 2026-02-26
### Added
+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*
+5 -3
View File
@@ -58,10 +58,12 @@ Everyone who made this project better — bug reports, PRs, and integrations.
<details>
<summary><strong>📦 Releases & Session Recovery</strong></summary>
### Current Version: v2.17.0
### Current Version: v2.18.2
| Version | Highlights |
|---------|------------|
| **v2.18.2** | Mastra Code hooks fix (hooks.json + docs accuracy) |
| **v2.18.1** | Copilot garbled characters complete fix |
| **v2.18.0** | BoxLite sandbox runtime integration |
| **v2.17.0** | Mastra Code support + all IDE SKILL.md spec fixes |
| **v2.16.1** | Copilot garbled characters fix — PS1 UTF-8 encoding + bash ensure_ascii (thanks @Hexiaopi!) |
@@ -151,7 +153,7 @@ A Claude Code plugin that transforms your workflow to use persistent markdown fi
[![GitHub Copilot](https://img.shields.io/badge/GitHub%20Copilot-Hooks-000000)](https://docs.github.com/en/copilot/reference/hooks-configuration)
[![Mastra Code](https://img.shields.io/badge/Mastra%20Code-Skills-00BCD4)](https://code.mastra.ai)
[![BoxLite](https://img.shields.io/badge/BoxLite-Sandbox-6C3483)](https://boxlite.ai)
[![Version](https://img.shields.io/badge/version-2.18.0-brightgreen)](https://github.com/OthmanAdi/planning-with-files/releases)
[![Version](https://img.shields.io/badge/version-2.18.2-brightgreen)](https://github.com/OthmanAdi/planning-with-files/releases)
[![SkillCheck Validated](https://img.shields.io/badge/SkillCheck-Validated-4c1)](https://getskillcheck.com)
## Quick Install
@@ -393,4 +395,4 @@ MIT License — feel free to use, modify, and distribute.
## Star History
[![RepoStars](https://repostars.dev/api/embed?repo=OthmanAdi%2Fplanning-with-files&theme=copper)](https://repostars.dev/?repos=OthmanAdi%2Fplanning-with-files&theme=copper)
<a href="https://repostars.dev/?repos=OthmanAdi%2Fplanning-with-files&theme=copper"><img src="https://repostars.dev/api/embed?repo=OthmanAdi%2Fplanning-with-files&theme=copper" width="100%" alt="Star History Chart" /></a>
+25 -10
View File
@@ -40,14 +40,20 @@ Install just for yourself:
# Clone the repo
git clone https://github.com/OthmanAdi/planning-with-files.git /tmp/planning-with-files
# Copy to your personal Mastra Code skills folder
# Copy skill to your personal Mastra Code skills folder
mkdir -p ~/.mastracode/skills
cp -r /tmp/planning-with-files/.mastracode/skills/planning-with-files ~/.mastracode/skills/
# Copy hooks (required for plan enforcement)
# If you already have ~/.mastracode/hooks.json, merge the entries manually
cp /tmp/planning-with-files/.mastracode/hooks.json ~/.mastracode/hooks.json
# Clean up
rm -rf /tmp/planning-with-files
```
> **Note:** If you already have a `~/.mastracode/hooks.json`, do not overwrite it. Instead, merge the PreToolUse, PostToolUse, and Stop entries from the skill's hooks.json into your existing file.
### Verification
```bash
@@ -60,15 +66,20 @@ Restart your Mastra Code session. The skill auto-activates when you work on comp
## How It Works
### Hooks (Native Support)
### Hooks (via hooks.json)
Mastra Code supports the same hook system as Claude Code. This integration includes:
Mastra Code uses a separate `hooks.json` file for lifecycle hooks. This is different from Claude Code, which defines hooks in SKILL.md frontmatter. Mastra Code reads hooks from:
| Hook | Trigger | What It Does |
1. `.mastracode/hooks.json` (project-level, highest priority)
2. `~/.mastracode/hooks.json` (global)
This integration includes a pre-configured `hooks.json` with all three hooks:
| Hook | Matcher | What It Does |
|------|---------|--------------|
| **PreToolUse** | Before Write, Edit, Bash, Read, Glob, Grep | Reads first 30 lines of `task_plan.md` — keeps goals in attention |
| **PostToolUse** | After Write, Edit | Reminds you to update plan status |
| **Stop** | When agent finishes | Runs completion check script |
| **PreToolUse** | Write, Edit, Bash, Read, Glob, Grep | Reads first 30 lines of `task_plan.md` to keep goals in attention |
| **PostToolUse** | Write, Edit | Reminds you to update plan status after file changes |
| **Stop** | (all) | Runs `check-complete.sh` to verify all phases are done |
### Auto-Activation
@@ -94,8 +105,8 @@ Once activated, the skill creates:
Mastra Code reads from `.claude/skills/` as a fallback. If you already have planning-with-files installed for Claude Code, it will work — but the dedicated `.mastracode/` installation gives you:
- Native hooks integration (PreToolUse, PostToolUse, Stop)
- Correct script path resolution
- Native hooks via `hooks.json` (PreToolUse, PostToolUse, Stop)
- Correct script path resolution for Mastra Code directories
- No path conflicts with Claude Code plugin root
---
@@ -147,7 +158,11 @@ With personal installation (`~/.mastracode/skills/`):
### Hooks Not Running?
Check `.mastracode/hooks.json` for conflicts. The skill's hooks are defined in SKILL.md frontmatter and should work automatically.
Mastra Code reads hooks from `hooks.json`, not from SKILL.md frontmatter. Verify:
1. Check that `.mastracode/hooks.json` exists in your project root (workspace install) or `~/.mastracode/hooks.json` (personal install)
2. Verify the file contains PreToolUse, PostToolUse, and Stop entries
3. Restart Mastra Code after adding or modifying hooks.json
### Already Using Claude Code?
+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