From clean-pr
This skill should be used when the user asks to "clean up a PR", "check PR quality", "review PR for unnecessary changes", "simplify a pull request", "make PR easier to review", "reduce PR noise", "minimize diff", "remove debug statements from my PR", "prepare PR for review", "my PR is too big", or discusses PR hygiene, clean diffs, PR size, or making PRs easier for humans to review.
npx claudepluginhub nstrayer/clean-pr --plugin clean-prThis skill uses the workspace's default tool permissions.
PR cleanliness is about ensuring every change in a pull request serves the PR's stated purpose. A clean PR contains only the changes necessary to accomplish its goal -- nothing more, nothing less. This skill provides the knowledge base for analyzing and cleaning PRs.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
PR cleanliness is about ensuring every change in a pull request serves the PR's stated purpose. A clean PR contains only the changes necessary to accomplish its goal -- nothing more, nothing less. This skill provides the knowledge base for analyzing and cleaning PRs.
Noisy PRs cause review fatigue, hide bugs, and slow teams down -- clean PRs get reviewed faster and merge sooner.
Changes serving multiple unrelated purposes bundled in one PR. A bug fix mixed with a refactor. A new feature mixed with dependency updates. Each distinct purpose should be its own PR.
Detection signals:
Code added during development that should not ship (e.g., console.log, debugger, print(), TODO/FIXME comments, commented-out code blocks). See references/anti-patterns.md for the full catalog with language-specific regex patterns.
Changes that alter appearance without changing behavior -- whitespace-only changes, import reordering, blank line additions in untouched code. These inflate the diff and obscure real changes. See references/anti-patterns.md for detection approaches.
Changes that go beyond the PR's purpose, even if individually reasonable -- renames in untouched files, type annotations added to existing code, drive-by refactors. These should be separate PRs. See references/anti-patterns.md for detection signals.
PRs that are too large to review effectively. General thresholds: >400 lines changed or >15 files modified warrants attention. >800 lines or >30 files strongly suggests splitting. See references/anti-patterns.md for size guidelines and contextual adjustments.
New code that overlaps with or diverges from the existing codebase. These issues can only be detected by comparing new code against what already exists in the project.
These findings require human judgment -- they are never auto-fixable and are never Error severity.
To analyze a PR for cleanliness issues:
git diff origin/<base>...HEADUse references/severity-matrix.md as the canonical severity policy. Do not redefine severity mappings in commands or agent prompts.
To determine the base branch for comparison:
gh pr view --json baseRefName. Fall back to common defaults: main, master, develop.git fetch origin <base> 2>/dev/null and use origin/<base> for all subsequent diff/log commands. This ensures the comparison matches what GitHub sees, even when the local <base> branch is stale. If the argument already starts with origin/, use it as-is without redundant fetch.origin/<base> does not exist), fall back to the local <base> ref and warn: "Could not fetch remote ref -- comparing against local <base> which may be stale."git merge-base to find the actual divergence pointFor a comprehensive catalog of anti-patterns with language-specific examples and detection regex patterns, consult:
references/anti-patterns.md -- Detailed anti-pattern catalog with regex patterns for detection, organized by language and categoryreferences/severity-matrix.md -- Canonical severity mapping used by all PR cleanliness commands and agentsagents/codebase-analyzer.md -- Cross-codebase analysis agent for detecting duplicates, reimplemented utilities, and pattern divergence