Field notes / Workflow automation
Label an issue, get a reviewed PR
Most teams already have a process for getting an issue to a merged pull request. It lives in people's heads, a wiki page and a few CI jobs. With aictrl it can live in the repository, as one YAML file under .aictrl/workflows/.
The file says what starts the work and what happens next. A trigger fires on a GitHub event: a label is added, someone comments a command, a pull request is opened or marked ready. Each step is an agent running one of your skills in a clean container. The workflow decides what comes next: loop until the review passes, wait for a person, or stop and say why. Because it's a file in the repo, the process is reviewed, versioned and changed the same way as your code.
This post follows one example end to end, on a public repository, so you can check every step.
Transcript
In this demo, a GitHub issue becomes a reviewed pull request from one label. I'm Bulat, founder of aictrl. Let me show you how.
An aictrl flow starts when something happens: a label, a new issue, a pull request, a message in Slack, Telegram, Discord, a doc on Google Docs, or Confluence, or a clock.
Here is a workflow that lives in our repo. A label starts it: an agent implements the issue and opens the PR. Then, review and fix. Up to two rounds. Then, it reports back on the issue.
Workflow defined as a file in the repo, like a GitHub action, except every step is an agent running a skill.
Here is a real bug in our public skills repo. I'm adding one label. The run starts immediately. Every step runs in its own clean container.
And now we're back to the GitHub, and the pull request is ready. A few minutes later, the code review arrives. It found two things. A second agent checked each one, fixed the real ones, and wrote down why.
Round two of review. Found nothing above minor. The loop stops. And the issue links the pull request.
I personally really like this pattern where you can, with one tag, execute a large workflow on your task or pull request in GitHub. So if you like this demo, try aictrl on your repo.
The example
The workflow starts when the ai-fix label is added to an issue. It has three steps:
- Implement. An agent reads the issue, creates a branch linked to it, makes the change, runs the checks and opens a pull request.
- Review and fix, up to two rounds. A code review records its findings. A second agent checks each one against the code, fixes the real ones and records a verdict. The loop stops when nothing above minor is left, or after two rounds.
- Report. The workflow comments on the issue with the pull request link.
This workflow never merges. A person reviews the pull request and decides.
The file is public: skills-implement-issue-from-ai-fix.yaml. Shortened:
schemaVersion: aictrl/workflow/v2
name: skills-implement-issue-from-ai-fix
triggers:
- type: label
on: issue
label: ai-fix
inputs:
issue-url: $.issue.html_url
repository: $.repository.full_name
nodes:
- id: implement-issue
type: task
skill: implement-code-change
outputs: { prUrl: string }
- id: review-fix
type: loop
maxIterations: 2
until: "no findings || maxSeverityRank <= 2" # simplified: nothing above minor
body:
nodes:
- id: review
type: task
taskType: code-review
skill: code-review
- id: triage-fix
type: task
skill: reply-to-code-review
when: "review found something" # simplified
- id: notify-issue
type: task
All three skills are ones aictrl ships by default.
One run, step by step
The issue is skills#47, a real bug in our ux-testing harness: type --field never matched search inputs because it only looked for the textbox role. The issue names the line, explains the cause and lists two acceptance criteria. That matters. The workflow can only be as specific as the issue it starts from.
Times are UTC, 9 October.
- 16:19 Label added. The run starts within seconds.
- 16:22 Pull request opened against
main, 3½ minutes after the label: PR #63 makestype --fieldmatch search boxes and editable comboboxes, with regression tests. - 16:30 Review, round 1: one major finding (a field lookup could match a native dropdown, and typing into it would throw) and one note about an out-of-date comment.
- 16:37 Fix: a second agent checked both findings against the code, fixed both, and posted its verdict on each.
- 16:48 Review, round 2: nothing above minor. Two minor findings, which the fix step also handled (16:52), and the loop stopped.
- 16:54 Comment on the issue with the pull request link. The branch and pull request show in the issue's Development panel.
Total: 35 minutes, with nobody touching it. Then a person reviewed the pull request and merged it; the workflow never merges.
The rehearsal that failed
We rehearsed this on another issue in the same repo, skills#54, and the first run failed.
Earlier that day, an AI review of the workflow file had pointed out that later steps trusted the PR link reported by the first agent. If an issue's text steered that agent, a later step could push to the wrong pull request. We tightened the prompts so every step checks that the pull request belongs to the issue before it acts. To make that check, the review step got two extra inputs.
The file passed validation. The first run created the branch and opened PR #55 about five minutes after the label. Then the review step refused to start: the code-review step takes exactly one input. The run stopped within three seconds.
We gave the review step back its single input, re-synced, and re-added the label. The review still checks the pull request's branch, and the steps that write still confirm the pull request belongs to the issue. The second run:
- 19:49 started from the label.
- 19:52 found the pull request from the first attempt through its link to the issue, and reused it instead of opening a duplicate.
- 20:10 finished review round 1: two major findings and three minor.
- 20:14 pushed fixes, with a recorded verdict for each finding.
- 20:24 finished review round 2: nothing above minor.
- 20:26 pushed fixes for the remaining minor findings.
- 20:31 commented on the issue with the pull request link.
42 minutes, with no one touching it. Then a person reviewed and merged it.
Three things we took from it:
- A workflow file is code. It needs a rehearsal like any other change, somewhere you can watch every step.
- Valid isn't the same as runnable. The file passed validation but couldn't run. We're closing that gap so the validator catches it.
- Review is where the time goes. The first review round alone took 17 minutes. On our own repo, a run whose first review found nothing above minor took 17 minutes from label to comment.
Set it up on your repository
For the setup choices, limits and a tool comparison, see AI bug fixing from GitHub issues.
The GitHub triggers guide walks through it. In short:
- Connect the repository to aictrl.
- Add a workflow file under
.aictrl/workflows/. Start from the public example, or ask your coding agent to write one with thecreate-workflowskill. - Merge it. aictrl validates the file on sync and shows it under Workflows.
- Create the label and try it on one small, well-specified issue.
Then make it yours: your label, your target branch, your skills, your stop rule.
Limits
- You choose who merges; we strongly recommend a person. This workflow opens and fixes a pull request; it doesn't merge or deploy.
- Small, specific issues work best. Exact acceptance criteria give a reviewable diff. A vague issue gets a vague PR.
- The review is a sample. Two rounds catch a lot, but whatever is left at the limit lands on the reviewer's desk.
- Runs take minutes, not seconds. Plan on 15–45 minutes depending on how many review rounds it needs.