@taktdev/coda 1.0.0 → 1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taktdev/coda",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Bugherd QA automation MCP server",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: qa-approve
3
- description: "Commit and tag fixes for Bugherd tickets. Triggers Ready for Review in Bugherd."
3
+ description: "Merge fix branches into main with tagged commits. Triggers Ready for Review in Bugherd."
4
4
  argument-hint: "<ticket-id> [ticket-id...]"
5
5
  user-invocable: true
6
6
  ---
7
7
 
8
8
  # /qa-approve
9
9
 
10
- Merge fix branches into main/current branch with tagged commits that trigger Bugherd's GitHub integration, then shut down the responsible agent to free a team slot.
10
+ Tell the remediator to commit, then merge its branch into main with a tagged commit that triggers Bugherd's GitHub integration. Shut down the agent afterward.
11
11
 
12
12
  ## Usage
13
13
 
@@ -21,7 +21,8 @@ Merge fix branches into main/current branch with tagged commits that trigger Bug
21
21
 
22
22
  - **Single ticket:** `/qa-approve 42`
23
23
  - **Multiple tickets:** `/qa-approve 42 43 44`
24
- - **All pending:** `/qa-approve all` — finds all `.takty/qa/BH-*.md` files that have NOT been renamed to `-fixed` (i.e., excludes `BH-*-fixed.md`)
24
+ - **All pending:** `/qa-approve all` — finds all `.takty/qa/BH-*.md` files, excluding both `BH-*-fixed.md` AND `BH-*-flagged.md`
25
+ - **Flagged ticket:** `/qa-approve {id}` on a flagged ticket (`BH-{id}-flagged.md`) — warn user, show the Analysis section, and require explicit confirmation before proceeding
25
26
 
26
27
  ## Flow
27
28
 
@@ -29,37 +30,45 @@ For each ticket:
29
30
 
30
31
  ### 1. Read Remediation File
31
32
 
32
- Read `.takty/qa/BH-{id}.md` to get:
33
- - The branch name (from the "Worktree" section)
33
+ Check for both `.takty/qa/BH-{id}.md` and `.takty/qa/BH-{id}-flagged.md`. Read whichever exists to get:
34
+ - The branch name (from the `## Worktree` section)
34
35
  - The short description (from the `# BH-{id}: {title}` heading)
35
- - The list of changes made
36
- - The **agent name** (from the "Agent" section)
36
+ - The agent name (from the `## Agent` section)
37
+ - The worktree path (from the `## Worktree` section)
37
38
 
38
- ### 2. Verify Branch Exists
39
+ ### 2. Check for Flagged
39
40
 
40
- Check that the branch exists:
41
+ If the file is `BH-{id}-flagged.md`:
42
+ - Show the Analysis section to the user
43
+ - Warn that this ticket was flagged for manual review
44
+ - Ask for explicit confirmation before proceeding
45
+ - `/qa-approve all` **skips** flagged tickets and reports them at the end
46
+
47
+ ### 3. Tell Remediator to Commit
48
+
49
+ Send a message to the remediator agent instructing it to commit in its worktree:
41
50
 
42
51
  ```bash
43
- git branch --list {branch-name}
52
+ git add -A && git commit -m "fix: BH-{id} {description}"
44
53
  ```
45
54
 
46
- If the branch doesn't exist, report which tickets couldn't be found and skip them. Continue with remaining tickets.
55
+ Do NOT add a `Co-Authored-By` line. The remediator confirms the commit.
47
56
 
48
- ### 3. Merge the Branch
57
+ ### 4. Team Lead Merges
49
58
 
50
- Merge the ticket's branch into the current branch (usually `main`):
59
+ In the **main workspace** (not the worktree), merge the remediator's branch:
51
60
 
52
61
  ```bash
53
- git merge {branch-name} --no-ff -m "{short description} [Ready for Review BH-{id}]"
62
+ git merge {branch} --no-ff -m "{description} [Ready for Review BH-{id}]"
54
63
  ```
55
64
 
