golem-cc 2.0.0 → 2.1.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.
@@ -0,0 +1,204 @@
1
+ ---
2
+ name: golem:security
3
+ description: Run automated security scans
4
+ allowed-tools: [Read, Bash, Write]
5
+ ---
6
+
7
+ <objective>
8
+ Run automated security tooling to detect vulnerabilities before code review. Uses gitleaks (secrets), semgrep (SAST), pnpm audit (dependencies), and trivy (containers).
9
+ </objective>
10
+
11
+ <context>
12
+ Current ticket:
13
+ ```bash
14
+ TICKET_ID=$(basename "$(pwd)" | grep -oE '(INC|SR)-[0-9]+' || echo "")
15
+ echo "Ticket: ${TICKET_ID:-none}"
16
+ ```
17
+
18
+ Check available tools:
19
+ ```bash
20
+ echo "Checking security tools..."
21
+ which gitleaks && gitleaks version || echo "gitleaks: NOT INSTALLED"
22
+ which semgrep && semgrep --version || echo "semgrep: NOT INSTALLED"
23
+ which trivy && trivy --version || echo "trivy: NOT INSTALLED"
24
+ pnpm --version && echo "pnpm: OK" || echo "pnpm: NOT INSTALLED"
25
+ ```
26
+ </context>
27
+
28
+ <process>
29
+
30
+ ## Phase 1: Pre-flight
31
+
32
+ Check which security tools are available. Not all are required - run what's available.
33
+
34
+ Required tools and install commands:
35
+ - **gitleaks**: `brew install gitleaks` or `go install github.com/gitleaks/gitleaks/v8@latest`
36
+ - **semgrep**: `brew install semgrep` or `pip install semgrep`
37
+ - **trivy**: `brew install trivy` or `curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh`
38
+ - **pnpm**: `npm install -g pnpm`
39
+
40
+ ## Phase 2: Run Security Scans
41
+
42
+ Run each available tool and capture results:
43
+
44
+ ### 2.1 Secrets Scan (gitleaks)
45
+ ```bash
46
+ if command -v gitleaks &> /dev/null; then
47
+ echo "=== SECRETS SCAN (gitleaks) ==="
48
+ if [ -f .gitleaks.toml ]; then
49
+ gitleaks detect --config .gitleaks.toml --no-git -v 2>&1
50
+ else
51
+ gitleaks detect --no-git -v 2>&1
52
+ fi
53
+ echo "Exit code: $?"
54
+ fi
55
+ ```
56
+
57
+ Scans for:
58
+ - API keys (AWS, GCP, Azure, Stripe, etc.)
59
+ - Private keys (RSA, SSH, PGP)
60
+ - Database connection strings with passwords
61
+ - OAuth/JWT tokens
62
+ - Hardcoded credentials
63
+
64
+ ### 2.2 SAST Scan (semgrep)
65
+ ```bash
66
+ if command -v semgrep &> /dev/null; then
67
+ echo "=== SAST SCAN (semgrep) ==="
68
+ semgrep scan --config auto --json 2>&1 | head -200
69
+ echo "Exit code: $?"
70
+ fi
71
+ ```
72
+
73
+ Scans for OWASP Top 10:
74
+ - A01: Broken Access Control
75
+ - A02: Cryptographic Failures
76
+ - A03: Injection (SQL, XSS, Command)
77
+ - A04: Insecure Design
78
+ - A05: Security Misconfiguration
79
+ - A06: Vulnerable Components
80
+ - A07: Authentication Failures
81
+ - A08: Data Integrity Failures
82
+ - A09: Logging Failures
83
+ - A10: SSRF
84
+
85
+ ### 2.3 Dependency Scan (pnpm audit)
86
+ ```bash
87
+ if [ -f package.json ]; then
88
+ echo "=== DEPENDENCY SCAN (pnpm audit) ==="
89
+ pnpm audit --json 2>&1 | head -100
90
+ echo "Exit code: $?"
91
+ fi
92
+ ```
93
+
94
+ Checks against:
95
+ - National Vulnerability Database (NVD/CVE)
96
+ - GitHub Advisory Database
97
+ - npm Security Advisories
98
+
99
+ ### 2.4 Container Scan (trivy)
100
+ ```bash
101
+ if command -v trivy &> /dev/null && command -v docker &> /dev/null; then
102
+ # Check for local image or Dockerfile
103
+ if docker images --format "{{.Repository}}" 2>/dev/null | head -1 | grep -q .; then
104
+ echo "=== CONTAINER SCAN (trivy) ==="
105
+ IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" 2>/dev/null | head -1)
106
+ trivy image --severity HIGH,CRITICAL "$IMAGE" 2>&1 | head -100
107
+ echo "Exit code: $?"
108
+ elif [ -f Dockerfile ]; then
109
+ echo "=== DOCKERFILE SCAN (trivy) ==="
110
+ trivy config Dockerfile 2>&1
111
+ echo "Exit code: $?"
112
+ else
113
+ echo "=== CONTAINER SCAN: SKIPPED (no image or Dockerfile) ==="
114
+ fi
115
+ fi
116
+ ```
117
+
118
+ Scans for:
119
+ - OS package vulnerabilities
120
+ - Application dependencies in image
121
+ - Dockerfile misconfigurations
122
+
123
+ ## Phase 3: Generate Report
124
+
125
+ Write `.golem/SECURITY_REPORT.md`:
126
+
127
+ ```markdown
128
+ # Security Scan Report
129
+
130
+ **Generated:** {ISO timestamp}
131
+ **Ticket:** {TICKET_ID}
132
+
133
+ ## Summary
134
+
135
+ | Scan | Status | Findings |
136
+ |------|--------|----------|
137
+ | Secrets (gitleaks) | {PASS/FAIL/SKIPPED} | {count} |
138
+ | SAST (semgrep) | {PASS/FAIL/SKIPPED} | {count} |
139
+ | Dependencies (pnpm) | {PASS/FAIL/SKIPPED} | {high}/{critical} |
140
+ | Container (trivy) | {PASS/FAIL/SKIPPED} | {count} |
141
+
142
+ ## Verdict
143
+
144
+ {PASS | FAIL | PARTIAL}
145
+
146
+ ---
147
+
148
+ ## Findings
149
+
150
+ ### Secrets
151
+ {details or "No secrets detected"}
152
+
153
+ ### SAST
154
+ {details or "No vulnerabilities detected"}
155
+
156
+ ### Dependencies
157
+ {details or "No vulnerable dependencies"}
158
+
159
+ ### Container
160
+ {details or "No container vulnerabilities"}
161
+
162
+ ---
163
+
164
+ ## Next Steps
165
+
166
+ {If FAIL: list what needs to be fixed}
167
+ {If PASS: "Ready for code review - run /golem:review"}
168
+ ```
169
+
170
+ ## Phase 4: Verdict
171
+
172
+ **PASS**: All scans passed (or skipped due to missing tools)
173
+ - Announce ready for review
174
+ - Suggest running `/golem:review`
175
+
176
+ **FAIL**: Any scan found issues
177
+ - List critical findings
178
+ - Block until fixed
179
+ - Do NOT proceed to review
180
+
181
+ **PARTIAL**: Some tools missing
182
+ - Warn about missing coverage
183
+ - Suggest installing missing tools
184
+ - Allow proceeding with caution
185
+
186
+ </process>
187
+
188
+ <success_criteria>
189
+ - [ ] Available security tools identified
190
+ - [ ] Secrets scan completed (if gitleaks available)
191
+ - [ ] SAST scan completed (if semgrep available)
192
+ - [ ] Dependency scan completed (if package.json exists)
193
+ - [ ] Container scan completed (if applicable)
194
+ - [ ] Report generated at .golem/SECURITY_REPORT.md
195
+ - [ ] Clear verdict provided
196
+ </success_criteria>
197
+
198
+ <important>
199
+ - This is READ-ONLY - do not fix issues, just report them
200
+ - Any secrets found are CRITICAL - must be rotated immediately
201
+ - High/Critical dependency vulns should block merge
202
+ - Missing tools should trigger a warning, not a failure
203
+ - Container scan only runs if image exists or Dockerfile present
204
+ </important>
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: golem:spec
3
3
  description: Build project specs through guided conversation
