feat(gsd-tools): add compound init commands and update workflows (#468)

* feat(gsd-tools): add compound init commands for workflow setup

Adds 8 compound commands that return all context a workflow needs in
one JSON blob, replacing 5-10 atomic calls per workflow:

- init execute-phase: models, config, phase info, plan inventory
- init plan-phase: models, workflow flags, existing artifacts
- init new-project: models, brownfield detection, state checks
- init new-milestone: models, milestone info
- init quick: models, next task number, timestamps
- init resume: file existence, interrupted agent
- init verify-work: models, phase info
- init phase-op: generic phase context

Updated 8 workflows to use compound commands:
- execute-phase, plan-phase, new-project, quick
- resume-project, verify-work, discuss-phase

Token savings: ~200 lines of bash setup replaced with single init calls.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(gsd-tools): add 4 new init commands and update files to use compound commands

Add new compound init commands:
- init todos - context for todo workflows
- init milestone-op - context for milestone operations
- init map-codebase - context for codebase mapping
- init progress - context for progress workflow

Update 24 files to use compound init commands instead of atomic calls:
- 4 phase operation workflows (add-phase, insert-phase, remove-phase, verify-phase)
- 5 todo/milestone workflows (add-todo, check-todos, audit-milestone, complete-milestone, new-milestone)
- 6 misc workflows (execute-plan, map-codebase, pause-work, progress, set-profile, settings)
- 6 agent files (gsd-executor, gsd-planner, gsd-phase-researcher, gsd-plan-checker, gsd-debugger, gsd-research-synthesizer)
- 2 command files (debug, research-phase)
- 1 reference file (planning-config)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(gsd-tools): add init to help output

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(verify-phase): correct expected init fields

The workflow was referencing plans/summaries from init phase-op,
but those fields come from ls command. Updated to reference
has_plans and plan_count which are actually in phase-op output.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
TÂCHES
2026-02-07 22:09:07 -06:00
committed by GitHub
parent e02b37d5e8
commit 246d542c65
31 changed files with 1017 additions and 389 deletions

View File

@@ -979,10 +979,11 @@ mkdir -p .planning/debug/resolved
mv .planning/debug/{slug}.md .planning/debug/resolved/
```
**Check planning config:**
**Check planning config using state load (commit_docs is available from the output):**
```bash
COMMIT_PLANNING_DOCS=$(node ~/.claude/get-shit-done/bin/gsd-tools.js state load --raw | grep '^commit_docs=' | cut -d= -f2)
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.js state load)
# commit_docs is in the JSON output
```
**Commit the fix:**

View File

@@ -16,22 +16,21 @@ Your job: Execute the plan completely, commit each task, create SUMMARY.md, upda
<execution_flow>
<step name="load_project_state" priority="first">
Read project state:
Load execution context:
```bash
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.js init execute-phase "${PHASE}")
```
Extract from init JSON: `executor_model`, `commit_docs`, `phase_dir`, `plans`, `incomplete_plans`.
Also read STATE.md for position, decisions, blockers:
```bash
cat .planning/STATE.md 2>/dev/null
```
Parse: current position, accumulated decisions, blockers/concerns.
If STATE.md missing but .planning/ exists: offer to reconstruct or continue without.
If .planning/ missing: Error — project not initialized.
**Load planning config:**
```bash
COMMIT_PLANNING_DOCS=$(node ~/.claude/get-shit-done/bin/gsd-tools.js state load --raw | grep '^commit_docs=' | cut -d= -f2)
```
</step>
<step name="load_plan">

View File

@@ -293,11 +293,16 @@ Verified patterns from official sources:
Orchestrator provides: phase number/name, description/goal, requirements, constraints, output path.
Load phase context using init command:
```bash
PHASE_DIR=$(node ~/.claude/get-shit-done/bin/gsd-tools.js find-phase "$PHASE" --raw)
PADDED_PHASE=$(node ~/.claude/get-shit-done/bin/gsd-tools.js find-phase "$PHASE" | grep -o '"phase_number":"[^"]*"' | cut -d'"' -f4)
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.js init phase-op "${PHASE}")
```
cat "$PHASE_DIR"/*-CONTEXT.md 2>/dev/null
Extract from init JSON: `phase_dir`, `padded_phase`, `phase_number`, `commit_docs`.
Then read CONTEXT.md if exists:
```bash
cat "$phase_dir"/*-CONTEXT.md 2>/dev/null
```
**If CONTEXT.md exists**, it constrains research:

View File

@@ -297,13 +297,19 @@ issue:
## Step 1: Load Context
Load phase operation context:
```bash
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.js init phase-op "${PHASE_ARG}")
```
Extract from init JSON: `phase_dir`, `phase_number`, `has_plans`, `plan_count`.
Orchestrator provides CONTEXT.md content in the verification prompt. If provided, parse for locked decisions, discretion areas, deferred ideas.
```bash
PHASE_DIR=$(node ~/.claude/get-shit-done/bin/gsd-tools.js find-phase "$PHASE_ARG" --raw)
ls "$PHASE_DIR"/*-PLAN.md 2>/dev/null
grep -A 10 "Phase $PHASE_NUM" .planning/ROADMAP.md | head -15
ls "$PHASE_DIR"/*-BRIEF.md 2>/dev/null
ls "$phase_dir"/*-PLAN.md 2>/dev/null
grep -A 10 "Phase $phase_number" .planning/ROADMAP.md | head -15
ls "$phase_dir"/*-BRIEF.md 2>/dev/null
```
**Extract:** Phase goal, requirements (decompose goal), locked decisions, deferred ideas.

View File

@@ -683,14 +683,14 @@ Triggered by `--gaps` flag. Creates plans to address verification or UAT failure
**1. Find gap sources:**
```bash
PHASE_DIR=$(node ~/.claude/get-shit-done/bin/gsd-tools.js find-phase "$PHASE_ARG" --raw)
Use init context (from load_project_state) which provides `phase_dir`:
```bash
# Check for VERIFICATION.md (code verification gaps)
ls "$PHASE_DIR"/*-VERIFICATION.md 2>/dev/null
ls "$phase_dir"/*-VERIFICATION.md 2>/dev/null
# Check for UAT.md with diagnosed status (user testing gaps)
grep -l "status: diagnosed" "$PHASE_DIR"/*-UAT.md 2>/dev/null
grep -l "status: diagnosed" "$phase_dir"/*-UAT.md 2>/dev/null
```
**2. Parse gaps:** Each gap has: truth (failed behavior), reason, artifacts (files with issues), missing (things to add/fix).
@@ -830,15 +830,20 @@ node ~/.claude/get-shit-done/bin/gsd-tools.js commit "fix($PHASE): revise plans
<execution_flow>
<step name="load_project_state" priority="first">
Read `.planning/STATE.md` — parse current position, accumulated decisions, pending todos, blockers/concerns.
If STATE.md missing but .planning/ exists, offer to reconstruct or continue without.
**Load planning config:**
Load planning context:
```bash
COMMIT_PLANNING_DOCS=$(node ~/.claude/get-shit-done/bin/gsd-tools.js state load --raw | grep '^commit_docs=' | cut -d= -f2)
INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.js init plan-phase "${PHASE}")
```
Extract from init JSON: `planner_model`, `researcher_model`, `checker_model`, `commit_docs`, `research_enabled`, `phase_dir`, `phase_number`, `has_research`, `has_context`.
Also read STATE.md for position, decisions, blockers:
```bash
cat .planning/STATE.md 2>/dev/null
```
If STATE.md missing but .planning/ exists, offer to reconstruct or continue without.
</step>
<step name="load_codebase_context">
@@ -905,17 +910,17 @@ done
</step>
<step name="gather_phase_context">
```bash
PHASE_DIR=$(node ~/.claude/get-shit-done/bin/gsd-tools.js find-phase "$PHASE" --raw)
Use `phase_dir` from init context (already loaded in load_project_state).
cat "$PHASE_DIR"/*-CONTEXT.md 2>/dev/null # From /gsd:discuss-phase
cat "$PHASE_DIR"/*-RESEARCH.md 2>/dev/null # From /gsd:research-phase
cat "$PHASE_DIR"/*-DISCOVERY.md 2>/dev/null # From mandatory discovery
```bash
cat "$phase_dir"/*-CONTEXT.md 2>/dev/null # From /gsd:discuss-phase
cat "$phase_dir"/*-RESEARCH.md 2>/dev/null # From /gsd:research-phase
cat "$phase_dir"/*-DISCOVERY.md 2>/dev/null # From mandatory discovery
```
**If CONTEXT.md exists:** Honor user's vision, prioritize essential features, respect boundaries. Locked decisions — do not revisit.
**If CONTEXT.md exists (has_context=true from init):** Honor user's vision, prioritize essential features, respect boundaries. Locked decisions — do not revisit.
**If RESEARCH.md exists:** Use standard_stack, architecture_patterns, dont_hand_roll, common_pitfalls.
**If RESEARCH.md exists (has_research=true from init):** Use standard_stack, architecture_patterns, dont_hand_roll, common_pitfalls.
</step>
<step name="break_into_tasks">