feat: /pre-merge skill for MR/PR review before submission
Context
When preparing a merge request, there's a gap between the /ship verification (which runs at implementation time) and the actual MR submission. Code changes accumulate after /ship — bug fixes, CI config changes, rebase conflict resolutions — that never go through code review or security scan.
The current workflow requires manually invoking /code-review or /audit before submitting, which is easy to forget.
Proposal
A /pre-merge skill that automatically:
- Diffs the current branch against the target branch (
origin/main) - Runs a scoped
/code-reviewon the diff (not the full codebase) - Runs a scoped
/secure-reviewon the diff (if the skill is deployed) - Validates CI config files (YAML syntax, no conflict markers)
- Checks for common MR hygiene issues (uncommitted changes, secrets in diff, large binary files)
- Produces a summary: READY / NEEDS_ATTENTION with findings
Lighter than /audit (full codebase scan), heavier than manual review. Designed to run in 2-5 minutes as a pre-submission gate.
Motivation
During a real session building Maven support for a Tekton pipeline, we accumulated 9 commits across /ship, /fix, CI config changes, and rebase. The final MR had:
- Unresolved merge conflict markers inherited from
origin/mainduring rebase - A thread-safety bug in a CVE patch
- A shell variable scoping issue in CI config (
before_scriptvars not visible inscript)
All of these were caught by manually running /code-review at the end, but a /pre-merge skill would have caught them automatically.
Integration with claude-devkit
This could be a new skill in skills/pre-merge/SKILL.md following the coordinator pattern. It would compose /code-review and /secure-review as subagents, similar to how /audit composes them.
🤖 Generated with Claude Code
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