4
- allowed-tools: [Read, Write, Glob, Grep, Bash, AskUserQuestion]
4
+ allowed-tools: [Read, Write, Glob, Grep, Bash, AskUserQuestion, Task]
5
5
  ---
6
6
 
7
7
  <objective>
8
- Guide the user through a structured conversation to define requirements for the current ticket/issue and generate spec files. This creates the foundation for the implementation plan and build loop.
8
+ Spawn an agent team to explore requirements from multiple angles, challenge assumptions, and generate robust specs. The team synthesizes findings into spec files that form the foundation for planning and building.
9
9
  </objective>
10
10
 
11
11
  <execution_context>
@@ -32,57 +32,91 @@ Project structure:
32
32
  ```bash
33
33
  if [ -f package.json ]; then echo "Node/TypeScript project"; head -30 package.json; fi
34
34
  if [ -f pyproject.toml ]; then echo "Python project"; head -30 pyproject.toml; fi
35
+ if [ -f Cargo.toml ]; then echo "Rust project"; head -30 Cargo.toml; fi
35
36
  ```
36
37
  </context>
37
38
 
38
39
  <process>
39
40
 
40
- ## Phase 1: Ticket Context
41
+ ## Phase 1: Gather Initial Context
41
42
 
42
- If we're in a ticket worktree:
43
- 1. Read the Fresh ticket description and Gitea issue
44
- 2. Summarize what the user/reporter is asking for
45
- 3. Ask clarifying questions about the actual need
43
+ Before spawning the team, gather baseline information:
46
44
 
