gsd-cc 1.5.6 → 1.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gsd-cc",
3
- "version": "1.5.6",
3
+ "version": "1.5.8",
4
4
  "description": "Get Shit Done on Claude Code — structured AI development with your Max plan",
5
5
  "author": "Philipp Briese (https://github.com/0ui-labs)",
6
6
  "homepage": "https://github.com/0ui-labs/GSD-CC#readme",
@@ -4,7 +4,7 @@ description: >
4
4
  Start auto-mode. Dispatches tasks via claude -p in fresh sessions.
5
5
  Use when user says /gsd-cc-auto, /gsd-cc auto, or chooses "auto" when
6
6
  /gsd-cc offers manual vs. auto execution.
7
- allowed-tools: Read, Write, Bash, Glob
7
+ allowed-tools: Read, Write, Bash, Glob, AskUserQuestion
8
8
  ---
9
9
 
10
10
  # /gsd-cc-auto — Auto-Mode
@@ -36,11 +36,12 @@ command -v jq
36
36
  ```
37
37
  If not: "jq is required for auto-mode. Install with: `brew install jq`"
38
38
 
39
- ### claude -p works
39
+ ### claude CLI is available
40
40
  ```bash
41
- claude -p "echo test" --output-format json --max-turns 1
41
+ command -v claude || which claude
42
42
  ```
43
- If fails: "claude -p is not working. Make sure Claude Code is installed and you're logged in with a Max plan."
43
+ If not found: "claude CLI is not installed. Make sure Claude Code is installed and in your PATH."
44
+ Note: The auto-loop.sh script resolves the full path to claude automatically, so PATH issues in subprocesses are handled.
44
45
 
45
46
  ### No stale lock file
46
47
  ```
@@ -71,12 +72,20 @@ Auto-mode ready.
71
72
 
72
73
  ## Step 3: Ask for Budget (Optional)
73
74
 
75
+ Use AskUserQuestion:
76
+
74
77
  ```
75
- Set a token budget? (Enter a number, or press Enter for unlimited)
78
+ Question: "Token-Budget setzen?"
79
+ Header: "Budget"
80
+ Options:
81
+ - label: "Unlimited (Recommended)"
82
+ description: "No token limit — auto-mode runs until the slice/milestone is done."
83
+ - label: "Set a budget"
84
+ description: "Limit total token usage. You'll be asked for the number."
76
85
  ```
77
86
 
78
- If the user provides a number, pass it as `--budget`.
79
- If they press Enter or say "no", no budget limit.
87
+ "Unlimited" no budget limit, proceed to Step 4
88
+ "Set a budget" ask user for the number (via AskUserQuestion with "Other" or text input), pass as `--budget`
80
89
 
81
90
  ## Step 4: Start auto-loop.sh
82
91
 
@@ -7,6 +7,32 @@
7
7
 
8
8
  set -euo pipefail
9
9
 
10
+ # ── macOS compatibility: timeout shim ─────────────────────────────────────────
11
+
12
+ if ! command -v timeout &>/dev/null; then
13
+ if command -v gtimeout &>/dev/null; then
14
+ timeout() { gtimeout "$@"; }
15
+ else
16
+ # Fallback: ignore timeout, just run the command directly
17
+ timeout() { shift; "$@"; }
18
+ fi
19
+ fi
20
+
21
+ # ── Resolve claude CLI path ───────────────────────────────────────────────────
22
+
23
+ CLAUDE_BIN="$(command -v claude 2>/dev/null || true)"
24
+ if [[ -z "$CLAUDE_BIN" ]]; then
25
+ # Common locations
26
+ for p in "/opt/homebrew/bin/claude" "/usr/local/bin/claude" "$HOME/.claude/bin/claude"; do
27
+ [[ -x "$p" ]] && CLAUDE_BIN="$p" && break
28
+ done
29
+ fi
30
+
31
+ if [[ -z "$CLAUDE_BIN" ]]; then
32
+ echo "❌ claude CLI not found. Install Claude Code first."
33
+ exit 1
34
+ fi
35
+
10
36
  # ── Configuration ──────────────────────────────────────────────────────────────
11
37
 
12
38
  GSD_DIR=".gsd"
@@ -36,11 +62,6 @@ done
36
62
 
37
63
  # ── Prerequisites ──────────────────────────────────────────────────────────────
