Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Structured planning workflow that uses files to track tasks, decisions, and project progress.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
scripts/check-complete.ps1
1# Check if all phases in task_plan.md are complete2# Always exits 0 -- uses stdout for status reporting3# Used by Stop hook to report task completion status45param(6[string]$PlanFile = "task_plan.md"7)89if (-not (Test-Path $PlanFile)) {10Write-Host '[planning-with-files] No task_plan.md found -- no active planning session.'11exit 012}1314# Read file content15$content = Get-Content $PlanFile -Raw1617# Count total phases18$TOTAL = ([regex]::Matches($content, "### Phase")).Count1920# Check for **Status:** format first21$COMPLETE = ([regex]::Matches($content, "\*\*Status:\*\* complete")).Count22$IN_PROGRESS = ([regex]::Matches($content, "\*\*Status:\*\* in_progress")).Count23$PENDING = ([regex]::Matches($content, "\*\*Status:\*\* pending")).Count2425# Fallback: check for [complete] inline format if **Status:** not found26if ($COMPLETE -eq 0 -and $IN_PROGRESS -eq 0 -and $PENDING -eq 0) {27$COMPLETE = ([regex]::Matches($content, "\[complete\]")).Count28$IN_PROGRESS = ([regex]::Matches($content, "\[in_progress\]")).Count29$PENDING = ([regex]::Matches($content, "\[pending\]")).Count30}3132# Report status -- always exit 0, incomplete task is a normal state33if ($COMPLETE -eq $TOTAL -and $TOTAL -gt 0) {34Write-Host ('[planning-with-files] ALL PHASES COMPLETE (' + $COMPLETE + '/' + $TOTAL + '). If the user has additional work, add new phases to task_plan.md before starting.')35} else {36Write-Host ('[planning-with-files] Task in progress (' + $COMPLETE + '/' + $TOTAL + ' phases complete). Update progress.md before stopping.')37if ($IN_PROGRESS -gt 0) {38Write-Host ('[planning-with-files] ' + $IN_PROGRESS + ' phase(s) still in progress.')39}40if ($PENDING -gt 0) {41Write-Host ('[planning-with-files] ' + $PENDING + ' phase(s) pending.')42}43}44exit 045