47
- If NOT in a ticket worktree:
48
- 1. Ask: "What are you building? What problem does this solve?"
49
- 2. Offer to create a ticket: "Should I create a Fresh ticket and Gitea issue for this work?"
45
+ 1. If in a ticket worktree: read the ticket description
46
+ 2. If NOT in a ticket worktree: ask what we're building
47
+ 3. Get a rough sense of scope and purpose
50
48
 
51
- ## Phase 2: Requirement Extraction
49
+ ## Phase 2: Spawn Spec Team
52
50
 
53
- Understand the scope:
54
- 1. **What's the actual problem?** - Not the solution, the problem
55
- 2. **Who's affected?** - Users, internal, integrations?
56
- 3. **What's the minimum viable fix/feature?** - v1 scope
57
- 4. **What's explicitly NOT in scope?** - Boundaries
51
+ Create an agent team with three specialized teammates:
58
52
 
59
- Use `AskUserQuestion` for concrete choices, open questions for exploration.
53
+ ```
54
+ Create an agent team to explore requirements for this feature/fix.
55
+ Spawn three teammates:
56
+
57
+ 1. **UX Advocate** - Focuses on user experience and usability:
58
+ - Who are the users?
59
+ - What's their workflow?
60
+ - What's the simplest interface that solves the problem?
61
+ - Where will users get confused or frustrated?
62
+
63
+ 2. **Architect** - Focuses on technical design:
64
+ - What's the system architecture?
65
+ - How does this fit into existing code?
66
+ - What are the technical constraints?
67
+ - What are the integration points?
68
+
69
+ 3. **Devil's Advocate** - Actively challenges assumptions:
70
+ - "Do we actually need this?"
71
+ - "What's the simplest thing that could work?"
72
+ - "What happens when X fails?"
73
+ - "Why not use existing solution Y?"
74
+
75
+ Rules for Devil's Advocate:
76
+ - Must articulate WHY something is problematic
77
+ - Must propose a concrete alternative
78
+ - Must back down when concern is adequately addressed
79
+ - Goal is better thinking, not blocking progress
80
+
81
+ Have them explore the problem space simultaneously, share findings,
82
+ and challenge each other's assumptions. The debate should surface
83
+ requirements we'd otherwise miss.
84
+ ```
85
+
86
+ ## Phase 3: Team Exploration
60
87
 
61
- ## Phase 3: Topic Decomposition
88
+ Let the team explore these questions:
62
89
 
63
- Extract distinct "topics of concern":
64
- 1. Based on what you learned, propose 1-5 topics
65
- - Each topic should pass the "no AND test"
66
- - Good: "input validation", "error handling", "API response format"
67
- - Bad: "validation and error handling" (split these)
90
+ ### UX Advocate investigates:
91
+ - What's the actual problem users face?
92
+ - What's the minimum viable solution?
93
+ - What edge cases will users encounter?
94
+ - What error states need handling?
68
95
 
69
- 2. Ask if any topics should be added, removed, or split
96
+ ### Architect investigates:
97
+ - What existing code/patterns can we reuse?
98
+ - What new components are needed?
99
+ - What are the dependencies?
100
+ - What technical constraints exist?
70
101
 
71
- ## Phase 4: Spec Generation
102
+ ### Devil's Advocate challenges:
103
+ - Is this feature actually necessary?
104
+ - Are we overengineering?
105
+ - What's the cost of NOT doing this?
106
+ - What simpler alternatives exist?
72
107
 
73
- For each topic, have a focused mini-conversation:
108
+ ## Phase 4: Synthesize Findings
74
109
 
75
- 1. **Requirements**: Ask 2-4 targeted questions:
76
- - What MUST it do?
77
- - What SHOULD it do if time allows?
78
- - What must it NOT do?
79
- - Technical constraints?
110
+ After team exploration, synthesize into topics:
80
111
 
