golem-cc 0.1.21 → 0.1.23
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 +105 -35
- package/bin/install.cjs +6 -0
- package/golem/prompts/PROMPT_build.md +6 -6
- package/golem/prompts/PROMPT_plan.md +4 -4
- package/package.json +1 -1
package/bin/golem
CHANGED
|
@@ -86,6 +86,35 @@ kv_line() {
|
|
|
86
86
|
printf " ${key_color}%-12s${NC} %s\n" "$key" "$value"
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
# Get version from package.json or embedded version file
|
|
90
|
+
get_version() {
|
|
91
|
+
# Check for version file first (created during global install)
|
|
92
|
+
if [[ -f "$GOLEM_DIR/VERSION" ]]; then
|
|
93
|
+
cat "$GOLEM_DIR/VERSION"
|
|
94
|
+
return
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
# Check source directory package.json
|
|
98
|
+
local source_pkg="$(dirname "$SCRIPT_DIR")/package.json"
|
|
99
|
+
local pkg_file=""
|
|
100
|
+
|
|
101
|
+
if [[ -f "$source_pkg" ]]; then
|
|
102
|
+
pkg_file="$source_pkg"
|
|
103
|
+
elif [[ -f "$GOLEM_DIR/package.json" ]]; then
|
|
104
|
+
pkg_file="$GOLEM_DIR/package.json"
|
|
105
|
+
fi
|
|
106
|
+
|
|
107
|
+
if [[ -n "$pkg_file" ]]; then
|
|
108
|
+
if command -v jq &>/dev/null; then
|
|
109
|
+
jq -r '.version // "unknown"' "$pkg_file" 2>/dev/null || echo "unknown"
|
|
110
|
+
else
|
|
111
|
+
grep -o '"version"[[:space:]]*:[[:space:]]*"[^"]*"' "$pkg_file" | head -1 | sed 's/.*"\([^"]*\)"$/\1/'
|
|
112
|
+
fi
|
|
113
|
+
else
|
|
114
|
+
echo "unknown"
|
|
115
|
+
fi
|
|
116
|
+
}
|
|
117
|
+
|
|
89
118
|
# Audit logging
|
|
90
119
|
log_event() {
|
|
91
120
|
local event="$1"
|
|
@@ -188,7 +217,9 @@ check_installed() {
|
|
|
188
217
|
# Install golem to current project
|
|
189
218
|
cmd_install() {
|
|
190
219
|
print_banner
|
|
191
|
-
|
|
220
|
+
local version
|
|
221
|
+
version=$(get_version)
|
|
222
|
+
header_box "INSTALLING v$version" "$BLUE"
|
|
192
223
|
echo ""
|
|
193
224
|
|
|
194
225
|
# Create directories
|
|
@@ -196,11 +227,11 @@ cmd_install() {
|
|
|
196
227
|
mkdir -p .golem/agents
|
|
197
228
|
mkdir -p .golem/specs
|
|
198
229
|
|
|
199
|
-
# Copy prompts and agents
|
|
230
|
+
# Copy prompts and agents (don't overwrite existing)
|
|
200
231
|
local copied_agents=false
|
|
201
232
|
if [[ -d "$GOLEM_DIR/golem/agents" ]]; then
|
|
202
|
-
if cp "$GOLEM_DIR/golem/prompts/"*.md .golem/prompts/ 2>/dev/null && \
|
|
203
|
-
cp "$GOLEM_DIR/golem/agents/"*.md .golem/agents/ 2>/dev/null; then
|
|
233
|
+
if cp -n "$GOLEM_DIR/golem/prompts/"*.md .golem/prompts/ 2>/dev/null && \
|
|
234
|
+
cp -n "$GOLEM_DIR/golem/agents/"*.md .golem/agents/ 2>/dev/null; then
|
|
204
235
|
copied_agents=true
|
|
205
236
|
echo -e "${GREEN}✓${NC} Copied prompts and agents"
|
|
206
237
|
fi
|
|
@@ -215,40 +246,13 @@ cmd_install() {
|
|
|
215
246
|
|
|
216
247
|
# Create AGENTS.md if it doesn't exist
|
|
217
248
|
if [[ ! -f ".golem/AGENTS.md" ]]; then
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
## Commands
|
|
222
|
-
|
|
223
|
-
### Testing
|
|
224
|
-
```bash
|
|
225
|
-
npm test
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
### Type Checking
|
|
229
|
-
```bash
|
|
230
|
-
npm run typecheck
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
### Linting
|
|
234
|
-
```bash
|
|
235
|
-
npm run lint
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
### Build
|
|
239
|
-
```bash
|
|
240
|
-
npm run build
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
## Learnings
|
|
244
|
-
<!-- Updated during build iterations -->
|
|
245
|
-
EOF
|
|
249
|
+
# Auto-detect project type and create AGENTS.md
|
|
250
|
+
detect_project
|
|
246
251
|
echo -e "${GREEN}✓${NC} Created .golem/AGENTS.md"
|
|
252
|
+
else
|
|
253
|
+
echo -e "${GREEN}✓${NC} Preserved existing .golem/AGENTS.md"
|
|
247
254
|
fi
|
|
248
255
|
|
|
249
|
-
# Auto-detect project type
|
|
250
|
-
detect_project
|
|
251
|
-
|
|
252
256
|
echo -e "${GREEN}✓${NC} Created .golem/ directory"
|
|
253
257
|
echo -e "${GREEN}✓${NC} Created .golem/specs/ directory"
|
|
254
258
|
echo ""
|
|
@@ -315,8 +319,74 @@ EOF
|
|
|
315
319
|
EOF
|
|
316
320
|
elif [[ -f "pyproject.toml" ]] || [[ -f "requirements.txt" ]]; then
|
|
317
321
|
echo -e "${GREEN}✓${NC} Detected Python project"
|
|
322
|
+
cat > .golem/AGENTS.md << 'EOF'
|
|
323
|
+
# Operational Guide
|
|
324
|
+
|
|
325
|
+
## Commands
|
|
326
|
+
|
|
327
|
+
### Testing
|
|
328
|
+
```bash
|
|
329
|
+
pytest
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### Linting
|
|
333
|
+
```bash
|
|
334
|
+
ruff check .
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Type Checking
|
|
338
|
+
```bash
|
|
339
|
+
mypy .
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
## Learnings
|
|
343
|
+
<!-- Updated during build iterations -->
|
|
344
|
+
EOF
|
|
318
345
|
elif [[ -f "go.mod" ]]; then
|
|
319
346
|
echo -e "${GREEN}✓${NC} Detected Go project"
|
|
347
|
+
cat > .golem/AGENTS.md << 'EOF'
|
|
348
|
+
# Operational Guide
|
|
349
|
+
|
|
350
|
+
## Commands
|
|
351
|
+
|
|
352
|
+
### Testing
|
|
353
|
+
```bash
|
|
354
|
+
go test ./...
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### Linting
|
|
358
|
+
```bash
|
|
359
|
+
golangci-lint run
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### Build
|
|
363
|
+
```bash
|
|
364
|
+
go build ./...
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
## Learnings
|
|
368
|
+
<!-- Updated during build iterations -->
|
|
369
|
+
EOF
|
|
370
|
+
else
|
|
371
|
+
# Unknown project type - create generic AGENTS.md
|
|
372
|
+
cat > .golem/AGENTS.md << 'EOF'
|
|
373
|
+
# Operational Guide
|
|
374
|
+
|
|
375
|
+
## Commands
|
|
376
|
+
|
|
377
|
+
### Testing
|
|
378
|
+
```bash
|
|
379
|
+
# Add your test command here
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### Build
|
|
383
|
+
```bash
|
|
384
|
+
# Add your build command here
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
## Learnings
|
|
388
|
+
<!-- Updated during build iterations -->
|
|
389
|
+
EOF
|
|
320
390
|
fi
|
|
321
391
|
}
|
|
322
392
|
|
package/bin/install.cjs
CHANGED
|
@@ -267,6 +267,12 @@ function install(isGlobal) {
|
|
|
267
267
|
// Write VERSION file
|
|
268
268
|
const versionDest = path.join(claudeDir, 'golem', 'VERSION');
|
|
269
269
|
fs.writeFileSync(versionDest, pkg.version);
|
|
270
|
+
|
|
271
|
+
// For global install, also write VERSION to ~/.golem/ for CLI access
|
|
272
|
+
if (isGlobal) {
|
|
273
|
+
const golemVersionDest = path.join(golemHomeDir, 'VERSION');
|
|
274
|
+
fs.writeFileSync(golemVersionDest, pkg.version);
|
|
275
|
+
}
|
|
270
276
|
console.log(` ${green}✓${reset} Wrote VERSION (${pkg.version})`);
|
|
271
277
|
|
|
272
278
|
// Install shell alias
|
|
@@ -5,13 +5,13 @@ You are in BUILD MODE. Implement ONE task from the plan, then exit.
|
|
|
5
5
|
## Phase 0: Orient
|
|
6
6
|
|
|
7
7
|
Study these files to understand context:
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
8
|
+
- @.golem/specs/* - All specification files
|
|
9
|
+
- @.golem/AGENTS.md - Operational commands (test/build/lint)
|
|
10
|
+
- @.golem/IMPLEMENTATION_PLAN.md - Current task list
|
|
11
11
|
|
|
12
12
|
## Phase 1: Select Task
|
|
13
13
|
|
|
14
|
-
1. Read IMPLEMENTATION_PLAN.md
|
|
14
|
+
1. Read .golem/IMPLEMENTATION_PLAN.md
|
|
15
15
|
2. Pick the first incomplete task (marked `- [ ]`)
|
|
16
16
|
3. Do NOT assume something is not implemented - search first
|
|
17
17
|
|
|
@@ -33,8 +33,8 @@ If ANY fails: fix the issue, then re-run ALL validation from the beginning.
|
|
|
33
33
|
|
|
34
34
|
## Phase 4: Complete
|
|
35
35
|
|
|
36
|
-
1. Update IMPLEMENTATION_PLAN.md - mark task `- [x]`
|
|
37
|
-
2. Update AGENTS.md learnings if you discovered something useful
|
|
36
|
+
1. Update .golem/IMPLEMENTATION_PLAN.md - mark task `- [x]`
|
|
37
|
+
2. Update .golem/AGENTS.md learnings if you discovered something useful
|
|
38
38
|
3. Commit changes with descriptive message
|
|
39
39
|
4. Exit
|
|
40
40
|
|
|
@@ -5,9 +5,9 @@ You are in PLANNING MODE. Analyze specs vs existing code and create IMPLEMENTATI
|
|
|
5
5
|
## Phase 0: Orient
|
|
6
6
|
|
|
7
7
|
Study these files first:
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
8
|
+
- @.golem/specs/* - All specification files
|
|
9
|
+
- @.golem/AGENTS.md - Operational commands
|
|
10
|
+
- @.golem/IMPLEMENTATION_PLAN.md - Current plan (if exists)
|
|
11
11
|
|
|
12
12
|
## Phase 1: Gap Analysis
|
|
13
13
|
|
|
@@ -19,7 +19,7 @@ Study these files first:
|
|
|
19
19
|
|
|
20
20
|
## Phase 2: Create Plan
|
|
21
21
|
|
|
22
|
-
Write
|
|
22
|
+
Write `.golem/IMPLEMENTATION_PLAN.md` with prioritized tasks:
|
|
23
23
|
|
|
24
24
|
```markdown
|
|
25
25
|
# Implementation Plan
|