56
- This creates a merge commit with the Bugherd tag in a single step.
65
+ This is safe because worktrees are isolated merging one branch into main does not affect any other remediator's worktree.
57
66
 
58
- If there are merge conflicts:
67
+ If merge conflicts arise (because main moved forward from earlier approvals):
59
68
  - For simple conflicts (whitespace, non-overlapping changes): resolve automatically
60
69
  - For complex conflicts: ask the user to resolve manually
61
70
 
62
- ### 4. Verify Tagged Commit
71
+ ### 5. Verify Tagged Commit
63
72
 
64
73
  Confirm the merge commit was created with the correct tag format:
65
74
 
@@ -69,35 +78,39 @@ git log -1 --oneline
69
78
 
70
79
  **Tag format rules:**
71
80
  - The Bugherd tag **must be in the commit subject line** (first line), not in the body/description
72
- - Do NOT add a `Co-Authored-By` line — it can interfere with the tag parsing
81
+ - Do NOT add a `Co-Authored-By` line — it can interfere with tag parsing
73
82
  - **Case-sensitive** — must be `Ready for Review` (capital R on Review), not `Ready for review`
74
- - Multiple tickets in one commit: `{short description} [Ready for Review BH-1,2,3]`
83
+ - Multiple tickets in one commit: `{description} [Ready for Review BH-1,2,3]`
75
84
 
76
- ### 5. Mark Remediation File as Fixed
85
+ ### 6. Rename Remediation File
77
86
 
78
- Rename the remediation file to append `-fixed`:
87
+ Rename the remediation file to mark it as fixed:
79
88
 
80
89
  ```bash
81
90
  mv .takty/qa/BH-{id}.md .takty/qa/BH-{id}-fixed.md
82
91
  ```
83
92
 
84
- ### 6. Shut Down the Agent
93
+ (Or from `BH-{id}-flagged.md` to `BH-{id}-fixed.md` if it was a flagged ticket that was approved.)
85
94
 
86
- If the remediation file has an **Agent** name and that agent is still part of the team:
95
+ ### 7. Delete Branch
87
96
 
97
+ Clean up the merged branch:
98
+
99
+ ```bash
100
+ git branch -d {branch}
88
101
  ```
