golem-cc 0.1.7 → 0.1.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/bin/golem +53 -8
- package/package.json +1 -1
package/bin/golem
CHANGED
|
@@ -216,10 +216,13 @@ EOF
|
|
|
216
216
|
cmd_spec() {
|
|
217
217
|
check_installed
|
|
218
218
|
print_banner
|
|
219
|
+
echo -e "${BLUE}Spec Builder${NC}"
|
|
220
|
+
echo -e "${DIM}Type 'done' when finished, Ctrl+C to exit${NC}"
|
|
221
|
+
echo ""
|
|
219
222
|
|
|
220
|
-
local spec_prompt="You are a spec-builder agent
|
|
223
|
+
local spec_prompt="You are a spec-builder agent helping define project requirements.
|
|
221
224
|
|
|
222
|
-
Your
|
|
225
|
+
Your workflow:
|
|
223
226
|
1. Ask what they're building and the core problem it solves
|
|
224
227
|
2. Break down the project into distinct topics of concern (3-7 topics)
|
|
225
228
|
3. For each topic, ask clarifying questions then create a spec file in specs/
|
|
@@ -231,19 +234,61 @@ Spec file format (save to specs/{topic-name}.md):
|
|
|
231
234
|
## Requirements (Must Have, Should Have, Must Not)
|
|
232
235
|
## Acceptance Criteria
|
|
233
236
|
|
|
234
|
-
Keep responses concise. Ask one question at a time.
|
|
235
|
-
Start NOW by asking: What are you building? Give me the elevator pitch."
|
|
237
|
+
Keep responses concise. Ask one question at a time."
|
|
236
238
|
|
|
237
239
|
# Load agent prompt if available
|
|
238
240
|
if [[ -f ".golem/agents/spec-builder.md" ]]; then
|
|
239
241
|
spec_prompt=$(sed '1,/^---$/d' .golem/agents/spec-builder.md | sed '1,/^---$/d')
|
|
240
242
|
fi
|
|
241
243
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
+
local tmp_file=$(mktemp)
|
|
245
|
+
trap "rm -f $tmp_file" EXIT
|
|
246
|
+
|
|
247
|
+
# Get initial response with session ID
|
|
248
|
+
claude -p \
|
|
249
|
+
--dangerously-skip-permissions \
|
|
250
|
+
--output-format json \
|
|
251
|
+
--append-system-prompt "$spec_prompt" \
|
|
252
|
+
"Start the spec-building conversation. Ask what I'm building." \
|
|
253
|
+
> "$tmp_file" 2>/dev/null
|
|
254
|
+
|
|
255
|
+
local session_id=$(jq -r '.session_id // empty' "$tmp_file" 2>/dev/null)
|
|
256
|
+
local response=$(jq -r '.result // empty' "$tmp_file" 2>/dev/null)
|
|
257
|
+
|
|
258
|
+
if [[ -z "$session_id" ]]; then
|
|
259
|
+
echo -e "${RED}Failed to start session. Make sure Claude CLI is working.${NC}"
|
|
260
|
+
return 1
|
|
261
|
+
fi
|
|
262
|
+
|
|
263
|
+
echo -e "${CYAN}Claude:${NC} $response"
|
|
244
264
|
echo ""
|
|
245
|
-
|
|
246
|
-
|
|
265
|
+
|
|
266
|
+
# Conversation loop
|
|
267
|
+
while true; do
|
|
268
|
+
echo -ne "${GREEN}You:${NC} "
|
|
269
|
+
read -r user_input
|
|
270
|
+
|
|
271
|
+
[[ -z "$user_input" ]] && continue
|
|
272
|
+
[[ "$user_input" == "done" ]] && {
|
|
273
|
+
echo ""
|
|
274
|
+
echo -e "${GREEN}Done!${NC} Specs saved to specs/"
|
|
275
|
+
echo -e "Next: Run ${CYAN}golem run plan${NC} to create implementation plan"
|
|
276
|
+
break
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
# Continue conversation with session ID
|
|
280
|
+
claude -p \
|
|
281
|
+
--dangerously-skip-permissions \
|
|
282
|
+
--output-format json \
|
|
283
|
+
--resume "$session_id" \
|
|
284
|
+
"$user_input" \
|
|
285
|
+
> "$tmp_file" 2>/dev/null
|
|
286
|
+
|
|
287
|
+
response=$(jq -r '.result // empty' "$tmp_file" 2>/dev/null)
|
|
288
|
+
echo ""
|
|
289
|
+
echo -e "${CYAN}Claude:${NC} $response"
|
|
290
|
+
echo ""
|
|
291
|
+
done
|
|
247
292
|
}
|
|
248
293
|
|
|
249
294
|
# Run the loop (plan or build mode)
|