Measure pull request size from git numstat or a diff, skipping lock and generated files, and plan how to split big changes into reviewable slices. Use when the user asks if a PR is too big, wants a size check, or asks to split a PR.
97%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
python3 scripts/pr_size.py (--numstat FILE | --diff FILE) [--warn N] [--fail N] [--limit N] [--depth N] [--suggest] [--ignore PATTERN]...FILE may be - for standard input. Exactly one of --numstat or --diff is required.
status: warn (512 lines counted, 2000 ignored)
slice 1: src (480 lines, oversized)
slice 2: docs, tests (190 lines)With --suggest, one slice N: line per slice follows the status line: the grouped directories, their
total lines, and oversized when a single group exceeds --limit. Root-level files are grouped as ..
<added>\t<deleted>\t<path> per line; -\t-\t<path> marks a binary file. A malformed line
(not three tab-separated fields, non-integer or negative counts) stops with exit 2 and names the line number.+ and - lines inside hunks are counted; +++/--- headers and
\ No newline at end of file are not. The path comes from +++ b/<path> (or --- a/<path> for deletions).--warn and --fail must be non-negative and --warn must be lower than --fail.--limit and --depth must be positive.--depth N groups by the first N directory segments of each path (src/api/users.py is src at depth 1, src/api at depth 2).Groups are sorted by lines (largest first), then name, and packed first-fit under --limit. A group
larger than the limit becomes its own oversized slice. Slices are listed with oversized ones first.
Binary files contribute 0 lines and can add a zero-line group for their directory.
Directory grouping does not know about code dependencies. A suggested slice is a size-based starting point; check that each part builds and passes tests on its own before opening it as a PR.