89
- SendMessage type: "shutdown_request" to the agent
90
- ```
91
102
 
92
- This frees a team slot. If more tickets are waiting in the Bugherd development column, the team lead can spawn a new agent.
103
+ ### 8. Shut Down Agent
104
+
105
+ Shut down the remediator agent to free resources.
93
106
 
94
- ### 7. Report Result
107
+ ### 9. Report Result
95
108
 
96
109
  Report for each ticket:
97
110
  - Commit hash
98
- - Branch merged
99
- - Agent shut down (or already idle/gone)
100
- - Remaining team slots available (out of 10)
111
+ - Branch merged and deleted
112
+ - Agent shut down
113
+ - Any skipped flagged tickets (when using `/qa-approve all`)
101
114
 
102
115
  ## Important Notes
103
116
 
@@ -106,5 +119,5 @@ Report for each ticket:
106
119
  - Process tickets sequentially to avoid merge conflicts between branches
107
120
  - If using `/qa-approve all`, first list which tickets will be approved and their descriptions before proceeding
108
121
  - The commit message format `{description} [Ready for Review BH-{id}]` is required by Bugherd's GitHub integration — tag must be in the subject line, case-sensitive
109
- - **Do NOT delete the team** after approving. The team persists until the user explicitly requests cleanup. Other agents may still be working or idle.
110
- - After shutting down an agent, check if there are unassigned tickets that could fill the freed slot
122
+ - `/qa-approve all` skips flagged files (`BH-*-flagged.md`) these need explicit `/qa-approve {id}` with user confirmation
123
+ - Remediator commits in its worktree, team lead merges into main (worktree limitation)
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: qa-remediate
3
- description: "Fetch Bugherd tickets and fix bugs. Spawns parallel agents for batch mode."
3
+ description: "Triage Bugherd tickets, spawn isolated remediators, and validate fixes sequentially."
4
4
  argument-hint: "[ticket-id] [context/hints]"
5
5
  user-invocable: true
6
6
  ---
7
7
 
8
8
  # /qa-remediate
9
9
 
10
- Fetch Bugherd tickets, group by similarity, and spawn team members to fix them. Up to 10 agents work in parallel, each on its own branch.
10
+ Fetch Bugherd tickets, triage and group them, then spawn remediators (each in its own worktree) to fix them sequentially. A fresh Validator checks each remediator's work before moving on.
11
11
 
12
12
  ## Usage
13
13
 
@@ -19,76 +19,158 @@ Fetch Bugherd tickets, group by similarity, and spawn team members to fix them.
19
19
 
20
20
  ## Argument Parsing
21
21
 
22
- - **No arguments** → Batch mode: fetch all tickets from the "development" column
23
- - **Number only** → Single ticket mode: spawn one agent for that ticket
22
+ - **No arguments** → Batch mode: spawn a Triager to fetch and file tickets, then remediators sequentially
23
+ - **Number only** → Single ticket mode: team lead triages inline, spawns one remediator
24
24
  - **Number + text** → Single ticket mode with context hints to guide the fix
25
25
 
26
26
  ## Team Lead Role
27
27
 
28
28
  The team lead (you, the main session) is **only** responsible for:
29
29
 
30
- 1. **Fetching** tickets from Bugherd
31
- 2. **Grouping** tickets by similarity
32
- 3. **Spawning and assigning** team members
33
- 4. **Relaying** agent reports and status to the user
34
- 5. **Managing slots** — spawn new agents as slots free up (max 10 concurrent)
30
+ 1. **Spawning the Triager** to fetch and file tickets
31
+ 2. **Receiving the Triager report** (groupings, remediator count, assignments)
32
+ 3. **Spawning all Remediators in parallel** (each in its own worktree)
33
+ 4. **Collecting worktree/branch reports** and writing them into remediation files
34
+ 5. **Sequencing active work** — telling one remediator at a time to start
35
+ 6. **Spawning a Validator** when a remediator finishes
36
+ 7. **Relaying validation feedback** to the remediator for corrections
37
+ 8. **Relaying status** to the user throughout
35
38
 
36
- The team lead does NOT fix tickets itself. All remediation work is done by spawned agents.
39
+ The team lead does NOT fix tickets, does NOT call Bugherd MCP (the Triager does that), and does NOT validate code.
37
40
 
38
41
  ## Batch Mode Flow
39
42
 
40
- 1. Call `list_tasks` MCP tool with `status="development"` to get tickets in the development column. **Only take the first 10 tickets** to avoid overloading context. If more exist, note the count and fetch the next batch after the current tickets are processed.
41
- 2. Create a team: `TeamCreate` with name `qa-remediate` (if not already active)
42
- 3. **Group tickets by similarity:**
43
- - Same block/module/component
44
- - Similar issue type across different components (e.g., "arrow icon wrong" on multiple blocks)
45
- - Related CSS/styling changes
46
- - Present the grouping to the user before spawning agents
47
- 4. Create a `TaskCreate` for each ticket
48
- 5. Spawn up to 10 remediator agents. Each agent MUST use:
49
- - `isolation: "worktree"` — each agent works in its own isolated worktree
50
- - `model: "opus"`Opus 4.6 for complex reasoning
51
- - `subagent_type: "general-purpose"`
52
- - `team_name: "qa-remediate"`
53
- - `name:` a descriptive name based on the ticket group (e.g., `remediator-hero`, `remediator-arrows`)
54
- - Grouped tickets can go to the same agent if closely related
55
- 6. Each remediator agent follows the **Remediator Steps** below
56
- 7. As agents finish and report back, relay their summaries to the user
57
- 8. **Do NOT shut down the team or agents.** Agents wait idle until the user reviews and approves via `/qa-approve`.
43
+ ### Step 1 Spawn Triager
44
+
45
+ Spawn a triager agent:
46
+ - `model: "sonnet"`
47
+ - `subagent_type: "general-purpose"`
48
+ - `name: "triager"`
49
+ - NO `isolation: "worktree"` works in the main workspace
50
+
51
+ Prompt includes: fetch development tickets, group them, create remediation files. See **Triager Steps** below.
52
+
53
+ ### Step 2Receive Triager Report
54
+
55
+ The Triager reports back with:
56
+ - Ticket groupings (which tickets go together)
57
+ - Number of remediators needed
58
+ - Ticket assignments per remediator
59
+
60
+ Present the groupings to the user. Shut down the Triager.
61
+
62
+ ### Step 3 — Spawn All Remediators in Parallel
63
+
64
+ Spawn all remediators at once, each with:
65
+ - `isolation: "worktree"` — each agent works in its own isolated worktree
66
+ - `model: "opus"` — Opus for complex reasoning
67
+ - `subagent_type: "general-purpose"`
68
+ - `name:` descriptive name based on ticket group (e.g., `remediator-hero`, `remediator-arrows`)
69
+
70
+ Initial prompt: **report your worktree path and branch name immediately, then WAIT for further instructions.**
71
+
72
+ ### Step 4 — Collect Worktree Reports
73
+
74
+ As each remediator reports its worktree path and branch, the team lead fills in the `## Agent` and `## Worktree` sections of each remediation file (in `.takty/qa/`).
75
+
76
+ ### Step 5 — Tell Remediator #1 to Start
77
+
78
+ Send the first remediator its assigned remediation file paths (absolute paths). It begins work per the **Remediator Steps** below.
79
+
80
+ ### Step 6 — Remediator #1 Finishes
81
+
82
+ Receive the remediator's summary of what was fixed, flagged, or changed.
83
+
84
+ ### Step 7 — Spawn Validator
85
+
86
+ Spawn a fresh Validator agent:
87
+ - `model: "sonnet"`
88
+ - `subagent_type: "general-purpose"`
89
+ - NO `isolation: "worktree"` — reads files via absolute paths in the remediator's worktree
90
+
91
+ See **Validator Steps** below.
92
+
93
+ ### Step 8 — Handle Validation
94
+
95
+ - If the Validator reports issues: relay them to the remediator for fixes, then re-validate
96
+ - If the Validator reports "all clear": shut down the Validator
97
+
98
+ ### Step 9 — Tell Remediator #2 to Start
99
+
100
+ Send the next remediator its assigned remediation file paths. Repeat steps 6–8.
101
+
102
+ ### Step 10 — Repeat
103
+
104
+ Continue until all remediators have completed and been validated.
105
+
106
+ ### Step 11 — Report Summary
107
+
108
+ Report to the user:
109
+ - Which tickets are ready (fixed and validated)
110
+ - Which tickets were flagged (renamed to `BH-{id}-flagged.md`)
111
+ - Remind user to run `/qa-approve` to merge and tag
58
112
 
