feat(gsd-tools): frontmatter CRUD, verification suite, template fill, state progression (#485)
* feat(gsd-tools): add frontmatter CRUD, verification suite, template fill, and state progression Four new command groups that delegate deterministic operations from AI agents to code: - frontmatter get/set/merge/validate: Safe YAML frontmatter manipulation with schema validation - verify plan-structure/phase-completeness/references/commits/artifacts/key-links: Structural checks agents previously burned context on - template fill summary/plan/verification: Pre-filled document skeletons so agents only fill creative content - state advance-plan/record-metric/update-progress/add-decision/add-blocker/resolve-blocker/record-session: Automate arithmetic and formatting in STATE.md Adds reconstructFrontmatter() + spliceFrontmatter() helpers for safe frontmatter roundtripping, and parseMustHavesBlock() for 3-level YAML parsing of must_haves structures. 20 new functions, ~1037 new lines. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: wire gsd-tools commands into agents and workflows - gsd-verifier: use `verify artifacts` and `verify key-links` instead of manual grep patterns for stub detection and wiring verification - gsd-executor: use `state advance-plan`, `state update-progress`, `state record-metric`, `state add-decision`, `state record-session` instead of manual STATE.md manipulation - gsd-plan-checker: use `verify plan-structure` and `frontmatter get` for structural validation and must_haves extraction - gsd-planner: add validation step using `frontmatter validate` and `verify plan-structure` after writing PLAN.md - execute-plan.md: use gsd-tools state commands for position/progress updates - verify-phase.md: use gsd-tools for must_haves extraction and artifact/link verification This makes the gsd-tools commands from PR #485 actually used by the system. --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -316,18 +316,35 @@ ls "$phase_dir"/*-BRIEF.md 2>/dev/null
|
||||
|
||||
## Step 2: Load All Plans
|
||||
|
||||
Use gsd-tools to validate plan structure:
|
||||
|
||||
```bash
|
||||
for plan in "$PHASE_DIR"/*-PLAN.md; do
|
||||
echo "=== $plan ==="
|
||||
cat "$plan"
|
||||
PLAN_STRUCTURE=$(node ~/.claude/get-shit-done/bin/gsd-tools.js verify plan-structure "$plan")
|
||||
echo "$PLAN_STRUCTURE"
|
||||
done
|
||||
```
|
||||
|
||||
**Parse:** Frontmatter (phase, plan, wave, depends_on, files_modified, autonomous, must_haves), objective, tasks (type, name, files, action, verify, done), verification/success criteria.
|
||||
Parse JSON result: `{ valid, errors, warnings, task_count, tasks: [{name, hasFiles, hasAction, hasVerify, hasDone}], frontmatter_fields }`
|
||||
|
||||
Map errors/warnings to verification dimensions:
|
||||
- Missing frontmatter field → `task_completeness` or `must_haves_derivation`
|
||||
- Task missing elements → `task_completeness`
|
||||
- Wave/depends_on inconsistency → `dependency_correctness`
|
||||
- Checkpoint/autonomous mismatch → `task_completeness`
|
||||
|
||||
## Step 3: Parse must_haves
|
||||
|
||||
Extract from each plan frontmatter:
|
||||
Extract must_haves from each plan using gsd-tools:
|
||||
|
||||
```bash
|
||||
MUST_HAVES=$(node ~/.claude/get-shit-done/bin/gsd-tools.js frontmatter get "$PLAN_PATH" --field must_haves)
|
||||
```
|
||||
|
||||
Returns JSON: `{ truths: [...], artifacts: [...], key_links: [...] }`
|
||||
|
||||
**Expected structure:**
|
||||
|
||||
```yaml
|
||||
must_haves:
|
||||
@@ -362,12 +379,24 @@ For each requirement: find covering task(s), verify action is specific, flag gap
|
||||
|
||||
## Step 5: Validate Task Structure
|
||||
|
||||
Use gsd-tools plan-structure verification (already run in Step 2):
|
||||
|
||||
```bash
|
||||
grep -c "<task" "$PHASE_DIR"/*-PLAN.md
|
||||
grep -B5 "</task>" "$PHASE_DIR"/*-PLAN.md | grep -v "<verify>"
|
||||
PLAN_STRUCTURE=$(node ~/.claude/get-shit-done/bin/gsd-tools.js verify plan-structure "$PLAN_PATH")
|
||||
```
|
||||
|
||||
Check: valid task type (auto, checkpoint:*, tdd), auto tasks have files/action/verify/done, action is specific, verify is runnable, done is measurable.
|
||||
The `tasks` array in the result shows each task's completeness:
|
||||
- `hasFiles` — files element present
|
||||
- `hasAction` — action element present
|
||||
- `hasVerify` — verify element present
|
||||
- `hasDone` — done element present
|
||||
|
||||
**Check:** valid task type (auto, checkpoint:*, tdd), auto tasks have files/action/verify/done, action is specific, verify is runnable, done is measurable.
|
||||
|
||||
**For manual validation of specificity** (gsd-tools checks structure, not content quality):
|
||||
```bash
|
||||
grep -B5 "</task>" "$PHASE_DIR"/*-PLAN.md | grep -v "<verify>"
|
||||
```
|
||||
|
||||
## Step 6: Verify Dependency Graph
|
||||
|
||||
|
||||
Reference in New Issue
Block a user