@datatamer.ai/agentdev 1.0.1
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 +283 -0
- package/dist/agentdev.js +10 -0
- package/package.json +51 -0
- package/skills/agentdev-gh.md +62 -0
- package/skills/agentdev-openspec.md +72 -0
- package/skills/auto-ticket-workflow.md +542 -0
- package/skills/auto-ticket.md +67 -0
|
@@ -0,0 +1,542 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "auto-ticket-workflow"
|
|
3
|
+
description: "Process GitHub tickets with @claude tag through full development lifecycle: create OpenSpec, implement, test locally, deploy to production, test production, and move to Done"
|
|
4
|
+
dependencies:
|
|
5
|
+
- gh (GitHub CLI)
|
|
6
|
+
- kubectl
|
|
7
|
+
- openspec
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Auto-Ticket Workflow Skill
|
|
11
|
+
|
|
12
|
+
Automates the entire ticket lifecycle from GitHub project board through development, testing, and deployment.
|
|
13
|
+
|
|
14
|
+
## IMPORTANT: Execution Rules
|
|
15
|
+
|
|
16
|
+
**This skill runs FULLY AUTOMATICALLY. DO NOT ask user for permission at any step.**
|
|
17
|
+
|
|
18
|
+
- Execute all commands immediately without confirmation
|
|
19
|
+
- Run ALL phases (0-7) sequentially WITHOUT pausing between phases
|
|
20
|
+
- After completing each phase, IMMEDIATELY start the next phase
|
|
21
|
+
- Only stop if there's an actual error or failure
|
|
22
|
+
- The user has already authorized the workflow by invoking this skill
|
|
23
|
+
|
|
24
|
+
## CRITICAL: Screenshot & Image Size Limit
|
|
25
|
+
|
|
26
|
+
**Claude's vision API has a 2000px per-dimension limit for multi-image requests.** To avoid failures:
|
|
27
|
+
|
|
28
|
+
- **Playwright viewport**: Always use `1920x1080` (NOT 2560x1440)
|
|
29
|
+
- **Never read screenshots larger than 1920px** with the Read tool — resize first
|
|
30
|
+
- When taking screenshots with Playwright, use: `viewport: { width: 1920, height: 1080 }`
|
|
31
|
+
- If you need to resize an existing image: `npx sharp-cli resize 1920 -i input.png -o output.png` or use ImageMagick: `convert input.png -resize 1920x1080 output.png`
|
|
32
|
+
|
|
33
|
+
## CRITICAL: NO Nested Skills
|
|
34
|
+
|
|
35
|
+
**DO NOT use the Skill tool to invoke other skills.** This causes the workflow to stop prematurely.
|
|
36
|
+
|
|
37
|
+
Instead, all OpenSpec operations are INLINED in this skill:
|
|
38
|
+
- Phase 2 contains the full opsx:ff logic
|
|
39
|
+
- Phase 3 contains the full opsx:apply logic
|
|
40
|
+
|
|
41
|
+
## CRITICAL: Output Progress
|
|
42
|
+
|
|
43
|
+
**Always output status messages to show progress:**
|
|
44
|
+
- Print "=== PHASE X: <name> ===" when starting each phase
|
|
45
|
+
- Print command output or summaries after running commands
|
|
46
|
+
- Print "✓ <action> complete" after completing steps
|
|
47
|
+
- Print errors immediately if they occur
|
|
48
|
+
- NEVER run silently - the user needs to see what's happening
|
|
49
|
+
|
|
50
|
+
## Check for New Comments Between Phases
|
|
51
|
+
|
|
52
|
+
**Between every phase transition**, check if new comments have been posted on the ticket:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
if [ -f "$COMMENT_SIGNAL_FILE" ]; then
|
|
56
|
+
echo "📬 New comments detected!"
|
|
57
|
+
cat "$COMMENT_SIGNAL_FILE"
|
|
58
|
+
rm "$COMMENT_SIGNAL_FILE"
|
|
59
|
+
fi
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Rules:**
|
|
63
|
+
- If the signal file exists, read it, then delete it
|
|
64
|
+
- New comments may contain updated requirements — adjust your work accordingly
|
|
65
|
+
- Comments from bot accounts (starting with "🤖") are status updates — ignore them
|
|
66
|
+
- The most recent human comment takes priority over earlier instructions
|
|
67
|
+
- If a comment says to stop or cancel, halt the workflow and comment on the issue
|
|
68
|
+
|
|
69
|
+
## GitHub Project Configuration
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
Project: data-tamer (Project #1)
|
|
73
|
+
Project ID: PVT_kwDOCJIWbs4AnuSZ
|
|
74
|
+
Status Field ID: PVTSSF_lADOCJIWbs4AnuSZzgfaWGs
|
|
75
|
+
|
|
76
|
+
Status Options:
|
|
77
|
+
- Todo: f75ad846
|
|
78
|
+
- In Progress: 47fc9ee4
|
|
79
|
+
- test: c48bc058
|
|
80
|
+
- Done: 98236657
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## RELIABLE Status Transitions
|
|
84
|
+
|
|
85
|
+
**CRITICAL: Always verify status changes succeeded.**
|
|
86
|
+
|
|
87
|
+
For EVERY status change:
|
|
88
|
+
1. Run the `gh project item-edit` command
|
|
89
|
+
2. Verify by querying the item status
|
|
90
|
+
3. If failed, retry once
|
|
91
|
+
4. Print confirmation: "✓ Ticket #X moved to <status>"
|
|
92
|
+
|
|
93
|
+
**Status Change Template:**
|
|
94
|
+
```bash
|
|
95
|
+
# Change status
|
|
96
|
+
gh project item-edit --id <item-id> --project-id PVT_kwDOCJIWbs4AnuSZ \
|
|
97
|
+
--field-id PVTSSF_lADOCJIWbs4AnuSZzgfaWGs \
|
|
98
|
+
--single-select-option-id <option-id>
|
|
99
|
+
|
|
100
|
+
# Verify (query the specific item)
|
|
101
|
+
gh api graphql -f query='query { node(id: "<item-id>") { ... on ProjectV2Item { fieldValueByName(name: "Status") { ... on ProjectV2ItemFieldSingleSelectValue { name } } } } }' | jq -r '.data.node.fieldValueByName.name'
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Status Option IDs:**
|
|
105
|
+
- Todo: `f75ad846`
|
|
106
|
+
- In Progress: `47fc9ee4`
|
|
107
|
+
- test: `c48bc058`
|
|
108
|
+
- Done: `98236657`
|
|
109
|
+
|
|
110
|
+
## Workflow Phases
|
|
111
|
+
|
|
112
|
+
### Phase 0: Preflight — Read Ticket Status & Comments
|
|
113
|
+
|
|
114
|
+
**This phase determines the ticket's current state and reads ALL context before doing anything.**
|
|
115
|
+
|
|
116
|
+
**CRITICAL JQ NOTE:** Do NOT use `!= null` in jq commands - it causes shell escaping errors.
|
|
117
|
+
|
|
118
|
+
**Step 1: ALWAYS read the ticket body and ALL comments first:**
|
|
119
|
+
```bash
|
|
120
|
+
# Read issue body
|
|
121
|
+
agentdev gh issue view <issue-number> -R data-tamer/<repo> --json title,body,labels,assignees
|
|
122
|
+
|
|
123
|
+
# Read ALL comments (CRITICAL — follow-up comments override the original body)
|
|
124
|
+
agentdev gh api rest 'repos/data-tamer/<repo>/issues/<issue-number>/comments' | node -e "let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{JSON.parse(d).forEach(c=>console.log('---',c.user.login,c.created_at,'---\n'+c.body+'\n'))})"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Comment Priority Rules:**
|
|
128
|
+
- Follow-up comments contain updated requirements that **OVERRIDE** the original ticket body
|
|
129
|
+
- Bot comments (starting with "🤖") are status updates — skip them when reading requirements
|
|
130
|
+
- Always prioritize the **most recent non-bot @claude comment** as the primary requirement
|
|
131
|
+
- If comments say "take screenshots from X" or "use real data from Y", do exactly that
|
|
132
|
+
|
|
133
|
+
**Step 2: Check the ticket's current project board status:**
|
|
134
|
+
```bash
|
|
135
|
+
# Get all project items
|
|
136
|
+
gh api graphql -f query='query { organization(login: "data-tamer") { projectV2(number: 1) { items(first: 100, orderBy: {field: POSITION, direction: DESC}) { nodes { id fieldValueByName(name: "Status") { ... on ProjectV2ItemFieldSingleSelectValue { name } } content { ... on Issue { number title body repository { name } } } } } } } }' > /tmp/gh-items.json
|
|
137
|
+
|
|
138
|
+
# Find THIS ticket's status and item ID
|
|
139
|
+
cat /tmp/gh-items.json | jq -r '.data.organization.projectV2.items.nodes[] | select(.content.number == <issue-number>) | select(.content.repository.name == "<repo>") | "\(.id)|\(.fieldValueByName.name)"' 2>/dev/null | head -1
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Step 3: Resume from the right phase based on current status:**
|
|
143
|
+
|
|
144
|
+
| Current Status | Action |
|
|
145
|
+
|---|---|
|
|
146
|
+
| **Done** | Ticket already complete. If comments contain new @claude requests, move back to "In Progress" and go to Phase 3 |
|
|
147
|
+
| **test** | Skip to Phase 6 (Production Testing) |
|
|
148
|
+
| **In Progress** | Check if OpenSpec exists. If yes → Phase 3 (Implementation). If no → Phase 2 (OpenSpec) |
|
|
149
|
+
| **Todo** | Proceed to Phase 1 (Discovery & Claim) |
|
|
150
|
+
| **Not on board** | Proceed to Phase 1 (Discovery & Claim) |
|
|
151
|
+
|
|
152
|
+
**Before continuing, check for new comments** (see "Check for New Comments Between Phases" above).
|
|
153
|
+
|
|
154
|
+
### Phase 1: Ticket Discovery & Claim
|
|
155
|
+
|
|
156
|
+
**If the ticket is already known** (passed via executor prompt), skip discovery and use that ticket directly.
|
|
157
|
+
|
|
158
|
+
**If no specific ticket was given**, find tickets in "Todo" status with `@claude` in the body or comments:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# Reuse /tmp/gh-items.json from Phase 0 if available, otherwise fetch:
|
|
162
|
+
gh api graphql -f query='query { organization(login: "data-tamer") { projectV2(number: 1) { items(first: 100, orderBy: {field: POSITION, direction: DESC}) { nodes { id fieldValueByName(name: "Status") { ... on ProjectV2ItemFieldSingleSelectValue { name } } content { ... on Issue { number title body repository { name } } } } } } } }' > /tmp/gh-items.json
|
|
163
|
+
|
|
164
|
+
# Filter for Todo items with @claude
|
|
165
|
+
cat /tmp/gh-items.json | jq -r '.data.organization.projectV2.items.nodes[] | select(.fieldValueByName.name == "Todo") | select(.content.body | contains("@claude")) | "\(.id)|\(.content.number)|\(.content.title)|\(.content.repository.name)"' 2>/dev/null | head -1
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**Expected output format:** `ITEM_ID|ISSUE_NUMBER|TITLE|REPO_NAME`
|
|
169
|
+
|
|
170
|
+
If no tickets found: Report "No @claude tickets found in Todo status." and stop.
|
|
171
|
+
|
|
172
|
+
If ticket found, extract and store:
|
|
173
|
+
- `item_id`: First field (for project status updates)
|
|
174
|
+
- `issue_number`: Second field
|
|
175
|
+
- `title`: Third field
|
|
176
|
+
- `repo`: Fourth field (e.g., data-tamer-dashboard)
|
|
177
|
+
|
|
178
|
+
**Before continuing, check for new comments** (see "Check for New Comments Between Phases" above).
|
|
179
|
+
|
|
180
|
+
### Phase 2: OpenSpec Creation (INLINED - NO Skill tool)
|
|
181
|
+
|
|
182
|
+
**This phase creates OpenSpec artifacts WITHOUT calling the Skill tool.**
|
|
183
|
+
|
|
184
|
+
1. **Read the full ticket details AND all comments:**
|
|
185
|
+
```bash
|
|
186
|
+
# Read the issue body
|
|
187
|
+
gh issue view <issue-number> -R data-tamer/<repo> --json title,body,labels,assignees
|
|
188
|
+
|
|
189
|
+
# CRITICAL: Read ALL issue comments (follow-up instructions override the original body)
|
|
190
|
+
agentdev gh api rest 'repos/data-tamer/<repo>/issues/<issue-number>/comments' | node -e "let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{JSON.parse(d).forEach(c=>console.log('---',c.user.login,c.created_at,'---\n'+c.body+'\n'))})"
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**IMPORTANT: Comment Priority Rules:**
|
|
194
|
+
- Follow-up comments contain updated requirements that **OVERRIDE** the original ticket body
|
|
195
|
+
- When a ticket is re-queued after completion, the **latest @claude comments** explain what needs to change
|
|
196
|
+
- Always prioritize the **most recent non-bot comment** over the original issue body
|
|
197
|
+
- Bot comments (starting with "🤖") are status updates — skip them when reading requirements
|
|
198
|
+
- If comments say "take screenshots from X" or "use real data from Y", do exactly that — do NOT create synthetic/mock UI
|
|
199
|
+
|
|
200
|
+
2. **Derive a kebab-case change name** from the ticket title (e.g., "Fix slide loading" → `fix-slide-loading`)
|
|
201
|
+
|
|
202
|
+
3. **Create the OpenSpec change:**
|
|
203
|
+
```bash
|
|
204
|
+
openspec new change "<change-name>"
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
4. **Get artifact build order:**
|
|
208
|
+
```bash
|
|
209
|
+
openspec status --change "<change-name>" --json
|
|
210
|
+
```
|
|
211
|
+
Parse the JSON to get `applyRequires` (artifacts needed before implementation).
|
|
212
|
+
|
|
213
|
+
5. **Create artifacts in sequence:**
|
|
214
|
+
|
|
215
|
+
For each artifact in dependency order:
|
|
216
|
+
```bash
|
|
217
|
+
# Get instructions for the artifact
|
|
218
|
+
openspec instructions <artifact-id> --change "<change-name>" --json
|
|
219
|
+
```
|
|
220
|
+
- Read the `template` from instructions
|
|
221
|
+
- Read any dependency files for context
|
|
222
|
+
- Create the artifact file following the template structure
|
|
223
|
+
- Print "✓ Created <artifact-id>"
|
|
224
|
+
|
|
225
|
+
Continue until all `applyRequires` artifacts are complete.
|
|
226
|
+
|
|
227
|
+
6. **Comment on GitHub issue:**
|
|
228
|
+
```bash
|
|
229
|
+
gh issue comment <issue-number> -R data-tamer/<repo> --body "## OpenSpec Change Created
|
|
230
|
+
|
|
231
|
+
Change: \`<change-name>\`
|
|
232
|
+
Starting automated implementation.
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
*Automated by Claude Code Auto-Ticket Workflow*"
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
**After Phase 2: Print "✓ OpenSpec artifacts created. CONTINUING TO PHASE 3..." and IMMEDIATELY proceed.**
|
|
239
|
+
|
|
240
|
+
**Before continuing, check for new comments** (see "Check for New Comments Between Phases" above).
|
|
241
|
+
|
|
242
|
+
### Phase 3: Implementation (INLINED - NO Skill tool)
|
|
243
|
+
|
|
244
|
+
**This phase implements tasks WITHOUT calling the Skill tool.**
|
|
245
|
+
|
|
246
|
+
1. **Move ticket to "In Progress" and VERIFY:**
|
|
247
|
+
```bash
|
|
248
|
+
# Move to In Progress
|
|
249
|
+
gh project item-edit --id <item-id> --project-id PVT_kwDOCJIWbs4AnuSZ \
|
|
250
|
+
--field-id PVTSSF_lADOCJIWbs4AnuSZzgfaWGs \
|
|
251
|
+
--single-select-option-id 47fc9ee4
|
|
252
|
+
|
|
253
|
+
# Verify the change
|
|
254
|
+
gh api graphql -f query='query { node(id: "<item-id>") { ... on ProjectV2Item { fieldValueByName(name: "Status") { ... on ProjectV2ItemFieldSingleSelectValue { name } } } } }' | jq -r '.data.node.fieldValueByName.name'
|
|
255
|
+
```
|
|
256
|
+
Print "✓ Ticket #<number> moved to In Progress (verified)"
|
|
257
|
+
|
|
258
|
+
2. **Find the OpenSpec change:**
|
|
259
|
+
```bash
|
|
260
|
+
ls openspec/changes/ | grep -v archive
|
|
261
|
+
```
|
|
262
|
+
Use the change name from Phase 2 or find a matching change.
|
|
263
|
+
|
|
264
|
+
3. **Get apply instructions:**
|
|
265
|
+
```bash
|
|
266
|
+
openspec instructions apply --change "<change-name>" --json
|
|
267
|
+
```
|
|
268
|
+
This returns context files and task list.
|
|
269
|
+
|
|
270
|
+
4. **Read context files** listed in `contextFiles` (proposal, specs, design, tasks).
|
|
271
|
+
|
|
272
|
+
5. **Implement tasks one by one:**
|
|
273
|
+
|
|
274
|
+
For each pending task in tasks.md:
|
|
275
|
+
- Print "Working on task: <task description>"
|
|
276
|
+
- Make the code changes required
|
|
277
|
+
- Keep changes minimal and focused
|
|
278
|
+
- Mark task complete: `- [ ]` → `- [x]`
|
|
279
|
+
- Print "✓ Task complete"
|
|
280
|
+
|
|
281
|
+
6. **Commit changes:**
|
|
282
|
+
```bash
|
|
283
|
+
git add <changed-files>
|
|
284
|
+
git commit -m "fix/feat: <description>
|
|
285
|
+
|
|
286
|
+
Fixes #<issue-number>
|
|
287
|
+
|
|
288
|
+
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>"
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
7. **Comment on issue with implementation details**
|
|
292
|
+
|
|
293
|
+
**After Phase 3: Print "✓ Implementation complete. CONTINUING TO PHASE 4..." and IMMEDIATELY proceed.**
|
|
294
|
+
|
|
295
|
+
**Before continuing, check for new comments** (see "Check for New Comments Between Phases" above).
|
|
296
|
+
|
|
297
|
+
### Phase 4: Local Testing
|
|
298
|
+
|
|
299
|
+
1. Determine which services need restart:
|
|
300
|
+
- `data-tamer-dashboard/` → Frontend (hot reload, NO restart needed)
|
|
301
|
+
- `tamer_service/` → `kubectl rollout restart deployment/tamer-datasource-consumer-dev deployment/tamer-message-consumer-dev -n datatamer`
|
|
302
|
+
- `consumer_service/` → `kubectl rollout restart deployment/consumer-service-dev -n datatamer`
|
|
303
|
+
|
|
304
|
+
2. **Run Playwright headless tests:**
|
|
305
|
+
```bash
|
|
306
|
+
cd /home/riccardo/Documents/apps/datatamer/app/auto-ticket-logs
|
|
307
|
+
node playwright-test.js login # Test login works
|
|
308
|
+
node playwright-test.js slides # Test slides feature
|
|
309
|
+
```
|
|
310
|
+
Screenshots are saved to `/tmp/auto-ticket-screenshots/`
|
|
311
|
+
|
|
312
|
+
3. If tests fail: Fix issues and re-test (do NOT move to production)
|
|
313
|
+
|
|
314
|
+
4. If tests pass: Comment on issue and proceed
|
|
315
|
+
|
|
316
|
+
**After Phase 4: Print "✓ Local tests passed. CONTINUING TO PHASE 5..." and IMMEDIATELY proceed.**
|
|
317
|
+
|
|
318
|
+
**Before continuing, check for new comments** (see "Check for New Comments Between Phases" above).
|
|
319
|
+
|
|
320
|
+
### Phase 5: Production Deployment
|
|
321
|
+
|
|
322
|
+
1. **Deploy using git workflow:**
|
|
323
|
+
```bash
|
|
324
|
+
git push origin master
|
|
325
|
+
git checkout production
|
|
326
|
+
git merge master
|
|
327
|
+
git push origin production
|
|
328
|
+
git checkout master
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
2. **Wait for GitHub Actions:**
|
|
332
|
+
```bash
|
|
333
|
+
gh run watch -R data-tamer/<repo>
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
3. **Verify production pods:**
|
|
337
|
+
```bash
|
|
338
|
+
ssh root@153.92.127.95 'export KUBECONFIG=/etc/rancher/k3s/k3s.yaml && kubectl get pods -n datatamer | grep <service>'
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
4. Comment on issue with deployment status
|
|
342
|
+
|
|
343
|
+
**After Phase 5: Print "✓ Production deployed. CONTINUING TO PHASE 6..." and IMMEDIATELY proceed.**
|
|
344
|
+
|
|
345
|
+
**Before continuing, check for new comments** (see "Check for New Comments Between Phases" above).
|
|
346
|
+
|
|
347
|
+
### Phase 6: Production Testing
|
|
348
|
+
|
|
349
|
+
1. **Move ticket to "test" status and VERIFY:**
|
|
350
|
+
```bash
|
|
351
|
+
# Move to test
|
|
352
|
+
gh project item-edit --id <item-id> --project-id PVT_kwDOCJIWbs4AnuSZ \
|
|
353
|
+
--field-id PVTSSF_lADOCJIWbs4AnuSZzgfaWGs \
|
|
354
|
+
--single-select-option-id c48bc058
|
|
355
|
+
|
|
356
|
+
# Verify the change
|
|
357
|
+
gh api graphql -f query='query { node(id: "<item-id>") { ... on ProjectV2Item { fieldValueByName(name: "Status") { ... on ProjectV2ItemFieldSingleSelectValue { name } } } } }' | jq -r '.data.node.fieldValueByName.name'
|
|
358
|
+
```
|
|
359
|
+
Print "✓ Ticket #<number> moved to test (verified)"
|
|
360
|
+
|
|
361
|
+
2. **Run Playwright tests on production:**
|
|
362
|
+
```bash
|
|
363
|
+
cd /home/riccardo/Documents/apps/datatamer/app/auto-ticket-logs
|
|
364
|
+
node playwright-test.js login --production
|
|
365
|
+
node playwright-test.js slides --production
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
3. **Take final screenshot of the feature working:**
|
|
369
|
+
- Use browser automation (Claude in Chrome MCP) to navigate to the relevant page on production
|
|
370
|
+
- Take a screenshot showing the implemented feature
|
|
371
|
+
- Save to `/tmp/auto-ticket-screenshots/final-<issue-number>.png`
|
|
372
|
+
|
|
373
|
+
4. **If production tests FAIL:**
|
|
374
|
+
- Comment on issue with failure details
|
|
375
|
+
- Rollback if critical
|
|
376
|
+
- Move ticket back to "Todo" (with verification)
|
|
377
|
+
- Stop workflow
|
|
378
|
+
|
|
379
|
+
5. **If production tests PASS:**
|
|
380
|
+
- Comment on issue confirming success
|
|
381
|
+
- Print "✓ Production tests passed. CONTINUING TO PHASE 7..."
|
|
382
|
+
|
|
383
|
+
**Before continuing, check for new comments** (see "Check for New Comments Between Phases" above).
|
|
384
|
+
|
|
385
|
+
### Phase 7: Completion
|
|
386
|
+
|
|
387
|
+
1. **Move ticket to "Done" and VERIFY:**
|
|
388
|
+
```bash
|
|
389
|
+
# Move to Done
|
|
390
|
+
gh project item-edit --id <item-id> --project-id PVT_kwDOCJIWbs4AnuSZ \
|
|
391
|
+
--field-id PVTSSF_lADOCJIWbs4AnuSZzgfaWGs \
|
|
392
|
+
--single-select-option-id 98236657
|
|
393
|
+
|
|
394
|
+
# Verify the change
|
|
395
|
+
gh api graphql -f query='query { node(id: "<item-id>") { ... on ProjectV2Item { fieldValueByName(name: "Status") { ... on ProjectV2ItemFieldSingleSelectValue { name } } } } }' | jq -r '.data.node.fieldValueByName.name'
|
|
396
|
+
```
|
|
397
|
+
Print "✓ Ticket #<number> moved to Done (verified)"
|
|
398
|
+
|
|
399
|
+
2. **Archive OpenSpec change:**
|
|
400
|
+
```bash
|
|
401
|
+
openspec archive "<change-name>"
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
3. **Upload final screenshot to GitHub:**
|
|
405
|
+
- Check if screenshot exists at `/tmp/auto-ticket-screenshots/final-<issue-number>.png`
|
|
406
|
+
- If exists, upload to GitHub using the issue comment with image attachment:
|
|
407
|
+
```bash
|
|
408
|
+
# Upload screenshot as asset and get URL
|
|
409
|
+
SCREENSHOT="/tmp/auto-ticket-screenshots/final-<issue-number>.png"
|
|
410
|
+
if [ -f "$SCREENSHOT" ]; then
|
|
411
|
+
# Create a gist or use GitHub's drag-drop equivalent via API
|
|
412
|
+
# For now, reference the local screenshot in the comment
|
|
413
|
+
gh issue comment <issue-number> -R data-tamer/<repo> --body "## Ticket Complete ✅
|
|
414
|
+
|
|
415
|
+
### Final Result Screenshot
|
|
416
|
+

|
|
417
|
+
|
|
418
|
+
*Screenshot saved locally at: \`$SCREENSHOT\`*
|
|
419
|
+
|
|
420
|
+
### Summary
|
|
421
|
+
All phases passed:
|
|
422
|
+
- ✓ OpenSpec created
|
|
423
|
+
- ✓ Implementation complete
|
|
424
|
+
- ✓ Local tests passed
|
|
425
|
+
- ✓ Production deployed
|
|
426
|
+
- ✓ Production tests passed
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
*Automated by Claude Code Auto-Ticket Workflow*"
|
|
430
|
+
fi
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
**Alternative: Attach screenshot directly using gh CLI:**
|
|
434
|
+
- The `gh` CLI doesn't support direct image upload to comments
|
|
435
|
+
- Instead, use the Read tool to view the screenshot and describe the result in the comment
|
|
436
|
+
- Or upload to an image hosting service and include the URL
|
|
437
|
+
|
|
438
|
+
4. **Add completion comment with screenshot description:**
|
|
439
|
+
|
|
440
|
+
If screenshot was taken, use the Read tool to view it and include a description of what it shows in the completion comment. The comment should describe:
|
|
441
|
+
- What page/feature is shown
|
|
442
|
+
- Key visual elements confirming the fix works
|
|
443
|
+
- Any notable UI changes
|
|
444
|
+
|
|
445
|
+
```bash
|
|
446
|
+
gh issue comment <issue-number> -R data-tamer/<repo> --body "## Ticket Complete ✅
|
|
447
|
+
|
|
448
|
+
### Final Result
|
|
449
|
+
<description of what the screenshot shows - the working feature on production>
|
|
450
|
+
|
|
451
|
+
### Summary
|
|
452
|
+
| Phase | Status |
|
|
453
|
+
|-------|--------|
|
|
454
|
+
| 0. Preflight | ✓ Complete |
|
|
455
|
+
| 1. Discovery | ✓ Complete |
|
|
456
|
+
| 2. OpenSpec | ✓ Created |
|
|
457
|
+
| 3. Implementation | ✓ Committed |
|
|
458
|
+
| 4. Local Testing | ✓ Passed |
|
|
459
|
+
| 5. Production Deploy | ✓ Deployed |
|
|
460
|
+
| 6. Production Testing | ✓ Passed |
|
|
461
|
+
| 7. Completion | ✓ Done |
|
|
462
|
+
|
|
463
|
+
---
|
|
464
|
+
*Automated by Claude Code Auto-Ticket Workflow*"
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
5. **Close the issue:**
|
|
468
|
+
```bash
|
|
469
|
+
gh issue close <issue-number> -R data-tamer/<repo> --reason completed
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
Print "=== AUTO-TICKET WORKFLOW COMPLETE ===" with summary table.
|
|
473
|
+
|
|
474
|
+
## Failure Handling
|
|
475
|
+
|
|
476
|
+
When any phase fails:
|
|
477
|
+
|
|
478
|
+
1. Comment on issue with failure details (phase, error, logs)
|
|
479
|
+
2. **Move ticket back to "Todo" and VERIFY:**
|
|
480
|
+
```bash
|
|
481
|
+
gh project item-edit --id <item-id> --project-id PVT_kwDOCJIWbs4AnuSZ \
|
|
482
|
+
--field-id PVTSSF_lADOCJIWbs4AnuSZzgfaWGs \
|
|
483
|
+
--single-select-option-id f75ad846
|
|
484
|
+
|
|
485
|
+
# Verify
|
|
486
|
+
gh api graphql -f query='query { node(id: "<item-id>") { ... on ProjectV2Item { fieldValueByName(name: "Status") { ... on ProjectV2ItemFieldSingleSelectValue { name } } } } }' | jq -r '.data.node.fieldValueByName.name'
|
|
487
|
+
```
|
|
488
|
+
3. Report what went wrong
|
|
489
|
+
|
|
490
|
+
## Login Credentials
|
|
491
|
+
|
|
492
|
+
```
|
|
493
|
+
Username: riccardo.ravaro@datatamer.ai
|
|
494
|
+
Password: Nettuno1999
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
## Testing Environments
|
|
498
|
+
|
|
499
|
+
### Local (app.local.datatamer.ai)
|
|
500
|
+
- URL: https://app.local.datatamer.ai
|
|
501
|
+
- DB access: `kubectl exec -it postgresql-0 -n datatamer -- psql -U postgres -d postgres`
|
|
502
|
+
|
|
503
|
+
### Production (app.datatamer.ai)
|
|
504
|
+
- URL: https://app.datatamer.ai
|
|
505
|
+
- SSH: `ssh root@153.92.127.95`
|
|
506
|
+
|
|
507
|
+
## Key Constraints
|
|
508
|
+
|
|
509
|
+
1. **Fully automatic** - Never ask user for permission during execution
|
|
510
|
+
2. **NO nested skills** - All logic is inlined to prevent workflow interruption
|
|
511
|
+
3. **Verified status changes** - Every status transition is verified after execution
|
|
512
|
+
4. **@claude tag required** - Only process tickets with `@claude` in body text
|
|
513
|
+
5. **Sequential workflow** - Each ticket must pass each phase before proceeding
|
|
514
|
+
|
|
515
|
+
---
|
|
516
|
+
|
|
517
|
+
**Default Behavior**: When invoked, automatically process @claude tickets through the complete workflow. The ticket moves through statuses: Todo → In Progress → test → Done (verified at each step).
|
|
518
|
+
|
|
519
|
+
---
|
|
520
|
+
|
|
521
|
+
## Non-Interactive / Cron Mode
|
|
522
|
+
|
|
523
|
+
```bash
|
|
524
|
+
claude -p --dangerously-skip-permissions --output-format stream-json --verbose "/auto-ticket-workflow"
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
### Multi-Agent Mode
|
|
528
|
+
|
|
529
|
+
```bash
|
|
530
|
+
# Run parallel agents
|
|
531
|
+
./run-multi-agent.sh 3
|
|
532
|
+
|
|
533
|
+
# Cron entry
|
|
534
|
+
* * * * * MAX_AGENTS=3 /path/to/auto-ticket-logs/run-multi-cron.sh
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
### Web UI
|
|
538
|
+
|
|
539
|
+
```bash
|
|
540
|
+
# View live logs at http://localhost:3847
|
|
541
|
+
systemctl status auto-ticket-webui
|
|
542
|
+
```
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Auto-Ticket Workflow
|
|
2
|
+
|
|
3
|
+
Process GitHub tickets with @claude tag through the full development lifecycle.
|
|
4
|
+
|
|
5
|
+
Use the `auto-ticket-workflow` skill to:
|
|
6
|
+
1. Find tickets in Todo with @claude tag
|
|
7
|
+
2. Create OpenSpec proposal and implement
|
|
8
|
+
3. Test locally and deploy to production
|
|
9
|
+
4. Move ticket to Done when verified
|
|
10
|
+
|
|
11
|
+
## GitHub CLI
|
|
12
|
+
|
|
13
|
+
Use `agentdev gh` instead of `gh` for ALL GitHub operations.
|
|
14
|
+
GH_TOKEN is pre-configured in your environment.
|
|
15
|
+
|
|
16
|
+
Examples:
|
|
17
|
+
- agentdev gh issue view 123 -R data-tamer/repo --json title,body,state,labels
|
|
18
|
+
- agentdev gh api rest 'repos/data-tamer/repo/issues/123/comments' | node -e "let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{JSON.parse(d).forEach(c=>console.log('---',c.user.login,c.created_at,'---\n'+c.body+'\n'))})"
|
|
19
|
+
- agentdev gh issue comment 123 -R data-tamer/repo --body "update"
|
|
20
|
+
- agentdev gh issue create -R data-tamer/repo --title "Fix" --body "description"
|
|
21
|
+
- agentdev gh pr create -R data-tamer/repo --title "Fix" --body "..." --head fix-branch --base master
|
|
22
|
+
- agentdev gh pr merge 45 -R data-tamer/repo --squash
|
|
23
|
+
- agentdev gh issue reopen 123 -R data-tamer/repo
|
|
24
|
+
|
|
25
|
+
## OpenSpec
|
|
26
|
+
|
|
27
|
+
Use `agentdev openspec` instead of `openspec` for ALL spec-driven development operations.
|
|
28
|
+
OpenSpec is bundled with agentdev — no separate install needed.
|
|
29
|
+
|
|
30
|
+
Examples:
|
|
31
|
+
- agentdev openspec init --tools claude-code
|
|
32
|
+
- agentdev openspec status --json
|
|
33
|
+
- agentdev openspec list --json
|
|
34
|
+
- agentdev openspec validate --all --json
|
|
35
|
+
- agentdev openspec instructions proposal --change my-change --json
|
|
36
|
+
- agentdev openspec show my-change --json
|
|
37
|
+
- agentdev openspec archive my-change --yes
|
|
38
|
+
|
|
39
|
+
## Reading Ticket Comments (CRITICAL)
|
|
40
|
+
|
|
41
|
+
Before implementing any ticket, ALWAYS read the full issue AND its comments:
|
|
42
|
+
|
|
43
|
+
1. Read issue body: `agentdev gh issue view <N> -R data-tamer/<repo> --json title,body,state,labels`
|
|
44
|
+
2. Read ALL comments: `agentdev gh api rest 'repos/data-tamer/<repo>/issues/<N>/comments' | node -e "let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{JSON.parse(d).forEach(c=>console.log('---',c.user.login,c.created_at,'---\n'+c.body+'\n'))})"`
|
|
45
|
+
|
|
46
|
+
Follow-up comments contain updated requirements that OVERRIDE the original ticket body.
|
|
47
|
+
When a ticket is re-queued after completion, the latest comments explain what needs to change.
|
|
48
|
+
Always prioritize the most recent @claude comment over the original issue body.
|
|
49
|
+
|
|
50
|
+
## OpenSpec
|
|
51
|
+
|
|
52
|
+
Use `agentdev openspec` instead of `openspec` for ALL spec-driven development operations.
|
|
53
|
+
OpenSpec is bundled with agentdev — no separate install needed.
|
|
54
|
+
|
|
55
|
+
Examples:
|
|
56
|
+
- agentdev openspec init --tools claude-code
|
|
57
|
+
- agentdev openspec status --json
|
|
58
|
+
- agentdev openspec list --json
|
|
59
|
+
- agentdev openspec validate --all --json
|
|
60
|
+
- agentdev openspec instructions proposal --change my-change --json
|
|
61
|
+
- agentdev openspec show my-change --json
|
|
62
|
+
- agentdev openspec archive my-change --yes
|
|
63
|
+
|
|
64
|
+
Workflow: After claiming a ticket, create an OpenSpec proposal before implementing.
|
|
65
|
+
Use `agentdev openspec status --json` to check artifact completion during the workflow.
|
|
66
|
+
|
|
67
|
+
Run the skill now and report progress.
|