59
113
  ## Single Ticket Mode Flow
60
114
 
61
- Same as batch but for one ticket. Still spawns an agent — the team lead does not fix it directly.
115
+ Skip the Triager — the team lead handles triage inline:
116
+
117
+ 1. Call `get_task` MCP tool with the ticket ID to get full details
118
+ 2. Create `.takty/qa/BH-{id}.md` — populate File, Ticket, Description sections
119
+ 3. Spawn one remediator (same worktree + opus settings as batch mode)
120
+ 4. Collect worktree report, fill in Agent + Worktree sections
121
+ 5. Tell the remediator to start
122
+ 6. When done, spawn a Validator, handle feedback loop
123
+ 7. Report result to user
124
+
125
+ ## Triager Steps
62
126
 
63
- 1. Create a team: `TeamCreate` with name `qa-remediate` (if not already active)
64
- 2. Create a `TaskCreate` for the ticket
65
- 3. Spawn one remediator agent (same settings as batch mode)
66
- 4. Agent follows the **Remediator Steps** below
67
- 5. Relay the agent's report to the user when done
127
+ The Triager agent performs these steps:
68
128
 
69
- ## Slot Management
129
+ ### 1. Fetch Tickets
130
+ - Call `list_tasks` MCP tool with `status="development"` to get tickets in the development column
131
+ - Take up to 15 tickets. If more exist, note the count.
132
+ - Call `get_task` for each ticket to get full details (description, priority, screenshots, comments)
70
133
 
