Multi-file bug fixes go wrong in a very predictable way: the agent starts editing too early, touches unrelated files, and you end up with a messy change you can’t review or reproduce.
This post shares a repeatable prompt workflow you can reuse for multi-file fixes:
Recon → Plan → Patch → Verify
And yes — I built a tiny free tool to generate this kind of prompt pack automatically.
Project home: https://devstral2.org
Free generator: https://devstral2.org/tools/devstral2-prompt-pack.html
Why multi-file bug fixing is harder than it looks
Multi-file bugs usually span boundaries:
- page templates / layout wrappers
- typography + global CSS rules
- content rendering (Markdown/prose styles)
- build/deploy differences and caching
Agents fail here when they "just start editing" before understanding how the UI is composed.
The workflow (Recon → Plan → Patch → Verify)
1) Recon (Repo reconnaissance)
Goal: understand the minimum set of files involved.
Ask the agent to:
- locate the entry point(s)
- list candidate files with 1-line reasons
- form a root-cause hypothesis before editing anything
2) Plan (Minimal change plan)
Goal: define the smallest patch that meets acceptance criteria.
Require:
- file list + why
- patch steps (by file)
- acceptance criteria + verification steps
3) Patch (Step-by-step edits)
Goal: keep diffs auditable.
Require:
- edits grouped by file
- “what changed” + “why”
- avoid unrelated refactors
4) Verify (Proof it works)
Goal: provide evidence.
- manual checks
- quick regressions
- (optional) tests/build commands
Real bug scenario (from devstral2.org)
While adding blog post detail pages to devstral2.org, I hit a real UI bug:
- Bug: the blog detail content looked too gray / low contrast on the dark theme, so parts of the article were hard to read.
- Expected behavior: the blog detail page should match the homepage’s typography/layout style (consistent font, contrast, spacing).
- Verification: after the fix, I refreshed the page and confirmed the entire blog detail content is clear.
In practice, the minimal fix was:
make the blog detail wrapper reuse the homepage container/typography classes (instead of rewriting global CSS).
Copy-paste Prompt Pack (example)
Use this prompt pack for the same category of bug:
Prompt Pack: Multi-file bug fixing (low-contrast blog detail page)
- You are an AI engineer working on a dark-themed website (devstral2.org).
- Bug: blog post detail content is too gray/low-contrast; parts are hard to read.
- Goal: make the blog detail typography/layout consistent with the homepage; ensure readability.
- Constraints: minimal diffs; avoid broad refactors; don’t change unrelated pages; keep design consistent.
Recon (before edits):
- Locate where the blog detail page is rendered (template/component/html).
- Identify the homepage wrapper/container + typography classes.
- Compare blog detail wrapper vs homepage wrapper.
- Find which styling rule causes low contrast (color/opacity/prose/text class/CSS vars).
- List candidate files to change with 1-line reasons.
Plan (minimal fix):
- Propose the smallest patch: blog detail wrapper reuses homepage container/typography structure.
- Specify exact files to edit and why.
- Define acceptance criteria + regression checks.
Patch:
- Update the blog detail wrapper/container classes to match homepage.
- Keep changes scoped; no unrelated formatting refactors.
- Explain changes PR-style (what/why).
Verify:
- Refresh blog detail page and verify readability.
- Check headings/paragraphs/links (and code blocks if present).
- Quick regression: open homepage + at least one tools page.
Output format:
- Root cause hypothesis
- Files to change
- Patch steps (by file)
- Verification checklist
Quick acceptance checklist
- [ ] Recon done before edits (candidate files listed)
- [ ] Plan includes acceptance criteria
- [ ] Changes are minimal and scoped
- [ ] Verify includes refresh + quick regressions
- [ ] No unrelated pages were impacted
If you try this workflow, which step helps you the most — Recon, Plan, Patch, or Verify?
Project home: https://devstral2.org
Free generator: https://devstral2.org/tools/devstral2-prompt-pack.html

Top comments (0)