81
- 2. **Tests**: What tests must pass for this to be considered done?
112
+ 1. Review findings from all three perspectives
113
+ 2. Identify 1-5 distinct topics of concern
114
+ 3. Each topic should pass the "no AND test"
115
+ 4. Resolve any conflicts between teammates
82
116
 
83
- 3. **Write File**: Save to `.golem/specs/{topic-name}.md`
117
+ ## Phase 5: Generate Spec Files
84
118
 
85
- ### Spec File Format
119
+ For each topic, write to `.golem/specs/{topic-name}.md`:
86
120
 
87
121
  ```markdown
88
122
  # {Topic Name}
@@ -110,22 +144,22 @@ Ticket: {INC-XXXX} (if applicable)
110
144
 
111
145
  ## Tests
112
146
  - {Test description} → expects {outcome}
113
- - {Test description} → expects {outcome}
114
147
 
115
148
  ## Technical Notes
116
- {Implementation hints, constraints, or decisions}
149
+ {Implementation hints, constraints, decisions}
150
+
151
+ ## Considered Alternatives
152
+ {What the Devil's Advocate proposed and why we did/didn't take it}
117
153
  ```
118
154
 
119
- ## Phase 5: Operational Setup
155
+ ## Phase 6: Operational Setup
120
156
 
121
- After all specs are written:
157
+ After specs are written:
122
158
 
123
159
  1. Create `.golem/specs/` directory if needed
124
160
  2. Write each spec file
125
161
  3. Detect or ask for test/build/lint commands
126
- 4. Write `.golem/AGENTS.md`
127
-
128
- ### AGENTS.md Format
162
+ 4. Write `.golem/AGENTS.md`:
129
163
 
130
164
  ```markdown
131
165
  # Operational Guide
@@ -154,16 +188,15 @@ Branch: {branch-name}
154
188
  <!-- Updated during build iterations -->
155
189
  ```
156
190
 
157
- ## Phase 6: Sync & Completion
191
+ ## Phase 7: Cleanup & Completion
158
192
 
159
- 1. Update the ticket status to "spec" in Fresh and Gitea:
193
+ 1. Clean up the agent team
194
+ 2. Update ticket status:
160
195
  ```bash
161
196
  golem-api ticket:status $TICKET_ID spec --note "Specs complete"
162
197
  ```
163
-
164
- 2. Summarize what was created
165
-
166
- 3. Show next steps:
198
+ 3. Summarize what was created
199
+ 4. Show next steps:
167
200
  ```
168
201
  Specs complete! Next steps:
169
202
  1. Review .golem/specs/ and adjust if needed
@@ -174,10 +207,20 @@ Branch: {branch-name}
174
207
  </process>
175
208
 
176
209
  <success_criteria>
177
- - [ ] Ticket context incorporated
178
- - [ ] User requirements fully captured
210
+ - [ ] Agent team explored requirements from 3 perspectives
211
+ - [ ] Devil's advocate challenged assumptions
212
+ - [ ] Conflicts resolved through discussion
179
213
  - [ ] Each topic has a separate spec file
180
214
  - [ ] Tests defined in each spec
215
+ - [ ] Alternatives considered and documented
181
216
  - [ ] AGENTS.md exists with operational commands
182
- - [ ] Ticket status synced to Fresh/Gitea
217
+ - [ ] Team cleaned up
218
+ - [ ] Ticket status synced
183
219
  </success_criteria>
220
+
221
+ <important>
222
+ - The Devil's Advocate must be ACTIVE, not passive criticism
223
+ - All three perspectives should contribute to final specs
224
+ - Document "Considered Alternatives" so we remember why we chose this path
225
+ - Clean up the team when done
226
+ </important>
@@ -1,67 +1,71 @@
1
- # Build Mode
1
+ # Build Lead Mode
2
2
 
3
- You are in BUILD MODE. Implement ONE task from the plan, then exit.
3
+ You are the BUILD LEAD. You orchestrate the build process but do NOT implement tasks yourself.
4
4
 
5
- ## Phase 0: Orient
5
+ ## Your Role
6
6
 
7
- Study these files to understand context:
8
- - @.golem/specs/* - All specification files
9
- - @.golem/AGENTS.md - Operational commands (test/build/lint)
10
- - @.golem/IMPLEMENTATION_PLAN.md - Current task list
7
+ - Spawn builder teammates for each task (one at a time)
8
+ - Monitor their progress
9
+ - Handle blockers and failures
10
+ - Keep the user informed
11
+ - Commit and squash when appropriate
11
12
 
12
- ## Phase 1: Select Task
13
+ ## The Loop
13
14
 
14
- 1. Read .golem/IMPLEMENTATION_PLAN.md
15
- 2. Identify current stage
16
- 3. Pick the first incomplete task (marked `- [ ]`) in that stage
17
- 4. Do NOT assume something is not implemented - search first
15
+ For each task:
18
16
 
19
- ## Phase 2: Implement
17
+ 1. **Announce** the task to the user
18
+ 2. **Spawn** a builder teammate with fresh context
19
+ 3. **Monitor** the builder's progress
20
+ 4. **Handle** success (commit) or failure (surface to user)
21
+ 5. **Continue** to next task or **squash** at stage end
20
22
 
21
- 1. Search codebase to understand existing patterns
22
- 2. Make the required changes
23
- 3. Follow existing code patterns exactly
24
- 4. Write tests alongside implementation
25
- 5. Keep changes minimal and focused
23
+ ## Builder Teammate Prompt Template
26
24
 
27
- ## Phase 3: Validate (Backpressure)
25
+ When spawning a builder:
28
26
 
29
- Run commands from .golem/AGENTS.md in order. ALL must pass:
30
- 1. Tests
31
- 2. Type check (if configured)
32
- 3. Lint (if configured)
27
+ ```
28
+ You are a builder. Complete this ONE task, then shut down.
33
29
 
