Ac qa gh pr review

From WaterplanAI/agentic-config · View interactive version

Ac qa gh pr review is an AI agent skill from the GitHub repository WaterplanAI/agentic-config. Reviews pull requests through a bounded shared worker-wave review flow, consolidated reporting, and user-confirmed `gh pr review` actions.

How to use this skill

Skill file

PR Review - pi adaptation

Review a pull request with a bounded shared worker-wave on top of the shipped @agentic-config/pi-compat orchestration helpers.

Current shipped boundary

This pi wrapper now ships, but it stays inside the bounded IT003 contract:

Arguments

Required references

Read these when needed:

Pre-flight

  1. Verify gh CLI is available and authenticated:

```bash

gh --version

gh auth status

```

  1. Verify the current directory is inside the repo being reviewed:

```bash

REPO_ROOT=$(git rev-parse --show-toplevel)

```

  1. Resolve runtime paths and report defaults:

```bash

DATE_PREFIX=$(date +%Y-%m-%d)

UUID_VALUE=$(uuidgen | tr 'A-Z' 'a-z')

RUN_ROOT="$REPO_ROOT/tmp/gh-pr-review/$DATE_PREFIX-$UUID_VALUE"

mkdir -p "$RUN_ROOT/reports" "$RUN_ROOT/results"

```

  1. Fetch PR metadata and review inputs before launching workers:

```bash

gh pr view "$PR_REF" \

--json number,url,title,body,author,state,baseRefName,headRefName,headRefOid,files,additions,deletions,commits \

> "$RUN_ROOT/pr.json"

gh pr view "$PR_REF" --json comments,reviews > "$RUN_ROOT/feedback.json"

gh pr diff "$PR_REF" > "$RUN_ROOT/pr.diff"

set +e

gh pr checks "$PR_REF" > "$RUN_ROOT/checks.txt" 2>&1

CHECKS_EXIT=$?

set -e

```

  1. Derive machine-readable coordinator facts from pr.json.
  1. Resolve the default report path when $REPORT_PATH was not provided:

```bash

REPORT_PATH="${REPORT_PATH:-$RUN_ROOT/PR-$PR_NUMBER-$UUID_VALUE.md}"

COMMENT_PATH="$RUN_ROOT/github-review-comment.md"

```

  1. Check whether the local checkout actually matches the PR head:

```bash

LOCAL_HEAD=$(git -C "$REPO_ROOT" rev-parse HEAD)

LOCAL_BRANCH=$(git -C "$REPO_ROOT" rev-parse --abbrev-ref HEAD)

```

Fixed review-worker wave

Use one bounded worker wave with these ordered workers:

  1. expected-changes
  2. security-review
  3. code-quality-review
  4. test-review
  5. logic-review

Create one report/result pair per worker:

Worker contract

Every worker task must explicitly tell the worker to:

  1. read node_modules/@agentic-config/pi-compat/assets/orchestration/protocol/worker.md
  2. stay non-interactive and never launch nested subagents
  3. keep writes limited to its assigned report path and result path
  4. read the coordinator artifacts it needs from:
  1. inspect the local repo only as far as the assigned scope requires
  2. write a substantive markdown report first
  3. call:

```bash

node node_modules/@agentic-config/pi-compat/assets/orchestration/tools/write-result.js \

--result-path "$RESULT_PATH" \

--worker-id "$WORKER_ID" \

--status "$STATUS" \

--summary "$SUMMARY" \

--report-path "$REPORT_PATH" \

--target "$TARGET"

```

  1. return a concise completion message after the result file exists

Worker status rules

Use the result status to encode review significance honestly:

Worker scope details

1. Expected changes validation

Target: expected-changes

Inputs and expectations:

Required report sections:

2. Security review

Target: security

Check the diff and affected files for:

Required report sections:

3. Code quality review

Target: code-quality

Check project conventions and changed-file quality.

Rules:

Required report sections:

4. Test discovery and execution

Target: tests

Rules:

Required report sections:

5. Logic and bug risk review

Target: logic-bug-risk

Review the logic changes critically:

Required report sections:

Launch the worker wave

Use exactly one synchronous subagent.parallel call when the five workers are independent, which they should be in this phase because they only write to disjoint report/result files.

Prefer the worker agent.

Each worker task should include:

Summarize the worker results

After all workers return, summarize the ordered result set:

set +e
node node_modules/@agentic-config/pi-compat/assets/orchestration/tools/summarize-results.js \
  --result "$RUN_ROOT/results/01-expected.json" \
  --result "$RUN_ROOT/results/02-security.json" \
  --result "$RUN_ROOT/results/03-quality.json" \
  --result "$RUN_ROOT/results/04-tests.json" \
  --result "$RUN_ROOT/results/05-logic.json" \
  --fail-on-missing \
  --fail-on-status fail \
  --format json \
  > "$RUN_ROOT/summary.json"
SUMMARY_EXIT=$?
set -e

Interpretation rules:

Final synthesis

The coordinator owns the final review report.

Create the final markdown report at $REPORT_PATH.

Include at least:

# PR Review: #{PR_NUMBER}

**URL**: {PR_URL}
**Title**: {PR_TITLE}
**Author**: {AUTHOR}
**Branch**: {HEAD} -> {BASE}
**Review Session**: {UUID}
**Date**: {TIMESTAMP}
**Checkout Mode**: {head-aligned|diff-only}

---

## Executive Summary

{APPROVE | REQUEST_CHANGES | COMMENT}

## Worker Wave Summary

- Totals by status from `summary.json`
- Any missing or limited evidence
- CI/check status summary from `checks.txt`

## Detailed Findings

### Expected Changes
{from worker 1}

### Security
{from worker 2}

### Code Quality
{from worker 3}

### Test Results
{from worker 4}

### Logic & Bug Risk
{from worker 5}

## Recommendation

- APPROVE when no worker reported `fail` and the evidence supports merge readiness
- REQUEST_CHANGES when any worker reported a blocking issue
- COMMENT when only `warn` results or non-blocking concerns remain

## Recommended Review Message

{copy-paste-ready review body}

## Next Steps

{actionable follow-ups}

Also write the concise review-ready message to $COMMENT_PATH.

Recommendation rules

Optional review action

Keep review posting serial and user-confirmed.

  1. Show the exact command that would run.
  2. Use AskUserQuestion to offer only the actions that are honest for the current result:
  1. If the user chooses a posting action, run the corresponding command with $COMMENT_PATH.

Representative commands:

gh pr review "$PR_REF" --comment --body-file "$COMMENT_PATH"
gh pr review "$PR_REF" --request-changes --body-file "$COMMENT_PATH"
gh pr review "$PR_REF" --approve --body-file "$COMMENT_PATH"

If the user chooses not to post, stop after writing the report and comment files.

Final user-facing output

Report clearly:

Error handling

| Condition | Action |

|---|---|

| gh unavailable or unauthenticated | STOP |

| not inside a git repo | STOP |

| PR metadata or diff fetch fails | STOP |

| gh pr checks reports failing checks | continue and treat as review evidence |

| local checkout does not match PR head | continue in diff-only mode and report the limitation honestly |

| worker result file missing | STOP |

| worker reports warn | continue and surface explicitly |

| worker reports fail | continue to synthesis and normally recommend REQUEST_CHANGES |

| user declines posting | keep report only |

Non-goals

This skill does not ship:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.