Back to prompt library
Implementation brief
Linked challenge: Build a Repository Bug-Fixing Agent
Prompt source
Build the complete application50 lines11 sectionsNo variables1 code block
## Who Uses It
A software maintainer handling incoming bug reports.
## What You Will Build
Build an agent that turns a bug report into a reproducible failure, a code patch, and a reviewable change package. Let maintainers inspect the evidence before accepting the fix.
## Inputs
- Issue description
- Local repository files
- Allowed test commands
## Workflow
1. Read the issue and inspect relevant files.
2. Create a failing reproduction test.
3. Implement the smallest supported fix.
4. Run the allowed checks and assemble a local change package.
## Interface
An issue workspace with reproduction logs, a code diff, test results, and an accept-or-reject review panel.
## Working Demo
Import the repository, reproduce total(100, 10) returning 110, fix it to return 90, and display passing tests with the diff.
## Deliverables
- A working local application with the specified review interface.
- Source code, dependency lockfile, and setup commands.
- A recorded end-to-end demo using the supplied starter data.
- Example outputs, action logs, and automated tests.
## Starter Data
These fictional records are a small development fixture, not a production dataset. Implement the mock services described in the brief.
```json
{
"request": "Fix discounts being charged as an addition.",
"files": {
"pricing.py": "def total(price, discount):\n return price + discount\n",
"test_pricing.py": "from pricing import total\ndef test_no_discount():\n assert total(100, 0) == 100\n"
},
"issue": {
"price": 100,
"discount": 10,
"expected_total": 90
},
"allowed_commands": [
"pytest"
]
}
```
## Constraints
Run code only in an isolated local workspace. Do not push commits or open remote pull requests.
Choose an available model that supports your implementation. Record its identifier and version.
## Evaluation
Review the complete application, not only the starter-case answers.
- The new regression test fails on the original code.
- The existing test and regression test pass after the change.
- The review package contains a diff and actual test logs.
Add one normal case, one incomplete-input case, and one failure-recovery case.