fix: remove jq as undocumented hard dependency (#1300)

Add --pick flag to gsd-tools.cjs for extracting a single field from
JSON output, replacing all jq pipe usage across workflow and reference
files. Since Node.js is already a hard dependency, this eliminates the
need for jq on systems where it is not installed (notably Windows).

Changes:
- gsd-tools.cjs: add --pick <field> global flag with dot-notation and
  bracket syntax support (e.g., --pick section, --pick directories[-1])
- Replace 15 jq pipe patterns across 6 workflow/reference files with
  --pick flag or inline Node.js one-liner for variable extraction
- Add regression tests for --pick flag behavior

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-03-21 17:52:59 -04:00
parent 16b917ce69
commit 722e1db116
8 changed files with 149 additions and 20 deletions

View File

@@ -105,7 +105,7 @@ For each phase's VERIFICATION.md, extract the expanded requirements table:
For each phase's SUMMARY.md, extract `requirements-completed` from YAML frontmatter:
```bash
for summary in .planning/phases/*-*/*-SUMMARY.md; do
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" summary-extract "$summary" --fields requirements_completed | jq -r '.requirements_completed'
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" summary-extract "$summary" --fields requirements_completed --pick requirements_completed
done
```

View File

@@ -156,7 +156,7 @@ Extract one-liners from SUMMARY.md files using summary-extract:
```bash
# For each phase in milestone, extract one-liner
for summary in .planning/phases/*-*/*-SUMMARY.md; do
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" summary-extract "$summary" --fields one_liner | jq -r '.one_liner'
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" summary-extract "$summary" --fields one_liner --pick one_liner
done
```

View File

@@ -65,8 +65,7 @@ Gap: Flow "View dashboard" broken at data fetch
Find highest existing phase:
```bash
# Get sorted phase list, extract last one
PHASES=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" phases list)
HIGHEST=$(printf '%s\n' "$PHASES" | jq -r '.directories[-1]')
HIGHEST=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" phases list --pick directories[-1])
```
New phases continue from there:

View File

@@ -255,7 +255,7 @@ Display banner:
### Spawn gsd-phase-researcher
```bash
PHASE_DESC=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" roadmap get-phase "${PHASE}" | jq -r '.section')
PHASE_DESC=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" roadmap get-phase "${PHASE}" --pick section)
```
Research prompt:
@@ -384,14 +384,15 @@ ls "${PHASE_DIR}"/*-PLAN.md 2>/dev/null
Extract from INIT JSON:
```bash
STATE_PATH=$(printf '%s\n' "$INIT" | jq -r '.state_path // empty')
ROADMAP_PATH=$(printf '%s\n' "$INIT" | jq -r '.roadmap_path // empty')
REQUIREMENTS_PATH=$(printf '%s\n' "$INIT" | jq -r '.requirements_path // empty')
RESEARCH_PATH=$(printf '%s\n' "$INIT" | jq -r '.research_path // empty')
VERIFICATION_PATH=$(printf '%s\n' "$INIT" | jq -r '.verification_path // empty')
UAT_PATH=$(printf '%s\n' "$INIT" | jq -r '.uat_path // empty')
CONTEXT_PATH=$(printf '%s\n' "$INIT" | jq -r '.context_path // empty')
REVIEWS_PATH=$(printf '%s\n' "$INIT" | jq -r '.reviews_path // empty')
_gsd_field() { node -e "const o=JSON.parse(process.argv[1]); const v=o[process.argv[2]]; process.stdout.write(v==null?'':String(v))" "$1" "$2"; }
STATE_PATH=$(_gsd_field "$INIT" state_path)
ROADMAP_PATH=$(_gsd_field "$INIT" roadmap_path)
REQUIREMENTS_PATH=$(_gsd_field "$INIT" requirements_path)
RESEARCH_PATH=$(_gsd_field "$INIT" research_path)
VERIFICATION_PATH=$(_gsd_field "$INIT" verification_path)
UAT_PATH=$(_gsd_field "$INIT" uat_path)
CONTEXT_PATH=$(_gsd_field "$INIT" context_path)
REVIEWS_PATH=$(_gsd_field "$INIT" reviews_path)
```
## 7.5. Verify Nyquist Artifacts