The Junior Dev (GitHub)
Automating the first 15 minutes of every bug report. How to build an agent that triages issues.
Dwizi Team
Editorial
The Junior Dev (GitHub)
If you maintain an open-source project or work on a large engineering team, you know the pain of Triage.
You wake up to 10 new GitHub issues.
- Issue #1: "It doesn't work." (No details).
- Issue #2: "Bug in login." (Duplicate of #45).
- Issue #3: A feature request disguised as a bug.
You spend the first hour of your precious coding time just reading, labeling, and asking "What browser are you using?"
This is necessary work. A messy backlog kills velocity. But it is also low-leverage work. It doesn't require 10 years of distributed systems experience to ask for a screenshot. It requires reading comprehension.
The Problem: Context Switching
The real cost isn't the time; it's the context switching. Every time you stop coding to reply to an issue, you break your flow state.
The Solution: The AI Triage Agent
We can build a "Junior Dev" agent. It never sleeps. It reads every new issue the second it is posted. It checks your contribution guidelines. It searches for duplicates. And it politely asks the user for missing information.
It handles the "Level 1 Support" so you can focus on the "Level 2 Engineering."
The Implementation
We need two tools:
read_issue: To get the text.comment_on_issue: To reply.add_labels: To organize.
Here is the implementation of the commenting tool.
/**
* Adds a comment to a GitHub issue.
*
* Description for LLM: "Post a comment to ask for more info, summarize the bug, or redirect the user."
*/
type Input = {
owner: string;
repo: string;
issueNumber: number;
body: string;
};
export default async function commentOnIssue(args: Input) {
const token = Deno.env.get("GITHUB_TOKEN");
if (!token) throw new Error("Missing GITHUB_TOKEN");
const { owner, repo, issueNumber, body } = args;
// 1. Identity Management
// It is crucial that users know they are talking to a bot.
// Deception erodes trust. We append a signature.
const signedBody = `${body}\n\n> 🤖 *Triaged by AI Agent*`;
// 2. The API Call
const res = await fetch(`https://api.github.com/repos/${owner}/${repo}/issues/${issueNumber}/comments`, {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Accept": "application/vnd.github.v3+json",
"User-Agent": "Dwizi-Agent"
},
body: JSON.stringify({ body: signedBody })
});
if (!res.ok) {
// If we can't comment (e.g., repo is locked), we need to know.
return { success: false, status: res.status, error: await res.text() };
}
return { success: true, url: res.url };
}
The Execution Story
Event: A user submits Issue #402: "Login crashes."
Agent Action:
- Wake Up: The agent receives the webhook.
- Read: It reads the body: "Login crashes."
- Think: "This is insufficient. I need reproduction steps, browser version, and console logs. Also, I recall Issue #390 was about login crashes."
- Action 1 (Check Duplicates): It searches open issues for "login crash". It finds #390.
- Action 2 (Comment): It calls
comment_on_issue.- Body: "Hi! Thanks for the report. This looks similar to #390. Could you check if that solves your issue? If not, please provide your browser version and any console errors."
- Action 3 (Label): It calls
add_labels({ labels: ["needs-more-info", "potential-duplicate"] }).
The Result: When you log in 4 hours later, you see the issue. You see the label. You see the user's reply with the logs.
You didn't have to play "20 Questions." You just have to fix the bug.
The Philosophy
This is the ideal use case for AI: Augmentation, not Replacement.
The AI didn't fix the bug. It didn't replace the engineer. It removed the friction around the engineering. It acted as a force multiplier, allowing one senior dev to manage a repo that would usually require a team.
Subscribe to Dwizi Blog
Get stories on the future of work, autonomous agents, and the infrastructure that powers them. No fluff.
We respect your inbox. Unsubscribe at any time.
Read Next
Project Management (Linear/Jira)
Stop manually creating tickets. Let the conversation become the ticket.
Currency Conversion (Determinism)
A simple tool that proves a big point: Why we need 'Islands of Truth' in a sea of hallucination.
The Executive Assistant (Calendar)
How to build an agent that can actually manage your time, finding free slots and booking meetings.