Skip to content

Commit 5fb55c0

Browse files
feat: update conflict handling and feedback process in documentation
- Clarified conflict reporting process for agents - Updated user feedback steps for library changes - Revised section titles for better clarity - Improved instructions for branch and PR creation
1 parent 08dc059 commit 5fb55c0

2 files changed

Lines changed: 96 additions & 233 deletions

File tree

agentic/commands/update.md

Lines changed: 96 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,26 @@ All agents run in parallel — each only touches its own library's files.
7676

7777
### Phase 3: Collect & Present
7878

79-
Agents report back via `SendMessage` (auto-delivered to you). Once all agents have reported:
80-
81-
1. **Present a summary to the user** for each library:
82-
- What was changed (bullet points from agent)
83-
- Local preview image path: `plots/{spec_id}/implementations/.update-preview/{library}/plot.png`
84-
- Agent's self-assessment score
85-
- Any spec changes the agent made
86-
87-
2. **Ask the user for feedback.** They can:
88-
- Give per-library feedback (e.g., "matplotlib looks good, seaborn needs more contrast")
89-
- Say **"ship"**, **"ok"**, **"looks good"**, or **"passt"** to proceed to shipping
90-
- Say **"abort"** to cancel everything
79+
Agents report back via `SendMessage` (auto-delivered to you). Agents may report either **completed work** (`STATUS: done`) or **a conflict** (`STATUS: conflict`). Once all agents have reported:
80+
81+
1. **Handle conflicts first.** If any agent reports a conflict:
82+
- Present the conflict to the user clearly: which rule/spec is violated, what the agent suggests as alternatives
83+
- Ask the user to decide:
84+
- **Adjust the request** to comply with existing rules
85+
- **Update the rule or spec** — the user tells you which file to edit and how, you make the edit, then tell the agent to proceed
86+
- **Override** — explicitly tell the agent to proceed despite the conflict
87+
- Send the user's decision to the agent via `SendMessage`. The agent will then continue with Step 3.
88+
89+
2. **Present a summary to the user** for each library that completed successfully:
90+
- What was changed (bullet points from agent)
91+
- Local preview image path: `plots/{spec_id}/implementations/.update-preview/{library}/plot.png`
92+
- Agent's self-assessment score
93+
- Any spec changes the agent made
94+
95+
3. **Ask the user for feedback.** They can:
96+
- Give per-library feedback (e.g., "matplotlib looks good, seaborn needs more contrast")
97+
- Say **"ship"**, **"ok"**, **"looks good"**, or **"passt"** to proceed to shipping
98+
- Say **"abort"** to cancel everything
9199

92100
---
93101

@@ -96,9 +104,10 @@ Agents report back via `SendMessage` (auto-delivered to you). Once all agents ha
96104
For per-library feedback:
97105

98106
1. Send the feedback to the specific idle teammate via `SendMessage` (e.g., to `seaborn-updater`). This wakes them up.
99-
2. The agent re-modifies, re-generates, reports back, and goes idle again.
100-
3. Present updated results to the user.
101-
4. Repeat until the user approves.
107+
2. The agent runs its conflict check again (Step 2) on the new feedback. If it detects a conflict, it reports back with `STATUS: conflict` instead of making changes — handle as in Phase 3.
108+
3. If no conflict, the agent re-modifies, re-generates, reports back, and goes idle again.
109+
4. Present updated results to the user.
110+
5. Repeat until the user approves.
102111

103112
---
104113

@@ -124,7 +133,7 @@ For each updated library, edit `plots/{spec_id}/metadata/{library}.yaml`:
124133
| `updated` | Current UTC timestamp in ISO 8601 (e.g., `2026-02-10T14:30:00+00:00`) |
125134
| `generated_by` | Get from `CLAUDE_MODEL` env var, or detect via `claude --version` / model name |
126135
| `python_version` | Get from `uv run python --version` |
127-
| `library_version` | Get from `uv run python -c "import {library}; print({library}.__version__)"` |
136+
| `library_version` | Get from `uv run python -c "from importlib.metadata import version; print(version('{package}'))"` where `{package}` is the pip package name. Mapping: `highcharts``highcharts-core`, `letsplot``lets-plot`, all others → same as `{library}` |
128137
| `quality_score` | Set to `null` (CI review will fill this) |
129138
| All other fields | **Keep unchanged** (including `review`, `impl_tags`, `preview_url`, etc.) |
130139

