golem-cc 2.1.1 → 3.0.0

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.
Files changed (84) hide show
  1. package/.claude/commands/golem/build.md +18 -0
  2. package/.claude/commands/golem/config.md +39 -0
  3. package/.claude/commands/golem/continue.md +73 -0
  4. package/.claude/commands/golem/doctor.md +46 -0
  5. package/.claude/commands/golem/document.md +138 -0
  6. package/.claude/commands/golem/help.md +58 -0
  7. package/.claude/commands/golem/pause.md +130 -0
  8. package/.claude/commands/golem/plan.md +111 -0
  9. package/.claude/commands/golem/review.md +166 -0
  10. package/.claude/commands/golem/security.md +186 -0
  11. package/.claude/commands/golem/simplify.md +76 -0
  12. package/.claude/commands/golem/spec.md +105 -0
  13. package/.claude/commands/golem/status.md +33 -0
  14. package/.golem/agents/code-simplifier.md +54 -0
  15. package/.golem/agents/review-architecture.md +59 -0
  16. package/.golem/agents/review-logic.md +50 -0
  17. package/.golem/agents/review-security.md +50 -0
  18. package/.golem/agents/review-style.md +48 -0
  19. package/.golem/agents/review-tests.md +48 -0
  20. package/.golem/agents/spec-builder.md +60 -0
  21. package/.golem/bin/golem.mjs +270 -0
  22. package/.golem/lib/build.mjs +557 -0
  23. package/.golem/lib/claude.mjs +95 -0
  24. package/.golem/lib/config.mjs +421 -0
  25. package/.golem/lib/display.mjs +191 -0
  26. package/.golem/lib/doctor.mjs +197 -0
  27. package/.golem/lib/document.mjs +792 -0
  28. package/.golem/lib/gates.mjs +78 -0
  29. package/.golem/lib/init.mjs +166 -0
  30. package/.golem/lib/output.mjs +40 -0
  31. package/.golem/lib/ratelimit.mjs +86 -0
  32. package/.golem/lib/security.mjs +603 -0
  33. package/.golem/lib/simplify.mjs +101 -0
  34. package/.golem/lib/tui.mjs +368 -0
  35. package/.golem/lib/usage.mjs +119 -0
  36. package/.golem/lib/worktree.mjs +509 -0
  37. package/.golem/prompts/build.md +23 -0
  38. package/.golem/prompts/document-inline.md +66 -0
  39. package/.golem/prompts/document-markdown.md +80 -0
  40. package/.golem/prompts/simplify.md +35 -0
  41. package/README.md +141 -142
  42. package/bin/golem-shim.mjs +36 -0
  43. package/bin/install.mjs +193 -0
  44. package/package.json +27 -32
  45. package/.env.example +0 -17
  46. package/bin/golem +0 -1006
  47. package/commands/golem/build.md +0 -235
  48. package/commands/golem/config.md +0 -55
  49. package/commands/golem/doctor.md +0 -137
  50. package/commands/golem/help.md +0 -212
  51. package/commands/golem/plan.md +0 -214
  52. package/commands/golem/review.md +0 -376
  53. package/commands/golem/security.md +0 -204
  54. package/commands/golem/simplify.md +0 -94
  55. package/commands/golem/spec.md +0 -226
  56. package/commands/golem/status.md +0 -60
  57. package/dist/api/freshworks.d.ts +0 -61
  58. package/dist/api/freshworks.d.ts.map +0 -1
  59. package/dist/api/freshworks.js +0 -119
  60. package/dist/api/freshworks.js.map +0 -1
  61. package/dist/api/gitea.d.ts +0 -96
  62. package/dist/api/gitea.d.ts.map +0 -1
  63. package/dist/api/gitea.js +0 -154
  64. package/dist/api/gitea.js.map +0 -1
  65. package/dist/cli/index.d.ts +0 -9
  66. package/dist/cli/index.d.ts.map +0 -1
  67. package/dist/cli/index.js +0 -352
  68. package/dist/cli/index.js.map +0 -1
  69. package/dist/sync/ticket-sync.d.ts +0 -53
  70. package/dist/sync/ticket-sync.d.ts.map +0 -1
  71. package/dist/sync/ticket-sync.js +0 -226
  72. package/dist/sync/ticket-sync.js.map +0 -1
  73. package/dist/types.d.ts +0 -125
  74. package/dist/types.d.ts.map +0 -1
  75. package/dist/types.js +0 -5
  76. package/dist/types.js.map +0 -1
  77. package/dist/worktree/manager.d.ts +0 -54
  78. package/dist/worktree/manager.d.ts.map +0 -1
  79. package/dist/worktree/manager.js +0 -190
  80. package/dist/worktree/manager.js.map +0 -1
  81. package/golem/agents/code-simplifier.md +0 -81
  82. package/golem/agents/spec-builder.md +0 -90
  83. package/golem/prompts/PROMPT_build.md +0 -71
  84. package/golem/prompts/PROMPT_plan.md +0 -102
