golem-cc 0.1.10 → 0.1.11
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 +13 -98
- package/bin/install.cjs +3 -3
- package/package.json +1 -1
package/bin/golem
CHANGED
|
@@ -50,7 +50,6 @@ print_usage() {
|
|
|
50
50
|
echo -e "${BLUE}Usage:${NC} golem <command> [options]"
|
|
51
51
|
echo ""
|
|
52
52
|
echo -e "${BLUE}Commands:${NC}"
|
|
53
|
-
echo " spec Build specs through guided conversation"
|
|
54
53
|
echo " run plan Create implementation plan from specs"
|
|
55
54
|
echo " run build Run autonomous build loop"
|
|
56
55
|
echo " simplify [path] Run code simplifier"
|
|
@@ -63,9 +62,9 @@ print_usage() {
|
|
|
63
62
|
echo " --no-simplify Skip code simplification in build loop"
|
|
64
63
|
echo ""
|
|
65
64
|
echo -e "${BLUE}Workflow:${NC}"
|
|
66
|
-
echo " 1. golem
|
|
67
|
-
echo " 2. golem run plan Generate
|
|
68
|
-
echo " 3. golem run build Autonomous
|
|
65
|
+
echo " 1. claude → /golem:spec Define requirements (interactive)"
|
|
66
|
+
echo " 2. golem run plan Generate implementation plan"
|
|
67
|
+
echo " 3. golem run build Autonomous build loop"
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
# Check if golem is installed in current project
|
|
@@ -145,7 +144,7 @@ EOF
|
|
|
145
144
|
echo -e "${GREEN}✓${NC} Created specs/ directory"
|
|
146
145
|
echo ""
|
|
147
146
|
echo -e "${BLUE}Next steps:${NC}"
|
|
148
|
-
echo -e " 1. Run ${CYAN}golem
|
|
147
|
+
echo -e " 1. Run ${CYAN}claude${NC} then ${CYAN}/golem:spec${NC} to define requirements"
|
|
149
148
|
echo -e " 2. Run ${CYAN}golem run plan${NC} to create implementation plan"
|
|
150
149
|
echo -e " 3. Run ${CYAN}golem run build${NC} to start autonomous coding"
|
|
151
150
|
}
|
|
@@ -212,104 +211,20 @@ EOF
|
|
|
212
211
|
fi
|
|
213
212
|
}
|
|
214
213
|
|
|
215
|
-
#
|
|
214
|
+
# Show spec workflow hint
|
|
216
215
|
cmd_spec() {
|
|
217
|
-
check_installed
|
|
218
216
|
print_banner
|
|
219
217
|
echo -e "${BLUE}Spec Builder${NC}"
|
|
220
|
-
echo -e "${DIM}Type 'done' when finished, Ctrl+C to exit${NC}"
|
|
221
218
|
echo ""
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
Spec file format (save to specs/{topic-name}.md):
|
|
232
|
-
# {Topic Name}
|
|
233
|
-
## Purpose
|
|
234
|
-
## Requirements (Must Have, Should Have, Must Not)
|
|
235
|
-
## Acceptance Criteria
|
|
236
|
-
|
|
237
|
-
Keep responses concise. Ask one question at a time."
|
|
238
|
-
|
|
239
|
-
local tmp_err=$(mktemp)
|
|
240
|
-
trap "rm -f $tmp_err" EXIT
|
|
241
|
-
|
|
242
|
-
# Helper to run claude and handle errors
|
|
243
|
-
run_claude() {
|
|
244
|
-
local output
|
|
245
|
-
local exit_code
|
|
246
|
-
|
|
247
|
-
output=$(claude "$@" 2>"$tmp_err")
|
|
248
|
-
exit_code=$?
|
|
249
|
-
|
|
250
|
-
if [[ $exit_code -ne 0 ]] || grep -q "API Error" "$tmp_err" 2>/dev/null; then
|
|
251
|
-
local err_msg=$(cat "$tmp_err")
|
|
252
|
-
if [[ "$err_msg" == *"tool_use"* ]] || [[ "$err_msg" == *"invalid_request_error"* ]]; then
|
|
253
|
-
echo ""
|
|
254
|
-
echo -e "${YELLOW}Session corrupted. Starting fresh...${NC}"
|
|
255
|
-
echo ""
|
|
256
|
-
return 1
|
|
257
|
-
else
|
|
258
|
-
echo -e "${RED}Error: $err_msg${NC}"
|
|
259
|
-
return 1
|
|
260
|
-
fi
|
|
261
|
-
fi
|
|
262
|
-
|
|
263
|
-
echo "$output"
|
|
264
|
-
return 0
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
# First message - starts a new session
|
|
268
|
-
echo -e "${CYAN}Claude:${NC}"
|
|
269
|
-
if ! run_claude -p --dangerously-skip-permissions --append-system-prompt "$spec_prompt" \
|
|
270
|
-
"Start the spec-building conversation. Ask what I'm building."; then
|
|
271
|
-
echo -e "${RED}Failed to start session${NC}"
|
|
272
|
-
return 1
|
|
273
|
-
fi
|
|
219
|
+
echo -e "To build specs, run ${CYAN}claude${NC} and use the ${CYAN}/golem:spec${NC} command."
|
|
220
|
+
echo ""
|
|
221
|
+
echo -e "${DIM}Workflow:${NC}"
|
|
222
|
+
echo -e " 1. ${CYAN}claude${NC} - Start Claude Code"
|
|
223
|
+
echo -e " 2. ${CYAN}/golem:spec${NC} - Build specs through conversation"
|
|
224
|
+
echo -e " 3. ${CYAN}exit${NC} - Exit when done"
|
|
225
|
+
echo -e " 4. ${CYAN}golem run plan${NC} - Generate implementation plan"
|
|
226
|
+
echo -e " 5. ${CYAN}golem run build${NC} - Run autonomous build loop"
|
|
274
227
|
echo ""
|
|
275
|
-
|
|
276
|
-
# Conversation loop
|
|
277
|
-
local restart_needed=false
|
|
278
|
-
while true; do
|
|
279
|
-
echo -ne "${GREEN}You:${NC} "
|
|
280
|
-
read -r user_input
|
|
281
|
-
|
|
282
|
-
[[ -z "$user_input" ]] && continue
|
|
283
|
-
[[ "$user_input" == "done" ]] && {
|
|
284
|
-
echo ""
|
|
285
|
-
echo -e "${GREEN}Done!${NC} Specs saved to specs/"
|
|
286
|
-
echo -e "Next: Run ${CYAN}golem run plan${NC} to create implementation plan"
|
|
287
|
-
break
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
echo ""
|
|
291
|
-
echo -e "${CYAN}Claude:${NC}"
|
|
292
|
-
if ! run_claude -p --continue --dangerously-skip-permissions "$user_input"; then
|
|
293
|
-
# Session error - offer to restart
|
|
294
|
-
echo -e "${YELLOW}Would you like to start a new session? (y/n)${NC} "
|
|
295
|
-
read -r restart_choice
|
|
296
|
-
if [[ "$restart_choice" == "y" ]]; then
|
|
297
|
-
echo ""
|
|
298
|
-
echo -e "${BLUE}Starting new session...${NC}"
|
|
299
|
-
echo -e "${DIM}Paste your previous context to continue where you left off.${NC}"
|
|
300
|
-
echo ""
|
|
301
|
-
echo -e "${CYAN}Claude:${NC}"
|
|
302
|
-
if ! run_claude -p --dangerously-skip-permissions --append-system-prompt "$spec_prompt" \
|
|
303
|
-
"Start the spec-building conversation. Ask what I'm building."; then
|
|
304
|
-
echo -e "${RED}Failed to start new session${NC}"
|
|
305
|
-
return 1
|
|
306
|
-
fi
|
|
307
|
-
else
|
|
308
|
-
echo -e "${DIM}Type 'done' to exit or try again${NC}"
|
|
309
|
-
fi
|
|
310
|
-
fi
|
|
311
|
-
echo ""
|
|
312
|
-
done
|
|
313
228
|
}
|
|
314
229
|
|
|
315
230
|
# Run the loop (plan or build mode)
|
package/bin/install.cjs
CHANGED
|
@@ -278,9 +278,9 @@ function install(isGlobal) {
|
|
|
278
278
|
2. Run ${cyan}golem --install${reset} in your project directory
|
|
279
279
|
|
|
280
280
|
${yellow}Workflow:${reset}
|
|
281
|
-
golem
|
|
282
|
-
golem run plan
|
|
283
|
-
golem run build
|
|
281
|
+
claude → /golem:spec → Define requirements (interactive)
|
|
282
|
+
golem run plan → Generate implementation plan
|
|
283
|
+
golem run build → Run autonomous coding loop
|
|
284
284
|
`);
|
|
285
285
|
}
|
|
286
286
|
|