38
64
 
39
- if ! command -v claude &>/dev/null; then
40
- echo "❌ claude CLI not found. Install Claude Code first."
41
- exit 1
42
- fi
43
-
44
65
  if ! command -v jq &>/dev/null; then
45
66
  echo "❌ jq not found. Install with: brew install jq"
46
67
  exit 1
@@ -51,6 +72,16 @@ if [[ ! -f "$GSD_DIR/STATE.md" ]]; then
51
72
  exit 1
52
73
  fi
53
74
 
75
+ # Validate required STATE.md fields
76
+ for field in milestone current_slice current_task phase rigor; do
77
+ val=$(grep "^$field:" "$GSD_DIR/STATE.md" | head -1 | sed "s/^$field:[[:space:]]*//" || true)
78
+ if [[ -z "$val" || "$val" == "—" ]]; then
79
+ echo "❌ STATE.md is missing required field: $field"
80
+ echo " Run /gsd-cc to fix project state before starting auto-mode."
81
+ exit 1
82
+ fi
83
+ done
84
+
54
85
  # ── Cleanup trap ───────────────────────────────────────────────────────────────
55
86
 
56
87
  cleanup() {
@@ -81,6 +112,24 @@ log_cost() {
81
112
  fi
82
113
  }
83
114
 
115
+ # Find the next slice that needs work (no PLAN or no UNIFY)
116
+ # Returns slice name (e.g. "S03") or empty if milestone is complete
117
+ find_next_slice() {
118
+ local roadmap
119
+ roadmap=$(ls "$GSD_DIR"/M*-ROADMAP.md 2>/dev/null | head -1)
120
+ if [[ -z "$roadmap" ]]; then
121
+ return
122
+ fi
123
+
124
+ # Extract slice IDs from roadmap (### S01, ### S02, etc.)
125
+ grep -oE '### S[0-9]+' "$roadmap" | sed 's/### //' | while read -r slice; do
126
+ if [[ ! -f "$GSD_DIR/${slice}-UNIFY.md" ]]; then
127
+ echo "$slice"
128
+ return
129
+ fi
130
+ done
131
+ }
132
+
84
133
  # ── Main loop ──────────────────────────────────────────────────────────────────
85
134
 
86
135
  echo "▶ GSD-CC Auto-Mode starting..."
@@ -143,7 +192,7 @@ while true; do
143
192
  cat "$PROMPTS_DIR/unify-instructions.txt" >> "$PROMPT_FILE"
144
193
 
145
194
  RESULT_FILE="/tmp/gsd-result-$$.json"
146
- timeout 600 claude -p "$(cat "$PROMPT_FILE")" \
195
+ timeout 600 "$CLAUDE_BIN" -p "$(cat "$PROMPT_FILE")" \
147
196
  --allowedTools "Read,Write,Edit,Glob,Grep,Bash(git checkout *),Bash(git merge *),Bash(git commit *)" \
148
197
  --output-format json \
149
198
  --max-turns 15 > "$RESULT_FILE" 2>/dev/null || {
@@ -161,29 +210,28 @@ while true; do
161
210
 
162
211
  # Check if milestone is complete (all slices unified)
163
212
  if [[ "$PHASE" == "unified" ]]; then
164
- # Check roadmap for remaining slices
165
- NEXT_RESULT=$(claude -p "Read .gsd/STATE.md and all .gsd/M*-ROADMAP.md and .gsd/S*-UNIFY.md files. Determine the next slice that needs work (no PLAN.md or no UNIFY.md). Output ONLY valid JSON: {\"slice\":\"S01\",\"phase\":\"plan\"} or {\"done\":true} if all slices are unified." \
166
- --allowedTools "Read,Glob" \
167
- --output-format json --max-turns 3 2>/dev/null) || {
168
- echo "❌ Failed to determine next unit."
169
- break
170
- }
171
-
172
- NEXT=$(echo "$NEXT_RESULT" | jq -r '.result // empty' 2>/dev/null || echo "$NEXT_RESULT")
213
+ NEXT_SLICE=$(find_next_slice)
173
214
 
174
- if echo "$NEXT" | jq -e '.done' > /dev/null 2>&1; then
215
+ if [[ -z "$NEXT_SLICE" ]]; then
175
216
  echo ""
176
217
  echo "✅ Milestone $MILESTONE complete. All slices planned, executed, and unified."
177
218
  break
178
219
  fi
179
220
 
180
- SLICE=$(echo "$NEXT" | jq -r '.slice')
181
- PHASE=$(echo "$NEXT" | jq -r '.phase')
221
+ SLICE="$NEXT_SLICE"
182
222
  TASK="T01"
183
223
 
224
+ # Determine phase for next slice
225
+ if [[ -f "$GSD_DIR/${SLICE}-PLAN.md" ]]; then
226
+ PHASE="plan-complete"
227
+ else
228
+ PHASE="plan"
229
+ fi
230
+
184
231
  update_state_field "current_slice" "$SLICE"
185
232
  update_state_field "phase" "$PHASE"
186
233
  update_state_field "current_task" "$TASK"
234
+ echo "▶ Moving to next slice: $SLICE ($PHASE)"
187
235
  fi
188
236
 
189
237
  # ── 4. Budget check ────────────────────────────────────────────────────────
@@ -272,7 +320,7 @@ while true; do
272
320
  ALLOWED_TOOLS="Read,Write,Edit,Glob,Grep,Bash(npm *),Bash(npx *),Bash(git add *),Bash(git commit *),Bash(node *),Bash(python3 *)"
273
321
  fi
274
322
 
275
- timeout "$TIMEOUT" claude -p "$(cat "$PROMPT_FILE")" \
323
+ timeout "$TIMEOUT" "$CLAUDE_BIN" -p "$(cat "$PROMPT_FILE")" \
276
324
  --allowedTools "$ALLOWED_TOOLS" \
277
325
  --output-format json \
278
326
  --max-turns "$MAX_TURNS" > "$RESULT_FILE" 2>/dev/null || {
@@ -4,7 +4,7 @@ description: >
4
4
  Change GSD-CC settings like language. Updates CLAUDE.md so changes
5
5
  take effect immediately. Use when user says /gsd-cc-config, wants to
6
6
  change language, or asks about GSD-CC settings.
7
- allowed-tools: Read, Write, Edit, Glob
7
+ allowed-tools: Read, Write, Edit, Glob, AskUserQuestion
8
8
  ---
9
9
 
10
10
  # /gsd-cc-config — Settings
@@ -5,7 +5,7 @@ description: >
5
5
  captures implementation decisions, and writes CONTEXT.md. Use when
6
6
  /gsd-cc routes here, when user says /gsd-cc-discuss, or before planning a
7
7
  slice that has ambiguous requirements.
8
- allowed-tools: Read, Write, Edit, Glob, Grep
8
+ allowed-tools: Read, Write, Edit, Glob, Grep, AskUserQuestion
9
9
  ---
10
10
 
11
11
  # /gsd-cc-discuss — Implementation Decisions
@@ -60,9 +60,18 @@ Not every category applies to every slice. Focus on what's relevant.
60
60
  For each gray area you identify:
61
61
 
62
62
  1. **State the ambiguity clearly** — "The slice says 'user list' but doesn't specify: paginated table or infinite scroll? How many users are expected?"
63
- 2. **Offer concrete options** — "Option A: paginated table (simpler, better for large lists). Option B: infinite scroll (smoother UX, more complex)."
64
- 3. **Wait for the user's decision**
65
- 4. **Confirm and move on** — "Got it: paginated table, 25 per page."
63
+ 2. **Use AskUserQuestion to present concrete options** — Build the options dynamically based on the gray area. Example:
64
+ ```
65
+ Question: "User list: how should it handle large datasets?"
66
+ Header: "UI"
67
+ Options:
68
+ - label: "Paginated table (Recommended)"
69
+ description: "Simpler, better for large lists. Classic table with page controls."
70
+ - label: "Infinite scroll"
71
+ description: "Smoother UX, more complex to implement. Loads more items as user scrolls."
72
+ ```
73
+ Always put your recommendation first with "(Recommended)" in the label.
74
+ 3. **Confirm and move on** — "Got it: paginated table, 25 per page."
66
75
 
67
76
  **Rules:**
68
77
  - One gray area at a time. Don't dump all questions at once.
@@ -5,7 +5,7 @@ description: >
5
5
  next action. Use when user types /gsd-cc, mentions project planning,
6
6
  milestones, slices, or tasks. Also triggers when no .gsd/ exists
7
7
  and user wants to start a new project.
8
- allowed-tools: Read, Write, Edit, Bash, Glob, Grep
8
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
9
9
  ---
10
10
 
11
11
  # /gsd-cc — Main Router
@@ -50,20 +50,22 @@ IF .gsd/auto.lock exists:
50
50
  ### No Project
51
51
  ```
52
52
  IF .gsd/ does not exist:
53
- Present three starting points:
53
+ Use AskUserQuestion to present starting points:
54
54
 
55
- "No project found. How do you want to start?
55
+ Question: "No project found. How do you want to start?"
56
+ Header: "Start"
57
+ Options:
58
+ - label: "Explore an idea"
59
+ description: "I have a vague idea or a problem — let's explore it together"
60
+ - label: "Plan a project"
61
+ description: "I know what I want to build — let's plan it"
62
+ - label: "Import a document"
63
+ description: "I have an existing concept document — import it"
56
64
 
57
- 1) I have a vague idea or a problem — let's explore it together
58
- 2) I know what I want to build let's plan it
59
- 3) I have an existing concept document import it
60
-
61
- Or just describe what's on your mind."
62
-
63
- → "1" or signals uncertainty → delegate to /gsd-cc-ideate
64
- → "2" or clear project description → delegate to /gsd-cc-seed
65
- → "3" or mentions a document/file/spec → delegate to /gsd-cc-ingest
66
- → If they just describe their project → delegate to /gsd-cc-seed with their description
65
+ "Explore an idea" delegate to /gsd-cc-ideate
66
+ "Plan a project" or clear project description delegate to /gsd-cc-seed
67
+ "Import a document" or mentions a document/file/spec delegate to /gsd-cc-ingest
68
+ → If user selects "Other" and describes their project → delegate to /gsd-cc-seed with their description
67
69
  ```
68
70
 
69
71
  ### Seed Done, No Stack
@@ -91,44 +93,22 @@ IF M*-ROADMAP.md exists AND there are slices without a S*-PLAN.md:
91
93
  ### Plan Ready, Not Executed
92
94
  ```
93
95
  IF S*-PLAN.md exists for current slice AND no T*-SUMMARY.md files for it:
94
- Present the three execution modes with clear pros/cons:
95
-
96
- "S{nn} is planned with {n} tasks. How do you want to execute?
97
-
98
- 1) Manual
99
- You work through each task one by one, each in a fresh session.
100
- + Full control review code, run tests, adjust after each task
101
- + You see exactly what happens
102
- - You need to be present for every task
103
- - Slowest option
104
- Best for: critical slices, learning the codebase, first-time users
105
-
106
- 2) Auto (this slice) ← recommended
107
- Claude runs all {n} tasks in this slice autonomously.
108
- UNIFY runs automatically when done.
109
- Before the NEXT slice, you're back for Discuss + Plan.
110
- + Tasks run in the background — go grab a coffee
111
- + You still decide the direction for every slice
112
- + Best balance of speed and control
113
- - You can't intervene between tasks within this slice
114
- Best for: most situations — you decide WHAT, Claude does the HOW
115
-
116
- 3) Auto (full milestone)
117
- Claude runs everything autonomously: plan, execute, UNIFY,
118
- next slice, repeat — until the milestone is done.
119
- Discuss is skipped. Claude makes all detail decisions.
120
- + Fastest — walk away, come back when it's done
121
- + Great for well-defined projects with tight rigor
122
- - No input from you between slices
123
- - Claude may make wrong assumptions in detail planning
124
- - Higher risk of going in an unwanted direction
125
- Best for: small/clear projects, utility tools, tight rigor
126
-
127
- 1, 2, or 3?"
128
-
129
- → "1" or "manual" → delegate to /gsd-cc-apply
130
- → "2" or "auto" → delegate to /gsd-cc-auto (slice mode)
131
- → "3" or "full auto":
96
+ First print: "S{nn} is planned with {n} tasks."
97
+ → Then use AskUserQuestion to present execution modes:
98
+
99
+ Question: "How do you want to execute?"
100
+ Header: "Mode"
101
+ Options:
102
+ - label: "Auto (this slice) (Recommended)"
103
+ description: "Claude runs all tasks autonomously. UNIFY runs after. You decide direction for every slice. Best balance of speed and control."
104
+ - label: "Manual"
105
+ description: "You work through each task one by one in fresh sessions. Full control — review code, run tests, adjust after each task."
106
+ - label: "Auto (full milestone)"
107
+ description: "Claude does everything autonomously: plan, execute, UNIFY, next slice, repeat. Fastest, but no input from you between slices."
108
+
109
+ "Manual" delegate to /gsd-cc-apply
110
+ "Auto (this slice)" → delegate to /gsd-cc-auto (slice mode)
111
+ "Auto (full milestone)":
132
112
  Check if .gsd/PROFILE.md exists.
133
113
  If NOT: "Full auto needs a decision profile so Claude can make
134
114
  decisions on your behalf. Run /gsd-cc-profile first (15-25 min).
@@ -6,7 +6,7 @@ description: >
6
6
  beginners, debates with experts. Use when /gsd-cc routes here
7
7
  after seed, when user says /gsd-cc-stack, or when tech decisions
8
8
  need to be made.
9
- allowed-tools: Read, Write, Edit, Glob, WebSearch
9
+ allowed-tools: Read, Write, Edit, Glob, WebSearch, AskUserQuestion
10
10
  ---
11
11
 
12
12
  # /gsd-cc-stack — Tech Stack Discussion
@@ -61,31 +61,32 @@ Let's start with the basics.
61
61
  Then go through each layer, one at a time:
62
62
 
63
63
  **Language / Runtime:**
64
- ```
65
- First: what programming language should this be written in?
66
-
67
- For your project, I'd recommend {language} because {reason in plain
68
- language — e.g. "it's the most common for web apps, which means
69
- more examples and help available online"}.
70
-
71
- Another option would be {alternative} — {one sentence tradeoff}.
72
64
 
73
- My recommendation: {language}. Sound good?
65
+ Briefly explain what a programming language choice means, then use AskUserQuestion:
74
66
  ```
75
-
76
- **Framework:**
67
+ Question: "Which programming language?"
68
+ Header: "Language"
69
+ Options:
70
+ - label: "{language} (Recommended)"
71
+ description: "{reason in plain language — e.g. 'Most common for web apps, more examples and help available online'}"
72
+ - label: "{alternative}"
73
+ description: "{one sentence tradeoff}"
77
74
  ```
78
- Next: the framework — this is like the blueprint style for your app.
79
75
 
80
- {Framework} is a good fit because {reason}.
81
- It's {popular/stable/fast/beginner-friendly/...}.
82
-
83
- {Alternative} would also work — {tradeoff in plain language}.
76
+ **Framework:**
84
77
 
85
- My recommendation: {framework}. What do you think?
78
+ Briefly explain what a framework is, then use AskUserQuestion:
79
+ ```
80
+ Question: "Which framework?"
81
+ Header: "Framework"
82
+ Options:
83
+ - label: "{framework} (Recommended)"
84
+ description: "{reason — popular/stable/fast/beginner-friendly/...}"
85
+ - label: "{alternative}"
86
+ description: "{tradeoff in plain language}"
86
87
  ```
87
88
 
88
- Continue for: Database, Styling, Hosting/Deployment, Authentication (if needed), and any project-specific tools.
89
+ Continue for: Database, Styling, Hosting/Deployment, Authentication (if needed), and any project-specific tools. Always use AskUserQuestion for each decision.
89
90
 
90
91
  ### For advanced users:
91
92
 
@@ -100,12 +101,9 @@ performance needs, team size, deployment constraints, etc.}
100
101
  Here's what I'd start with and why — push back wherever you disagree.
101
102
  ```
102
103
 
103
- Then present your recommendations with honest tradeoffs. Expect debate. If they have unconventional preferences, explore them seriously:
104
+ Then for each stack layer, present your analysis briefly and use AskUserQuestion with your recommendation and alternatives. Expect debate if the user selects "Other" with an unconventional choice, explore it seriously:
104
105
 
105
- ```
106
- Interesting — you want to use {unusual choice}. Most people would
107
- reach for {conventional choice} here. What's your reasoning?
108
- ```
106
+ "Interesting — you want to use {unusual choice}. Most people would reach for {conventional choice} here. What's your reasoning?"
109
107
 
110
108
  If their reasoning is sound, support it. If it's risky, explain the risk honestly but don't override them.
111
109