agentleFS
bladerblader/razor/SKILL.md

razor

Skill17 starsChanged 9 months agoMITView on GitHub

Minimize local diff size against merge base for uncommitted branch work using only behavior-preserving, scope-preserving architectural reductions.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. AmosChenZixuan/Agentic-working-contract★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 9 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always anchor to merge base: MB=$(git merge-base <base-ref> HEAD) (origin/latest by default).

    line 16
  2. Very specific:

    Use unified working-tree diff only: git diff "$MB".

    line 17
  3. Distinctive:

    Only propose/apply behavior-preserving, scope-preserving reductions.

    line 19
  4. Distinctive:

    Never generate functionality-loss or scope-reduction options.

    line 20
  5. Distinctive:

    Do not remove/trim comments or doc-comments.

    line 21
  6. Distinctive:

    Prefer ideas that remove whole cross-file patterns or flows, not local line edits.

    line 27
  7. Distinctive:

    Treat file-local cleanups as fallback only after high-impact PR-wide ideas are exhausted.

    line 28
  8. Distinctive:

    Read every line of every file in the diff on every iteration.

    line 29
  9. Very specific:

    Update TRIM_CODEX.MD every iteration before execution, then refresh after re-measurement.

    line 30
  10. Distinctive:

    Run formatting on touched files and run targeted validation each pass.

    line 31
  11. Distinctive:

    Never use destructive git commands.

    line 32
  12. Very specific:

    Write/update TRIM_CODEX.MD with:

    line 49
  13. Distinctive:

    Before stats and after stats (insertions, deletions, churn).

    line 67

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Razor

Reduce local diff size with merge-base-anchored architectural planning and behavior-preserving execution only.

Core Iteration Directive

On every iteration, follow this exact directive:

"Deeply analyze this implementation across the entire PR (not file-by-file in isolation), and create a detailed plan called TRIM_CODEX.MD with the most impactful architectural ideas to dramatically reduce the total size of this PR, without reducing scope or behavior. Comments do not count."

Non-negotiables

  • Always anchor to merge base: MB=$(git merge-base <base-ref> HEAD) (origin/latest by default).
  • Use unified working-tree diff only: git diff "$MB".
  • Include untracked code-file lines in insertion totals.
  • Only propose/apply behavior-preserving, scope-preserving reductions.
  • Never generate functionality-loss or scope-reduction options.
  • Do not remove/trim comments or doc-comments. Comment lines do not count toward reduction targets.
  • Keep optimization priority:
    1. Primary: reduce non-comment insertions.
    2. Secondary: reduce non-comment total churn.
  • Optimize at PR architecture level first:
    1. Identify duplication and redundant abstractions spanning multiple files/components.
    2. Prefer ideas that remove whole cross-file patterns or flows, not local line edits.
    3. Treat file-local cleanups as fallback only after high-impact PR-wide ideas are exhausted.
  • Read every line of every file in the diff on every iteration.
  • Update TRIM_CODEX.MD every iteration before execution, then refresh after re-measurement.
  • Run formatting on touched files and run targeted validation each pass.
  • Never use destructive git commands.

Workflow

  1. Establish base and merge base.
  2. Measure unified diff (status, numstat, name-status, untracked files, untracked code lines).
  3. Compute baseline metrics:
    • insertions
    • deletions
    • total churn
    • comment-line additions (reported separately, not targeted)
  4. Full-diff read (mandatory):
    • For each file in git diff --name-status "$MB", read full current file contents.
    • For modified files, also review git diff "$MB" -- <file> hunks.
  5. Deep architectural analysis:
    • Identify structural duplication and avoidable abstraction layers across the full PR surface.
    • Map cross-file data/control flow to find consolidation cuts that remove entire repeated paths.
    • Rank ideas by expected PR-wide churn reduction; prioritize multi-file high-leverage cuts.
  6. Write/update TRIM_CODEX.MD with:
    • Goal and invariants.
    • Merge-base baseline and divergence.
    • Runtime/test hotspot ranking.
    • Architectural diagnosis of churn drivers.
    • Ranked behavior-preserving architectural ideas with explicit PR-wide scope (estimated insertion/churn savings, risk, validation notes).
    • Clear separation of PR-wide architectural cuts vs local cleanup (local cleanup only when no higher-impact architectural cuts remain).
    • Ordered execution sequence and validation gates.
    • Iteration history.
  7. Apply viable behavior-preserving ideas.
  8. Format touched files.
  9. Run targeted validation.
  10. Re-measure and refresh TRIM_CODEX.MD with before/after metrics and applied/skipped status.
  11. Rerun fresh planning on the updated tree.

Output contract

Always return:

  1. Base ref and merge-base SHA.
  2. Before stats and after stats (insertions, deletions, churn).
  3. Primary and secondary percent reductions.
  4. Comment-line additions count (reported separately).
  5. Ranked behavior-preserving ideas and applied changes.
  6. Confirmation TRIM_CODEX.MD was refreshed this iteration.
  7. Confirmation every diff file was fully read this iteration.
  8. Explicit statement whether any additional behavior-preserving, scope-preserving reductions remain after fresh rerun.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.