KatalockAi AcademyBack to KatalockAi
Capstone 16, counts toward Phase 17

GitHub issue-to-PR agent

Build an async GitHub App agent that turns a labelled issue into a verified, review-ready PR inside a sandbox, with scoped credentials, budgets and no way to force-push.

about 30 h Earns its own certificate Reviewed against a 7-point rubric
Submit your project Get coached by Professor Katalock

The capstone and what it builds on

  1. 1GitHub Issue-to-PR Autonomous AgentThe capstone brief
  2. 2The Autonomous Coding Agent Landscape (2026)Phase 15: Autonomous systems
  3. 3Benchmarks: SWE-bench, GAIA, AgentBenchPhase 14: Agent engineering
  4. 4Scope Contracts and Task BoundariesPhase 14: Agent engineering
  5. 5Verification GatesPhase 14: Agent engineering
  6. 6The Workbench on a Real RepoPhase 14: Agent engineering
  7. 7Action Budgets, Iteration Caps, and Cost GovernorsPhase 15: Autonomous systems
  8. 8Security - Secrets, API Key Rotation, Audit Logs, GuardrailsPhase 17: Infrastructure and production

What You'll Build

A background coding agent: label an issue @agent fix this, a webhook enqueues work, a worker infers the build environment, runs an agent loop in a sandbox, verifies tests and coverage, and opens a PR with its rationale. The engineering focus is environment inference, scoped credentials, per-repo budgets, branch protection and secret hygiene.

Requirements

  1. GitHub App with minimal permissions (issues read and write, pull requests write, contents read and write, workflows read). Branch protection on main blocks direct pushes and force-pushes, and the App is not on the bypass list; include the settings as JSON or a description.
  2. Webhook receiver that verifies the signature, filters for the trigger label or PR comment and enqueues the job (SQLite, Redis or a cloud queue).
  3. Dispatcher enforcing per-repo per-day limits on PR count and spend.
  4. Environment inference: detect language and package manager (for example uv, pnpm, go mod, cargo) and generate a Dockerfile if the repo has none.
  5. Agent loop with ripgrep, a repo map, read and edit, run_tests and git tools, with hard limits on cost, wall-clock and turns.
  6. Verification: run the full test suite in the sandbox; red tests mean no PR; a coverage drop over 2 percentage points opens the PR with a needs-review label.
  7. Diff allow-list in the worker that rejects changes under .github/workflows and to secret files.
  8. PR body with rationale, diff summary, trace link, cost and turns; an @agent comment on the PR triggers a follow-up run.
  9. Credential hygiene: short-lived installation tokens only; logs scrubbed for secrets before archiving, proven with a planted fake secret.
  10. Evaluation on at least 10 seeded issues across at least 2 repos: pass rate, PR quality (diff size, coverage delta, style), cost and latency per issue.

Constraints

  • Model-agnostic: any OpenAI-compatible endpoint (including the KatalockAi API) or a local model (for example via Ollama, llama.cpp or vLLM) may be used. No named commercial model is required; record which model you used in the README.
  • Hardware: a laptop with Docker. Use a tunnel (smee.io, cloudflared or ngrok) for webhooks, or run the worker as a GitHub Actions job.
  • Substitution: the lesson uses Lambda, SQS, ECS, 30 issues and comparisons with hosted agents. Here a local receiver and queue, 10 or more seeded issues in your own test repos, and an optional comparison are accepted.
  • Only install the App on test repos you own. Never give it admin rights or bypass permissions.

Stretch Goals

  • Add a flaky-test mode that reruns a test many times and proposes a stabilising change.
  • Add a dry-run mode that opens a draft PR with only the plan.
  • Build a per-repo cost dashboard with an anomaly alert.

How to Submit

  • Public GitHub repo with app/ (manifest and permissions), receiver/, dispatcher/, worker/ (env inference, agent loop, verification), eval/ (issues, results) and README.md, plus links to your test repos with the agent's PRs.
  • README: architecture, App permissions and branch-protection setup, how to run locally, the eval table, safety measures and limitations.
  • Paste the eval table, links to two agent-opened PRs and the output of the secret-scrub and force-push tests.

How It's Reviewed

Professor Katalock reads your repository and the evidence you paste, and scores each criterion out of 100. You pass with a weighted total of 70 or more and no criterion below 40. A copied or padded submission is flagged and fails.

CriterionWeightHow it's checked
Pass rate20Eval table for 10 or more seeded issues with CI-green and coverage-OK outcomes, plus links to real PRs.
PR quality15Diff size, coverage delta and style conformance reported; PR bodies contain rationale, cost, turns and trace link.
Cost and latency per issue10Spend and wall-clock per PR logged; per-repo daily caps enforced in the dispatcher.
Safety20Minimal App permissions, branch protection without bypass, workflow-path allow-list, short-lived tokens and the secret-scrub test.
Operator UX10Rationale in the PR, needs-review labelling, and an @agent follow-up comment that triggers a rerun.
Code quality and structure10Receiver, dispatcher and worker are separate; signature verification and budget logic are tested.
README: design decisions and limitations15README explains credential scoping and verification choices, analyses the learner's own failed issues and states limits.

Submit

Push your work to a public GitHub repository with a README that explains how to run it, then paste the evidence below. Up to 3 reviews a day, free.

  • Eval table (issue, outcome, diff size, coverage delta, cost, wall-clock)
  • Links to two PRs opened by the agent on your test repos
  • Output of the planted-secret log scrub test
  • Output showing a force-push or workflow-file edit being rejected
  • Short reflection on the issue type that most often failed

Reviews are done by AI against the rubric above. They check the evidence in your repository; they are not a substitute for a human code review, and a review can be wrong. If you think it is, improve the README so the evidence is unmistakable and resubmit.