* fix(#170): update workflow fallback install hint package * chore(#170): add changeset for workflow fallback hint migration * fix(#170): mark workflow-hint test as structural text contract
2.7 KiB
2.7 KiB
Display comprehensive project statistics including phases, plans, requirements, git metrics, and timeline.
<required_reading> Read all files referenced by the invoking prompt's execution_context before starting. </required_reading>
Gather project statistics:# SDK resolution: prefer local gsd-tools.cjs, fall back to global gsd-sdk (#3668)
GSD_TOOLS="${RUNTIME_DIR:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}/get-shit-done/bin/gsd-tools.cjs"
if [ -f "$GSD_TOOLS" ]; then
GSD_SDK="node $GSD_TOOLS"
elif command -v gsd-sdk >/dev/null 2>&1; then
GSD_SDK="gsd-sdk"
else
echo "ERROR: gsd-sdk not found on PATH and $GSD_TOOLS does not exist." >&2
echo "Run: npx -y @opengsd/get-shit-done-redux@latest --claude --local" >&2
exit 1
fi
STATS=$($GSD_SDK query stats.json)
if [[ "$STATS" == @file:* ]]; then STATS=$(cat "${STATS#@file:}"); fi
Extract fields from JSON: milestone_version, milestone_name, phases, phases_completed, phases_total, total_plans, total_summaries, percent, plan_percent, requirements_total, requirements_complete, git_commits, git_first_commit_date, last_activity.
# 📊 Project Statistics — {milestone_version} {milestone_name}
## Progress
[████████░░] X/Y phases (Z%)
## Plans
X/Y plans complete (Z%)
## Phases
| Phase | Name | Plans | Completed | Status |
|-------|------|-------|-----------|--------|
| ... | ... | ... | ... | ... |
## Requirements
✅ X/Y requirements complete
## Git
- **Commits:** N
- **Started:** YYYY-MM-DD
- **Last activity:** YYYY-MM-DD
## Timeline
- **Project age:** N days
If no .planning/ directory exists, inform the user to run /gsd:new-project first.
ANALYZE=$($GSD_SDK query roadmap.analyze)
if [[ "$ANALYZE" == @file:* ]]; then ANALYZE=$(cat "${ANALYZE#@file:}"); fi
MVP_COUNT=$(echo "$ANALYZE" | jq '[.phases[] | select(.mode == "mvp")] | length')
TOTAL_COUNT=$(echo "$ANALYZE" | jq '.phases | length')
Emit a summary line in the stats output:
Phases: ${TOTAL_COUNT} total | ${MVP_COUNT} MVP | $((TOTAL_COUNT - MVP_COUNT)) standard
If MVP_COUNT == 0, the project has no MVP-mode phases — omit the line (no clutter for non-MVP projects).
<success_criteria>
- Statistics gathered from project state
- Results formatted clearly
- Displayed to user </success_criteria>