71
- - Maximum 10 concurrent team members
72
- - When a ticket is approved via `/qa-approve`, that agent is shut down, freeing a slot
73
- - If more tickets remain in the current batch, the team lead can spawn a new agent for the next ticket
74
- - When all tickets from the current batch are assigned or completed, fetch the next 10 from Bugherd via `list_tasks`
75
- - Check `TaskList` and team config to track active vs idle agents
134
+ ### 2. Group by Similarity
135
+ - Same block/module/component
136
+ - Similar issue type across different components (e.g., "arrow icon wrong" on multiple blocks)
137
+ - Related CSS/styling changes
138
+
139
+ ### 3. Create Remediation Files
140
+ - Create `.takty/qa/BH-{id}.md` for each ticket using the template below
141
+ - Populate only the **File**, **Ticket**, and **Description** sections
142
+ - Leave Agent, Worktree, Analysis, Changes Made, Test Page, and Status sections empty
143
+
144
+ ### 4. Report to Team Lead
145
+ - List the groupings with ticket IDs and descriptions
146
+ - State how many remediators are needed
147
+ - State which tickets are assigned to which remediator
148
+
149
+ ### 5. Done
150
+ The Triager shuts down after reporting.
76
151
 
77
152
  ## Remediator Steps
78
153
 
79
- For each ticket:
154
+ ### 1. Report Worktree + Branch
155
+
156
+ **Immediately** report your working directory and branch:
157
+
158
+ ```bash
159
+ pwd
160
+ git branch --show-current
161
+ ```
162
+
163
+ Then **WAIT** for the team lead to tell you to start.
80
164
 
81
- ### 1. Gather Context
82
- - Call `get_task` MCP tool with the ticket ID to get full ticket details and comments
83
- - If a screenshot URL is present, call `WebFetch` on it to view the screenshot
84
- - Note the priority, description, and any comments from the team
165
+ ### 2. Read Remediation Files
85
166
 
86
- ### 2. Find Relevant Code
87
- - Use `Grep`, `Glob`, and `Read` to search the codebase for relevant code
88
- - Look at block templates, Blade views, CSS, and JS files related to the reported issue
89
- - Read the files to understand the current implementation
167
+ When told to start, read the assigned remediation files. All ticket info is in the file — do NOT call Bugherd MCP tools. If a screenshot URL is present in the file, use `WebFetch` to view it.
90
168
 
91
- ### 3. Assess Risk
169
+ ### 3. Find Relevant Code
170
+
171
+ Use `Grep`, `Glob`, and `Read` to search the codebase for relevant code. Look at block templates, Blade views, CSS, and JS files related to the reported issue.
172
+
173
+ ### 4. Assess Risk
92
174
 
93
175
  Categorize the fix as **safe** or **risky**:
94
176
 
@@ -101,16 +183,18 @@ Categorize the fix as **safe** or **risky**:
101
183
  | Visibility/responsive tweaks | Authentication / permissions |
102
184
  | Changes scoped to a single block | **Changes to shared components** (`block-wrapper`, `block-header`, `button`, `eyebrow`) — these affect every block that uses them |
103
185
 
104
- ### 4. Implement or Flag
105
-
106
186
  **Safe fixes:** Implement the fix directly in the worktree.
107
187
 
108
188
  **Risky fixes:** Do NOT implement. Instead:
109
- - Document the recommended fix in the remediation file
110
- - Explain why it's flagged in the Analysis section
111
- - Mark the status as "Flagged for manual review"
189
+ - Document the recommended fix in the Analysis section
190
+ - Explain why it's flagged
191
+ - Rename the remediation file to `BH-{id}-flagged.md` and update the `## File` path to match
192
+
193
+ ### 5. Implement Fix
194
+
195
+ Make changes in the worktree. Overlapping tickets in a group can be addressed together.
112
196
 
