Turn Bug Reports into Agent Reproduction Scripts and Fix Briefs
Generates a standalone reproduction script, expected assertion logs, and strict edit boundaries for coding agents like Claude Code or Cursor.
Agent prompt for Claude Code and Cursor
Prompt
mkdir -p .agents/skills/turn-bug-reports-into-agent-reproduction-scripts-and-fix-briefs && curl -sL "https://prompts-gpt.com/prompts/turn-bug-reports-into-agent-reproduction-scripts-and-fix-briefs/raw" -o .agents/skills/turn-bug-reports-into-agent-reproduction-scripts-and-fix-briefs/SKILL.mdAct as a principal software engineer preparing an automated bug-fix task for an autonomous coding agent.
I will paste an error log, bug description, or failing stack trace below. If I have not provided enough detail, ask me up to 3 clarifying questions first.
Rules:
1. Provide a standalone reproduction script (bash script or single test runner command) that fails with the reported error and exits with code 1, and exits with 0 once fixed.
2. State the exact log output assertions: write the exact substring or regex that signals failure versus success.
3. Include a strict edit boundary: explicitly name the only allowed files to modify, and ban modifying configuration files, dependencies, or unrelated test files.
4. Provide a step-by-step fix hypothesis describing root cause and the expected logic change.
Output format:### 1. Standalone Reproduction Script
(Code block)
### 2. Log Assertions
- Failure assertion: (exact text)
- Success assertion: (exact text)
### 3. Strict Scope & Edit Boundaries
- Allowed files: (list)
- Forbidden files: (list)
### 4. Root Cause Hypothesis & Fix Checklist
- (Numbered steps)
End with one sentence noting risks or dependencies outside the reproduction sandbox.Example output
Tips and common edits
Why this works
- Eliminates hallucinated fixes by demanding a runnable repro that exits non-zero before the fix and zero after.
- Prevents scope creep by strictly defining allowed files and banning edits to package manifests and configs.
- Specifies exact assertion strings so agents can verify their own fixes without manual developer oversight.
Use before handing a bug to Claude Code, Cursor, or Codex. Paste your stack trace and repository structure directly after the prompt text.
Common edits
- Switch the reproduction script from a Bash test runner command to a single Python unittest or pytest invocation.
- Add a maximum retry count or token budget limit before the agent must revert and yield to human review.
Reuse it: Use in a workflowAdapt in the builder
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
More like this
Verify the Coding Agent's 'Done' Claim Against the Diff and Test Output
Checks each claim in a coding agent's final summary against the actual diff and test runs, marks it verified, unverified or contradicted with evidence, and lists unmentioned changes, skipped tests and stubs.
Root-Cause Bug Fix With a Failing Test and a Minimal Patch
Get a reproduced bug, a regression test that fails before the fix and passes after it, the smallest patch and a log of the commands Claude Code actually ran.
Audit AI Code Diffs for Performance Regressions
This prompt scans code changes for silent performance killers like N+1 queries, unindexed filters, and memory leaks before you merge them.
Convert User Stories into Strict Acceptance Test Assertions
This prompt transforms vague business requirements into precise Given-When-Then test assertions with exact HTTP status codes and JSON payload structures for AI coding agents.
Create Automated Verification Loops for Long-Running Coding Agents
Generate a deterministic shell pipeline that combines linting, isolated unit testing, and diff-budget monitoring to validate AI agent code changes.
Design a Sandbox Security Policy for Autonomous Coding Agents
Generate a rigorous security policy for autonomous agents to define allowed shell commands, file access boundaries, and network restrictions.
- Generate Database Migration and Rollback Specs for Coding Agents
- Generate Reproducible Bug Fix Specs for Coding Agents
- Create a Legacy Module Reference Sheet for Coding Agents
- Create a Verification Loop Script for AI Coding Agents
- Evaluate Coding Agent Test Suites for False Positive Traps
- Review AI Pull Requests for Phantom Imports and Bloat