為編碼智能體準備簡短的錯誤重現材料,別只在 Slack 描述問題
Record a short repro for the agent instead of describing the bug in Slack
Sherotree 建議向編碼智能體提供簡短、可重播的錯誤重現資料,而非只在 Slack 以文字描述問題。材料可包括操作步驟及預期與實際結果、帶狀態的網址、關鍵網絡紀錄或控制台錯誤;只有時序等問題才需要短錄影。他亦建議限定修改範圍,並要求智能體提出最小修補及指出會修改的檔案。
I’ve lost count of how many Slack threads start with “the settings page is weird on save” and end with three people guessing which field, which browser, and whether it’s staging or prod. Then someone pastes a paragraph of vibes into the coding agent and wonders why the patch misses.
Agents don’t need your narrative. They need a short, replayable repro — something they can open, run, or watch once and map onto files. Describing the bug in chat is the slow path.
What “short repro” means (under ~90 seconds)
Not a full Loom walkthrough. Not a five-minute screen share. One of these, whichever is cheapest:
- Recorded steps — numbered clicks + expected vs actual (fits in a comment)
- Failing URL + query/state — deep link with the bad filter, locale, or feature flag already on
- Minimal HAR / network snippet — the one 500 that matters, not the whole waterfall
- 10–30s screen recording — only if timing / animation / hover is the bug
- Console + stack — the red line and the first app frame, not a wall of React warnings
If it takes longer to make the repro than to guess twice, you’re overbuilding. Cap it.
The Slack description tax
A typical thread looks like:
“User said save doesn’t work. I tried once, seemed fine. Maybe race? Can someone check?”
That message is useful for humans coordinating. It’s garbage input for an agent. There’s no route, no payload, no browser, no “works on /settings?tab=billing but fails on /settings?tab=team”.
I treat Slack as the routing layer (“who owns this / is it Sev?”) and the agent chat / PR as the artifact layer. Don’t merge those jobs.
A repro pack I actually paste
I keep a stub next to bug triage so I’m not inventing format every time:
## Repro for agent
**Surface:** Settings → Team members
**Env:** staging, Chrome 130, logged in as org-admin
**URL:** https://staging.example.com/settings/team?invite=open
**Steps:**
1. Open invite modal
2. Enter email already in org
3. Click Send invite
**Expected:** inline error “Already a member”
**Actual:** spinner forever; network tab shows POST /invites → 409 with body `{ "code": "duplicate" }`; UI never reads `code`
**Artifacts:**
- console: `Unhandled rejection: InviteError`
- optional: 18s recording `repro-invite-409.mp4` (only if steps unclear)
**Out of scope:** redesign modal, change API status codes
**Ask:** smallest UI fix — map 409/duplicate to the existing error component
That pack is boring on purpose. Agents thrive on boring.
Why recordings beat paragraphs (sometimes)
When the bug is timing — toast that flashes, focus that jumps, drag that drops a pixel early — prose fails. A 15-second clip with the mouse visible beats five Slack messages.
Rules I use so recordings stay useful:
- Start already on the broken screen (no login theater)
- One take; don’t narrate a podcast over it
- Name the file with the symptom (
invite-spinner-409.mp4), notscreen-recording-tuesday - Still write the Expected/Actual lines — video alone is slow to index
If the bug is a clear 409 and a missing branch, skip the video. Steps + network row win.
Wire it into the agent workflow
- Before asking for a fix: drop the repro pack (and file paths if you know them).
- Constraint line: “touch only the invite modal + its error mapper; no API changes.”
-
Acceptance: “show me the branch that handles
code === 'duplicate'and a one-line test or Storybook state.”
A prompt I reuse:
Here’s a short repro. Don’t ask clarifying questions you can answer from the pack. Propose the smallest patch and name the files you’ll change.
Agents that can see the failure waste less of your review time inventing theories.
What I stopped doing
- Pasting “it’s broken” into the agent and hoping
- Screenshot-only reports with no URL or status code
- Long voice notes that never become steps
- Letting the agent “explore the settings area” without a target state
Exploration without a repro is how you get drive-by refactors.
Tiny habit, big DX win
Next time you’re about to type a paragraph in Slack and into the agent, stop. Spend ninety seconds on a repro pack. Route ownership in Slack; feed artifacts to the agent.
You’ll get smaller diffs, fewer “works on my machine” loops, and fewer threads that exist only to reconstruct what one recording would have shown.
來源:DEV Community · dev.to