merge-to-main

merge-to-main is a skill for Claude Code, Codex from TheSmuks/ai-project-template. It costs 22 tokens per session (1,162 once invoked), scanned A, original, MIT.

A workflow for taking a code change from a branch through a GitHub pull request, which is a proposed change for review, until it is merged into the main branch. It watches automated checks and handles failures along the way.

In plain words
What is it for?
Checking repository conventions, updating the changelog, committing and pushing changes, creating or updating a pull request, monitoring CI, fixing failed checks, merging when green, and updating pull-request checkboxes.
Why use it?
It gathers the preparation, pull-request creation, continuous-integration checks, fixes, and merge into one repeatable process.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit Checking repository conventions, updating the changelog, committing and pushing changes, creating or updating a pull request, monitoring CI, fixing failed checks, merging when green, and updating pull-request checkboxes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/thesmuks/ai-project-template/merge-to-main
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add TheSmuks/ai-project-template --skill merge-to-main
Clone the repo
git clone --depth 1 https://github.com/TheSmuks/ai-project-template

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for merge-to-main

README.md
[![agentmods](https://agentmods.dev/badge/skills/thesmuks/ai-project-template/merge-to-main/github.svg)](https://agentmods.dev/skills/thesmuks/ai-project-template/merge-to-main)
Your own site
<a href="https://agentmods.dev/skills/thesmuks/ai-project-template/merge-to-main"><img src="https://agentmods.dev/badge/skills/thesmuks/ai-project-template/merge-to-main/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for merge-to-main

Your own site · 80×15
<a href="https://agentmods.dev/skills/thesmuks/ai-project-template/merge-to-main"><img src="https://agentmods.dev/badge/skills/thesmuks/ai-project-template/merge-to-main.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,162 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00022 $0.01162
Opus 5 $0.00011 $0.00581
Sonnet 5 $0.00004 $0.00232
Haiku 4.5 $0.00002 $0.00116

Measured 12d ago against content hash 40bf1e401c55, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

merge-to-main scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.omp/skills/merge-to-main/SKILL.md · 113 lines

How it starts

The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Merge to Main

Automated PR lifecycle: prepare → create PR → monitor CI → fix failures → merge when green → update checkbox fields in the PR body.

When to Use

Invoke this skill after completing work on a feature branch, when you are ready to create or update a pull request and merge it into main.

Phase 1: Prepare

  1. Read AGENTS.md and .github/PULL_REQUEST_TEMPLATE.md for conventions.
  2. Verify the current branch follows <type>/<short-description> naming (e.g. feature/add-embeddings, fix/token-overflow).
  3. Verify CHANGELOG.md has been updated under [Unreleased] (required by changelog-check.yml).
  4. If the working tree is dirty, stage and commit remaining changes.
  5. Push the branch to origin.

Phase 2: Create PR

  1. Read .github/PULL_REQUEST_TEMPLATE.md if it exists.
  2. Check whether a PR already exists for this branch:
    gh pr list --head <branch-name> --state open
    
    If one exists, skip creation and proceed to Phase 3.
  3. Create the PR via gh pr create:
    gh pr create --base main --title "<title>" --body "<body>"
    
    • Title: Extract from the first line of the most recent commit message (conventional commit format: <type>[optional scope]: <description>).
    • Body: Fill in the PR template based on the changes. Leave "Automated checks" boxes unchecked — Phase 4 will update them.
    • Draft: Create as ready-for-review by default. Use --draft to create a draft PR instead.

Phase 3: Monitor CI

  1. Poll check status:
    gh pr checks <pr-number>
    
  2. Wait for all checks to reach a terminal state (pass or fail).
    • Poll interval: ~30 seconds
    • Max wait: 10 minutes
  3. For each failing check: a. Read the failure log: bash gh run view <run-id> --log-failed b. Diagnose the issue. c. Fix the issue using appropriate tools (read, edit, search, ast_edit). d. Amend the last commit (if unpushed) or create a new fix commit. e. Push the fix. f. Re-enter the monitoring loop.
  4. Max retries: 3 (to prevent infinite loops on unfixable issues).
  5. After 3 retries with failures, report what failed and stop — let the user decide.

Read the full file on GitHub · 113 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 113 lines · 22 tokens per session scan A 40bf1e401c55

Subscribe to this mod's changes

merge-to-main is a skill published in the GitHub repository TheSmuks/ai-project-template (7 stars, last pushed 4mo ago), licensed MIT. It adds 22 tokens to every session and 1,162 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.