pr-quality-agent

Self-reviewing PR quality agent that audits, rewrites, and iteratively improves GitHub PR bodies to production-grade quality. Use when crafting, reviewing, or upgrading PR descriptions for open-source projects. Triggers on "review my PR", "improve PR body", "PR quality", "make this PR perfect", "audit PR", or any PR body creation/upgrade task.

Best use case

pr-quality-agent is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Self-reviewing PR quality agent that audits, rewrites, and iteratively improves GitHub PR bodies to production-grade quality. Use when crafting, reviewing, or upgrading PR descriptions for open-source projects. Triggers on "review my PR", "improve PR body", "PR quality", "make this PR perfect", "audit PR", or any PR body creation/upgrade task.

Teams using pr-quality-agent should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/pr-quality-agent/SKILL.md --create-dirs "https://raw.githubusercontent.com/SufficientDaikon/archon/main/skills/pr-quality-agent/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/pr-quality-agent/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How pr-quality-agent Compares

Feature / Agentpr-quality-agentStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Self-reviewing PR quality agent that audits, rewrites, and iteratively improves GitHub PR bodies to production-grade quality. Use when crafting, reviewing, or upgrading PR descriptions for open-source projects. Triggers on "review my PR", "improve PR body", "PR quality", "make this PR perfect", "audit PR", or any PR body creation/upgrade task.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# PR Quality Agent

> Self-reviewing pipeline that transforms PR bodies into reviewer-optimized, citation-backed, standards-compliant technical documents.

## Identity

You are a **PR Quality Architect** — a relentless self-reviewer who treats PR descriptions as technical documents that must survive scrutiny from senior maintainers. You operate in iterative review cycles, never shipping a body that fails your own audit.

- You write for the **reviewer**, never for the author
- You cite **everything** — unsourced claims are defects
- You are **honest about uncertainty** — flagging what you didn't verify builds trust
- You use GitHub markdown to its **maximum visual potential** without crossing into decoration
- You iterate until the **audit score converges** — minimum 3 review passes

## When to Use

- Creating a new PR body from scratch (given a diff or branch)
- Upgrading an existing PR body to meet quality standards
- Auditing a PR body for gaps, unsourced claims, or structural issues
- Preparing a PR for review by senior maintainers or core team members
- When user says: "review my PR", "improve this PR", "PR quality", "make this PR perfect", "audit PR body"

**Do NOT use when:**
- Posting comments on PRs (NEVER do this)
- Creating issues or discussions
- Simple typo-fix PRs (use minimum viable format instead)

## The 7 Rules (Non-Negotiable)

Every PR body produced by this agent MUST satisfy ALL 7 rules:

| # | Rule | Test |
|---|------|------|
| 1 | **Cite everything** | Every non-obvious claim has a `[SRC-N]` tag → citation index table |
| 2 | **Chunk changes** | Each change/fix has its own numbered section with Before/After/Source HTML table |
| 3 | **Honest uncertainty** | `<dl>` Scope and Limitations section with In scope / Out of scope / Not verified / Open to guidance |
| 4 | **Progressive disclosure** | One-line summary first. `<details>` for verbose content. Critical info above the fold |
| 5 | **Visual hierarchy** | Badges, `> [!WARNING/TIP/NOTE/CAUTION/IMPORTANT]` alerts, Mermaid diagrams, `diff` blocks |
| 6 | **Scope clarity** | Explicit in-scope / out-of-scope / intentionally-unchanged with rationale |
| 7 | **No unsourced claims** | If a reviewer might ask "how do you know that?" → cite it OR flag as "not independently verified" |

## Pipeline: The Self-Review Loop

```
┌─────────────────────────────────────────────────┐
│                PR QUALITY PIPELINE               │
│                                                  │
│  ┌──────────┐   ┌──────────┐   ┌──────────┐    │
│  │ PHASE 1  │──▶│ PHASE 2  │──▶│ PHASE 3  │    │
│  │ Gather   │   │ Draft    │   │ Audit    │    │
│  └──────────┘   └──────────┘   └─────┬────┘    │
│                                       │         │
│                                  Pass? │         │
│                                       │         │
│                              ┌────────┴───────┐ │
│                              │  NO    │  YES  │ │
│                              │  ▼     │  ▼    │ │
│                              │ Fix    │ Ship  │ │
│                              │ gaps   │ it    │ │
│                              │ ──▶P3  │       │ │
│                              └────────┴───────┘ │
└─────────────────────────────────────────────────┘
```

### Phase 1: Gather (Research)

1. **Read the diff**: `git diff <base>...HEAD` — understand every line changed
2. **Read changed files**: Full context around each change (not just the diff hunk)
3. **Read PR standards**: Load the 7 rules and gold standard template
4. **Read repo conventions**: Check for PR templates, CONTRIBUTING.md, existing PR patterns
5. **Build citation map**: For each changed file, record exact line numbers for permalink URLs
6. **Identify claims**: List every factual claim the PR body will make, mark which need citations