113
- ### 5. Create Test Page
197
+ ### 6. Create Test Page
114
198
 
115
199
  Always attempt to create a draft page for QA verification. If `ddev exec` fails, note the command in the remediation file so it can be run later.
116
200
 
@@ -125,12 +209,55 @@ CONTENT='<!-- wp:paragraph --><p>Test content for BH-{id}</p><!-- /wp:paragraph
125
209
  ddev exec wp post create --post_type=page --post_title="QA: BH-{id}" --post_status=draft --post_content="$CONTENT"
126
210
  ```
127
211
 
128
- ### 6. Write Remediation File
212
+ ### 7. Update Remediation File
213
+
214
+ Update the remediation file via the **absolute path** from the `## File` section. Fill in:
215
+ - Analysis
216
+ - Changes Made table
217
+ - Test Page URL and verification instructions
218
+ - Status checkboxes (Analyzed, Fixed)
219
+
220
+ ### 8. Report and Wait
221
+
222
+ After finishing:
223
+ 1. Send a summary to the team lead (ticket IDs, what was fixed/flagged, any concerns)
224
+ 2. **Do NOT commit.** Changes stay uncommitted in the worktree.
225
+ 3. **Wait idle** — do NOT shut down. The team lead will handle validation and approval.
129
226
 
130
- Create `.takty/qa/BH-{id}.md` using this template:
227
+ ## Validator Steps
228
+
229
+ A fresh Validator is spawned for each remediator after it finishes. The Validator:
230
+
231
+ ### 1. Read Code Standards
232
+ Read `.takty/code-standards-checklist.md` from the main workspace.
233
+
234
+ ### 2. Read Remediation Files and Changed Code
235
+ - The team lead provides the remediation file paths
236
+ - Read each remediation file to find the changed files
237
+ - Read each changed file via its absolute path in the remediator's worktree
238
+
239
+ ### 3. Validate Against Standards
240
+ Check for:
241
+ - Tailwind over custom CSS
242
+ - Tailwind scale values (not arbitrary pixel values)
243
+ - `cn()` single-object pattern
244
+ - `@class` directive for conditional classes
245
+ - Use of existing shared components
246
+
247
+ ### 4. Report
248
+ - If violations found: list each (file, line, what to fix)
249
+ - If all clear: report "all clear"
250
+
251
+ ### 5. Done
252
+ The Validator shuts down after reporting.
253
+
254
+ ## Remediation File Template
131
255
 
132
256
  ```markdown
133
- # BH-{id}: {title/short description}
257
+ # BH-{id}: {title}
258
+
259
+ ## File
260
+ - **Path:** {absolute path to this file}
134
261
 
135
262
  ## Ticket
136
263
  - **Bugherd ID:** {id}
@@ -138,56 +265,36 @@ Create `.takty/qa/BH-{id}.md` using this template:
138
265
  - **Admin link:** {admin_link}
139
266
  - **Screenshot:** {screenshot_url}
140
267
 
141
- ## Agent
142
- - **Name:** {agent name, e.g. remediator-hero}
143
- - **Group:** {ticket group description, e.g. "Hero block styling"}
144
-
145
268
  ## Description
146
269
  {from Bugherd}
147
270
 
271
+ ## Agent
272
+ - **Name:** {filled by team lead}
273
+ - **Group:** {ticket group}
274
+
275
+ ## Worktree
276
+ - **Branch:** {filled by team lead}
277
+ - **Path:** {filled by team lead}
278
+
148
279
  ## Analysis
149
- {root cause, affected files}
280
+ {filled by remediator}
150
281
 
151
282
  ## Changes Made
152
283
  | File | Change |
153
284
  |------|--------|
154
- | `path/to/file.php` | Fixed XYZ |
285
+ {filled by remediator}
155
286
 
156
287
  ## Test Page
157
288
  - **URL:** {site_url}/qa-bh-{id}/
158
289
  - **What to verify:** {instructions}
159
290
 
160
- ## Worktree
161
- - **Branch:** {branch name from worktree}
162
- - **Path:** {worktree path}
163
-
164
291
  ## Status
165
- - [x] Analyzed
166
- - [x] Fixed
292
+ - [ ] Analyzed
293
+ - [ ] Fixed
294
+ - [ ] Validated
167
295
  - [ ] Approved
168
296
  ```
