Skip to content

PR Lifecycle

Once implementation reaches a pull request, the PR-phase agents can help. They share the same ai-dlc/* vocabulary used across the rest of AI-DLC, all under the dedicated ai-dlc/pr/* namespace, but every trigger, every commit, and every comment is scoped to a single PR.

This page is the deep dive on that phase: the overall flow, then a per-agent breakdown of what fires it, what it does, and what it produces — written so the same workflow works on GitHub and Azure DevOps. For most teams, this is the easiest place to start adopting AI-DLC because review support and tidy-up work fit naturally around an existing PR process.


AgentTrigger label / tagPostsPushes commits
pr-reviewerai-dlc/pr/pr-reviewUnified review commentNo
ac-verifierai-dlc/pr/verify-acPer-AC pass/fail/uncovered tableNo
comment-resolverai-dlc/pr/address-commentsReply on each thread + commitsYes
test-authorai-dlc/pr/improve-testsSummary comment + commitsYes
doc-writerai-dlc/pr/update-docsSummary comment + commitsYes

The two read-only agents (pr-reviewer, ac-verifier) post comments only — they can be added freely (including in parallel) without branch contention. The three committers can be applied to a PR at any point in its life:

  • Before merge → commits go to the PR’s own branch. You can apply one, several, or all in parallel; each agent pushes its own commits.
  • After merge → each agent cuts a new branch from the merge commit, pushes its commits there, and opens a follow-up PR that references the original. You’ll get one follow-up PR per agent.

flowchart TD
    Open([PR opened by implementer<br/>or by you]) --> Draft{Draft?}
    Draft -->|yes| Ready[You mark ready for review]
    Draft -->|no| Ready
    Ready --> Pick{Pick a label}

    Pick -->|ai-dlc/pr/pr-review| AGR[pr-reviewer]
    Pick -->|ai-dlc/pr/verify-ac| AGV[ac-verifier]
    Pick -->|ai-dlc/pr/address-comments| AGC[comment-resolver]
    Pick -->|ai-dlc/pr/improve-tests| AGT[test-author]
    Pick -->|ai-dlc/pr/update-docs| AGD[doc-writer]

    AGR -->|review comment| Human{You decide}
    AGV -->|AC table| Human
    AGC -->|commits + replies| Human
    AGT -->|commits + summary| Human
    AGD -->|commits + summary| Human

    Human -->|more work| Pick
    Human -->|merge| Merged([Merged])

    Merged -.->|ai-dlc/pr/address-comments<br/>post-merge| FUP1[Follow-up PR<br/>by comment-resolver]
    Merged -.->|ai-dlc/pr/improve-tests<br/>post-merge| FUP2[Follow-up PR<br/>by test-author]
    Merged -.->|ai-dlc/pr/update-docs<br/>post-merge| FUP3[Follow-up PR<br/>by doc-writer]

    FUP1 --> Open
    FUP2 --> Open
    FUP3 --> Open

Every arrow leaving an agent represents the agent removing its trigger label, posting a structured comment (and pushing commits, where applicable), and adding ai-dlc/status/awaiting-human. Every arrow leaving a human represents a single label/tag change.


The PR moves through these states by label transitions alone:

stateDiagram-v2
    [*] --> Draft
    Draft --> ReadyForReview : you mark ready
    ReadyForReview --> Reviewing : ai-dlc/pr/pr-review
    Reviewing --> AwaitingHuman : review posted
    AwaitingHuman --> Reviewing : ai-dlc/pr/pr-review re-added after push
    AwaitingHuman --> VerifyingAc : ai-dlc/pr/verify-ac
    VerifyingAc --> AwaitingHuman : AC table posted

    AwaitingHuman --> AddressingComments : ai-dlc/pr/address-comments (pre-merge)
    AwaitingHuman --> ImprovingTests     : ai-dlc/pr/improve-tests     (pre-merge)
    AwaitingHuman --> UpdatingDocs       : ai-dlc/pr/update-docs       (pre-merge)
    AddressingComments --> AwaitingHuman : commits pushed to PR branch
    ImprovingTests     --> AwaitingHuman : commits pushed to PR branch
    UpdatingDocs       --> AwaitingHuman : commits pushed to PR branch

    AwaitingHuman --> Merged : you merge
    Merged --> FollowUpComments : ai-dlc/pr/address-comments (post-merge)
    Merged --> FollowUpTests    : ai-dlc/pr/improve-tests    (post-merge)
    Merged --> FollowUpDocs     : ai-dlc/pr/update-docs      (post-merge)
    FollowUpComments --> Merged : new PR opened
    FollowUpTests    --> Merged : new PR opened
    FollowUpDocs     --> Merged : new PR opened
    Merged --> [*]

Each agent below uses the same shape: Triggers (how it’s invoked on each platform), Activities (what it does once invoked), and Outputs (what you’ll find on the PR when it’s done).

A read-only, multi-dimensional review of the PR diff. Full plugin reference: PR Reviewer.

This is the best default starting point for AI-DLC on a mature team because it adds signal without changing the branch.

PlatformSurfaceWhat you doWebhook event the rule matches
GitHubLabel on the PRAdd ai-dlc/pr/pr-reviewpull_request where action==labeled and the just-added label.name=='ai-dlc/pr/pr-review' (the rule fires once per addition, not on every later PR update)
GitHubReviewer assignment (default rule)Request xianix-agent as a reviewerpull_request with action==review_requested and requested_reviewer.login=='xianix-agent'
Azure DevOpsTag on the PRAdd ai-dlc/pr/pr-reviewgit.pullrequest.updated where message.text matches tagged the pull request and the new tag in resource.labels is ai-dlc/pr/pr-review (so the rule fires only on the tag-addition event, not on commits, comments, or reviewer updates)
Azure DevOpsReviewer assignment (default rule)Add xianix-agent as a reviewergit.pullrequest.updated with xianix-agent in resource.reviewers and message contains as a reviewer

See PR Reviewer — Rule Examples for the complete match-any blocks.

  1. Detects platform from git remote (GitHub vs Azure DevOps).
  2. Fetches the PR diff, commit log, and changed file list against the base branch.
  3. Classifies the change (type, languages, risk, scope).
  4. Runs four reviewers in parallel: code quality, security, test coverage, performance.
  5. Compiles the findings into a single structured report.
  6. Adds ai-dlc/status/in-progress while running, removes it on completion.
  • A single unified review comment posted on the PR, grouped by reviewer with severity tags and inline file references.
  • For unsupported platforms only, a pr-review-report.md file written to the workspace.
  • Removes ai-dlc/pr/pr-review, adds ai-dlc/status/awaiting-human.
  • No commits. With the optional --fix flag (when invoked manually) the plugin will also apply fixes, commit, and push — the default lifecycle rule does not enable --fix.

Closes the loop between the Requirement Analyst phase and the PR. Cross-checks the PR diff against the Gherkin acceptance criteria written by ac-writer on the linked issue / work item.

This is most useful when the team has already invested in explicit acceptance criteria. It should be treated as a support tool for static verification, not as a replacement for human signoff or runtime validation.

PlatformSurfaceWhat you doWebhook event the rule matches
GitHubLabel on the PRAdd ai-dlc/pr/verify-acpull_request where action==labeled and the just-added label.name=='ai-dlc/pr/verify-ac' (fires once per addition, not on later PR updates)
Azure DevOpsTag on the PRAdd ai-dlc/pr/verify-acgit.pullrequest.updated where message.text matches tagged the pull request and the new tag in resource.labels is ai-dlc/pr/verify-ac

The agent expects the PR description (or a linked issue / work item) to reference the ID where the AC lives — for example Closes #42 on GitHub or AB#42 on Azure DevOps.

  1. Resolves the linked issue / work item from the PR body or commit trailers.
  2. Reads the Gherkin acceptance criteria from that artifact.
  3. Walks the PR diff and any related test files.
  4. Classifies each scenario into one of:
    • pass — clearly satisfied by the diff.
    • fail — contradicted by the diff.
    • uncovered — no evidence either way (usually a missing test).
  5. Adds ai-dlc/status/in-progress while running, removes it on completion.
  • A per-AC table comment on the PR with the status of every scenario and a short justification per row.
  • A suggested next step at the bottom of the comment — typically ai-dlc/pr/address-comments to fix fail rows or ai-dlc/pr/improve-tests to cover uncovered rows.
  • Removes ai-dlc/pr/verify-ac, adds ai-dlc/status/awaiting-human.
  • No commits. This agent is strictly read-only.

Picks up unresolved review threads — from humans, pr-reviewer, or ac-verifier — and applies the actionable ones as commits.

Best used for clear, repetitive follow-up work after humans have already decided what should change. On contentious or fast-moving PRs, teams may prefer to use it after merge so the main review branch stays stable.

PlatformSurfaceWhat you doWebhook event the rule matches
GitHubLabel on the PRAdd ai-dlc/pr/address-commentspull_request where action==labeled and the just-added label.name=='ai-dlc/pr/address-comments' (fires once per addition, not on later PR updates)
Azure DevOpsTag on the PRAdd ai-dlc/pr/address-commentsgit.pullrequest.updated where message.text matches tagged the pull request and the new tag in resource.labels is ai-dlc/pr/address-comments
  1. Lists every unresolved review thread on the PR (top-level and inline).
  2. Classifies each comment into one of three buckets:
    • apply — clear, actionable change request.
    • discuss — needs human judgement; will be left open.
    • decline — out of scope, conflicts with another decision, or factually wrong.
  3. For every apply comment, edits the relevant files.
  4. Pushes commits and resolves the threads it acted on.
  5. Replies to discuss and decline threads with a short justification, leaving them open.
  6. Adds ai-dlc/status/in-progress while running, removes it on completion.
Where the PR isWhat the agent does
Open (pre-merge)Pushes commits to the PR’s source branch; resolves the threads it addressed.
Already mergedCuts a new branch from the merge commit (e.g. ai-dlc/pr/address-comments/<n>), pushes the changes, and opens a follow-up PR linked back to the original.
  • A summary comment on the PR listing each comment and its disposition (apply / discuss / decline).
  • Removes ai-dlc/pr/address-comments, adds ai-dlc/status/awaiting-human.

Strengthens the test suite for a PR — fills coverage gaps, adds edge cases, refines flaky or weak assertions. Baseline tests from implementation (including TDD) are assumed; this step is about improvement, not greenfield test authorship.

This is a strong fit for boring but valuable engineering work: hardening tests after the main code path is already understood.

PlatformSurfaceWhat you doWebhook event the rule matches
GitHubLabel on the PRAdd ai-dlc/pr/improve-testspull_request where action==labeled and the just-added label.name=='ai-dlc/pr/improve-tests' (fires once per addition, not on later PR updates)
Azure DevOpsTag on the PRAdd ai-dlc/pr/improve-testsgit.pullrequest.updated where message.text matches tagged the pull request and the new tag in resource.labels is ai-dlc/pr/improve-tests

May be applied at the same time as ai-dlc/pr/update-docs — the two agents run in parallel and each pushes its own commits.

  1. Reads the PR diff and the existing test files for the changed modules.
  2. Identifies uncovered branches, missing edge cases, and weak assertions.
  3. Writes new tests (or strengthens existing ones) in the project’s existing testing style and framework.
  4. Runs the test suite locally inside its sandbox to confirm everything still passes.
  5. Adds ai-dlc/status/in-progress while running, removes it on completion.
Where the PR isWhat the agent does
Open (pre-merge)Pushes test commits to the PR’s source branch.
Already mergedCuts a new branch from the merge commit (e.g. ai-dlc/pr/improve-tests/<n>), pushes the test improvements, and opens a follow-up PR linked back to the original.
  • A summary comment on the PR listing the files touched, the new tests added, and any coverage delta the agent could measure.
  • Removes ai-dlc/pr/improve-tests, adds ai-dlc/status/awaiting-human.

Updates user-facing and internal documentation (Docs/, READMEs, inline doc comments) so the docs ship with the code.

This is another strong fit for boring but important follow-up work, especially when teams routinely merge changes before docs catch up.

PlatformSurfaceWhat you doWebhook event the rule matches
GitHubLabel on the PRAdd ai-dlc/pr/update-docspull_request where action==labeled and the just-added label.name=='ai-dlc/pr/update-docs' (fires once per addition, not on later PR updates)
Azure DevOpsTag on the PRAdd ai-dlc/pr/update-docsgit.pullrequest.updated where message.text matches tagged the pull request and the new tag in resource.labels is ai-dlc/pr/update-docs

May be applied at the same time as ai-dlc/pr/improve-tests. The two agents commit independently — resolve any push races the same way you would for two human contributors.

  1. Reads the PR diff and locates the documentation that mentions the changed surfaces.
  2. Cross-references READMEs, the Docs/ tree, and any in-code doc comments.
  3. Drafts updates in the project’s existing documentation style (tone, formatting, frontmatter).
  4. Adds ai-dlc/status/in-progress while running, removes it on completion.
Where the PR isWhat the agent does
Open (pre-merge)Pushes doc commits to the PR’s source branch so code and docs stay reviewable together.
Already mergedCuts a new branch from the merge commit (e.g. ai-dlc/pr/update-docs/<n>), pushes the doc updates, and opens a follow-up PR linked back to the original.
  • A summary comment on the PR listing the doc files touched and a one-line rationale per file.
  • Removes ai-dlc/pr/update-docs, adds ai-dlc/status/awaiting-human.

The PR-phase agents are designed to compose. Some common combinations:

GoalLabels to applyOrder
Standard review passai-dlc/pr/pr-reviewOne at a time
Review + verify against ACai-dlc/pr/pr-review, ai-dlc/pr/verify-acIn parallel — both read-only
Apply review feedbackai-dlc/pr/address-commentsAfter review is posted
Ship a feature with full hygieneai-dlc/pr/improve-tests + ai-dlc/pr/update-docsIn parallel before merge
Forgot something — patch post-mergeAny of ai-dlc/pr/address-comments, ai-dlc/pr/improve-tests, ai-dlc/pr/update-docsEach opens its own follow-up PR

Under the hood every PR-phase trigger uses the same agent contract as the rest of the lifecycle:

sequenceDiagram
    autonumber
    participant You
    participant SCM as GitHub / AzDO
    participant Xianix as Xianix Agent
    participant Agent as PR-phase agent

    You->>SCM: Add label/tag ai-dlc/pr/<phase> on PR
    SCM->>Xianix: webhook (pull_request labeled / git.pullrequest.updated "tagged")
    Xianix->>Xianix: rules.json -> match -> resolve inputs
    Xianix->>Agent: Spawn executor with plugin + prompt
    Agent->>SCM: Add label ai-dlc/status/in-progress
    Agent->>Agent: Do the work (read, edit, test)
    opt Committer agents only
        Agent->>SCM: Push commits (PR branch or follow-up branch)
    end
    Agent->>SCM: Post structured comment with output
    Agent->>SCM: Remove ai-dlc/pr/<phase> and ai-dlc/status/in-progress
    Agent->>SCM: Add ai-dlc/status/awaiting-human
    You->>SCM: Review, optionally add the next ai-dlc/pr/<phase> label

For the platform-specific rule blocks (the exact match-any filters and use-inputs mappings) see: