/approve — Push PR to Auto-Merge

SkillDev tools

Graph-based static analysis tool

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the /approve — Push PR to Auto-Merge skill

What this skill tells your AI

The instructions your AI receives, as published by disentinel/grafema in .claude/skills/approve/SKILL.md and read by ahel’s review.

When to Use

User says /approve after reviewing a completed task in a worker worktree. This replaces the manual merge-to-main workflow.

What It Does

  1. Pushes current branch to origin
  2. Creates a PR against main
  3. Enables auto-merge (GitHub merges automatically when CI passes)
  4. Updates Linear issue status to "In Review"

Prerequisites

  • Must be on a task branch (e.g., task/REG-XXX), NOT on main
  • Steve Jobs review should have been completed before calling this

Steps

1. Validate State

# Get current branch
BRANCH=$(git branch --show-current)

# Must not be on main
if [ "$BRANCH" = "main" ]; then
  echo "ERROR: Cannot approve from main branch"
  exit 1
fi

2. Commit Uncommitted Changes (if any)

If there are uncommitted changes (staged or unstaged), commit them all:

  1. Run git status and git diff to see what's pending
  2. Run git log --oneline -5 to match commit message style
  3. Stage all changed files: git add specific files (avoid secrets/.env)
  4. Create a commit with a descriptive message summarizing the changes
  5. End the commit message with Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

If working tree is clean, skip to next step.

3. Push Branch

git push -u origin "$BRANCH"

4. Create PR

Create PR with title and body derived from the task:

  • Title: Extract from Linear issue if REG-XXX is in branch name, otherwise use branch name
  • Body: Include summary of changes from commits on this branch (vs main)
# Get commits unique to this branch
git log main..HEAD --oneline

# Create PR
gh pr create --title "..." --body "..."

If PR already exists, skip creation and use existing PR.

5. Enable Auto-Merge

# Get PR number
PR_URL=$(gh pr view --json url --jq '.url')

# Enable auto-merge with merge commit strategy
gh pr merge --auto --merge

This tells GitHub: "merge this PR automatically when all required status checks pass."

6. Update Linear

Extract issue ID from branch name (e.g., task/REG-123REG-123).

Update Linear issue status to In Review using mcp__linear__update_issue.

7. Report

Print summary:

  • PR URL
  • Auto-merge status: enabled
  • CI checks: running (will merge when green)
  • Linear status: updated to "In Review"

What Happens Next

  • GitHub CI runs automatically (Tests, Typecheck & Lint, Build, Version Sync)
  • When ALL checks pass → PR auto-merges to main
  • If merge conflict → auto-merge fails, GitHub sends notification on the PR
  • User resolves conflict by telling worker to rebase: git rebase main && git push --force-with-lease

Notifications

Conflicts and CI failures appear as:

  • GitHub notification (bell icon on github.com)
  • Email (if GitHub email notifications enabled)
  • Failed status check on the PR page
  • Comment on PR explaining the failure reason

Multiple Workers

Multiple workers can /approve simultaneously. Since strict: false is set in branch protection:

  • All PRs run CI concurrently against current main
  • PRs merge in order as CI completes
  • No need to wait for one PR to merge before the next starts CI
  • If a merge conflict occurs after another PR merges, only that specific PR needs a rebase

Signals

GitHub stars
36
Forks
3
Last commit
Aug 2026
Advanced
Catalog kind
skill
Gateway key
approve
Source
github.com/disentinel/grafema