Add a new `/gsd:stats` command that displays comprehensive project statistics including phase progress, plan execution metrics, requirements completion, git history, and timeline information. - New command definition: commands/gsd/stats.md - New workflow: get-shit-done/workflows/stats.md - CLI handler: `gsd-tools stats [json|table]` - Stats function in commands.cjs with JSON and table output formats - 5 new tests covering empty project, phase/plan counting, requirements counting, last activity, and table format rendering Co-authored-by: ashanuoc <ashanuoc@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
58 lines
1.4 KiB
Markdown
58 lines
1.4 KiB
Markdown
<purpose>
|
|
Display comprehensive project statistics including phases, plans, requirements, git metrics, and timeline.
|
|
</purpose>
|
|
|
|
<required_reading>
|
|
Read all files referenced by the invoking prompt's execution_context before starting.
|
|
</required_reading>
|
|
|
|
<process>
|
|
|
|
<step name="gather_stats">
|
|
Gather project statistics:
|
|
|
|
```bash
|
|
STATS=$(node "$GSD_TOOLS" stats json)
|
|
if [[ "$STATS" == @file:* ]]; then STATS=$(cat "${STATS#@file:}"); fi
|
|
```
|
|
|
|
Extract fields from JSON: `milestone_version`, `milestone_name`, `phases`, `total_plans`, `total_summaries`, `percent`, `requirements_total`, `requirements_complete`, `git_commits`, `git_first_commit_date`, `last_activity`.
|
|
</step>
|
|
|
|
<step name="present_stats">
|
|
Present to the user with this format:
|
|
|
|
```
|
|
# 📊 Project Statistics — {milestone_version} {milestone_name}
|
|
|
|
## Progress
|
|
[████████░░] X/Y plans (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.
|
|
</step>
|
|
|
|
</process>
|
|
|
|
<success_criteria>
|
|
- [ ] Statistics gathered from project state
|
|
- [ ] Results formatted clearly
|
|
- [ ] Displayed to user
|
|
</success_criteria>
|