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.sh
1#!/usr/bin/env bash2# Check if all phases in task_plan.md are complete3# Always exits 0 — uses stdout for status reporting4# Used by Stop hook to report task completion status56PLAN_FILE="${1:-task_plan.md}"78if [ ! -f "$PLAN_FILE" ]; then9echo "[planning-with-files] No task_plan.md found — no active planning session."10exit 011fi1213# Count total phases14TOTAL=$(grep -c "### Phase" "$PLAN_FILE" || true)1516# Check for **Status:** format first17COMPLETE=$(grep -cF "**Status:** complete" "$PLAN_FILE" || true)18IN_PROGRESS=$(grep -cF "**Status:** in_progress" "$PLAN_FILE" || true)19PENDING=$(grep -cF "**Status:** pending" "$PLAN_FILE" || true)2021# Fallback: check for [complete] inline format if **Status:** not found22if [ "$COMPLETE" -eq 0 ] && [ "$IN_PROGRESS" -eq 0 ] && [ "$PENDING" -eq 0 ]; then23COMPLETE=$(grep -c "\[complete\]" "$PLAN_FILE" || true)24IN_PROGRESS=$(grep -c "\[in_progress\]" "$PLAN_FILE" || true)25PENDING=$(grep -c "\[pending\]" "$PLAN_FILE" || true)26fi2728# Default to 0 if empty29: "${TOTAL:=0}"30: "${COMPLETE:=0}"31: "${IN_PROGRESS:=0}"32: "${PENDING:=0}"3334# Report status (always exit 0 — incomplete task is a normal state)35if [ "$COMPLETE" -eq "$TOTAL" ] && [ "$TOTAL" -gt 0 ]; then36echo "[planning-with-files] ALL PHASES COMPLETE ($COMPLETE/$TOTAL). If the user has additional work, add new phases to task_plan.md before starting."37else38echo "[planning-with-files] Task in progress ($COMPLETE/$TOTAL phases complete). Update progress.md before stopping."39if [ "$IN_PROGRESS" -gt 0 ]; then40echo "[planning-with-files] $IN_PROGRESS phase(s) still in progress."41fi42if [ "$PENDING" -gt 0 ]; then43echo "[planning-with-files] $PENDING phase(s) pending."44fi45fi46exit 047