aictrl.devBlog

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.

A real run on the public skills repository, cut from 35 minutes. 1920 × 1080 · 1 min 46 sec.
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:

  1. Implement. An agent reads the issue, creates a branch linked to it, makes the change, runs the checks and opens a pull request.
  2. 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.
  3. 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.

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:

42 minutes, with no one touching it. Then a person reviewed and merged it.

Three things we took from it:

  1. A workflow file is code. It needs a rehearsal like any other change, somewhere you can watch every step.
  2. 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.
  3. 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:

  1. Connect the repository to aictrl.
  2. Add a workflow file under .aictrl/workflows/. Start from the public example, or ask your coding agent to write one with the create-workflow skill.
  3. Merge it. aictrl validates the file on sync and shows it under Workflows.
  4. 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

Start with aictrl

Code review or bug fix. The workflow is yours.

Use our skills or bring your own. 20 free executions, no card.