Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

pr-simplify

БесплатноБез исполняемых скриптовНе проверен

Line-reduction simplification pass for an eve PR or branch with fresh eyes. Reduces production LOC by replacing bolted-on complexity with simpler upfront…

vercelот vercel★ 6 166 звёзд на GitHub

Об этом скилле

PR simplify

Look at a PR or branch with fresh eyes and simplify it before merge. PRs that have been iterated on accumulate bolted-on layers, duplicate machinery, dead code paths, and noisy low-value tests. Stepping back to the outcomes the change needs to achieve often reveals a simpler upfront design that removes substantial complexity while preserving every observable behavior.

This is a code line-reduction pass. Every production simplification must produce fewer lines of production code (net-negative production LOC). Do not replace working code with more verbose abstractions, extra wrapper layers, or larger rewrites—if a proposed production change does not shrink production code, reject it.

Read AGENTS.md first—especially its coding principles (KISS, code is liability, lean core, stable APIs / semver) and testing tiers.

Two modes share one rubric:

  • Report-only mode (used by pr-shepherd, or when the user asks for simplification ideas without edits): inspect the diff and codebase, do not edit files, and return prioritized findings.
  • Apply mode (standalone invocation on a PR or branch): run the fresh-eyes analysis, triage findings against the code, apply the accepted simplifications, and verify them.

What to look for

Start by distilling the concrete outcomes, invariants, and contracts the PR is trying to achieve from the PR description, diff, and tests—ignoring the commit-by-commit path that produced the code. Then inspect the diff together with surrounding code and repo callers across four areas:

1. Simpler upfront design (outcome-first)

  • Bolted-on layers, adapters, glue wrappers, or intermediate transforms that only exist because requirements or fixes were layered on one by one.
  • Special-case flags, mode switches, or multi-stage state plumbing that disappear if the data model, state ownership, or control flow is designed directly for the combined outcomes.
  • New layers or hooks added where an existing core mechanism in eve already covers the need.

Ask: knowing all the outcomes this PR needs to deliver, what simpler structure would have been written from scratch in fewer lines?

2. Duplicate machinery and code paths

  • Parallel code paths, near-identical branches, or repeated parsing, normalization, validation, serialization, or wiring logic inside the PR that should converge on one canonical path.
  • New helpers or machinery in the PR that reimplement something the repository already provides—search surrounding modules and shared utilities before keeping a second copy.
  • Split sources of truth where two structures or paths track the same state and can drift apart.

Unify onto one canonical owner only when the paths truly share responsibility and collapsing them shrinks production code. Do not fuse unrelated concerns into a leaky abstraction just because they look syntactically similar.

3. Dead and unreachable code

  • Unreachable branches, impossible fallback paths, or defensive guards whose conditions are already guaranteed upstream.
  • Old code paths, compatibility shims, feature switches, or migration glue superseded by the PR's own changes.
  • Unused parameters, options, fields, types, helpers, or exports—including test-only production seams that no production caller needs.

Verify callers across the entire repository (not only the diff) before marking anything dead.

4. Low-value and unnecessary tests

Agents frequently add tests while working just for the sake of having tests, leaving behind suites that add maintenance cost without catching real bugs. Audit every new or modified test in the PR against the test-audit value bar and junk patterns:

  • Tests that prove nothing beyond their own mocks, restate the implementation line by line, or assert trivial plumbing that fails under any harmless refactor.
  • Redundant tests that replay the same contract across multiple layers or tiers (or repeat parameter matrix rows that hit the same code path) when one owner-boundary test already covers it.
  • Tests that exist only to exercise dead code, deleted duplicate paths, or test-only production exports and seams—delete the test and the seam together.
  • Oversized setup or high-tier (integration/scenario) tests verifying behavior that a single tight unit case or existing table-driven test can cover.

Keep every test that independently protects an observable behavior, public API or protocol contract, security invariant, or credible regression—and delete or consolidate the rest.

Report-only mode

  1. Inspect the target diff:
    • For a pushed PR with no local unpushed edits: gh pr view <n> and gh pr diff <n>.
    • For a local branch, unpushed commits, or uncommitted working-tree edits: git diff "$(git merge-base origin/<base> HEAD)" (typically origin/main) plus any untracked files from git status --short (and `gh pr view
Полный SKILL.md на GitHub

Установить pr-simplify в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл pr-simplify?

Line-reduction simplification pass for an eve PR or branch with fresh eyes. Reduces production LOC by replacing bolted-on complexity with simpler upfront designs, unifying duplicate machinery and code paths, removing dead or unreachable code, and cutting low-value tests written for the sake of testing. Use when asked to simplify a PR or branch, or as the report-only simplification pass inside pr-shepherd.

Как установить скилл pr-simplify?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл pr-simplify запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить pr-simplify с