Skip to content

PR Comment Resolver

The PR Comment Resolver plugin reads every unresolved review thread on a pull request, classifies each comment, applies the actionable ones as commits, and posts a structured disposition report.

ActionWhat it means
ApplyClear, actionable change request — edits the relevant files and resolves the thread
DiscussNeeds human judgement — leaves the thread open with a short explanation
DeclineOut of scope, conflicts with another decision, or factually wrong — leaves the thread open with a short justification

Works with GitHub, Azure DevOps, Bitbucket, and any generic git repository.


flowchart TD
    A[Detect platform] --> B[List unresolved review threads]
    B --> C{Code-related?}
    C -->|No| N[Auto-decline — outside the scope of automated code resolution]
    C -->|Yes| D[Classify each comment]
    D --> E{Classification}
    E -->|Apply| F[Edit relevant files]
    E -->|Discuss| G[Reply with explanation]
    E -->|Decline| H[Reply with justification]
    F --> I[Push commits & resolve threads]
    G --> J[Leave thread open]
    H --> J
    N --> J
    I --> K[Post summary comment]
    J --> K
    K --> L{PR state?}
    L -->|Open pre-merge| M[Commits land on PR branch]
    L -->|Already merged| O[New branch + follow-up PR]
  1. Detect platform — reads git remote to identify GitHub, Azure DevOps, Bitbucket, or generic.
  2. List threads — fetches every unresolved review thread (top-level and inline) via the platform API.
  3. Filter — each thread is checked for relevance; comments that do not request a code change (general discussion, process questions, praise) are auto-declined with the reply: “This comment does not request a code change and is outside the scope of automated resolution.”
  4. Classify — each remaining comment is assigned one of three dispositions: apply, discuss, or decline.
  5. Apply changes — for every apply comment, the relevant files are edited in place.
  6. Push & resolve — commits are pushed and the addressed threads are marked resolved on the platform.
  7. Reply to the restdiscuss and decline threads each receive a short reply explaining why they were left open.
  8. Post summary — a structured comment lists every thread and its final disposition.

When triggered after a PR is already merged, the plugin cuts a new branch from the merge commit, pushes the changes there, and opens a follow-up PR linked back to the original.


InputSourceRequiredDescription
Repository URLAgent ruleYesThe repository to resolve comments in — provided by the Xianix Agent rule, not typed in the prompt
PR numberPromptNoTarget a specific pull request (e.g. 123)
Branch namePromptNoOverride the branch to commit resolved changes to

The platform (GitHub, Azure DevOps, etc.) is auto-detected from git remote — you don’t need to specify it.


Resolve comments on the current PR:

/resolve-comments

Resolve comments on a specific PR:

/resolve-comments 42

The Xianix Agent reads these from its secrets store and injects them at runtime via the rule’s with-envs block (see the rule examples below). For local CLI use, export them in your shell.

VariablePlatformRequiredPurpose
GITHUB-TOKENGitHubYesAuthenticate gh CLI for fetching threads, posting replies, and pushing commits
AZURE-DEVOPS-TOKENAzure DevOpsYesPAT for REST API calls, thread management, and git push

The GITHUB-TOKEN requires the following repository permissions:

PermissionAccessWhy it’s needed
ContentsRead & WriteRead repository files, commit changes, and push to branches
MetadataReadSearch repositories, list collaborators, and access repository metadata
Pull requestsRead & WriteFetch review threads and comments, post replies, resolve threads, and open follow-up PRs

The AZURE-DEVOPS-TOKEN (Personal Access Token) requires:

PermissionAccessWhy it’s needed
CodeRead & WriteRead repository files, push the resolution commits
Pull Request ThreadsRead & WriteFetch review threads, post replies, and resolve threads

Terminal window
# Point Claude Code at the plugin
claude --plugin-dir /path/to/xianix-plugins-official/plugins/comment-resolver
# Then in the chat
/resolve-comments

Or trigger it automatically via the Xianix Agent by adding a rule — see the examples below and the Rules Configuration guide.


Add one (or both) of the execution blocks below to your rules.json so the Xianix Agent automatically resolves review comments when a webhook fires.