169
297
 
170
- For risky/flagged tickets, replace "Fixed" with "Flagged for manual review" and explain why in the Analysis section.
171
-
172
- ### 7. Commit Changes
173
-
174
- Create a branch and commit all changes:
175
-
176
- ```bash
177
- git checkout -b qa/bh-{id}
178
- git add -A
179
- git commit -m "fix: BH-{id} {short description}"
180
- ```
181
-
182
- **Do NOT add a `Co-Authored-By` line.** Commits from QA workflows must not include co-author trailers.
183
-
184
- ### 8. Report and Wait
185
-
186
- After committing:
187
- 1. Send a message to the team lead with a summary (ticket ID, what was fixed, branch name, any concerns)
188
- 2. Mark the task as completed
189
- 3. **Wait idle** — do NOT shut down. The user will review the report and either approve or request changes via `/qa-resume`.
190
-
191
298
  ## Code Style Rules
192
299
 
193
300
  When writing fixes, follow these project conventions:
@@ -203,9 +310,11 @@ For the full checklist, see `.takty/code-standards-checklist.md`.
203
310
  ## Important Notes
204
311
 
205
312
  - The `.takty/qa/` directory is gitignored — remediation files are local working docs only, they do not get committed
206
- - ALWAYS use `isolation: "worktree"` when spawning remediator agents via the Task tool. Each agent's worktree gets its own branch automatically.
207
- - Remediator agents MUST commit their changes before reporting back
208
- - For risky fixes: still create the `.takty/qa/BH-{id}.md` file but mark it as "Flagged for manual review"
313
+ - Remediators: ALWAYS use `isolation: "worktree"`. Do NOT commit. Do NOT call Bugherd MCP tools.
314
+ - Risky fixes: rename remediation file to `BH-{id}-flagged.md` and update the `## File` path
315
+ - Do NOT add `Co-Authored-By` on any QA workflow commits
316
+ - Triager: `model: "sonnet"`, no worktree isolation
317
+ - Validators: `model: "sonnet"`, no worktree isolation, fresh instance per remediator
318
+ - All remediators are spawned at once (each in its own worktree) but only one is actively working at a time
209
319
  - When creating test pages with `wp post create`, assign block content to a shell variable first to avoid escaping issues with `!` in `<!-- wp:` markup
210
- - **Do NOT delete the team** until the user explicitly tells you to. The team persists across `/qa-approve` and `/qa-resume` calls.
211
- - Each remediation file MUST include the **Agent** section with the team member's name so `/qa-resume` can delegate back to it
320
+ - Each remediation file MUST include the **Agent** section with the agent's name so `/qa-resume` can delegate back to it
@@ -7,7 +7,7 @@ user-invocable: true
7
7
 
8
8
  # /qa-resume
9
9
 
10
- Resume work on a Bugherd ticket by delegating to the original idle agent, or falling back to a new agent if the original is unavailable.
10
+ Resume work on a Bugherd ticket by delegating to the original idle agent, or falling back to a new agent if the original is unavailable. Spawns a Validator after the remediator finishes.
11
11
 
12
12
  ## Usage
13
13
 
@@ -30,31 +30,35 @@ Error: Ticket number required. Usage: /qa-resume <ticket-number>
30
30
 
31
31
  ### 2. Read Remediation File
32
32
 
33
- Read `.takty/qa/BH-{id}.md` for context:
33
+ Check for both `.takty/qa/BH-{id}.md` and `.takty/qa/BH-{id}-flagged.md`. Read whichever exists for context:
34
34
  - Previous analysis and root cause
35
35
  - Changes already made (file paths and descriptions)
36
36
  - Branch name and worktree path
37
37
  - Current status (what's done, what's pending)
38
- - **Agent name** (from the "Agent" section)
38
+ - **Agent name** (from the `## Agent` section)
39
+ - **Absolute file path** (from the `## File` section)
39
40
 
40
- If the file doesn't exist, report that no previous work was found for this ticket and suggest using `/qa-remediate {id}` instead.
41
+ If neither file exists, report that no previous work was found for this ticket and suggest using `/qa-remediate {id}` instead.
41
42
 
42
43
  ### 3. Fetch Latest Ticket State
43
44
 
44
- Call `get_task` MCP tool with the ticket ID to:
45
+ The **team lead** calls `get_task` MCP tool with the ticket ID to:
45
46
  - Check for new comments since the last session
46
47
  - See if priority or status has changed
47
48
  - Get any new screenshots or feedback
48
49
 
50
+ Include the latest ticket state in the message to the remediator.
51
+
49
52
  ### 4. Delegate to the Original Agent
50
53
 
51
- If the remediation file has an **Agent** name (e.g., `remediator-hero`):
54
+ If the remediation file has an **Agent** name (e.g., `remediator-hero`) and the agent is still running:
52
55
 
53
- 1. Read the team config at `~/.claude/teams/qa-remediate/config.json` to check if the agent is still a team member
54
- 2. If the agent exists, send it a message via `SendMessage`:
55
- - Include the user's context/instructions from the `/qa-resume` arguments
56
- - Include any new ticket comments or feedback from step 3
57
- - The agent already has the worktree and branch context from its previous work
56
+ 1. Send it a message with:
57
+ - The absolute path to the remediation file (from the `## File` section)
58
+ - The user's context/instructions from the `/qa-resume` arguments
59
+ - Any new ticket comments or feedback from step 3
60
+ - Instructions: no commits, no Bugherd MCP, update file via absolute path
61
+ 2. The agent already has the worktree and branch context from its previous work
58
62
  3. Relay the agent's response back to the user when it reports back
59
63
 
60
64
  **The team lead does NOT do the fix itself.** Always delegate.
@@ -63,20 +67,36 @@ If the remediation file has an **Agent** name (e.g., `remediator-hero`):
63
67
 
64
68
  If the original agent is not found (shut down, crashed, etc.):
65
69
 
66
- 1. Spawn a new remediator agent with the same settings as `/qa-remediate`:
70
+ 1. Spawn a new remediator agent with the same settings:
67
71
  - `isolation: "worktree"`
68
72
  - `model: "opus"`
69
73
  - `subagent_type: "general-purpose"`
70
- - `team_name: "qa-remediate"`
71
74
  - `name:` reuse the original agent name from the remediation file
72
75
  2. Include in the agent prompt:
73
76
  - The full remediation file content (previous analysis, changes, branch)
74
77
  - The latest ticket state and new comments
75
78
  - The user's context/instructions
76
79
  - Instructions to check out the existing branch if it still exists, or start fresh if not
77
- 3. The agent follows the same remediation steps: fix, commit, update remediation file, report back, wait idle
80
+ - **No commits, no Bugherd MCP, update file via absolute path**
81
+ 3. The agent follows the same remediator steps: fix, update remediation file, report back, wait idle
82
+
83
+ ### 6. Validate After Resume
84
+
85
+ After the remediator reports completion, spawn a fresh Validator:
86
+
87
+ - `model: "sonnet"`
88
+ - `subagent_type: "general-purpose"`
89
+ - NO `isolation: "worktree"` — reads files via absolute paths in the remediator's worktree
90
+
91
+ The Validator follows the same steps as in `/qa-remediate`:
92
+ 1. Read `.takty/code-standards-checklist.md` from the main workspace
93
+ 2. Read remediation files and changed files via absolute paths
94
+ 3. Validate against code standards (Tailwind, scale values, `cn()`, `@class`, existing components)
95
+ 4. Report violations or "all clear"
96
+
97
+ If issues found: relay to remediator for fixes, then re-validate. If clear: shut down Validator.
78
98
 
79
- ### 6. Update Remediation File
99
+ ### 7. Update Remediation File
80
100
 
81
101
  After the agent reports back, ensure the remediation file is updated with:
82
102
  - The new agent name (if a fallback agent was spawned)