@@ -0,0 +1,18 @@
1
+ The build loop should be run at the terminal, not inside Claude Code.
2
+
3
+ Run this command in your terminal:
4
+
5
+ ```
6
+ npx golem build
7
+ ```
8
+
9
+ **Why the terminal?** The build loop ("Ralph loop") spawns a fresh Claude context for each task. Running it here would nest Claude inside Claude, wasting tokens and losing the key benefit: each iteration starts clean with no accumulated confusion. The terminal version also provides rich real-time output (progress bars, spinners, token usage) that doesn't work inside this chat.
10
+
11
+ **Options:**
12
+ - `npx golem build --iterations 3` — limit to 3 tasks
13
+ - `npx golem build --dry-run` — preview the next task without running it
14
+ - `npx golem build --no-simplify` — skip the simplification pass
15
+
16
+ If you'd like, I can show you the current plan status — read `.golem/IMPLEMENTATION_PLAN.md` and summarize which stages are complete, what's next, and how many tasks remain.
17
+
18
+ Want me to show the current plan status?
@@ -0,0 +1,39 @@
1
+ Show current configuration for this golem project.
2
+
3
+ ## Steps
4
+
5
+ 1. Read `.golem/config.json` (if it doesn't exist, note that defaults are in use)
6
+ 2. Detect the project framework by checking for `nuxt.config.*` or `next.config.*`
7
+ 3. Check which security tools are installed: `which gitleaks`, `which semgrep`, `which trivy`
8
+ 4. Read `.golem/AGENTS.md` for the configured test/build/lint commands
9
+
10
+ ## Output
11
+
12
+ Present the configuration as a clear summary:
13
+
14
+ ```
15
+ Configuration (.golem/config.json):
16
+ model: {value} (default: opus)
17
+ autoCommit: {value} (default: true)
18
+ simplifyOnBuild: {value} (default: true)
19
+
20
+ Project:
21
+ Framework: {nuxt | next | none detected}
22
+ Path: {cwd}
23
+
24
+ Security Tools:
25
+ gitleaks: {installed | not installed}
26
+ semgrep: {installed | not installed}
27
+ trivy: {installed | not installed}
28
+
29
+ AGENTS.md Commands:
30
+ Test: {command or "not configured"}
31
+ Build: {command or "not configured"}
32
+ Lint: {command or "not configured"}
33
+ ```
34
+
35
+ If `$ARGUMENTS` contains `set`, tell the user to use the terminal command instead: `npx golem config set <key> <value>`. Valid keys: `model`, `autoCommit`, `simplifyOnBuild`.
36
+
37
+ ## Begin
38
+
39
+ Read the config file and gather project info now.
@@ -0,0 +1,73 @@
1
+ Resume work from a previous session by reading the handoff document and project context.
2
+
3
+ ## Steps
4
+
5
+ 1. **Check for handoff document**
6
+ - Read `.golem/HANDOFF.md`
7
+ - If it doesn't exist, tell the user: "No handoff document found. Run `/golem:pause` to create one first, or start fresh with `/golem:status`."
8
+ - Extract the timestamp/date from the handoff to show how fresh it is
9
+
10
+ 2. **Load project context**
11
+ - Read `.golem/AGENTS.md` for test/build/lint commands
12
+ - Read `.golem/config.json` for current settings
13
+ - Read `.golem/IMPLEMENTATION_PLAN.md` if it exists
14
+
15
+ 3. **Read memory files**
16
+ - Check for `.claude/projects/{project}/memory/MEMORY.md` and other memory files
17
+ - Incorporate any gotchas or learnings from memory
18
+
19
+ 4. **Present summary**
20
+ - Show when the handoff was created (date/timestamp from handoff)
21
+ - Current Focus: What was being worked on
22
+ - Next Steps: What to do next (from the handoff)
23
+ - Key Gotchas: Important things to remember
24
+ - Plan Progress: If there's an implementation plan, show X/Y tasks complete
25
+
26
+ 5. **Handle optional focus argument**
27
+ - If `$ARGUMENTS` is provided, note it as the narrowed focus
28
+ - Example: `/golem:continue "finish the pause/continue commands"`
29
+ - Incorporate the argument into the summary and next steps
30
+
31
+ 6. **Confirm before proceeding**
32
+ - Ask the user: "Does this match your understanding? Should I proceed with these next steps, or would you like to redirect?"
33
+ - Wait for user confirmation
34
+ - DO NOT modify any files or start work until the user confirms
35
+
36
+ ## Output Format
37
+
38
+ ```
39
+ # Resuming Session
40
+
41
+ Handoff created: {date/time from handoff}
42
+
43
+ ## Current Focus
44
+ {what was being worked on}
45
+
46
+ ## Next Steps
47
+ {prioritized list of what to do next}
48
+
49
+ ## Key Gotchas
50
+ {important caveats from handoff/memory}
51
+
52
+ ## Plan Progress
53
+ {X}/{Y} tasks complete ({percent}%)
54
+
55
+ {if $ARGUMENTS provided:}
56
+ **Narrowed Focus:** {$ARGUMENTS}
57
+
58
+ ---
59
+
60
+ Does this match your understanding? Should I proceed with these next steps, or would you like to redirect?
61
+ ```
62
+
63
+ ## Rules
64
+
65
+ - **Read-only until confirmed** — do not modify any files during the continue process
66
+ - Show the handoff timestamp so the user can judge if it's stale
67
+ - Keep the summary concise — hit the key points, don't reproduce the entire handoff
68
+ - If the handoff mentions specific files to read, read them to build deeper context before presenting the summary
69
+ - After user confirms, proceed with the work without additional ceremony
70
+
71
+ ## Begin
72
+
73
+ Read the handoff document now. If it's missing, stop and tell the user to run `/golem:pause` first.
@@ -0,0 +1,46 @@
1
+ Diagnose setup issues for this golem project. Run all checks inline and report results.
2
+
3
+ ## Checks
4
+
5
+ Run these checks in order, reporting pass/fail for each.
6
+
7
+ ### Project Checks
8
+
9
+ 1. **`.golem/` directory** — verify it exists with subdirs: `lib/`, `bin/`, `specs/`, `prompts/`, `agents/`
10
+ 2. **`AGENTS.md`** — verify `.golem/AGENTS.md` exists and is non-empty
11
+ 3. **Slash commands** — verify `.claude/commands/golem/` exists and contains `.md` files
12
+ 4. **`.env` in `.gitignore`** — read `.gitignore` and check that `.env` is listed
13
+ 5. **Specs** — check if `.golem/specs/` has any `.md` files
14
+ 6. **Implementation plan** — check if `.golem/IMPLEMENTATION_PLAN.md` exists
15
+
16
+ ### User Checks
17
+
18
+ 7. **Claude CLI** — run `claude --version` and report the version
19
+ 8. **Node.js >= 18** — run `node --version` and verify major version >= 18
20
+ 9. **Git configured** — run `git config user.name` and `git config user.email`
21
+ 10. **Old installations** — check if `~/.golem/` exists (it shouldn't)
22
+
23
+ ### Security Tools
24
+
25
+ 11. **gitleaks** — `which gitleaks`
26
+ 12. **semgrep** — `which semgrep`
27
+ 13. **trivy** — `which trivy`
28
+
29
+ For missing security tools, show install commands: `brew install gitleaks`, `brew install semgrep`, `brew install trivy`.
30
+
31
+ ### Test Validation
32
+
33
+ 14. Read the test command from `.golem/AGENTS.md` (first bash code block) and run it to verify it works.
34
+
35
+ ## Output
36
+
37
+ For each check, show a clear pass/fail indicator. At the end, show a summary: `{passed}/{total} checks passed`.
38
+
39
+ If `$ARGUMENTS` contains `--fix`, also attempt to fix issues:
40
+ - Create missing `.golem/` subdirectories
41
+ - Add `.env` to `.gitignore` if missing
42
+ - Note what was fixed
43
+
44
+ ## Begin
45
+
46
+ Start running the checks now.
@@ -0,0 +1,138 @@
1
+ You are running a full documentation pass for this project. Your goal is to detect the project type, add inline code documentation, generate markdown docs, update the changelog, and update the README.
2
+
3
+ ## Rules
4
+
5
+ - Do NOT change any code behavior — documentation only
6
+ - Do NOT touch test files, generated files, lock files, or node_modules
7
+ - Do NOT delete existing markdown documentation — archive deprecated content to `{docsPath}/deprecated/` with a deprecation date
8
+ - Do NOT add type annotations to JavaScript files
9
+ - Preserve existing accurate documentation — only update what has drifted from the code
10
+ - Documentation should be educational and clear, not boilerplate that restates function signatures
11
+
12
+ ## Options
13
+
14
+ Parse `$ARGUMENTS` for these flags:
15
+
16
+ - `--path <dir>` — scope documentation to a subdirectory instead of the whole project
17
+ - `--inline-only` — only run inline code documentation (Phase 2), skip markdown generation
18
+ - `--markdown-only` — only run markdown generation (Phase 3+), skip inline docs
19
+ - `--docs-path <dir>` — override the output directory for markdown docs (default: `docs/` or `docsPath` from `.golem/config.json`)
20
+ - `--dry-run` — report what would be documented without making any changes
21
+
22
+ If no flags are provided, run the full documentation pass (all phases).
23
+
24
+ ## Phase 1: Detect Project Type
25
+
26
+ Read `package.json`, `tsconfig.json`, `pyproject.toml`, and other manifest files to determine:
27
+
28
+ - **Language**: javascript, typescript, python
29
+ - **Framework**: vue, nuxt, react, next, none
30
+ - **Module system**: esm, commonjs, n/a
31
+ - **Database tooling**: prisma, drizzle, knex, sqlalchemy, alembic, raw-sql, none
32
+ - **Inline doc standard**: jsdoc, tsdoc, google-docstring, sql-comments
33
+
34
+ Report the detection results before proceeding.
35
+
36
+ ## Phase 2: Inline Documentation (skip if `--markdown-only`)
37
+
38
+ Find all source files in the project (or scoped path). For each file:
39
+
40
+ 1. Read the file completely
41
+ 2. Add a file header comment explaining its purpose and role in the system
42
+ 3. Add documentation to non-obvious functions, methods, classes, and types
43
+ 4. Use the correct standard for the detected project type:
44
+ - JavaScript/ESM: JSDoc (`/** ... */`)
45
+ - TypeScript: TSDoc (`/** ... */`) with `@param`, `@returns`, `@example`
46
+ - Vue/Nuxt SFCs: JSDoc in `<script>`, `<!-- -->` comments for non-obvious template/style sections
47
+ - React/Next: JSDoc/TSDoc
48
+ - Python: Google-style docstrings
49
+ - SQL: `--` comment blocks on tables, columns, procedures
50
+ 5. Skip trivially obvious functions (simple getters, self-documenting one-liners)
51
+ 6. Document complex conditionals and non-obvious "why" decisions inline
52
+
53
+ After documenting files, run the test command from `.golem/AGENTS.md` to verify no behavior was changed. If tests fail, revert the changes that broke them.
54
+
55
+ ## Phase 3: Markdown Documentation (skip if `--inline-only`)
56
+
57
+ Generate or update project documentation in the docs directory (`docs/` by default, or the path from `--docs-path` / `docsPath` config).
58
+
59
+ ### Directory Structure
60
+
61
+ ```
62
+ {docsPath}/
63
+ index.md — project overview
64
+ architecture.md — system design, component connections
65
+ getting-started.md — setup, install, prerequisites
66
+ configuration.md — all config options explained
67
+ modules/
68
+ {module-name}.md — one per major module/component
69
+ api/
70
+ {resource}.md — API reference (if project has endpoints)
71
+ database/
72
+ schema.md — schema overview with relationships
73
+ guides/
74
+ setup.md — dev environment setup
75
+ {workflow}.md — project-specific how-tos
76
+ deprecated/
77
+ {old-thing}.md — archived docs with deprecation date
78
+ ```
79
+
80
+ ### Frontmatter
81
+
82
+ Every markdown file must include YAML frontmatter:
83
+
84
+ ```yaml
85
+ ---
86
+ title: "Page Title"
87
+ description: "Brief description"
88
+ navigation:
89
+ order: 1
90
+ ---
91
+ ```
92
+
93
+ ### Content Rules
94
+
95
+ - Only create docs for things that actually exist — no empty placeholders
96
+ - Explain behavior and usage — do not dump source code into docs
97
+ - Use standard CommonMark markdown, no platform-specific extensions
98
+ - Cross-link related docs where appropriate
99
+
100
+ ## Phase 4: Changelog
101
+
102
+ Generate or update `CHANGELOG.md` at the project root from git history:
103
+
104
+ - Group by date with sections: **New Features**, **Improvements**, **Bug Fixes**
105
+ - Write in plain language for non-technical audiences (managers, stakeholders)
106
+ - No jargon — translate developer actions into user-facing impact
107
+ - Only include sections that have entries
108
+
109
+ ## Phase 5: README
110
+
111
+ Generate or update `README.md` at the project root:
112
+
113
+ - Include project name and description
114
+ - Link into the docs directory for detailed documentation
115
+ - Preserve any existing user-written content outside of golem-generated markers
116
+
117
+ ## Phase 6: Archive Deprecated
118
+
119
+ Check if any documented modules have been removed from the codebase. If so, move their docs to `{docsPath}/deprecated/` with:
120
+
121
+ - A `deprecated_date` field in frontmatter
122
+ - A `replaced_by` field (empty if no direct replacement)
123
+
124
+ ## Phase 7: Summary
125
+
126
+ Present a summary of what was done:
127
+
128
+ - Number of source files documented inline
129
+ - Number of markdown files created or updated
130
+ - Number of commits included in changelog
131
+ - README action (created or updated)
132
+ - Number of deprecated docs archived
133
+
134
+ If `--dry-run` was specified, report what would have been done without making changes.
135
+
136
+ ## Begin
137
+
138
+ Start by reading `.golem/config.json` for `docsPath` and model settings, then detect the project type (Phase 1). Announce that you're beginning the documentation pass.
@@ -0,0 +1,58 @@
1
+ Show all golem commands and how to use them.
2
+
3
+ Present the following help text to the user:
4
+
5
+ ---
6
+
7
+ ## Golem Commands
8
+
9
+ ### Slash Commands (Claude Code)
10
+
11
+ | Command | Description |
12
+ |---------|-------------|
13
+ | `/golem:spec` | Build project specs through guided conversation |
14
+ | `/golem:plan` | Create implementation plan from specs |
15
+ | `/golem:build` | Run autonomous build loop (redirects to terminal) |
16
+ | `/golem:review` | Run parallel code review before PR |
17
+ | `/golem:security` | Run automated security scans |
18
+ | `/golem:simplify` | Simplify recent or staged code changes |
19
+ | `/golem:status` | Show plan progress and recent commits |
20
+ | `/golem:doctor` | Diagnose setup issues |
21
+ | `/golem:config` | Show current configuration |
22
+ | `/golem:help` | Show this help text |
23
+
24
+ ### Terminal Commands
25
+
26
+ | Command | Description |
27
+ |---------|-------------|
28
+ | `npx golem build` | Run the build loop (recommended over slash command) |
29
+ | `npx golem build --iterations 3` | Limit to 3 tasks |
30
+ | `npx golem build --dry-run` | Preview next task without running |
31
+ | `npx golem security` | Run default security scan |
32
+ | `npx golem security --full` | Run full security scan with git history |
33
+ | `npx golem doctor` | Run health checks |
34
+ | `npx golem doctor --fix` | Run health checks and auto-fix issues |
35
+ | `npx golem config show` | Show current config |
36
+ | `npx golem config set <key> <value>` | Set a config value |
37
+ | `npx golem simplify [path]` | Simplify code |
38
+
39
+ ### Typical Workflow
40
+
41
+ 1. `/golem:spec` — define what you're building
42
+ 2. `/golem:plan` — create a staged implementation plan
43
+ 3. `npx golem build` — execute the plan (in terminal)
44
+ 4. `/golem:review` — review the code before shipping
45
+ 5. `/golem:security` — final security check
46
+
47
+ ### Key Files
48
+
49
+ - `.golem/specs/` — project specifications
50
+ - `.golem/IMPLEMENTATION_PLAN.md` — staged task plan
51
+ - `.golem/AGENTS.md` — test, build, lint commands
52
+ - `.golem/config.json` — project configuration
53
+ - `.golem/SECURITY_REPORT.md` — last security scan
54
+ - `.golem/REVIEW_REPORT.md` — last code review
55
+
56
+ ---
57
+
58
+ That's all the golem commands. Ask if you need details on any specific command.
@@ -0,0 +1,130 @@
1
+ You are generating a session handoff document. Your goal is to capture the full project state so a fresh Claude session can resume seamlessly using `/golem:continue`.
2
+
3
+ The handoff has two layers:
4
+ 1. **Factual sections** — gathered by reading files and running commands (deterministic, not from memory)
5
+ 2. **Conversational sections** — written by you based on what happened in this session
6
+
7
+ ## Phase 1: Gather Project Facts
8
+
9
+ Perform these steps to collect project state. If any file is missing, skip that section and note it was unavailable.
10
+
11
+ ### 1. Project Summary
12
+
13
+ Read `package.json` and extract the `name`, `version`, and `description` fields. Format as a one-liner.
14
+
15
+ ### 2. Git State
16
+
17
+ Run these commands:
18
+ ```bash
19
+ git branch --show-current
20
+ git status --short
21
+ git log --oneline -15
22
+ ```
23
+
24
+ Record the current branch, whether the working tree is clean or dirty (list changed files if dirty), and the last 15 commit subjects.
25
+
26
+ ### 3. Implementation Plan Progress
27
+
28
+ Read `.golem/IMPLEMENTATION_PLAN.md`. Count:
29
+ - Total tasks (lines matching `- [x]` or `- [ ]`)
30
+ - Completed (`[x]`)
31
+ - In-progress or pending (`[ ]`)
32
+
33
+ List any in-progress items. If the file doesn't exist, note: "No implementation plan found."
34
+
35
+ ### 4. Spec Status
36
+
37
+ List all files in `.golem/specs/` using a glob for `*.md`. For each spec file, note whether it appears to be implemented (check if its features exist in the codebase or if it's referenced in completed plan stages) or not yet implemented. If no specs exist, note: "No specs found."
38
+
39
+ ### 5. Config Snapshot
40
+
41
+ Read `.golem/config.json` and summarize the key settings: model, autoCommit, simplifyOnBuild, maxRetries, enabled gates, and any worktree configuration.
42
+
43
+ ### 6. Key Files
44
+
45
+ Read `package.json` for the entry points. List important project files from `.golem/lib/` and `.golem/bin/` with a one-line description of each file's purpose (read the first few lines of each if needed).
46
+
47
+ ### 7. Verified Commands
48
+
49
+ List commands that are known to work based on `package.json` scripts, `.golem/AGENTS.md`, and the CLI help output. Include the full command syntax.
50
+
51
+ ### 8. Gotchas
52
+
53
+ Read the existing `.golem/HANDOFF.md` (if it exists) for any "Don't Forget" or gotchas section. Also check `.claude/projects/` memory files for recorded gotchas. Preserve any known pitfalls.
54
+
55
+ ## Phase 2: Add Conversational Context
56
+
57
+ Based on what happened in this conversation session, write these sections:
58
+
59
+ ### Current Focus
60
+ What was actively being worked on in this session? What problem were we solving? Be specific — name files, features, bugs, or tasks.
61
+
62
+ ### What's Next
63
+ What are the concrete next steps to pick up from? List them in priority order. Be actionable — "run X", "implement Y", "fix Z".
64
+
65
+ ### Decisions Made
66
+ Any decisions from this conversation that aren't captured elsewhere. Include rationale so a fresh session understands the "why".
67
+
68
+ ## Phase 3: Assemble and Write HANDOFF.md
69
+
70
+ Combine all sections into a single markdown document with this structure:
71
+
72
+ ```markdown
73
+ # {project name} Handoff Document
74
+
75
+ ## Project Summary
76
+ {one-liner from package.json}
77
+
78
+ ## Git State
79
+ - **Branch:** {branch}
80
+ - **Working tree:** {clean or list of files}
81
+ - **Recent commits:**
82
+ {last 15 commits}
83
+
84
+ ## Plan Progress
85
+ {completed}/{total} tasks ({percent}%) — {in-progress count} in progress
86
+ {list in-progress items if any}
87
+
88
+ ## Spec Status
89
+ | Spec | Status |
90
+ |------|--------|
91
+ {each spec with status}
92
+
93
+ ## Config Snapshot
94
+ {key settings formatted as a list}
95
+
96
+ ## Key Files
97
+ | File | Purpose |
98
+ |------|---------|
99
+ {important files with descriptions}
100
+
101
+ ## Verified Commands
102
+ ```bash
103
+ {commands that work}
104
+ ```
105
+
106
+ ## Gotchas
107
+ {known pitfalls and caveats}
108
+
109
+ ## Current Focus
110
+ {what was being worked on — from conversation}
111
+
112
+ ## What's Next
113
+ {concrete next steps — from conversation}
114
+
115
+ ## Decisions Made
116
+ {decisions and rationale — from conversation}
117
+ ```
118
+
119
+ Write the assembled document to `.golem/HANDOFF.md`, overwriting any existing content.
120
+
121
+ ## Phase 4: Confirm
122
+
123
+ After writing the file, tell the user:
124
+ - The handoff was written to `.golem/HANDOFF.md`
125
+ - How many sections were populated vs skipped
126
+ - They can now `/clear` or start a new session, and use `/golem:continue` to resume
127
+
128
+ ## Begin
129
+
130
+ Start by gathering project facts (Phase 1). Read all the files and run the commands now.
@@ -0,0 +1,111 @@
1
+ You are a planning agent for a software project. Your job is to analyze specs, investigate the codebase, and generate a staged implementation plan. You do NOT write code — you only plan.
2
+
3
+ ## Rules
4
+
5
+ - Do NOT modify any source code, config files, or test files
6
+ - Do NOT create new source files
7
+ - The ONLY file you write is `.golem/IMPLEMENTATION_PLAN.md`
8
+ - Ask the user to confirm the plan before writing it
9
+ - Every task must be atomic and independently testable
10
+ - Every stage must produce a working, committable state
11
+
12
+ ## Process
13
+
14
+ ### Phase 1: Read Specs
15
+
16
+ Read ALL spec files in `.golem/specs/`. Summarize what you find — list each spec and its core requirements. If no specs exist, tell the user to run `/golem:spec` first and stop.
17
+
18
+ ### Phase 2: Investigate Codebase
19
+
20
+ Search the codebase extensively:
21
+
22
+ 1. Read `package.json` for dependencies, scripts, and project structure
23
+ 2. Read `.golem/AGENTS.md` for test, build, and lint commands
24
+ 3. Scan source directories for existing implementations
25
+ 4. Check for existing tests, configs, and infrastructure
26
+ 5. Read any existing `.golem/IMPLEMENTATION_PLAN.md` to understand prior progress
27
+
28
+ Build a mental map of what exists and how it's structured.
29
+
30
+ ### Phase 3: Gap Analysis
31
+
32
+ For each spec requirement, classify it:
33
+
34
+ - **Done** — fully implemented and tested
35
+ - **Partial** — started but incomplete (note what's missing)
36
+ - **Missing** — not implemented at all
37
+ - **Blocked** — can't be implemented yet (note the blocker)
38
+
39
+ Present the gap analysis to the user as a table. Ask if anything looks wrong before proceeding.
40
+
41
+ ### Phase 4: Generate Plan
42
+
43
+ Create staged tasks from the gaps:
44
+
45
+ 1. **Group by dependency** — things that must come first go in earlier stages
46
+ 2. **Group by coherence** — related tasks belong in the same stage
47
+ 3. **Order within stages** — foundational pieces first, then features, then polish
48
+ 4. **Keep stages small** — 3-6 tasks per stage is ideal
49
+ 5. **Each stage gets a conventional commit message** — `feat(scope): description`, `fix(scope): description`, etc.
50
+
51
+ For each task, specify:
52
+ - **Title** — what gets built
53
+ - **Files** — which files will be created or modified
54
+ - **Model** — `opus` for complex architecture, refactoring, multi-file features, or tricky logic. `sonnet` for straightforward tasks like adding tests, renaming, simple CRUD, config changes, documentation, or single-file modifications with clear specs. Default to `sonnet` — only use `opus` when reasoning depth matters.
55
+ - **Notes** — implementation hints (what to do, not how to code it)
56
+ - **Tests** — how to verify it works
57
+ - **Depends on** — other tasks that must complete first (only if within the same stage)
58
+
59
+ Preserve completed tasks from any existing plan — mark them `[x]` and keep their content.
60
+
61
+ ### Phase 5: Write Plan
62
+
63
+ Present the full plan to the user. After they confirm, write it to `.golem/IMPLEMENTATION_PLAN.md` using this format:
64
+
65
+ ```markdown
66
+ # Implementation Plan
67
+
68
+ Generated: {date}
69
+ Based on: .golem/specs/*.md
70
+
71
+ ## Status
72
+ - Stages: {N}
73
+ - Completed: {count}
74
+
75
+ ---
76
+
77
+ ## Stage 1: {Name}
78
+ Commit: {type}({scope}): {description}
79
+
80
+ ### [ ] 1.1. {Task title}
81
+ Files: {expected files}
82
+ Model: {opus or sonnet}
83
+ Notes: {implementation hints}
84
+ Tests: {verification criteria}
85
+
86
+ ### [ ] 1.2. {Task title}
87
+ Files: {files}
88
+ Model: {opus or sonnet}
89
+ Notes: {notes}
90
+ Depends on: 1.1
91
+ Tests: {tests}
92
+
93
+ ---
94
+
95
+ ## Stage 2: {Name}
96
+ Commit: {type}({scope}): {description}
97
+
98
+ ...
99
+
100
+ ---
101
+
102
+ ## Risks & Mitigations
103
+
104
+ - **{Risk}** — {description}. Mitigation: {strategy}.
105
+ ```
106
+
107
+ End with a summary: how many stages, how many tasks, estimated scope.
108
+
109
+ ## Starting
110
+
111
+ Begin by reading all files in `.golem/specs/`. Then investigate the codebase. Do not ask the user any questions until you've completed your analysis and are ready to present the gap analysis.