golem-cc 0.1.6 → 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 +56 -12
- package/package.json +1 -1
package/bin/golem
CHANGED
|
@@ -216,11 +216,11 @@ EOF
|
|
|
216
216
|
cmd_spec() {
|
|
217
217
|
check_installed
|
|
218
218
|
print_banner
|
|
219
|
-
echo -e "${BLUE}
|
|
220
|
-
echo -e "${DIM}
|
|
219
|
+
echo -e "${BLUE}Spec Builder${NC}"
|
|
220
|
+
echo -e "${DIM}Type 'done' when finished, Ctrl+C to exit${NC}"
|
|
221
221
|
echo ""
|
|
222
222
|
|
|
223
|
-
local spec_prompt="You are a spec-builder agent
|
|
223
|
+
local spec_prompt="You are a spec-builder agent helping define project requirements.
|
|
224
224
|
|
|
225
225
|
Your workflow:
|
|
226
226
|
1. Ask what they're building and the core problem it solves
|
|
@@ -228,23 +228,67 @@ Your workflow:
|
|
|
228
228
|
3. For each topic, ask clarifying questions then create a spec file in specs/
|
|
229
229
|
4. Finally, create/update AGENTS.md with test/build/lint commands
|
|
230
230
|
|
|
231
|
-
Spec file format (
|
|
231
|
+
Spec file format (save to specs/{topic-name}.md):
|
|
232
232
|
# {Topic Name}
|
|
233
233
|
## Purpose
|
|
234
234
|
## Requirements (Must Have, Should Have, Must Not)
|
|
235
235
|
## Acceptance Criteria
|
|
236
236
|
|
|
237
|
-
|
|
237
|
+
Keep responses concise. Ask one question at a time."
|
|
238
238
|
|
|
239
|
-
#
|
|
239
|
+
# Load agent prompt if available
|
|
240
240
|
if [[ -f ".golem/agents/spec-builder.md" ]]; then
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
241
|
+
spec_prompt=$(sed '1,/^---$/d' .golem/agents/spec-builder.md | sed '1,/^---$/d')
|
|
242
|
+
fi
|
|
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
|
|
247
261
|
fi
|
|
262
|
+
|
|
263
|
+
echo -e "${CYAN}Claude:${NC} $response"
|
|
264
|
+
echo ""
|
|
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
|
|
248
292
|
}
|
|
249
293
|
|
|
250
294
|
# Run the loop (plan or build mode)
|