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.
npx agentmods add skills/jtsang4/efficient-coding/merge-and-rebasenpx skills add jtsang4/efficient-coding --skill merge-and-rebasegit clone --depth 1 https://github.com/jtsang4/efficient-codingWrote 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.
[](https://agentmods.dev/skills/jtsang4/efficient-coding/merge-and-rebase)<a href="https://agentmods.dev/skills/jtsang4/efficient-coding/merge-and-rebase"><img src="https://agentmods.dev/badge/skills/jtsang4/efficient-coding/merge-and-rebase.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00082 | $0.01343 |
| Opus 5 | $0.00041 | $0.00672 |
| Sonnet 5 | $0.00016 | $0.00269 |
| Haiku 4.5 | $0.00008 | $0.00134 |
Grade A, and why
merge-and-rebase 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 4d 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.
How it starts
The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Merge and Rebase
The user has finished a change on a feature branch. Carry it through four stages: commit and push, open a request against trunk, merge it, then rebase the feature branch onto the new trunk. Stop and ask whenever the repository state contradicts what the user described.
Before Starting
Establish the ground truth from the repository itself, not from assumptions:
- The current branch, and confirmation that it is not the trunk branch. If the user is standing on trunk, stop and ask what they intended.
- The trunk branch name as this repository actually uses it —
main,master,develop, or something else. Read it from the remote's default branch or the repo's own conventions rather than guessing. - The hosting platform and remote, so you know whether the target is a GitHub pull request, a GitLab merge request, or another forge's equivalent.
- Whether the working tree has uncommitted changes, and whether they are all part of the feature the user means to ship.
Report anything surprising — unrelated modified files, a detached HEAD, an unexpected upstream, an already-open request for this branch — before acting on it.
Stage 1: Commit and Push
Review the actual diff before writing anything. Understand what changed and why.
Stage the changes that belong to this feature. Leave unrelated edits, stray debug output, local scratch files, and secrets out of the commit; call them out to the user instead of silently including or discarding them.
Write the commit message in the style this repository already uses — check recent history for whether it follows Conventional Commits, a ticket-prefix convention, or plain prose, and match it. Describe why the change exists, not a file-by-file inventory. Do not add promotional trailers or co-author lines that the repo does not already use.
Push the branch to the remote, setting upstream if it has none. If the push is rejected because the remote branch moved, inspect the divergence and ask before overwriting anything.
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.
- 4d ago First seen · 80 lines · 82 tokens per session scan A 343fc77a83db
merge-and-rebase is a skill published in the GitHub repository jtsang4/efficient-coding (2 stars, last pushed 3d ago), licensed MIT. It adds 82 tokens to every session and 1,343 once invoked, about $0.0004 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.
Other skills, from other repositories
ship-it
Code commit, PR creation, merge, and issue closure workflow via GitHub CLI (gh). Triggers after a goal (GitHub Issue) implementation is complete — commit code, push branch, create PR, merge, then close the issue. Use when the user says "提交代码", "commit and merge", "创建PR", "合入", "关闭issue", "ship-it", or when a goal…
commit
A commit candidate is the exact patch that will enter the commit. A coherent change has one task or issue as its reason for existing.
git-github-flow
Use for branch prep, clean commits, PR descriptions, GitHub issue triage, changelogs, release notes, review response, merge readiness, or publishing a branch safely.
ship
Create branch, commit changes, and open PR with concise description. Triggers on "ship", "open pr", "send pr".
speq-git-discipline
Read-only git guardrails and the Conventional Commits reference — no history writes, verify changes before completing. Triggered by planner-agent, implementer-agent, implementer-expert-agent, and recorder-agent; git-agent alone is exempt and uses /speq-git-operations instead.
commit-message
把一团 diff 提炼成规范、可追溯的提交信息。核心:一条提交说清"做了什么"和"为什么",让未来的自己(和同事)能从提交历史里读懂项目演进。.