golem-cc 1.0.2 → 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.
- package/README.md +19 -7
- package/bin/golem +211 -58
- package/commands/golem/build.md +142 -77
- package/commands/golem/help.md +177 -37
- package/commands/golem/plan.md +102 -44
- package/commands/golem/review.md +376 -0
- package/commands/golem/security.md +204 -0
- package/commands/golem/spec.md +93 -50
- package/golem/prompts/PROMPT_build.md +53 -49
- package/package.json +11 -3
- package/.github/workflows/publish.yml +0 -42
- package/.golem/IMPLEMENTATION_PLAN.md +0 -59
- package/bin/install.sh +0 -69
- package/docs/FRESHSERVICE_SETUP.md +0 -338
- package/docs/HANDOFF.md +0 -241
- package/src/api/freshworks.ts +0 -167
- package/src/api/gitea.ts +0 -215
- package/src/cli/index.ts +0 -370
- package/src/sync/ticket-sync.ts +0 -303
- package/src/types.ts +0 -152
- package/src/worktree/manager.ts +0 -236
- package/tsconfig.json +0 -18
package/bin/install.sh
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# Install golem globally
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
set -euo pipefail
|
|
7
|
-
|
|
8
|
-
GOLEM_HOME="${GOLEM_HOME:-$HOME/.golem}"
|
|
9
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
10
|
-
|
|
11
|
-
echo "Installing golem to $GOLEM_HOME..."
|
|
12
|
-
|
|
13
|
-
# Create directory structure
|
|
14
|
-
mkdir -p "$GOLEM_HOME"/{commands,agents,prompts}
|
|
15
|
-
|
|
16
|
-
# Copy commands
|
|
17
|
-
cp -r "$SCRIPT_DIR/commands/golem" "$GOLEM_HOME/commands/"
|
|
18
|
-
echo "✓ Installed Claude commands"
|
|
19
|
-
|
|
20
|
-
# Copy agents and prompts
|
|
21
|
-
cp "$SCRIPT_DIR/golem/agents/"*.md "$GOLEM_HOME/agents/"
|
|
22
|
-
cp "$SCRIPT_DIR/golem/prompts/"*.md "$GOLEM_HOME/prompts/"
|
|
23
|
-
echo "✓ Installed agents and prompts"
|
|
24
|
-
|
|
25
|
-
# Build TypeScript
|
|
26
|
-
echo "Building TypeScript..."
|
|
27
|
-
cd "$SCRIPT_DIR"
|
|
28
|
-
pnpm build
|
|
29
|
-
|
|
30
|
-
# Link binaries
|
|
31
|
-
mkdir -p "$HOME/.local/bin"
|
|
32
|
-
ln -sf "$SCRIPT_DIR/bin/golem" "$HOME/.local/bin/golem"
|
|
33
|
-
ln -sf "$SCRIPT_DIR/dist/cli/index.js" "$HOME/.local/bin/golem-api"
|
|
34
|
-
chmod +x "$SCRIPT_DIR/dist/cli/index.js"
|
|
35
|
-
echo "✓ Linked binaries to ~/.local/bin"
|
|
36
|
-
|
|
37
|
-
# Create env template if not exists
|
|
38
|
-
if [[ ! -f "$GOLEM_HOME/.env" ]]; then
|
|
39
|
-
cat > "$GOLEM_HOME/.env" << 'EOF'
|
|
40
|
-
# Freshworks/Freshservice
|
|
41
|
-
FRESH_DOMAIN=yourcompany.freshservice.com
|
|
42
|
-
FRESH_API_KEY=your_api_key_here
|
|
43
|
-
|
|
44
|
-
# Gitea (on-prem)
|
|
45
|
-
GITEA_URL=https://dev.pearlriverresort.com
|
|
46
|
-
GITEA_TOKEN=your_token_here
|
|
47
|
-
GITEA_ORG=CRDE
|
|
48
|
-
|
|
49
|
-
# Default repo for issues (can be overridden per-project)
|
|
50
|
-
GITEA_REPO=
|
|
51
|
-
EOF
|
|
52
|
-
echo "✓ Created $GOLEM_HOME/.env template"
|
|
53
|
-
echo ""
|
|
54
|
-
echo "⚠️ Edit $GOLEM_HOME/.env with your API credentials"
|
|
55
|
-
fi
|
|
56
|
-
|
|
57
|
-
# Setup Claude integration
|
|
58
|
-
mkdir -p "$HOME/.claude/commands"
|
|
59
|
-
ln -sf "$GOLEM_HOME/commands/golem" "$HOME/.claude/commands/golem" 2>/dev/null || true
|
|
60
|
-
echo "✓ Linked Claude commands"
|
|
61
|
-
|
|
62
|
-
echo ""
|
|
63
|
-
echo "Installation complete!"
|
|
64
|
-
echo ""
|
|
65
|
-
echo "Make sure ~/.local/bin is in your PATH:"
|
|
66
|
-
echo ' export PATH="$HOME/.local/bin:$PATH"'
|
|
67
|
-
echo ""
|
|
68
|
-
echo "Then configure your credentials:"
|
|
69
|
-
echo " $GOLEM_HOME/.env"
|
|
@@ -1,338 +0,0 @@
|
|
|
1
|
-
# Freshservice API Setup Guide
|
|
2
|
-
|
|
3
|
-
This document details all the configuration changes required in Freshservice to enable API access for the Golem CLI integration.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Prerequisites
|
|
8
|
-
|
|
9
|
-
- Freshservice account with admin access
|
|
10
|
-
- Access to Admin settings
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## 1. Agent Role Configuration
|
|
15
|
-
|
|
16
|
-
**Problem:** The "Account Admin" role only provides administrative privileges (managing settings, users, etc.) but does NOT include permissions to access ticket data via API. API calls to `/api/v2/tickets` return `403 Forbidden`.
|
|
17
|
-
|
|
18
|
-
**Solution:** Your agent account needs an additional "Agent" role that includes ticket permissions.
|
|
19
|
-
|
|
20
|
-
### Steps:
|
|
21
|
-
|
|
22
|
-
1. Go to **Admin** → **Agents**
|
|
23
|
-
2. Find your agent account (or the account that will use the API)
|
|
24
|
-
3. Click to edit the agent
|
|
25
|
-
4. Under **Groups and Roles** → **Roles**, add one of these roles:
|
|
26
|
-
- **IT Agent** (basic ticket access)
|
|
27
|
-
- **IT Supervisor** (ticket access + reporting)
|
|
28
|
-
- **IT Manager** (broader permissions)
|
|
29
|
-
- **IT Operations** (if available)
|
|
30
|
-
|
|
31
|
-
5. Save the changes
|
|
32
|
-
|
|
33
|
-
### Required Privileges
|
|
34
|
-
|
|
35
|
-
The agent role must include these privileges for full API functionality:
|
|
36
|
-
- `manage_tickets` - Create, update, view tickets
|
|
37
|
-
- `view_time_entries` - View time tracking
|
|
38
|
-
- `edit_ticket_properties` - Modify ticket fields
|
|
39
|
-
- `reply_ticket` - Add replies/notes
|
|
40
|
-
|
|
41
|
-
### Verification
|
|
42
|
-
|
|
43
|
-
After adding the role, verify via API:
|
|
44
|
-
```bash
|
|
45
|
-
curl -u "YOUR_API_KEY:X" "https://YOUR_DOMAIN.freshservice.com/api/v2/agents/me"
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Check the `roles` array in the response - you should see multiple role IDs.
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## 2. API Key Generation
|
|
53
|
-
|
|
54
|
-
**Location:** Profile Settings → API Key (right side of page)
|
|
55
|
-
|
|
56
|
-
### Steps:
|
|
57
|
-
|
|
58
|
-
1. Click your **profile icon** (top right)
|
|
59
|
-
2. Go to **Profile Settings**
|
|
60
|
-
3. Look for **Your API Key** on the right side
|
|
61
|
-
4. Copy the API key
|
|
62
|
-
|
|
63
|
-
### Alternative Path:
|
|
64
|
-
- **Admin** → **Agents** → Click your name → **API Key** section
|
|
65
|
-
|
|
66
|
-
### Notes:
|
|
67
|
-
- The API key is tied to your user account and its permissions
|
|
68
|
-
- If you add new roles, you may need to regenerate the API key
|
|
69
|
-
- API key uses Basic Auth: `API_KEY:X` (the password is literally the letter X)
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## 3. Create Custom Ticket Source
|
|
74
|
-
|
|
75
|
-
**Problem:** When creating tickets via API, they default to "via Phone" as the source, which is misleading.
|
|
76
|
-
|
|
77
|
-
**Solution:** Create a custom ticket source for API-created tickets.
|
|
78
|
-
|
|
79
|
-
### Via API:
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
curl -X POST -u "YOUR_API_KEY:X" \
|
|
83
|
-
-H "Content-Type: application/json" \
|
|
84
|
-
-d '{"name":"ACE (API)"}' \
|
|
85
|
-
"https://YOUR_DOMAIN.freshservice.com/api/v2/ticket_fields/sources"
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
Response:
|
|
89
|
-
```json
|
|
90
|
-
{
|
|
91
|
-
"source": {
|
|
92
|
-
"id": 38000360046,
|
|
93
|
-
"choice_id": 1002,
|
|
94
|
-
"value": "ACE (API)",
|
|
95
|
-
"position": 19,
|
|
96
|
-
"visible": true,
|
|
97
|
-
"default": false
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
**Important:** Save the `choice_id` value (e.g., `1002`) - this is what you pass as the `source` field when creating tickets.
|
|
103
|
-
|
|
104
|
-
### Via Admin UI:
|
|
105
|
-
|
|
106
|
-
1. Go to **Admin** → **Ticket Fields** (under Service Desk Settings)
|
|
107
|
-
2. Find the **Source** field
|
|
108
|
-
3. Click to edit/expand it
|
|
109
|
-
4. Add a new choice: `ACE (API)`
|
|
110
|
-
5. Save
|
|
111
|
-
|
|
112
|
-
### Note on Deleting Sources:
|
|
113
|
-
- Default sources (Email, Phone, Portal, etc.) cannot be deleted
|
|
114
|
-
- Custom sources can only be deleted via the Admin UI (no DELETE API endpoint)
|
|
115
|
-
- To delete: **Admin** → **Ticket Fields** → **Source** → hover over custom source → trash icon
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
## 4. Required Fields for Ticket Creation
|
|
120
|
-
|
|
121
|
-
**Problem:** Freshservice instances may have required fields configured that cause `400 Validation failed` errors.
|
|
122
|
-
|
|
123
|
-
### Our Instance Requires:
|
|
124
|
-
|
|
125
|
-
| Field | Type | Example |
|
|
126
|
-
|-------|------|---------|
|
|
127
|
-
| `subject` | string | "Ticket title" |
|
|
128
|
-
| `description` | string | "Ticket description" |
|
|
129
|
-
| `email` | string | "requester@domain.com" |
|
|
130
|
-
| `group_id` | integer | `38000120203` |
|
|
131
|
-
| `category` | string | "Applications" |
|
|
132
|
-
| `source` | integer | `1002` (ACE API) |
|
|
133
|
-
|
|
134
|
-
### Finding Your Group IDs:
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
curl -u "YOUR_API_KEY:X" "https://YOUR_DOMAIN.freshservice.com/api/v2/groups"
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
### Finding Valid Categories:
|
|
141
|
-
|
|
142
|
-
```bash
|
|
143
|
-
curl -u "YOUR_API_KEY:X" "https://YOUR_DOMAIN.freshservice.com/api/v2/ticket_form_fields" | \
|
|
144
|
-
python3 -c "import sys,json; [print(f['choices']) for f in json.load(sys.stdin)['ticket_fields'] if f['name']=='category']"
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
Our valid categories: `Hardware`, `Applications`, `Infrastructure`, `Security`
|
|
148
|
-
|
|
149
|
-
### Finding Source IDs:
|
|
150
|
-
|
|
151
|
-
```bash
|
|
152
|
-
curl -u "YOUR_API_KEY:X" "https://YOUR_DOMAIN.freshservice.com/api/v2/ticket_form_fields" | \
|
|
153
|
-
python3 -c "import sys,json; [print(c['id'], c['value']) for f in json.load(sys.stdin)['ticket_fields'] if f['name']=='source' for c in f['choices']]"
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
---
|
|
157
|
-
|
|
158
|
-
## 5. Workspace Configuration
|
|
159
|
-
|
|
160
|
-
**Note:** If your Freshservice instance uses multiple workspaces, API access is workspace-scoped.
|
|
161
|
-
|
|
162
|
-
### Check Your Workspace:
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
curl -u "YOUR_API_KEY:X" "https://YOUR_DOMAIN.freshservice.com/api/v2/agents/me" | \
|
|
166
|
-
python3 -c "import sys,json; print('Workspace IDs:', json.load(sys.stdin)['agent']['workspace_ids'])"
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### List Workspaces:
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
curl -u "YOUR_API_KEY:X" "https://YOUR_DOMAIN.freshservice.com/api/v2/workspaces"
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
If tickets are in a different workspace than your agent, you'll get `403` errors.
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
## 6. API Endpoints Reference
|
|
180
|
-
|
|
181
|
-
### Base URL
|
|
182
|
-
```
|
|
183
|
-
https://YOUR_DOMAIN.freshservice.com/api/v2
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### Authentication
|
|
187
|
-
```
|
|
188
|
-
Basic Auth: API_KEY:X
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
### Endpoints Used by Golem
|
|
192
|
-
|
|
193
|
-
| Method | Endpoint | Description |
|
|
194
|
-
|--------|----------|-------------|
|
|
195
|
-
| GET | `/agents/me` | Get current agent profile |
|
|
196
|
-
| GET | `/tickets?filter=new_and_my_open` | List my open tickets |
|
|
197
|
-
| GET | `/tickets/{id}` | Get single ticket |
|
|
198
|
-
| POST | `/tickets` | Create ticket |
|
|
199
|
-
| PUT | `/tickets/{id}` | Update ticket |
|
|
200
|
-
| POST | `/tickets/{id}/notes` | Add note to ticket |
|
|
201
|
-
| GET | `/ticket_form_fields` | Get ticket field definitions |
|
|
202
|
-
| POST | `/ticket_fields/sources` | Create custom source |
|
|
203
|
-
| GET | `/groups` | List agent groups |
|
|
204
|
-
| GET | `/workspaces` | List workspaces |
|
|
205
|
-
|
|
206
|
-
### Valid Filter Values for Tickets
|
|
207
|
-
|
|
208
|
-
```
|
|
209
|
-
new_and_my_open, watching, spam, deleted, archived
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
Note: `assigned_to_me` is NOT valid (despite being documented elsewhere).
|
|
213
|
-
|
|
214
|
-
---
|
|
215
|
-
|
|
216
|
-
## 7. Common Errors and Solutions
|
|
217
|
-
|
|
218
|
-
### 403 Forbidden - "You are not authorized to perform this action"
|
|
219
|
-
|
|
220
|
-
**Causes:**
|
|
221
|
-
1. Agent only has "Account Admin" role (no ticket permissions)
|
|
222
|
-
2. Agent not assigned to correct workspace
|
|
223
|
-
3. API key is incorrect or expired
|
|
224
|
-
|
|
225
|
-
**Solution:** Add an agent role (IT Agent, IT Supervisor, etc.) with `manage_tickets` privilege.
|
|
226
|
-
|
|
227
|
-
### 400 Validation Failed - Missing group_id
|
|
228
|
-
|
|
229
|
-
**Cause:** Your Freshservice instance requires `group_id` for ticket creation.
|
|
230
|
-
|
|
231
|
-
**Solution:** Include `group_id` in ticket creation payload. Get valid IDs from `/api/v2/groups`.
|
|
232
|
-
|
|
233
|
-
### 400 Validation Failed - Invalid category
|
|
234
|
-
|
|
235
|
-
**Cause:** Category value doesn't match configured options.
|
|
236
|
-
|
|
237
|
-
**Solution:** Query `/api/v2/ticket_form_fields` to get valid category values for your instance.
|
|
238
|
-
|
|
239
|
-
### 400 Validation Failed - Invalid filter
|
|
240
|
-
|
|
241
|
-
**Cause:** Using unsupported filter value like `assigned_to_me`.
|
|
242
|
-
|
|
243
|
-
**Solution:** Use `new_and_my_open` instead.
|
|
244
|
-
|
|
245
|
-
---
|
|
246
|
-
|
|
247
|
-
## 8. Environment Variables
|
|
248
|
-
|
|
249
|
-
Set these in `~/.golem/.env`:
|
|
250
|
-
|
|
251
|
-
```bash
|
|
252
|
-
# Freshservice Configuration
|
|
253
|
-
FRESH_DOMAIN=your-instance.freshservice.com
|
|
254
|
-
FRESH_API_KEY=your_api_key_here
|
|
255
|
-
|
|
256
|
-
# Optional: Default values for ticket creation
|
|
257
|
-
FRESH_DEFAULT_GROUP_ID=38000120203
|
|
258
|
-
FRESH_DEFAULT_CATEGORY=Applications
|
|
259
|
-
FRESH_SOURCE_ID=1002
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
---
|
|
263
|
-
|
|
264
|
-
## 9. Testing the Configuration
|
|
265
|
-
|
|
266
|
-
Run these commands to verify everything is working:
|
|
267
|
-
|
|
268
|
-
### Test Authentication:
|
|
269
|
-
```bash
|
|
270
|
-
golem-api fresh:test
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
Expected output:
|
|
274
|
-
```
|
|
275
|
-
✓ Connected to Freshworks
|
|
276
|
-
Found X tickets assigned to you
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
### List Your Tickets:
|
|
280
|
-
```bash
|
|
281
|
-
golem-api fresh:list
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
### Create a Test Ticket:
|
|
285
|
-
```bash
|
|
286
|
-
curl -X POST -u "$FRESH_API_KEY:X" \
|
|
287
|
-
-H "Content-Type: application/json" \
|
|
288
|
-
-d '{
|
|
289
|
-
"subject": "API Test Ticket",
|
|
290
|
-
"description": "Testing API connectivity",
|
|
291
|
-
"email": "your@email.com",
|
|
292
|
-
"group_id": YOUR_GROUP_ID,
|
|
293
|
-
"category": "Applications",
|
|
294
|
-
"source": YOUR_SOURCE_ID,
|
|
295
|
-
"priority": 3,
|
|
296
|
-
"status": 2
|
|
297
|
-
}' \
|
|
298
|
-
"https://$FRESH_DOMAIN/api/v2/tickets"
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
---
|
|
302
|
-
|
|
303
|
-
## 10. Production Checklist
|
|
304
|
-
|
|
305
|
-
Before deploying to production:
|
|
306
|
-
|
|
307
|
-
- [ ] Create dedicated service account (don't use personal account)
|
|
308
|
-
- [ ] Assign IT Agent/Supervisor role to service account
|
|
309
|
-
- [ ] Generate API key for service account
|
|
310
|
-
- [ ] Create "ACE (API)" custom source
|
|
311
|
-
- [ ] Document group_id values for your teams
|
|
312
|
-
- [ ] Document valid category values
|
|
313
|
-
- [ ] Test ticket creation with all required fields
|
|
314
|
-
- [ ] Test ticket updates and notes
|
|
315
|
-
- [ ] Store API key securely (not in git)
|
|
316
|
-
|
|
317
|
-
---
|
|
318
|
-
|
|
319
|
-
## Appendix: Our Sandbox Configuration
|
|
320
|
-
|
|
321
|
-
**Domain:** `pearlriverresorthelpdesk-service-desk-sandbox.freshservice.com`
|
|
322
|
-
|
|
323
|
-
**Agent Roles Required:**
|
|
324
|
-
- Account Admin (for admin functions)
|
|
325
|
-
- IT Operations (role_id: 38000126321)
|
|
326
|
-
- IT Manager (role_id: 38000126322)
|
|
327
|
-
|
|
328
|
-
**Group ID (Development):** `38000120203`
|
|
329
|
-
|
|
330
|
-
**Categories:** `Hardware`, `Applications`, `Infrastructure`, `Security`
|
|
331
|
-
|
|
332
|
-
**Custom Source:**
|
|
333
|
-
- Name: `ACE (API)`
|
|
334
|
-
- choice_id: `1002`
|
|
335
|
-
|
|
336
|
-
**Workspace:**
|
|
337
|
-
- ID: `2`
|
|
338
|
-
- Name: `IT`
|
package/docs/HANDOFF.md
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
# Golem Project Handoff
|
|
2
|
-
|
|
3
|
-
## What Is This?
|
|
4
|
-
|
|
5
|
-
Golem is a personal agentic workflow manager that integrates:
|
|
6
|
-
- **Freshservice** (ticketing)
|
|
7
|
-
- **Gitea** (issues/PRs/code)
|
|
8
|
-
- **Claude Code** (AI-assisted development)
|
|
9
|
-
- **Local state** (source of truth linking everything)
|
|
10
|
-
|
|
11
|
-
It replaces the old `golem-cc` with a hyper-focused tool for your specific workflow.
|
|
12
|
-
|
|
13
|
-
## Repository
|
|
14
|
-
|
|
15
|
-
GitHub: https://github.com/daresTheDevil/golem (private)
|
|
16
|
-
|
|
17
|
-
## Current State
|
|
18
|
-
|
|
19
|
-
### Working
|
|
20
|
-
- ✅ Freshservice API connection (sandbox instance)
|
|
21
|
-
- ✅ Gitea API connection (dev.pearlriverresort.com)
|
|
22
|
-
- ✅ `golem new` - create ticket in Fresh + Gitea with bi-directional links
|
|
23
|
-
- ✅ `golem import` - import existing Fresh ticket, creates linked Gitea issue
|
|
24
|
-
- ✅ Idempotency on import - won't create duplicate Gitea issues
|
|
25
|
-
- ✅ `golem worktree` - create git worktree for ticket (works with/without remote)
|
|
26
|
-
- ✅ `golem-api ticket:status X done` - resolves ticket in both Fresh and Gitea
|
|
27
|
-
- ✅ Local state files in `.golem/tickets/*.yaml`
|
|
28
|
-
- ✅ CLI installed globally (`golem` and `golem-api`)
|
|
29
|
-
- ✅ Claude Code slash commands (`/golem:spec`, `/golem:plan`, `/golem:build`, etc.)
|
|
30
|
-
- ✅ Conventional commit branch naming: `{type}/{ticketId}-{slug}` (e.g., `fix/INC-6-idempotency-check`)
|
|
31
|
-
|
|
32
|
-
### Not Yet Tested
|
|
33
|
-
- ⏳ `golem build` - run Claude in print mode loop
|
|
34
|
-
- ⏳ `golem plan` - generate implementation plan
|
|
35
|
-
- ⏳ `golem squash` - squash stage commits
|
|
36
|
-
- ⏳ `golem pr` - create PR for ticket
|
|
37
|
-
- ⏳ Full workflow: spec → plan → build loop
|
|
38
|
-
|
|
39
|
-
### Known Issues
|
|
40
|
-
- Labels on Gitea issues disabled (Gitea expects label IDs, not strings)
|
|
41
|
-
- Can't delete Fresh tickets via API (need `delete_ticket` privilege)
|
|
42
|
-
|
|
43
|
-
## Project Structure
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
/Users/dkay/code/golem-cc-new/
|
|
47
|
-
├── bin/
|
|
48
|
-
│ ├── golem # Main bash CLI
|
|
49
|
-
│ └── install.sh # Global installer
|
|
50
|
-
├── src/
|
|
51
|
-
│ ├── api/
|
|
52
|
-
│ │ ├── freshworks.ts # Freshservice API client
|
|
53
|
-
│ │ └── gitea.ts # Gitea API client
|
|
54
|
-
│ ├── sync/
|
|
55
|
-
│ │ └── ticket-sync.ts # Import/sync logic
|
|
56
|
-
│ ├── worktree/
|
|
57
|
-
│ │ └── manager.ts # Git worktree operations
|
|
58
|
-
│ ├── cli/
|
|
59
|
-
│ │ └── index.ts # golem-api CLI commands
|
|
60
|
-
│ └── types.ts # TypeScript types
|
|
61
|
-
├── commands/golem/ # Claude Code slash commands
|
|
62
|
-
│ ├── spec.md
|
|
63
|
-
│ ├── plan.md
|
|
64
|
-
│ ├── build.md
|
|
65
|
-
│ ├── simplify.md
|
|
66
|
-
│ ├── status.md
|
|
67
|
-
│ └── help.md
|
|
68
|
-
├── golem/ # Prompts and agents
|
|
69
|
-
│ ├── agents/
|
|
70
|
-
│ │ ├── spec-builder.md
|
|
71
|
-
│ │ └── code-simplifier.md
|
|
72
|
-
│ └── prompts/
|
|
73
|
-
│ ├── PROMPT_build.md
|
|
74
|
-
│ └── PROMPT_plan.md
|
|
75
|
-
├── docs/
|
|
76
|
-
│ ├── FRESHSERVICE_SETUP.md # Detailed Fresh API setup guide
|
|
77
|
-
│ └── HANDOFF.md # This file
|
|
78
|
-
└── .golem/
|
|
79
|
-
└── tickets/ # Local ticket state files
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Environment
|
|
83
|
-
|
|
84
|
-
### Credentials Location
|
|
85
|
-
```
|
|
86
|
-
~/.golem/.env
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Required Environment Variables
|
|
90
|
-
```bash
|
|
91
|
-
# Freshworks/Freshservice
|
|
92
|
-
FRESH_DOMAIN=pearlriverresorthelpdesk-service-desk-sandbox.freshservice.com
|
|
93
|
-
FRESH_API_KEY=<redacted>
|
|
94
|
-
|
|
95
|
-
# Freshservice defaults for ticket creation
|
|
96
|
-
FRESH_DEFAULT_GROUP_ID=38000120203
|
|
97
|
-
FRESH_DEFAULT_CATEGORY=Applications
|
|
98
|
-
FRESH_SOURCE_ID=1002
|
|
99
|
-
FRESH_DEFAULT_EMAIL=ace-bot@pearlriverresort.com
|
|
100
|
-
|
|
101
|
-
# Gitea (on-prem)
|
|
102
|
-
GITEA_URL=https://dev.pearlriverresort.com
|
|
103
|
-
GITEA_TOKEN=<redacted>
|
|
104
|
-
GITEA_ORG=CRDE
|
|
105
|
-
GITEA_REPO=dashboard
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
### PATH Setup
|
|
109
|
-
In `~/.zshrc`:
|
|
110
|
-
```bash
|
|
111
|
-
case ":$PATH:" in
|
|
112
|
-
*":$HOME/.local/bin:"*) ;;
|
|
113
|
-
*) export PATH="$HOME/.local/bin:$PATH" ;;
|
|
114
|
-
esac
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Freshservice Configuration (IMPORTANT)
|
|
118
|
-
|
|
119
|
-
See `docs/FRESHSERVICE_SETUP.md` for full details. Key points:
|
|
120
|
-
|
|
121
|
-
1. **Agent needs both admin AND agent roles** - Account Admin alone can't access tickets via API
|
|
122
|
-
2. **Required ticket fields for creation**: `status`, `group_id`, `category`, `email`, `source`
|
|
123
|
-
3. **Required fields for closing**: `responder_id`, `resolution_notes`
|
|
124
|
-
4. **Custom source created**: "ACE (API)" with `choice_id: 1002`
|
|
125
|
-
5. **Valid filter**: Use `new_and_my_open` not `assigned_to_me`
|
|
126
|
-
|
|
127
|
-
### Your Roles
|
|
128
|
-
- Account Admin (38000126263)
|
|
129
|
-
- IT Operations (38000126321)
|
|
130
|
-
- IT Manager (38000126322)
|
|
131
|
-
|
|
132
|
-
### Key IDs
|
|
133
|
-
- Agent ID (dkay): `38001086138`
|
|
134
|
-
- Group ID (Development): `38000120203`
|
|
135
|
-
- Source ID (ACE API): `1002`
|
|
136
|
-
- Workspace ID: `2` (IT)
|
|
137
|
-
|
|
138
|
-
## Test Data Created
|
|
139
|
-
|
|
140
|
-
### Fresh Tickets (Sandbox)
|
|
141
|
-
- INC-2: "Test for API" → linked to Gitea #1
|
|
142
|
-
- INC-3: "Ticket created from API" (no Gitea link)
|
|
143
|
-
- INC-4: "Ticket created via Golem" → linked to Gitea #3
|
|
144
|
-
- INC-5: "Test golem new command" → linked to Gitea #5
|
|
145
|
-
- INC-6: "Add idempotency check..." → linked to Gitea #6 (RESOLVED)
|
|
146
|
-
- INC-7: "Test ticket close flow" → linked to Gitea #7 (RESOLVED)
|
|
147
|
-
|
|
148
|
-
### Gitea Issues (dashboard repo)
|
|
149
|
-
- #1: [INC-2] Test for API
|
|
150
|
-
- #3: [INC-4] Ticket created via API
|
|
151
|
-
- #5: [INC-5] Test golem new command
|
|
152
|
-
- #6: [INC-6] Add idempotency check to prevent duplicate Gitea issues
|
|
153
|
-
- #7: [INC-7] Test ticket close flow
|
|
154
|
-
|
|
155
|
-
### Test Project
|
|
156
|
-
- `~/code/test-worktree-project` - Used for testing worktree creation
|
|
157
|
-
- Has fake tickets TEST-1, TEST-2, TEST-3 with worktrees
|
|
158
|
-
|
|
159
|
-
## Commands Reference
|
|
160
|
-
|
|
161
|
-
### Terminal
|
|
162
|
-
```bash
|
|
163
|
-
golem help # Show all commands
|
|
164
|
-
golem version # Show version
|
|
165
|
-
golem init # Initialize golem in current project
|
|
166
|
-
|
|
167
|
-
golem new "Subject" # Create new ticket (interactive prompts for type/slug)
|
|
168
|
-
golem import INC-XXX # Import existing Fresh ticket
|
|
169
|
-
golem worktree INC-XXX # Create/switch to worktree for ticket
|
|
170
|
-
golem worktrees # List all worktrees
|
|
171
|
-
golem status [INC-XXX] # Show ticket or project status
|
|
172
|
-
|
|
173
|
-
golem-api fresh:test # Test Fresh connection
|
|
174
|
-
golem-api fresh:list # List your tickets
|
|
175
|
-
golem-api gitea:test # Test Gitea connection
|
|
176
|
-
golem-api ticket:list # List tracked tickets
|
|
177
|
-
golem-api ticket:get INC-XXX
|
|
178
|
-
golem-api ticket:status INC-XXX done --note "Resolution message"
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### Claude Code
|
|
182
|
-
```
|
|
183
|
-
/golem:help # Show help
|
|
184
|
-
/golem:status # Show current status
|
|
185
|
-
/golem:spec # Define specs (interactive)
|
|
186
|
-
/golem:plan # Create implementation plan
|
|
187
|
-
/golem:build # Run one build iteration
|
|
188
|
-
/golem:simplify # Run code simplifier
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
## Next Steps
|
|
192
|
-
|
|
193
|
-
1. **Test the full workflow**: spec → plan → build loop
|
|
194
|
-
2. **Test `golem squash`** - squash commits before PR
|
|
195
|
-
3. **Test `golem pr`** - create PR for ticket
|
|
196
|
-
4. **Production setup**: Same Fresh config steps on prod instance
|
|
197
|
-
5. **Consider**: Adding label support to Gitea (need to create labels first, then use IDs)
|
|
198
|
-
|
|
199
|
-
## Build Commands
|
|
200
|
-
|
|
201
|
-
```bash
|
|
202
|
-
cd /Users/dkay/code/golem-cc-new
|
|
203
|
-
pnpm install # Install deps
|
|
204
|
-
pnpm build # Compile TypeScript
|
|
205
|
-
./bin/install.sh # Reinstall globally (after changes)
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
## Recent Fixes (2026-02-04)
|
|
209
|
-
|
|
210
|
-
### Worktree Creation
|
|
211
|
-
- Fixed: Now works for repos without remotes (falls back to local branch → HEAD)
|
|
212
|
-
- Fixed: `set -e` bug where missing local `.env` caused silent exit
|
|
213
|
-
|
|
214
|
-
### Freshservice Integration
|
|
215
|
-
- Fixed: `golem new` now includes all required fields (status, source, group_id, category, email)
|
|
216
|
-
- Fixed: Closing tickets now sets `responder_id` (current agent) and `resolution_notes`
|
|
217
|
-
- Uses status 4 (Resolved) instead of 5 (Closed) for simpler workflow
|
|
218
|
-
|
|
219
|
-
### Idempotency
|
|
220
|
-
- Added `findIssueByTicketId()` to Gitea client
|
|
221
|
-
- Import checks local state first, then searches Gitea before creating
|
|
222
|
-
- Re-importing won't create duplicate issues
|
|
223
|
-
|
|
224
|
-
## Useful Debug Commands
|
|
225
|
-
|
|
226
|
-
```bash
|
|
227
|
-
# Check Fresh ticket details
|
|
228
|
-
curl -s -u "API_KEY:X" "https://DOMAIN/api/v2/tickets/ID" | python3 -m json.tool
|
|
229
|
-
|
|
230
|
-
# Check Fresh ticket notes
|
|
231
|
-
curl -s -u "API_KEY:X" "https://DOMAIN/api/v2/tickets/ID/conversations"
|
|
232
|
-
|
|
233
|
-
# Check Gitea issues
|
|
234
|
-
curl -s -H "Authorization: token TOKEN" "https://dev.pearlriverresort.com/api/v1/repos/CRDE/dashboard/issues?state=all"
|
|
235
|
-
|
|
236
|
-
# Check local ticket state
|
|
237
|
-
cat .golem/tickets/INC-2.yaml
|
|
238
|
-
|
|
239
|
-
# Get your agent ID
|
|
240
|
-
curl -s -u "API_KEY:X" "https://DOMAIN/api/v2/agents/me" | python3 -c "import sys,json; print(json.load(sys.stdin)['agent']['id'])"
|
|
241
|
-
```
|