CommunityCoding & Developmentgithub.com

pr-simplify

Simplify your own change to its smallest complete fix. Use before opening a PR, before pushing large repairs to one, or when asked to shrink a PR or clean up slop.

What is pr-simplify?

pr-simplify is a Claude Code agent skill that simplify your own change to its smallest complete fix. Use before opening a PR, before pushing large repairs to one, or when asked to shrink a PR or clean up slop.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/clawdbot/clawdbot/tree/main/.agents/skills/pr-simplify

Installed? Explore more Coding & Development skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Simplify the change

An editing pass by the change's author: run it on your own branch before you open the PR, and again before you push large repairs. It precedes review and never replaces it. Inherit the task's scope and repair authority; a review-only request gets findings instead of edits. The chosen maintainer workflow owns publication, review and merge.

The diff is a proposal. Passing tests show it works, not that its architecture or every added test is needed.

Rules: the root AGENTS.md sections "Design priorities", "One owner, complete cutover", "Runtime and code safeguards" and "Product and validation", plus the nearest scoped AGENTS.md. Steps 2 and 3 apply every rule to every changed file.

1. Re-derive the smallest complete fix

Read the user's outcome and latest scope, the complete diff against the target merge base, and retained proof. Reuse session context already gathered. Then ask:

Starting from the base, what is the smallest complete fix using the owners already present? Would I still introduce this architecture?

Inspect the largest added modules, state, adapters and test scaffolding first. Read their direct callers and relevant history: apparently redundant behavior may protect a shipped configuration or an earlier regression. Scope is the changed system and the paths it replaces.

Trace every changed hunk to the stated outcome. A hunk that serves another goal leaves this change: drop it or move it to its own PR.

Count the non-mechanical changed lines. Above about 800, or about 500 for complex logic, name the smallest coherent stage that can land first and cut the change to that stage.

Done when you can state the defect, the required invariant, and the smallest complete fix in one sentence each, and every remaining hunk serves that fix.

2. Remove unnecessary architecture

Apply each supported simplification in the diff:

  • One decision owner. Move repeated caller-side policy into the operation that owns the decision. Migrate affected callers and remove the old implementations, exports and repair branches. Different transports can share a decision while keeping their own delivery contracts.
  • Existing state first. Challenge new schemas, managers, caches and combined representations. Reuse an existing owner when its lifetime, authority, atomicity and cleanup fit. Remove a proposed migration only when it is genuinely unnecessary; keep the migration that keeps existing config and state working after update. New state belongs in a field that means it.
  • Delete the redundant path. Remove parallel renderers, duplicated parsers, fake lifecycle operations used only to obtain a result, derived state callers can already obtain, and wrappers that merely forward or rename. Prefer one simpler representation over fallback modes around the old one.
  • Polish last. In every changed hunk, keep only what a maintainer of the surrounding file would write:
    • comments that explain ownership, lifecycle, ordering or constraints;
    • checks and try/catch blocks that match the surrounding module and guard real states;
    • real types instead of laundering casts (as any, as unknown as T, widen-then-assert);
    • variables and helpers that add domain meaning, remove duplication or simplify control flow;
    • shims, aliases, retries and fallbacks backed by a named shipped contract and removal plan;
    • naming, control flow, imports and formatting that match the surrounding file.

Preserve the requested fix and supported behavior, not the proposal's accidental design. Keep real domain differences and justified public compatibility. When history (git log -p -S <symbol>) leaves a path's purpose unclear, keep it and report it. Report new product decisions, breaking contracts, unrelated cleanup and destructive branch replacement as findings for the owner.

3. Keep tests for failures

For each added or changed test group and its setup helpers, name the distinct observable failure it catches.

Keep regressions for the actual defect and distinct boundaries: ordering, cancellation, stale authority, restart, rejection, real errors and affected consumer differences. Keep static contract guards that independently protect a real boundary. Remove duplicate same-path cases, mock echoes, incidental field-copy or wording assertions, assertions on statically defined values, tests that only prove removed logic is gone, tests of obsolete implementations, and scaffolding or test-only production hooks. Consolidate useful cases in an existing owner suite.

Removing tests never weakens the assertions, coverage of real boundaries or baselines that remain.

Done when every remaining test group has a named failure.

4. Prove the smaller change and hand it on

Batch the edits, then rerun the reproduction and focused checks for the changed contracts and affected consumers. Reuse proof whose inputs are unchanged. A preserved restart, upgrade or transport claim needs applicable proof. The existing workflow selects broader checks.

Done when the complete diff is inspected, every rule has a verdict for each changed file, supported simplifications are applied, superseded paths are unreachable and affected behavior still has proof. No change is a valid result when the existing shape is justified. Aim for net-negative code, not a deletion quota.

Report in the PR body or existing task evidence: the responsibility or machinery that disappeared, the behavior still protected, and production/test deltas against the merge base. Label a reduction against an earlier revision separately from the whole-change delta. Name any necessary remaining growth or unresolved decision.

Then open or update the PR. After later repairs, simplify only the new changes and the owners they touch before pushing them.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

acp-router

Route plain-language requests for Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Grok Build, Qwen, Kiro, Kimi, iFlow, Factory Droid, Kilocode, or explicit ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). For coding-agent thread requests, read this skill first, then use only `sessions_spawn` for thread creation. Codex chat binding defaults to the native Codex app-server plugin unless ACP is explicit or background spawn needs ACP.

add-model-provider

Add and live-prove a model provider with non-interactive config one-liners, without exposing credentials.

agent-transcript

Requested GitHub PR/issue agent transcripts: redact, trim, preview, and insert safely.

apple-notes

Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.

apple-reminders

List, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.

auto-qa

Run OpenClaw-wide autonomous QA and live/stress campaigns across independent subsystem lanes, with verified fixes and a resumable evidence report.

autoreview

Structured code review through the shared OpenClaw agent-skills installation.

bear-notes

Create, search, and manage Bear notes via grizzly CLI.

blacksmith-testbox

Run Blacksmith Testbox for CI-parity checks, secrets, hosted services, migrations, or builds local cannot reproduce.

block-kit

Use proactively for structured or interactive Slack replies, and when asked to author or validate native Slack Block Kit JSON.

blogwatcher

Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.

blucli

BluOS CLI (blu) for discovery, playback, grouping, and volume.

bluebubbles

Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.

browser-automation

Use when controlling web pages with the OpenClaw browser tool, especially multi-step flows, login checks, tab management, or recovery from stale refs/timeouts.

camsnap

Capture frames or clips from RTSP/ONVIF cameras and local webcams, including USB pan/tilt/zoom control.

canvas

Present HTML on connected OpenClaw node canvases, navigate/eval/snapshot, and debug canvas host URLs.

channel-message-flows

Use when running QA Lab channel message flow evidence.

clawdtributor

Clawtributor PRs here, last week or another window: discover conversation refs, recheck GitHub, rank by impact.

clawhub

Search ClawHub for plugins by default, or skills when explicitly requested; install, verify, update, uninstall, publish, or sync skills.

Related Skills