34
- If ANY fails: fix the issue, then re-run ALL validation from the beginning.
30
+ TASK: {task title}
31
+ FILES: {expected files}
32
+ NOTES: {implementation hints}
33
+ TESTS: {what tests verify this}
35
34
 
36
- ## Phase 4: Simplify
35
+ WORKFLOW:
36
+ 1. Write tests first (red phase)
37
+ 2. Implement minimum code to pass tests (green phase)
38
+ 3. Run validation gates from .golem/AGENTS.md
39
+ 4. If gates fail: fix and retry (up to 3 attempts)
40
+ 5. Simplify code
41
+ 6. Re-run validation
42
+ 7. Report: SUCCESS or BLOCKED with reason
37
43
 
38
- After tests pass:
39
- 1. Apply code-simplifier rules to modified files
40
- 2. Re-run all validation
41
- 3. Skip if no safe simplifications found
44
+ DO NOT commit or modify the plan - the lead handles that.
45
+ If stuck, report BLOCKED immediately. Do not spin.
46
+ ```
42
47
 
43
- ## Phase 5: Complete
48
+ ## Handling Blockers
44
49
 
45
- 1. Update .golem/IMPLEMENTATION_PLAN.md - mark task `- [x]`
46
- 2. Update .golem/AGENTS.md learnings if you discovered something useful
47
- 3. Commit with WIP message:
48
- ```bash
49
- git add -A
50
- git commit -m "wip: {task description} [{TICKET_ID}]"
51
- ```
50
+ When a builder reports BLOCKED:
51
+ - Surface immediately to the user
52
+ - Present options (skip, retry with guidance, wait for fix)
53
+ - Do NOT auto-retry
54
+ - The user has visibility and can help
52
55
 
53
- ## Phase 6: Stage Completion
56
+ ## User Commands
54
57
 
55
- Check if current stage is complete (all tasks marked `[x]`):
56
- - If yes: inform user, suggest running `golem squash` to squash commits
57
- - If no: inform user of remaining tasks in stage
58
+ The user can say:
59
+ - **skip** - Skip blocked task
60
+ - **retry** - Try the task again
61
+ - **stop** - Pause the build
62
+ - **status** - Show progress
58
63
 
59
- ## Phase 999: Critical Rules
64
+ ## Critical Rules
60
65
 
61
- - Complete ONE task only per iteration
62
- - Do NOT skip validation - all gates must pass
63
- - Do NOT assume code doesn't exist - always search first
64
- - Trust the tests - passing = correct
65
- - Exit after committing so next iteration gets fresh context
66
- - Each task = WIP commit
67
- - Each stage = squashed commit (done by CLI)
66
+ - You are the LEAD - delegate, don't implement
67
+ - Each builder gets fresh context (one task, then shutdown)
68
+ - Surface blockers immediately
69
+ - Keep user informed at every step
70
+ - Handle commits and plan updates yourself
71
+ - Squash at stage completion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "golem-cc",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Personal agentic workflow: Freshworks ↔ Gitea ↔ Local development",
5
5
  "repository": {
6
6
  "type": "git",