merge-gate
Skill1 starsChanged 5 months agoMITView on GitHub
Pre-flight production merge gatekeeper for pull requests and branches. Performs full-project context comparison against main, whole-diff AST blast-radius auditing, frontend UI and taste checks, backend security and protocol parity, tri-state merge verdicts, and automated humanized PR review comments. Trigger automatically whenever the user provides a PR number (PR #N or PR URL), branch name, or asks for a pre-flight merge check, PR review, merge gate, merge verdict, or pre-merge audit against main.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- coder-xieshijie/dev-skillstheir own version, first seen Oct 17, 2026
- emanueledenaro/claude-skillstheir own version, first seen Oct 15, 2026
- BlackAngel242/skill-markettheir own version, first seen Oct 15, 2026
- hmislk/hmistheir own version, first seen Oct 8, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- hmislk/hmis★ 244same name
- coder-xieshijie/dev-skills★ 5same name
- BlackAngel242/skill-market★ 0same name
- emanueledenaro/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 repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agy-skill-installerSkill
- apex-bug-hunterSkill
- arsSkill
- browser-triageSkill
- claude-md-initSkill
- delink-githubSkill
- gemini-skill-packagerSkill
- gh-readySkill
- indian-legal-verificationSkill
- local-systematic-verification-ocrSkill
- magento-team-leadSkill
- motioncraftSkill
- pdf-vector-engineSkill
- presscraftSkill
- score2mdSkill
- skill-shipSkill
- wpcraftSkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 5 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Before inspecting any diff hunk or emitting any evaluation, engage all four cognitive locks:
- Distinctive: line 33
Never evaluate a pull request as an isolated patch.
- Very specific: line 38
Never emit placeholder comments (// ...
- Very specific: line 43
Verify protected zero-touch paths using cryptographic MD5 and SHA-256 hashes against origin/main.
- Very specific: line 64
Run node scripts/preflight-merge-gate.js and node scripts/validate-skill-md5.js.
- Distinctive: line 70
When commanded to "Fix it" or "Execute fixes", apply approved surgical fixes adhering strictly to Karpathy's 4 laws.
- Distinctive: line 72
Commit fixes in granular GPG-signed commits (git commit -S) with zero AI attribution trailers.
- Very specific: line 73
If Verdict 1 is reached, merge the PR via gh pr merge <PR_NUMBER> --squash only after final user confirmation.
- Very specific: line 92
Frontend UI & Taste Gate: Verify responsive collapse down to 320px viewport, complete interactive states (loading, empty, error, disabled, …
- Very specific: line 93
Backend & Protocol Parity Gate: Verify Model Context Protocol (MCP) per-return outputSchema vs structuredContent parity across 100% of …
- Distinctive: line 164
When commanded to execute fixes and merge:
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Merge Gate
A deterministic, full-stack pre-flight production merge gatekeeper. It unifies full-project context comparison against main, CodeRabbit and Qodo PR-Agent AST call-graph blast-radius traversal, Obra Superpowers systematic debugging (systematic-debugging, defense-in-depth, condition-based-waiting, verification-before-completion), tasteskill.dev frontend UI and anti-slop rules, Karpathy's 4 Surgical Coding Laws, and Wikipedia's 33 humanizer anti-AI-writing principles.
When to Use
- Auditing a Pull Request (
PR #Nor PR URL) before merging intomainorproduction - Comparing a feature, fix, or release branch against
origin/main - Performing a pre-flight merge gatekeeper check on uncommitted working-tree changes
- Evaluating whether a PR completely resolves its target objective without collateral regressions
- Drafting and publishing an authentic human-voice GitHub PR review comment
- Generating an authoritative Tri-State Merge Verdict (
APPROVED,NEEDS IMPROVEMENT, orHALT - DO NOT MERGE)
1. Cognitive Locks Against Epistemic Reward-Hacking and Premature Merges
Before inspecting any diff hunk or emitting any evaluation, engage all four cognitive locks:
1.1 Strict Prohibition of AI Sycophancy
- Ban all performative praise, conversational filler, and premature approval ("Great PR!", "Looks good to me!", "Code looks solid!").
- State technical findings, contract mismatches, responsive defects, and verification proofs plainly with exact
file:linecitations.
1.2 Whole-Project Context Over Flat Diffs
- Never evaluate a pull request as an isolated patch.
- Reconstruct full project context on
mainfirst: readAGENTS.md,CLAUDE.md,INVARIANTS.md,HALL_OF_SHAME.md, contract schemas, database models, and critical path callers. - Compare what
mainexpects against what the branch delivers.
1.3 Anti-Short-Circuiting and Zero Placeholder Code
- Never emit placeholder comments (
// ... existing code,/* rest of implementation */,// TODO). - Inspect 100% of changed files, routes, and components without skipping or early bailing.
- Record an explicit inspection receipt for every audited file before proceeding to the next.
1.4 Cryptographic Verification Over Assertion
- Verify protected zero-touch paths using cryptographic MD5 and SHA-256 hashes against
origin/main. - Any modification to protected paths (such as OAuth 2.1 routes or token authorities) triggers an immediate merge halt.
2. Universal Scope Resolution and Two-Stage Gate
Resolve the operational scope before executing inspection passes. Run node scripts/preflight-merge-gate.js to gather deterministic telemetry.
2.1 Three-Lane Scope Resolution
| Mode | Trigger Condition | Inspection Scope |
| Pull Request Mode | User provides PR #N or a PR URL | Fetch git diff origin/main...HEAD, PR commits, issue threads, and all upstream callers and downstream callees in the AST symbol graph |
| Branch Comparison Mode | User specifies a branch name | Audit git diff origin/main...<branch> plus all transitive call-graph dependencies |
| Working-Tree Preflight Mode | User requests pre-merge check on current work | Audit git diff origin/main...HEAD plus uncommitted staged and working-tree changes (git diff HEAD and git status --porcelain) |
2.2 Two-Stage Execution Gate
Operate in a strict two-stage gate unless the user explicitly commands immediate code mutation:
- Stage 1: Deep Audit, Tri-State Verdict, and PR Comment (Default):
- Execute the 4-Stage Pre-Flight Merge Pipeline across the resolved scope.
- Run
node scripts/preflight-merge-gate.jsandnode scripts/validate-skill-md5.js. - Determine the authoritative Tri-State Merge Verdict (
APPROVED,NEEDS IMPROVEMENT, orHALT). - Draft the humanized review comment, verify it with
node scripts/preflight-merge-gate.js --verify-comment <draft-file>, and post it to the GitHub PR thread (gh pr comment <PR_NUMBER> --body-file <file>). - HALT and wait for the user's explicit confirmation before merging or editing code.
- Stage 2: Surgical Auto-Remediation and Verified Merge (Triggered on User Command):
- When commanded to "Fix it" or "Execute fixes", apply approved surgical fixes adhering strictly to Karpathy's 4 laws.
- Execute cold verification suites (
npm test,npm run build,npm run validate:skills). - Commit fixes in granular GPG-signed commits (
git commit -S) with zero AI attribution trailers. - If Verdict 1 is reached, merge the PR via
gh pr merge <PR_NUMBER> --squashonly after final user confirmation.
3. The 4-Stage Pre-Flight Merge Pipeline
Execute all four stages in sequence. Never skip stages even if an early blocker is discovered.
Stage 1: Full-Project Context Reconstruction on main
- Understand the PR's stated objective from the title, PR description, linked issue, and commit history.
- Inspect
mainto identify existing domain models, schemas, and historical invariants. - Determine whether the PR genuinely and completely solves the stated objective at runtime or introduces incomplete half-fixes.
- Consult
references/whole-project-main-diff-engine.mdfor whole-project traversal rules.
Stage 2: Whole-Diff AST & Security Blast-Radius Traversal
- Differential line-deletion (
-) audit: verify deleted gates, schemas,.refine()constraints, or tenant predicates (owner_id,tenant_id). - Bidirectional call-graph blast radius: traverse all upstream callers (fan-in) and downstream callees (fan-out) affected by modified symbols.
- Cryptographic zero-touch lock: verify MD5 and SHA-256 hashes of protected paths match
origin/mainbyte-for-byte. - Consult
references/whole-project-main-diff-engine.mdandreferences/backend-security-and-mcp-gate.md.
Stage 3: Full-Stack Regression and Quality Gates
- Frontend UI & Taste Gate: Verify responsive collapse down to 320px viewport, complete interactive states (
loading,empty,error,disabled,focus-visible), native dialog bans (alert,confirm,prompt),dangerouslySetInnerHTMLban, WCAG AA contrast (4.5:1), reduced-motion guards, and tasteskill.dev anti-slop rules. Consultreferences/frontend-ui-and-taste-gate.md. - Backend & Protocol Parity Gate: Verify Model Context Protocol (MCP) per-return
outputSchemavsstructuredContentparity across 100% of branches, composite tenant isolation on database queries, atomic idempotency concurrency, zero unwired dead helpers, and zero test suppressions (.skip,.only,.todo). Consultreferences/backend-security-and-mcp-gate.md.
Stage 4: Tri-State Verdict Determination & Humanized Review Publication
- Classify the PR into exactly one of three verdicts:
APPROVED FOR MERGE (SAFE TO MERGE INTO MAIN)PARTIAL / NEEDS IMPROVEMENT BEFORE MERGEHALT - DO NOT MERGE (BLOCKING DEFECTS FOUND)
- Draft the review comment using Wikipedia's 33 humanizer principles (zero em/en-dashes, zero AI jargon, authentic veteran staff engineer voice).
- Run
node scripts/preflight-merge-gate.js --verify-comment <draft-file>. - Post the review comment directly to the GitHub PR thread (
gh pr comment <PR_NUMBER> --body-file <draft-file>). - Consult
references/tri-state-verdict-and-humanizer-pr-comment.md.
4. The Tri-State Pre-Merge Verdict Matrix
| Verdict | Qualifying Criteria | Required Gatekeeper Action |
| VERDICT 1: APPROVED FOR MERGE | PR solves objective completely, introduces zero UI/security/protocol defects, passes cold builds and test suites, passes MD5/SHA-256 protected-path checks | Post humanized approval report to GitHub PR comment thread, HALT, and wait for user final merge command |
| VERDICT 2: PARTIAL / NEEDS IMPROVEMENT | Zero fatal crashes or security holes, but has incomplete edge-case handling, missing empty/loading states, architectural coupling, or code smells | Post improvement report to GitHub PR comment thread with surgical recommendations; wait for user direction |
| VERDICT 3: HALT - DO NOT MERGE | Any runtime crash, security breach, tenant leak, MCP schema drift, protected-path modification, or test reward-hacking detected | Immediately halt merge, post blocking report to GitHub PR comment thread, and present surgical fix blueprint |
5. Progressive Disclosure Reference Map
Load these auxiliary references when executing specific pipeline stages:
references/whole-project-main-diff-engine.md: Protocol for reconstructing full repository context onmain, mapping AST call-graph blast radius, line-deletion (-) analysis, and objective completion auditing.references/frontend-ui-and-taste-gate.md: Frontend UI checklist covering 320px responsive collapse, complete interactive states, native dialog bans, React state synchronization, WCAG AA contrast, and tasteskill.dev anti-slop rules.references/backend-security-and-mcp-gate.md: Backend checklist covering input and repository boundary validation, MCP outputSchema parity, database migration hygiene, composite tenant isolation, and test reward-hacking locks.references/tri-state-verdict-and-humanizer-pr-comment.md: Normative rules for the Tri-State Merge Verdict, automated GitHub PR comment posting, Wikipedia 33 humanizer rules, and surgical auto-remediation.scripts/preflight-merge-gate.js: Production-grade Node.js CLI scanner for cryptographic hash comparisons, diff parsing, UI anti-slop checks, MCP contract parity, and PR comment verification.scripts/validate-skill-md5.js: Node.js skill package integrity verifier and MD5/SHA-256 manifest generator.
6. Required Output Structure
Stage 1 Output: Pre-Flight Merge Gate Report
### Pre-Flight Merge Gate Evaluation: PR #<N>
**Verdict:** [ APPROVED FOR MERGE | PARTIAL / NEEDS IMPROVEMENT | HALT - DO NOT MERGE ]
#### 1. Target Objective Analysis
- Stated Objective: <concise summary of PR intent>
- Implementation Completeness: <Complete | Incomplete | Over-scoped>
- Edge Cases Handled / Missed: <mechanistic breakdown>
#### 2. AST Blast-Radius and Contract Verification
- Changed Components: <list of modified modules>
- Upstream Callers Affected: <verification of call sites>
- Protected Paths: <Untouched (MD5 match) | Modified (FAIL)>
#### 3. Frontend & Taste Findings
- 320px Viewport Compliance: <Pass | Defect file:line>
- Interactive UI States: <Complete | Missing states>
- Design Tokens & Anti-Slop: <Clean | Violations>
#### 4. Backend, Security & Protocol Findings
- Input & Boundary Validation: <Pass | Defect file:line>
- MCP Output Schema Parity: <100% Branches Verified | Defect file:line>
- Multi-Tenant Isolation: <Composite (owner_id, id) Bound | Leak Risk>
#### 5. Recommended Actions
- <Next step based on verdict>Stage 2 Output: Remediation and Merge Record
When commanded to execute fixes and merge:
- Commit Record: Exact commit SHA, subject line, and
git show --statoutput. - Cold Verification Evidence: Raw terminal output from
npm test,npm run build, andnode scripts/preflight-merge-gate.js. - Merge Evidence: The exact
gh pr mergeoutput or squash commit SHA landing onmain. - Post-Change Visualization: 5-point protocol: Target Boundary, Prior Behavior, Current Behavior, Downstream Impact, Unverified Scope.
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.

