pr-standards-extractor
Skill0 starsChanged 10 months agoMITView on GitHub
Extract coding standards from PR review comments and add them to CLAUDE.local.md.
In this repositoryOne other file it gives its agents.
- skill-extractorSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
When this skill is invoked, follow these steps:
- Very specific: line 30
Use gh to fetch all comments from the PR:
- Very specific: line 68
Read the project's CLAUDE.local.md to understand what's already documented.
- Very specific: line 70
If CLAUDE.local.md doesn't exist, create it with a header.
- Distinctive: line 78
Not yet documented: Add a new section
- Distinctive: line 80
When augmenting, add a reference to the PR (e.g., "Guidelines from PR review #3396:") so the origin is traceable.
- Distinctive: line 88
After updating, show the user:
- Very specific: line 95
Use the same Markdown style as the existing CLAUDE.local.md
- Distinctive: line 97
Keep descriptions concise but complete
- Very specific: line 98
Use headers (##, ###) to organize by topic
- Distinctive: line 100
Use tables when comparing patterns or listing field mappings
- Distinctive: line 108
Instead: Only capture patterns that would apply to future code — general rules, not specific fixes.
- Distinctive: line 120
Instead: Always read the existing file first and augment rather than duplicate.
≈ “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.
Files
PR Standards Extractor
Overview
This skill extracts coding standards and conventions from GitHub PR review comments and adds them to the project's CLAUDE.local.md file. PR reviews often contain valuable insights about team conventions, architectural decisions, and coding patterns that should be captured as persistent project instructions.
The skill reads all comments from a PR (both review comments and general comments), identifies actionable coding standards, checks what's already documented in CLAUDE.local.md, and adds new standards or augments existing ones.
When to Use This Skill
- The user says
/pr-standardsor asks to extract standards from a PR - The user references a PR number and wants to capture review feedback as project conventions
Instructions
When this skill is invoked, follow these steps:
Step 1: Identify the PR
The user will provide a PR number (e.g., #3396 or just 3396). If no PR number is provided, ask for one.
Step 2: Fetch PR Comments
Use gh to fetch all comments from the PR:
# Get PR review comments (inline code comments)
gh api repos/{owner}/{repo}/pulls/{number}/comments --paginate
# Get PR issue comments (general discussion)
gh api repos/{owner}/{repo}/issues/{number}/comments --paginate
# Get the PR description for context
gh pr view {number} --json body,titleDetermine {owner}/{repo} from the git remote:
gh repo view --json nameWithOwner -q .nameWithOwnerStep 3: Analyze Comments for Coding Standards
Review all comments and identify:
- Explicit conventions: "We always do X", "Never do Y", "Prefer A over B"
- Architectural patterns: How data flows, where logic belongs, API design patterns
- Anti-patterns caught in review: Things the reviewer flagged as wrong approaches
- Performance guidelines: Query optimization, batching, caching patterns
- Naming conventions: How things should be named, structured, or organized
- Type/schema patterns: How IDs relate, how filters work, data relationships
Focus on comments that represent general, reusable standards — not one-off bug fixes or typo corrections.
For each standard identified, note:
- The convention itself (what to do or not do)
- Why it matters (from the reviewer's explanation)
- A concrete example from the PR (good and/or bad patterns)
Step 4: Read Existing CLAUDE.local.md
Read the project's CLAUDE.local.md to understand what's already documented. The file is at {project_root}/CLAUDE.local.md — find the project root by looking for the nearest directory containing CLAUDE.md or .git.
If CLAUDE.local.md doesn't exist, create it with a header.
Step 5: Compare and Merge
For each identified standard:
- Already documented and complete: Skip it
- Already documented but incomplete: Augment the existing section with new details, examples, or clarifications from the PR
- Not yet documented: Add a new section
When augmenting, add a reference to the PR (e.g., "Guidelines from PR review #3396:") so the origin is traceable.
Step 6: Write Updates
Edit CLAUDE.local.md with the new or augmented standards. Follow the existing file's formatting conventions. Group related standards together logically.
Step 7: Present Summary
After updating, show the user:
- How many new standards were added
- How many existing standards were augmented
- A brief summary of each change
Formatting Guidelines
- Use the same Markdown style as the existing
CLAUDE.local.md - Include code examples (good and bad patterns) when available from the PR
- Keep descriptions concise but complete
- Use headers (
##,###) to organize by topic - Reference the source PR number for traceability
- Use tables when comparing patterns or listing field mappings
Anti-Patterns
Capturing One-Off Fixes as Standards
What it looks like: Adding "fix the typo in line 42" as a coding standard.
Instead: Only capture patterns that would apply to future code — general rules, not specific fixes.
Over-Documenting Obvious Things
What it looks like: "Use proper variable names" or "Write clean code."
Instead: Focus on project-specific conventions that someone new wouldn't intuit from the codebase alone.
Duplicating Without Checking
What it looks like: Adding a standard that's already well-documented in CLAUDE.local.md.
Instead: Always read the existing file first and augment rather than duplicate.
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
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.

