skills/distilling-prs/SKILL.md
Use when reviewing PRs to triage, categorize, or summarize changes requiring human attention. Triggers: 'summarize this PR', 'what changed in PR #X', 'triage PR', 'which files need review', 'PR overview', 'categorize changes', or pasting a PR URL. NOT for: deep code analysis (use advanced-code-review) or quick review (use code-review).
npx skillsauth add axiomantic/spellbook distilling-prsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
<ROLE>PR Review Analyst. Your reputation depends on accurately identifying which changes need human review and which are safe to skip.</ROLE>
| Tool | Purpose |
|------|---------|
| pr_fetch | Fetch PR metadata and diff from GitHub |
| pr_diff | Parse unified diff into FileDiff objects |
| pr_files | Extract file list from pr_fetch result |
| pr_match_patterns | Match heuristic patterns against file diffs |
| pr_bless_pattern | Bless a pattern for elevated precedence |
| pr_list_patterns | List all available patterns (builtin and blessed) |
Three-phase model: heuristics → AI analysis → report.
<analysis> When invoked with `/distilling-prs <pr>`: 1. Parse PR identifier (number or URL) 2. Run Phase 1: Fetch, parse, heuristic match 3. If unmatched files remain, use AI to analyze remaining changes 4. Run Phase 3: Generate report categorizing all changes 5. Present report to user </analysis>pr_data = pr_fetch("<pr-identifier>") # Fetch PR data
diff_result = pr_diff(pr_data["diff"]) # Parse the diff
match_result = pr_match_patterns(
files=diff_result["files"],
project_root="/path/to/project"
)
Produces:
match_result["matched"]: Files with pattern matches (categorized)match_result["unmatched"]: Files requiring AI analysisOn MCP tool failure: If pr_fetch or pr_match_patterns fails, halt and surface the error to the user. Do not proceed with partial data.
For unmatched files, analyze each to determine:
Produce a markdown report with:
# Analyze PR by number (uses current repo context)
pr_data = pr_fetch("123")
# Analyze PR by URL
pr_data = pr_fetch("https://github.com/owner/repo/pull/123")
# Parse and match
diff_result = pr_diff(pr_data["diff"])
match_result = pr_match_patterns(
files=diff_result["files"],
project_root="/Users/alice/project"
)
# Bless a discovered pattern
pr_bless_pattern("/Users/alice/project", "query-count-json")
# List all patterns
patterns = pr_list_patterns("/Users/alice/project")
Config file: ~/.local/spellbook/docs/<project-encoded>/distilling-prs-config.json
{
"blessed_patterns": ["query-count-json", "import-cleanup"],
"always_review_paths": ["**/migrations/**", "**/permissions.py"],
"query_count_thresholds": {
"relative_percent": 20,
"absolute_delta": 10
}
}
15 builtin patterns across three confidence levels. Use pr_list_patterns() to see all with IDs and descriptions.
Always Review (5): migration files, permission changes, model changes, signal handlers, endpoint changes
High Confidence (5): settings changes, query count JSON, debug print statements, import cleanup, gitignore updates
Medium Confidence (5): backfill commands, decorator removals, factory setup, test renames, test assertion updates
<FORBIDDEN> - Marking changes as "safe to skip" without pattern match or AI justification - Skipping Phase 1 heuristics and going straight to AI analysis - Collapsing "review required" changes to save space - Blessing patterns automatically without user confirmation </FORBIDDEN><FINAL_EMPHASIS> Heuristics before AI, always. A mis-categorized "safe to skip" sends a reviewer past a breaking change. Surface uncertainty rather than hide it. </FINAL_EMPHASIS>
testing
Use when creating new skills, editing existing skills, or verifying skills work before deployment. Triggers: 'write a skill', 'new skill', 'create a skill', 'skill doesn't work', 'skill isn't firing', 'edit skill', 'skill quality'. NOT for: general prompt improvement (use instruction-engineering) or command creation (use writing-commands).
development
Use when you have a spec, design doc, or requirements and need a detailed implementation plan before coding. Triggers: 'write a plan', 'create implementation plan', 'plan this out', 'break this down into steps', 'convert design to tasks', 'implementation order'. Also invoked by develop during planning. NOT for: reviewing existing plans (use reviewing-impl-plans).
testing
Use when creating new commands, editing existing commands, or reviewing command quality. Triggers: 'write command', 'new command', 'create a command', 'review command', 'fix command', 'command doesn't work', 'add a slash command'. NOT for: skill creation (use writing-skills).
development
Use when about to claim discovery during debugging. Triggers: "I found", "this is the issue", "I think I see", "looks like the problem", "that's why", "the bug is", "root cause", "culprit", "smoking gun", "aha", "got it", "here's what's happening", "the reason is", "causing the", "explains why", "mystery solved", "figured it out", "the fix is", "should fix", "this will fix". Also invoked by debugging, scientific-debugging, systematic-debugging before any root cause claim.