review-ready-code
Skill0 starsChanged 6 months agoMITView on GitHub
Turn a finished, tested implementation into a human-reviewable Git commit stack without changing the final code. Use when the user says a completed change is ready for review, asks to make a branch or diff review-ready, wants a large agent-generated diff split into small conceptual changes, or needs a review sequence that follows Google's Small CL guidance.
In this repository13 other files it gives its agents.
- change-consistencySkill
- engineer-agentic-aiSkill
- format-markdownSkill
- information-representation-designSkill
- living-artifactsSkill
- messaging-frameworkSkill
- python-testingSkill
- relevance-first-information-designSkill
- reviewable-branch-diffsSkill
- securitySkill
- software-designSkill
- swe-methodSkill
- thoughts-to-artifactSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
25 rules. About 0 are common, 22 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈22
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Do not rely only on remembered summaries of the article.
- Distinctive: line 31
After rebuilding the review stack, both checks must succeed:
- Distinctive: line 42
Before reorganizing the change:
- Very specific: line 47
Run the implementation's required validation before capturing SOURCE_HEAD.
- Distinctive: line 59
Use one linear review branch rather than a chain of dependent review branches.
- Very specific: line 66
If the source branch contains /, preserve the source branch name in the Git branch and replace path separators with - only where required …
- Distinctive: line 68
Create the review branch from the intended review base, not from the finished implementation HEAD.
- Distinctive: line 70
If the review branch already exists, do not overwrite it blindly.
- Distinctive: line 83
Prefer conceptual boundaries over file boundaries or arbitrary line counts.
- Distinctive: line 87
Keep code together when separating it would make the reviewer hold missing context in their head.
- Distinctive: line 96
Prefer separate review units for:
- Distinctive: line 105
Do not create one commit per file merely because files are easy to stage.
- Distinctive: line 130
Commit the unit with a conceptual message.
- Distinctive: line 131
When practical, validate the repository at that intermediate commit.
- Distinctive: line 134
Do not opportunistically fix, clean up, rename, reformat, or refactor code while building the review stack.
- Distinctive: line 138
Before handing the stack to the user:
- Distinctive: line 140
Verify every original changed path and hunk is represented exactly once across the stack.
- Very specific: line 141
Verify the review HEAD tree equals SOURCE_TREE.
- Distinctive: line 144
Run applicable repository validation on review HEAD.
- Distinctive: line 145
Stop and repair the stack if any identity check fails.
- Distinctive: line 147
Do not claim the stack is review-ready when the final tree differs, even if tests pass.
- Distinctive: line 153
commit SHA and subject;
- Distinctive: line 161
Treat the implementation branch as canonical and the review-ready history as regenerable.
- Distinctive: line 163
When feedback requires a code change:
- Distinctive: line 171
Do not maintain correctness by manually rebasing a chain of dependent review branches after every feedback change.
≈ “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.
Files
Review-Ready Code
Transform a completed implementation into a review representation that is easier for a human to understand. The implementation branch remains the source of truth; the review-ready branch is a disposable projection of the same final tree with a deliberately structured commit history.
Source Method
At every invocation, fetch and read Google's current Small CLs guidance before choosing commit boundaries:
Do not rely only on remembered summaries of the article. If the source cannot be fetched, report that limitation before reorganizing the history.
Use the article as the method for deciding what constitutes a reviewable change. In particular, prefer one self-contained conceptual change, keep related tests with the behavior they verify, separate meaningful refactors from behavior changes, and choose horizontal or vertical splits according to which makes each change independently understandable.
Invariant
This workflow changes history and presentation only, never the completed implementation.
Capture the finished implementation by immutable commit ID before doing anything else:
SOURCE_HEAD="$(git rev-parse HEAD)"
SOURCE_TREE="$(git rev-parse "${SOURCE_HEAD}^{tree}")"After rebuilding the review stack, both checks must succeed:
test "$(git rev-parse HEAD^{tree})" = "$SOURCE_TREE"
git diff --exit-code "$SOURCE_HEAD" HEAD --Tree identity is the acceptance criterion. Passing tests is not a substitute for tree identity.
Preconditions
Before reorganizing the change:
- Identify the intended PR/review base branch from repository context; do not assume
mainormaster. - Fetch current remote refs according to the repository's Git workflow.
- Require the finished implementation to be committed and the source worktree to be clean. Do not hide uncommitted work inside the review transformation.
- Run the implementation's required validation before capturing
SOURCE_HEAD. - Record:
- source branch name;
SOURCE_HEAD;SOURCE_TREE;- review base commit;
- the cumulative diff from review base to
SOURCE_HEAD.
The source branch must remain intact while the review representation is prepared.
Review Branch And Worktree
Use one linear review branch rather than a chain of dependent review branches.
Naming:
- review branch:
<source-branch>--review-ready - review worktree: a sibling directory ending in
--review-ready
If the source branch contains /, preserve the source branch name in the Git branch and replace path separators with - only where required for the filesystem worktree path.
Create the review branch from the intended review base, not from the finished implementation HEAD. Use a separate worktree so the implementation branch remains untouched.
If the review branch already exists, do not overwrite it blindly. Capture its tip for comparison or create a fresh regeneration branch, then replace the old projection only after validation.
Decompose The Finished Diff
Analyze the whole finished diff before making the first review commit. Build a coverage map so every changed hunk belongs to exactly one planned review unit.
A review unit should answer one coherent question such as:
- What externally visible behavior is being introduced?
- What domain rule or data-model capability is required?
- What adapter/integration change enables that behavior?
- What refactor is necessary independently of the behavior change?
Prefer conceptual boundaries over file boundaries or arbitrary line counts.
Keep Together
Keep code together when separating it would make the reviewer hold missing context in their head. Typical examples:
- a behavior change and the focused tests that demonstrate it;
- an API and at least one usage that makes its purpose understandable;
- a BDD scenario, the relevant step definition, and the production path needed for that scenario when they form one coherent vertical behavior;
- a schema/model addition and the minimal consumer needed to make its role clear.
Split Apart
Prefer separate review units for:
- unrelated behaviors;
- meaningful refactors versus feature/bug-fix behavior;
- independent test-framework or test-infrastructure work;
- generated/mechanical changes whose review task differs from handwritten logic;
- distinct vertical sub-features;
- architectural layers only when each horizontal slice remains independently understandable and valid.
Do not create one commit per file merely because files are easy to stage.
Order For Human Comprehension
Order review units so each commit can be understood using only:
- the existing codebase;
- the commit description;
- commits already reviewed earlier in the stack.
Minimize forward references to concepts that only appear in later commits.
When several valid orders exist, prefer the order that minimizes how much unresolved context the reviewer must retain. Tests may come before, with, or after supporting code only when that ordering improves comprehension and the commit remains self-contained; related tests normally belong in the same conceptual change.
Each commit message should state the conceptual change, not the staging mechanism.
Construct The Stack
Rebuild the review branch from the review base using only content already present in SOURCE_HEAD.
For every planned review unit:
- Materialize/stage only the hunks belonging to that unit.
- Inspect the staged diff before committing.
- Confirm no hunk assigned to another unit has leaked into the staged change.
- Commit the unit with a conceptual message.
- When practical, validate the repository at that intermediate commit. Adjust boundaries if an intermediate commit would leave the project invalid.
- Continue until the coverage map has no unassigned hunks.
Do not opportunistically fix, clean up, rename, reformat, or refactor code while building the review stack. Any desired code change belongs on the source implementation branch first.
Completeness And Identity Checks
Before handing the stack to the user:
- Verify every original changed path and hunk is represented exactly once across the stack.
- Verify the review HEAD tree equals
SOURCE_TREE. - Verify
git diff --exit-code "$SOURCE_HEAD" HEAD --succeeds. - Compare the cumulative review-base-to-HEAD diff with the original review-base-to-
SOURCE_HEADdiff when useful for diagnosis. - Run applicable repository validation on review HEAD.
- Stop and repair the stack if any identity check fails.
Do not claim the stack is review-ready when the final tree differs, even if tests pass.
Human Handoff
Present the commits in review order. For each commit, give only:
- commit SHA and subject;
- the conceptual question the commit answers;
- the main entry point or changed behavior to inspect first.
The human should be able to review commit 1, mark that concept understood, then move to commit 2 without scanning the entire finished diff at once.
Handling Review Feedback
Treat the implementation branch as canonical and the review-ready history as regenerable.
When feedback requires a code change:
- Apply the requested change to the source implementation branch, not only to the review projection.
- Re-run implementation validation and capture the new source HEAD/tree.
- Regenerate the review-ready stack from the same review base.
- Compare the previous and regenerated stacks with
git range-diffwhen useful so the reviewer can see which conceptual units actually changed. - Re-run the final tree-identity checks.
Do not maintain correctness by manually rebasing a chain of dependent review branches after every feedback change. Regeneration from the canonical finished state is the default because it keeps the end-state invariant mechanically checkable.
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
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.