The PR Comment Resolver is tag-driven. It runs when the ai-dlc/pr/address-comments label (GitHub) or tag (Azure DevOps) is present on a pull request and one of the following happens (OR logic across match-any entries):

ScenarioWhat it covers
Tag newly applied to a PRA human (or another rule) adds ai-dlc/pr/address-comments to an open PR
PR opened with the tag already presentA PR is created with the tag included from the start

There is no push-based re-trigger by default. The label or tag is the single source of truth for “resolve comments on this PR.”

PlatformScenarioWebhook eventFilter rule
GitHubTag newly appliedpull_requestaction==labeled and the just-added label.name=='ai-dlc/pr/address-comments'
GitHubPR opened with tagpull_requestaction==opened and ai-dlc/pr/address-comments is in pull_request.labels
Azure DevOpsTag newly appliedgit.pullrequest.updatedmessage.text contains tagged the pull request and ai-dlc/pr/address-comments is in resource.labels
Azure DevOpsPR created with taggit.pullrequest.createdai-dlc/pr/address-comments is in resource.labels

Each execution block in rules.json follows this top-level shape:

FieldPurpose
nameHuman-readable id for the execution
platform"github" or "azuredevops" — drives which provider the plugin uses
repository.urlWebhook path to the repository URL (e.g. repository.clone_url, resource.repository.remoteUrl)
repository.refWebhook path to the branch ref (e.g. pull_request.head.ref, resource.sourceRefName)
match-anyArray of trigger filters — first one to match wins
use-inputsMinimal — usually just the entry-point id (e.g. pr-number). The repository URL and ref are injected automatically from the repository block.
use-pluginsThe plugin to invoke
with-envsRequired environment variables, sourced from the agent’s secrets.* store and marked mandatory: true
execute-promptThe prompt sent to the agent. Implicit interpolations: {{repository-name}} and {{git-ref}} from the repository block, plus any name from use-inputs
{
"name": "github-pull-request-comment-resolver",
"platform": "github",
"repository": {
"url": "repository.clone_url",
"ref": "pull_request.head.ref"
},
"match-any": [
{
"name": "github-pr-tag-applied",
"rule": "action==labeled&&label.name=='ai-dlc/pr/address-comments'"
},
{
"name": "github-pr-opened-with-tag",
"rule": "action==opened&&pull_request.labels.*.name=='ai-dlc/pr/address-comments'"
}
],
"use-inputs": [
{ "name": "pr-number", "value": "number" }
],
"use-plugins": [
{
"plugin-name": "comment-resolver@xianix-plugins-official",
"marketplace": "xianix-team/plugins-official"
}
],
"with-envs": [
{ "name": "GITHUB-TOKEN", "value": "secrets.GITHUB-TOKEN", "mandatory": true }
],
"execute-prompt": "Pull request #{{pr-number}} in {{repository-name}} (branch: {{git-ref}}) has been tagged for review-comment resolution.\n\nRun /resolve-comments {{pr-number}} to classify and address the unresolved review threads."
}
{
"name": "azuredevops-pull-request-comment-resolver",
"platform": "azuredevops",
"repository": {
"url": "resource.repository.remoteUrl",
"ref": "resource.sourceRefName"
},
"match-any": [
{
"name": "azuredevops-pr-tag-applied",
"rule": "eventType==git.pullrequest.updated&&message.text*='tagged the pull request'&&resource.labels.*.name=='ai-dlc/pr/address-comments'"
},
{
"name": "azuredevops-pr-created-with-tag",
"rule": "eventType==git.pullrequest.created&&resource.labels.*.name=='ai-dlc/pr/address-comments'"
}
],
"use-inputs": [
{ "name": "pr-number", "value": "resource.pullRequestId" }
],
"use-plugins": [
{
"plugin-name": "comment-resolver@xianix-plugins-official",
"marketplace": "xianix-team/plugins-official"
}
],
"with-envs": [
{ "name": "AZURE-DEVOPS-TOKEN", "value": "secrets.AZURE-DEVOPS-TOKEN", "mandatory": true }
],
"execute-prompt": "Pull request #{{pr-number}} in {{repository-name}} (branch: {{git-ref}}) has been tagged for review-comment resolution.\n\nRun /resolve-comments {{pr-number}} to classify and address the unresolved review threads."
}