@@ -188,77 +197,84 @@ Update `preview_url` and `preview_thumb` in the metadata YAML to point to the st
188197
rm -rf plots/{spec_id}/implementations/.update-preview
189198
```
190199

191-
#### 5g. Git Branch & PR
200+
#### 5g. Per-Library Branches, PRs & Reviews
201+
202+
**IMPORTANT:** The review pipeline (`impl-review.yml`) extracts `SPEC_ID` and `LIBRARY` from the branch name
203+
pattern `implementation/{spec-id}/{library}`. Therefore, each library MUST get its own branch and PR.
204+
205+
Get `{owner}/{repo}` from `git remote get-url origin`.
206+
207+
**If the spec was changed**, commit that first on main or include it in each branch.
208+
209+
**For each library**, run the following sequentially:
192210

193211
```bash
194-
# Create branch
195-
git checkout -b implementation/{spec_id}/update
212+
# Ensure we start from main
213+
git checkout main
214+
215+
# Create per-library branch
216+
git checkout -b implementation/{spec_id}/{library}
196217

197-
# Stage only the changed files (NO images — those are in GCS)
198-
git add plots/{spec_id}/implementations/*.py
199-
git add plots/{spec_id}/metadata/*.yaml
200-
# If spec was changed:
218+
# Stage only this library's files
219+
git add plots/{spec_id}/implementations/{library}.py
220+
git add plots/{spec_id}/metadata/{library}.yaml
221+
# If spec was changed (only needed in first library branch):
201222
git add plots/{spec_id}/specification.md
202223

203224
# Commit
204-
git commit -m "update({spec_id}): {short description}
225+
git commit -m "update({spec_id}): {library} — {short description}
205226
206-
Updated libraries: {comma-separated list}
207227
{description}"
208228

209229
# Push
210-
git push -u origin implementation/{spec_id}/update
211-
```
212-
213-
#### 5h. Create PR
230+
git push -u origin implementation/{spec_id}/{library}
214231

215-
```bash
232+
# Create PR
216233
gh pr create \
217-
--title "update({spec_id}): {short description}" \
218-
--body "$(cat <<'EOF'
234+
--title "update({spec_id}): {library} — {short description}" \
235+
--body "$(cat <<EOF
219236
## Summary
220237
221-
Updated implementation(s) for **{spec_id}**.
238+
Updated **{library}** implementation for **{spec_id}**.
222239
223-
**Libraries:** {comma-separated list}
224240
**Changes:** {description}
225241
226-
### Per-Library Changes
227-
228-
{For each library:}
229-
#### {library}
242+
### Changes
230243
{bullet points of changes from agent}
231244
- Quality self-assessment: {score}/100
232245
233246
## Test Plan
234247
235-
- [ ] Preview images uploaded to GCS staging
236-
- [ ] Implementation files pass ruff format/check
237-
- [ ] Metadata YAML updated with current versions
248+
- [x] Preview images uploaded to GCS staging
249+
- [x] Implementation file passes ruff format/check
250+
- [x] Metadata YAML updated with current versions
238251
- [ ] Automated review triggered
239252
240253
---
241-
Generated with [Claude Code](https://claude.com/claude-code) `/update` command
254+
Generated with [Claude Code](https://claude.com/claude-code) \`/update\` command
242255
EOF
243256
)"
244-
```
245-
246-
#### 5i. Trigger Review
247257

248-
```bash
258+
# Trigger review for this PR
249259
PR_NUMBER=$(gh pr view --json number -q '.number')
250260
gh api repos/{owner}/{repo}/dispatches \
251261
-f event_type=review-pr \
252262
-f 'client_payload[pr_number]='"$PR_NUMBER"
253263
```
254264

255-
Get `{owner}/{repo}` from `git remote get-url origin`.
265+
After all branches are created, return to main:
266+
267+
```bash
268+
git checkout main
269+
```
270+
271+
Report all PR URLs to the user.
256272

257273
#### 5j. Cleanup Team
258274

259275
1. `SendMessage` with type `shutdown_request` to all agents
260276
2. `TeamDelete` to clean up the team
261-
3. Report the PR URL to the user
277+
3. Report all PR URLs to the user
262278

263279
---
264280

@@ -292,7 +308,33 @@ Read these files to understand what you're working with:
292308
If `preview_url` exists in the metadata, view the current preview image to understand what the plot currently looks
293309
like.
294310

295-
### Step 2: Modify Implementation
311+
### Step 2: Conflict Check
312+
313+
**Before making any changes**, check whether the user's request conflicts with:
314+
- **Generation rules** (`prompts/plot-generator.md`, `prompts/library/{LIBRARY}.md`)
315+
- **Quality criteria** (`prompts/quality-criteria.md`)
316+
- **The specification** (`plots/{SPEC_ID}/specification.md`)
317+
318+
If you detect a conflict, **DO NOT proceed with the change.** Instead, report the conflict to `update-lead` via `SendMessage`:
319+
320+
```
321+
LIBRARY: {LIBRARY}
322+
STATUS: conflict
323+
324+
CONFLICT:
325+
The requested change "{specific request}" conflicts with:
326+
- {rule source}: {quote the specific rule}
327+
- Reason: {explain why this is a conflict}
328+
329+
OPTIONS:
330+
1. Adjust the request to: {suggest a compliant alternative}
331+
2. Update the rule/spec to allow this (user must decide)
332+
3. Proceed anyway (user must explicitly override)
333+
```
334+
335+
Then go idle and wait for the lead to relay the user's decision. Only proceed once the conflict is resolved.
336+
337+
### Step 3: Modify Implementation
296338

297339
Edit `plots/{SPEC_ID}/implementations/{LIBRARY}.py`:
298340

@@ -305,7 +347,7 @@ Edit `plots/{SPEC_ID}/implementations/{LIBRARY}.py`:
305347
If the specification itself needs changes to make the plot better, also edit `plots/{SPEC_ID}/specification.md` and
306348
explain what you changed and why.
307349

308-
### Step 3: Generate Locally
350+
### Step 4: Generate Locally
309351

310352
Run the implementation to generate the plot image. **IMPORTANT**: Each agent MUST run in its own isolated preview
311353
directory to avoid race conditions with other parallel agents. All agents write `plot.png` — running in the shared
@@ -321,7 +363,7 @@ there directly — no copy step needed, no race condition with other agents.
321363

322364
If the script fails, read the error, fix the implementation, and retry. **Up to 3 retries.**
323365

324-
### Step 4: Process Images
366+
### Step 5: Process Images
325367

326368
Generate thumbnail and optimize:
327369

@@ -332,7 +374,7 @@ uv run python -m core.images process \
332374
plots/{SPEC_ID}/implementations/.update-preview/{LIBRARY}/plot_thumb.png
333375
```
334376

335-
### Step 5: Self-Check
377+
### Step 6: Self-Check
336378

337379
View the generated image at `plots/{SPEC_ID}/implementations/.update-preview/{LIBRARY}/plot.png`.
338380

@@ -348,7 +390,7 @@ Check against the quality criteria from `prompts/quality-criteria.md`:
348390

349391
Fix any obvious issues before reporting.
350392

351-
### Step 6: Report to Lead
393+
### Step 7: Report to Lead
352394

353395
Send a message to `update-lead` via `SendMessage` with:
354396

@@ -373,7 +415,7 @@ Then mark your task as completed via `TaskUpdate`.
373415

374416
**After reporting, go idle. The lead will wake you if the user has feedback for revisions.**
375417

376-
If the lead sends you feedback, repeat Steps 2-6 with the new instructions.
418+
If the lead sends you feedback, repeat Steps 2-7 with the new instructions (including the conflict check).
377419

378420
---
379421

0 commit comments

Comments
 (0)