agentleFS
nexuslabs-ainexuslabs-ai/nxds/.claude/skills/pr-fix-guide/SKILL.md

pr-fix-guide

Skill4 starsChanged 15 days agoMITView on GitHub

Fix PR review issues directly without agent delegation. Combines root cause analysis and fixing into a single-agent flow.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read each issue's severity from the Severity column of the review body.

    line 67
  2. Distinctive:

    Do NOT blindly accept the reviewer's suggested fix.

    line 79
  3. Distinctive:

    Keep the reasoning in your head.

    line 81
  4. Distinctive:

    Do not wait for explicit approval.

    line 98
  5. Distinctive:

    After emitting the plan, fix all issues.

    line 104
  6. Distinctive:

    Read the specific comment / inline-review thread fully — including any reviewer back-and-forth

    line 120
  7. Distinctive:

    Run the Reflex Check (above) at the moment of writing the change — same triggers, plus the two fix-specific ones

    line 121
  8. Distinctive:

    If something is genuinely not clean, say so on that trailing line — don't pad the output with a verification section.

    line 160

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PR Fix Guide

Purpose

Fix issues identified in PR reviews by combining root cause analysis (normally done by Principal Architect) and fixing (normally done by SDE2) into a single direct flow.

Rules

The full ruleset lives in .claude/rules/*.md — those files are the spec. Don't try to keep all of them in working memory.

The Reflex Check lives in implement-guide/SKILL.md (Part 2 → Step 3). It names the actions that should evoke a rule mid-write and points at the relevant file. The same triggers fire when writing a fix patch as when writing fresh code — read it before each fix; open a full rule file only when a reflex actually fires.

Two reflexes specific to fixing (root-cause and don't-over-fix) live below in Part 2 → Fix Process.

Part 1: Root Cause Analysis

Step 1: Gather Review Context

  1. Fetch PR details:

    gh pr view {pr_number} --json number,title,body,headRefName,baseRefName,author,url
  2. Extract GitHub issue from PR body (Closes #123)
  3. Get all review feedback:

    # Resolve owner/repo
    gh repo view --json owner,name --jq '"\(.owner.login)/\(.name)"'
    
    gh api repos/{owner}/{repo}/pulls/{pr_number}/reviews
    gh api repos/{owner}/{repo}/pulls/{pr_number}/comments
  4. Get changed files:

    gh pr diff {pr_number}

Step 2: Categorize Issues

Extract all issues from reviews and categorize:

CategoryIndicatorPriority
Blocking❌ Blocking, "blocking", "must", "required"Fix first
Minor⚠️ Minor, "minor", "consider", "suggestion", "nit"Fix second

Read each issue's severity from the Severity column of the review body. In a follow-up review, the Status column (❌ Still Present, ⚠️ Partial) and the ⚠️ New inline marker are not severity.

Step 3: Analyze Root Causes

For EACH issue:

  1. Read the relevant file(s) and surrounding code context -- not just the flagged line
  2. Understand what the reviewer is pointing at
  3. Research the root cause -- is it the line they flagged, or something deeper? What's the real shape of the problem?
  4. Decide what you'll actually do -- this may agree with, improve on, or differ from the reviewer's suggestion
  5. Everything is in scope. Do not carve out a "deferred" bucket. Reviewer framing like "not blocking", "follow-up", or "post-launch monitor" is not a license to skip — it is still a fix in this PR unless the finding maps to a cited, existing issue number. See no-follow-up-deferral.md.

Do NOT blindly accept the reviewer's suggested fix. Research and reason from the code.

Keep the reasoning in your head. The user verifies by reading the code, not prose — do NOT dump root-cause analysis into chat.

Plan Output Format

Emit a single one-line-per-fix table, then proceed to fixing directly:

## Plan: #{pr_number}

| #   | File:line    | Fix                         |
| --- | ------------ | --------------------------- |
| 1   | `file.ts:42` | {what you'll do — one line} |
| 2   | `file.ts:78` | {what you'll do — one line} |

Proceeding.

Do not wait for explicit approval. The plan is a preview so the user can interrupt if needed, not an approval gate. Pause only for a specific fix that is genuinely ambiguous or needs an architectural call.


Part 2: Fixing

After emitting the plan, fix all issues.

Fix Process

Before each change, run the Reflex Check from implement-guide/SKILL.md (Part 2 → Step 3). Same triggers fire here — the reviewer comment is the occasion for the edit, but the edit itself can still smuggle in a useEffect that orchestrates React state, a defensive existence check the schema already guarantees, a callback / mode-discriminator prop, a // fix for X comment, or a ripple gap downstream.

Two reflexes specific to fixing:

  • The reviewer flagged a symptom — is the symptom the root cause, or is the cause upstream? -> Read enough surrounding code to find the cause, not just the flagged line. Fix the cause; the symptom resolves itself. The reviewer's suggested fix is input, not instruction — you may agree with it, improve on it, or differ.
  • About to fix the flagged line, plus "improve a few things while I'm here"? -> Don't. Make the smallest correct change that addresses the comment. Out-of-scope cleanup belongs in its own PR.
  1. Fix all blocking issues first, then all minor issues
  2. For each fix:
    • Read the specific comment / inline-review thread fully — including any reviewer back-and-forth
    • Run the Reflex Check (above) at the moment of writing the change — same triggers, plus the two fix-specific ones
  3. Fix autonomously -- do NOT stop for user confirmation between individual fixes
  4. Only pause if:
    • The fix is genuinely ambiguous (the reviewer's intent is unclear)
    • The fix requires an architectural decision beyond the scope of the comment
    • A fix introduces a conflict with another pending fix

Verify Fixes

  1. Run checks:

    pnpm typecheck
    pnpm lint
  2. Review against original comments:
    • Does each fix address the feedback?
    • Any unintended side effects?
  3. Fix any new issues introduced

Fix Output Format

Single one-line-per-fix table. No "Changes Made", no code snippets, no "Next Steps". Verification is one trailing line.

## Done: #{pr_number}

| #   | File:line    | Fix                        |
| --- | ------------ | -------------------------- |
| 1   | `file.ts:42` | {what was done — one line} |
| 2   | `file.ts:78` | {what was done — one line} |

Typecheck + lint: clean.

If something is genuinely not clean, say so on that trailing line — don't pad the output with a verification section.


Principles

  1. Architect-first thinking -- understand root causes before fixing; reviewer suggestions are input, not instructions
  2. Address the actual feedback -- read carefully, don't assume
  3. Follow loaded rules -- .claude/rules/ files are source of truth
  4. Terse output -- plan and completion are one-line-per-fix tables; no root-cause prose, no rationale, no "issues addressed" narrative. The user verifies via the code
  5. Plan is a preview, not a gate -- emit the plan table and proceed directly. Pause only on a specific fix that is genuinely ambiguous
  6. No patches -- proper solutions only
  7. Don't over-fix -- only change what was requested
  8. Research before fixing -- if a fix involves a third-party library, verify correct usage via WebSearch

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.