First Bug Fix¶
Fix a bug from ticket to pull request in one command.
Prerequisites¶
- Agent Smith installed
- An AI provider API key (e.g.
ANTHROPIC_API_KEY) - A GitHub/Azure DevOps/Jira/GitLab ticket to fix
- Git credentials configured (SSH key or token)
1. Create a Configuration¶
Create agentsmith.yml:
projects:
my-api:
source:
type: GitHub
url: https://github.com/your-org/your-repo
auth: token
tickets:
type: GitHub
url: https://github.com/your-org/your-repo
auth: token
agent:
type: Claude
model: claude-sonnet-4-20250514
pipeline: fix-bug
secrets:
github_token: ${GITHUB_TOKEN}
anthropic_api_key: ${ANTHROPIC_API_KEY}
2. Run It¶
export ANTHROPIC_API_KEY=sk-ant-...
export GITHUB_TOKEN=ghp_...
agent-smith fix --ticket 42 --project my-api --config agentsmith.yml --headless
What Happens¶
Agent Smith runs 13 steps:
- FetchTicket — reads ticket #42 from GitHub
- CheckoutSource — clones the repo, creates
fix/42branch - BootstrapProject — detects language, framework, conventions
- LoadCodeMap — generates a navigable code map
- LoadDomainRules — loads coding standards from
.agentsmith/coding-principles.md - LoadContext — loads project context from
.agentsmith/context.yaml - AnalyzeCode — scout agent identifies relevant files
- GeneratePlan — AI writes a step-by-step plan
- Approval — skipped in
--headlessmode - AgenticExecute — AI writes code using tools (read, write, list, shell)
- Test — runs your test suite; if tests fail, the agent retries
- WriteRunResult — writes
result.mdwith token usage and cost data - CommitAndPR — commits, pushes, opens PR
Output¶
The PR includes:
- The code changes
- A
result.mdwith cost tracking and decision log - The ticket is updated with the PR link
Interactive Mode¶
Without --headless, Agent Smith pauses at step 9 and shows you the plan. You approve, request changes, or cancel before any code is written.
Via Chat¶
If you have the Dispatcher running with Slack/Teams integration:
Agent Smith spawns an ephemeral container, runs the pipeline, and streams progress back to your channel.