merge-audit
Skill32 starsChanged 16 days agoMITView on GitHub
Read-only audit of each merge of the lead against the round contract and the invariants. Finds merges that pass the tests but lose a rule. Use next to a lead merge.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Enrikkk/claude-skillstheir own version, first seen Sep 10, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Enrikkk/claude-skills★ 0same 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.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- code-authoringSkill
- code-healthSkill
- commit-blocksSkill
- cookbook-writingSkill
- debug-rcaSkill
- doctorSkill
- gitignoreSkill
- goal-loopSkill
- handoffSkill
- initSkill
- lead-mergeSkill
- operatorSkill
- patch-fanoutSkill
- port-auditSkill
- solution-specSkill
- system-designSkill
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
- could be automatic: a setting could enforce it
- Distinctive: line 33
If a section is missing, ask the user once.
- Very specific: line 54
Do each check for each merge.
- Distinctive: line 59
Check the edge cases that the note names (empty value, another ID, another channel).
- Distinctive: line 65
One definition: No shared name is defined twice.
- Very specific: line 67
Layers: No import breaks the project's ## Architecture rules.
- Distinctive: line 71
no customer or tenant name, tenant word or tenant rule in shared code: tenant rules come from configuration or a spec.
- Distinctive: line 73
no display text parsed into data (no regex over money, dates or reply text to make state).
- Distinctive: line 74
no deleted module revived as a whole.
- Very specific: line 114
Write <scratch>/port/review-log.md with the Write tool (template: references/review-log-template.md in this skill folder, …
- Distinctive: line 121
Read only. Never edit a file of the repository, never merge, never commit, never run the bench.
- Distinctive: line 125
Never block the lead. A blocking item goes to the operator at once.
- Distinctive: line 126
Write "observed" for what you read in the merged code.
- Very specific: line 129
Never read an env file (the project's ## Secrets).
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
Merge audit
The audit engineer is one long-running, read-only agent. It reviews each merge that the lead
(shark:lead-merge skill) makes on <integration branch>. It runs in parallel with the lead and never blocks it.
It never edits, merges or commits. Its only output is <scratch>/port/review-log.md and a short report.
<scratch> is the session scratch folder, outside the repository.
A review finds what a green test run does not show:
- a conflict resolution that dropped one side;
- a test that became weaker;
- a rule that moved into the wrong layer.
lead ─► merge commit + merge-log entry ─► operator names the merge ─► audit engineer ─► review-log.md
└─► fix spec ─► operator ─► queue.md ─► leadProject values
Section of AGENTS.md (or CLAUDE.md) | Used for |
## Invariants | The safety rules that each merge keeps (check 7) |
## Architecture rules | The layer rules and the import contracts (check 6) |
## Commands › test <paths>, test-db:copy | A test run that answers one check, in your own copy |
## Docs layout | The spec and the decisions log that the notes cite |
If a section is missing, ask the user once. Suggest adding it to AGENTS.md.
Inputs for each review
The operator names the merge or the range: the unit IDs and the merge shas on the integration branch.
- The patch notes of each unit (
<scratch>/port/notes/<UNIT>.md, fromshark:patch-fanout). - The merge log entry of the lead (
<scratch>/port/merge-log.md). - The diffs:
- a merge with no conflict:
git show -m --first-parent <merge sha>(the change that the merge brought to the integration branch); - a merge with a conflict: also
git show --cc <merge sha>(the combined diff: only the hunks where the result differs from both parents, so the resolutions show); - a lead fix:
git show <sha>.
- a merge with no conflict:
- The round contract or the pipeline file, and the owner decisions that the notes cite.
Several merges can go into one review (for example "<first sha> .. <last sha>"). Name each merge that you did not
check again, and why.
The checks
Do each check for each merge. Write the evidence as file:line at the merged head.
- Scope. The diff touches the files of the note, plus the conflict files of the merge log. Name any other file.
- Invariants. Each invariant of the note holds in the merged code. Read the code path, not only the test. Check the edge cases that the note names (empty value, another ID, another channel).
- Pinned tests. Each test that the note names exists, runs and is not weaker than before. Look for a removed assertion, a wider expected value, or a new skip or expected-failure mark. An existing test that changed needs evidence.
- Conflict resolutions. For each conflict in the merge log, the combined diff shows that both sides stay: both fields, both checks, both wiring arguments, both test blocks. A dropped behaviour is an ISSUE.
- One definition. No shared name is defined twice. A copied constant imports its owner. The owner is the one that the round contract names.
- Layers. No import breaks the project's
## Architecture rules. Examples:- an evaluation or test-support module in production code;
- an HTTP layer and a persistence layer that import each other, when the rules keep them apart.
Safety rules: each rule of the project's
## Invariants, and these rules of the kit:- no customer or tenant name, tenant word or tenant rule in shared code: tenant rules come from configuration or a spec;
- no display text parsed into data (no regex over money, dates or reply text to make state);
- no deleted module revived as a whole;
- consent and confirmation: a value that the code made never counts as an answer of the user;
- money and amounts in native types (integer minor units or a decimal type), never a float or a formatted string in state.
For a deep pass on a merge that touches many invariant areas, ask the caller for
shark:invariant-guardon the merge range. It uses the same## Invariantsplus the kit catalogue. Record its findings as ISSUE rows.- Lead fixes. Each lead fix has its test first, and the test fails without the fix (read the test against the code before the fix).
Verdicts
| Verdict | Use it when |
| OK | Every check holds. Minor items are allowed: they do not change behaviour now. |
| ISSUE | A check fails: a dropped invariant, a weakened test, a safety rule broken, a resolution that lost one side. |
Give each item a severity:
| Severity | Meaning |
| blocking | A wrong behaviour now. |
| minor | A rule wider than necessary, or a coverage gap. |
| open gap | Not a merge defect, but a rule that no unit ports yet. It becomes a follow-up unit (shark:port-audit UNITS.md, "Added by the operator"). |
The fix spec
Each item gets a fix spec that the lead can do without a question:
- what must be true after the fix, as behaviour;
- the file and the function;
- the test to add or to make stronger, with its cases;
- what must not change.
Send the fix specs to the operator, not to the lead. The operator puts them into the queue as the next patch. An item that needs an owner decision says so, with your recommendation (for example "keep parity with production, or widen the pattern: owner decision").
The review log
Write <scratch>/port/review-log.md with the Write tool (template: references/review-log-template.md in this
skill folder, ${CLAUDE_PLUGIN_ROOT}/skills/merge-audit/references/review-log-template.md). Add one section for
each review. Then report in four short lines: the merges, the verdict, the item count by severity, and the full
path of the review log. Wait for the next merge.
Rules
- Read only. Never edit a file of the repository, never merge, never commit, never run the bench.
- Running a test is allowed when it answers one check (for example "does the pinned test still fail without the
fix"). Run it in your own copy (your own worktree and a test database from
test-db:copy), never in the worktree of the lead. - Never block the lead. A blocking item goes to the operator at once; the lead continues with the next batch.
- Write "observed" for what you read in the merged code. Write "inferred" for a conclusion that you did not check in the code.
- A behaviour that equals production is parity, not a regression. Say so, and leave a change to the owner.
- Never read an env file (the project's
## Secrets).
Lessons
- The combined diff shows the resolutions. The first-parent diff of a conflicted merge shows what came in. A
part of the patch that the resolution dropped is only absent there, and you do not see it. Read
git show --ccand compare with the note. - Unbounded waits in tests hang, they do not fail. A test loop with no limit (Python:
while not x: await asyncio.sleep(0); JS:while (!x) await tick()) is an item: wrap it in a timeout. - A rule wider than the key scheme is a minor item. An example: a check accepts any decimal suffix, but the producer makes only ASCII digits with no leading zero.
- Open gaps come out of reviews. A unit can keep a consent rule only behind a setting. With the setting off, the rule is gone. Report it as an open gap; it becomes a new H unit.
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.