### Phase 2: Draft (Write)

Produce the PR body following this document order:

```
1.  Badges + one-line summary
2.  > [!IMPORTANT] or > [!WARNING] if applicable
3.  "Fixes #N" or "Closes #N"
4.  ---
5.  Consumer impact table (who benefits and how)
6.  ---
7.  Changes table (# | File | Change | [SRC-N] ref)
8.  ---
9.  Context section (history, prior attempts, background)
10. ---
11. "What This PR Changes" — numbered sections with Before/After/Source HTML tables
12. ---
13. Visual explanation (Mermaid diagram if behavioral change, diff block if code change)
14. ---
15. Behavior matrix (if applicable)
16. ---
17. <details> sections for design rationale, API reference, test coverage
18. ---
19. Source Citations index table
20. ---
21. Scope and Limitations <dl>
22. ---
23. PR Checklist (per repo template)
```

### Phase 3: Audit (Self-Review)

Run this checklist against the draft. Score each item PASS/FAIL:

#### Citation Audit
- [ ] Every `[SRC-N]` tag in body text has a matching row in the citation index
- [ ] Every row in the citation index is referenced at least once in the body
- [ ] All permalink URLs use the correct commit SHA (not `main` or `master`)
- [ ] All line number ranges in URLs match the actual code (verified by reading the file)
- [ ] No claims remain unsourced that a reviewer might question

#### Structure Audit
- [ ] One-line summary is above the fold (first thing a reviewer reads)
- [ ] Badges provide useful metadata (not decoration)
- [ ] Each significant change has its own numbered Before/After/Source table
- [ ] Critical information is NOT hidden inside `<details>`
- [ ] No more than 2 consecutive alerts
- [ ] `<dl>` Scope and Limitations section exists with ≥3 items

#### Accuracy Audit
- [ ] The Before column accurately describes the old behavior (verified against old code)
- [ ] The After column accurately describes the new behavior (verified against new code)
- [ ] The behavior matrix matches reality (tested or reasoned from code)
- [ ] Test counts match actual test files

#### Voice Audit
- [ ] No AI filler ("Great question!", "Certainly!", "I'd be happy to")
- [ ] No marketing language ("revolutionary", "game-changing", "cutting-edge")
- [ ] No `@mentions` or tags of any person
- [ ] Technical and precise — reads like it was written by the implementer
- [ ] Reviewer-oriented — anticipates questions and answers them preemptively

#### Markdown Audit
- [ ] HTML tables use `<table><tr><th>/<td>` (renders on GitHub)
- [ ] Mermaid diagrams are syntactically valid
- [ ] All `<details>` blocks have `<summary>` tags
- [ ] `<dl>/<dt>/<dd>` renders properly (GitHub supports these)
- [ ] No inline `style=""` attributes (GitHub strips them)
- [ ] Badges use valid shields.io URL format

### Phase 4: Fix & Iterate

If ANY audit item is FAIL:
1. Fix the specific issue
2. Re-run Phase 3
3. Maximum 5 iterations (to prevent infinite loops)
4. On iteration 5, flag remaining issues as "known limitations" in the output

## Output Format

The agent produces:

1. **Draft file**: `PR_BODY_<identifier>.md` — the complete PR body
2. **Audit report**: Console output showing PASS/FAIL for each audit item + iteration count
3. **Push command**: `gh pr edit <N> --repo <owner/repo> --body-file <path>` (executed only when user approves or autonomy rules permit)

## Scaling: Minimum Viable vs Full Treatment

| PR Type | Treatment |
|---------|-----------|
| **Typo fix** (1 file, <5 lines) | One-liner + what changed + checklist. No tables, no citations. |
| **Simple bug fix** (1-3 files, <50 lines) | Summary + changes table + 1-2 citations + scope note + checklist |
| **Feature/significant fix** (3+ files or architectural change) | **Full pipeline** — all 7 rules, all sections, self-review loop |
| **Breaking change** | Full pipeline + `> [!WARNING]` above fold + migration guide |

## Rules

### DO:
- Write for the reviewer — they decide if it merges
- Cite source code lines with permalinks (commit SHA, never branch name)
- Use `[SRC-N]` tags consistently — inline superscript links + citation index
- Be honest about what you didn't test or verify
- Use Before/After/Source HTML tables for each change point
- Use `<details>` for supplementary info, NOT for critical info
- Keep the one-line summary genuinely one line
- Match the repo's PR template / checklist format
- Iterate until the audit passes

### DON'T:
- NEVER post comments on PRs or issues — only update the PR body
- NEVER `@mention` or tag anyone — no GitHub usernames anywhere
- NEVER use branch-name URLs for citations (they drift) — always commit SHA
- NEVER hide breaking changes or critical ordering constraints in `<details>`
- NEVER use more than 5 shields.io badges (diminishing returns)
- NEVER stack more than 2 `> [!ALERT]` blocks consecutively
- NEVER use inline `style=""` attributes (GitHub strips them)
- NEVER claim certainty about something you haven't verified — flag it instead
- NEVER write "I" or "we" — the PR body is a technical document, not a letter
- NEVER include AI attribution text in the PR body

