All skills

Bug Hunting & Review

Merge Gate

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.

What this skill adds

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 #N or PR URL) before merging into main or production
  • 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, or HALT - 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:line citations.
  • ### 1.2 Whole-Project Context Over Flat Diffs
  • Never evaluate a pull request as an isolated patch.

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 |

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 main to 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.md for whole-project traversal rules.

Default agent prompt

Use $merge-gate to evaluate this pull request against main, verify full-stack invariants, and determine the pre-merge verdict.