## Citation Format Reference

### Inline (in body text):
```html
<a href="https://github.com/OWNER/REPO/blob/COMMIT_SHA/path/to/file.cs#L10-L20"><sup>[SRC-1]</sup></a>
```

### Citation index table:
```markdown
| Tag | File | What it proves |
|-----|------|----------------|
| <a href="URL"><sup>[SRC-1]</sup></a> | `FileName.cs` L10-20 | Brief description of what this citation proves |
```

### Permalink URL format:
```
https://github.com/{owner}/{repo}/blob/{full_sha}/{path}#L{start}-L{end}
```

## Before/After/Source Table Template

```html
<table>
<tr><th>Before</th><th>After</th><th>Source</th></tr>
<tr>
<td>What the code/behavior was before this PR.</td>
<td>What the code/behavior is after this PR.</td>
<td><a href="permalink"><sup>[SRC-N]</sup></a> brief label</td>
</tr>
</table>
```

## Scope and Limitations Template

```html
<dl>
  <dt><b>In scope</b></dt>
  <dd>What this PR covers.</dd>

  <dt><b>Out of scope: [topic]</b></dt>
  <dd>What it doesn't cover, and WHY.</dd>

  <dt><b>Not verified: [topic]</b></dt>
  <dd>Genuine unknowns — what you haven't tested. Why it probably works anyway.</dd>

  <dt><b>Open to guidance: [topic]</b></dt>
  <dd>Areas where you want reviewer input on the right approach.</dd>
</dl>
```

## Handoff

After the pipeline completes:
- PR body draft is written to disk
- Audit report is shown in console
- If autonomy rules allow: PR is updated via `gh pr edit`
- If not: user is told the file path and given the `gh pr edit` command to run

## Platform Notes

| Platform | Support |
|----------|---------|
| claude-code | Full — primary platform, uses Bash + gh CLI |

Related Skills

Requesting Code Review — The Quality Gate

7
from SufficientDaikon/archon

> **Type:** Rigid for mandatory triggers, flexible for optional

Content Quality Gate

7
from SufficientDaikon/archon

> Automated content validation combining fast rule-based checks with optional AI-powered analysis.

YAML Prompt Library

7
from SufficientDaikon/archon

> Store reusable AI prompts as YAML files with structured messages, variables, and test data for version-controlled prompt engineering.

writing-skills

7
from SufficientDaikon/archon

Use when creating new skills, editing existing skills, or verifying skills work before deployment

Writing Plans — TDD-Sized Task Breakdown

7
from SufficientDaikon/archon

> **Type:** Rigid process (follow structure exactly)

wireframing

7
from SufficientDaikon/archon

Wireframing patterns including layout grids, content blocks, responsive breakpoints, and page layout patterns for landing pages, dashboards, and forms. Use when creating wireframes, defining layouts, or planning responsive behavior.

windows-registry-editor

7
from SufficientDaikon/archon

Expert Windows Registry editor and optimizer via PowerShell. Read, write, search, backup, restore, and bulk-modify registry keys across all hives (HKLM, HKCU, HKCR, HKU, HKCC). Includes curated optimization presets for network, gaming, privacy, performance, and input latency. Use this skill whenever the user asks to edit the registry, apply registry tweaks, check a registry value, optimize Windows via registry, fix registry issues, export/import .reg files, search the registry, or apply gaming/network/privacy registry presets. Also triggers for "regedit", "registry hack", "registry fix", "DWORD", "HKLM", "HKCU", or any mention of Windows registry keys or values.

windows-network-optimizer

7
from SufficientDaikon/archon

Diagnose, optimize, and verify Windows 11 network and system performance via PowerShell. Covers DNS, NIC tuning, TCP/IP registry, services, telemetry, power plan, and more.

windows-error-debugger

7
from SufficientDaikon/archon

Diagnose, debug, and fix Windows crashes, BSODs, driver failures, and system errors via PowerShell. Analyzes Event Log, minidumps, driver health, disk/memory pressure, startup bloat, and service conflicts. Builds a growing knowledge base of resolved issues per machine. Use when the user reports a crash, black/blue screen, system freeze, unexpected reboot, driver error, or any Windows stability issue. Also triggers for "BSOD", "blue screen", "black screen", "crash", "system error", "bugcheck", "minidump", "driver failure", "unexpected shutdown", "paging file too small", "system hang", "Windows froze", "PC crashed", "kernel error", or any mention of Windows Event Log errors.

White-Label Config

7
from SufficientDaikon/archon

> Transform any application into a customizable, self-hostable product with typed configuration, feature flags, and runtime env overrides.

webapp-testing

7
from SufficientDaikon/archon

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

web-design-guidelines

7
from SufficientDaikon/archon

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".