port-commits

port-commits is a command for Cursor from DemonDamon/AgenticX. It costs 0 tokens per session (2,706 once invoked), scanned A, original, Apache-2.0.

A Git command for copying selected, finished commits from one branch onto another with `cherry-pick`, which reapplies those exact changes.

In plain words
What is it for?
Use it to transfer commits by their IDs, plan IDs, or recent-commit count to a target branch.
Why use it?
It moves only the requested commits instead of bringing over an entire branch and its unrelated work.

Command for Cursor

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.

agentmods
npx agentmods add commands/demondamon/agenticx/port-commits
Clone the repo
git clone --depth 1 https://github.com/DemonDamon/AgenticX

Made for: Cursor.

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 port-commits

README.md
[![agentmods](https://agentmods.dev/badge/commands/demondamon/agenticx/port-commits.svg)](https://agentmods.dev/commands/demondamon/agenticx/port-commits)
Your own site
<a href="https://agentmods.dev/commands/demondamon/agenticx/port-commits"><img src="https://agentmods.dev/badge/commands/demondamon/agenticx/port-commits.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,706 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00000 $0.02706
Opus 5 $0.00000 $0.01353
Sonnet 5 $0.00000 $0.00541
Haiku 4.5 $0.00000 $0.00271

Measured 6d ago against content hash 0764839473d4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

port-commits 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 6d 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.

.cursor/commands/port-commits.md · 200 lines

How it starts

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

port-commits

已落地、可追溯的一组 commit,用 cherry-pick(最稳妥) 同步到目标分支(常见:mainhc-0730)。

/port-from-branch 的区别:

指令 场景 默认动作
/port-from-branch 参考协作者分支,在 main 上核实后更瘦重做 禁止整包盲合
/port-commits 源分支上的改动已经定稿,要原样/按序搬到目标分支 只 cherry-pick 选定 commits,默认不 merge 整支

参数(从 $input 解析)

写法宽松:空格分隔的 token + 可选 --key=value。缺关键参数时先问用户再动手,不要猜错目标分支。

必选

  • --to=<目标分支>:要接收改动的分支,如 hc-0730
    • 也可写成自然语言:合并到 hc-0730 / 同步到分支A

选定要搬的 commits(四选一,可组合)

按优先级解析;最终必须解析出有序 commit 列表(旧 → 新):

  1. 显式 SHA(最稳)

    • 例:/port-commits a1b2c3d e4f5g6h --to=hc-0730
    • 支持短 SHA(≥7)与完整 SHA;解析后用 git rev-parse 校验存在。
  2. Plan-Id 检索(推荐给本仓库带 trailer 的提交)

    • --plan-id=<id>
    • 例:/port-commits --plan-id=2026-07-27-enterprise-portal-web-search-wiring --to=hc-0730
    • --from(默认 origin/main)历史上:
      git log <from> --grep='Plan-Id: <id>' --reverse --format='%H'
    • 可同时给多个:--plan-id=A --plan-id=B(先 A 再 B,各自内部按时间旧→新)。
  3. 源分支 + 最近 N 次

    • --from=<源分支>(默认 origin/main
    • --last=<N> 或自然语言「最近两次 / 最近 2 个提交 / last 2」
    • 例:/port-commits --from=main --last=2 --to=hc-0730
    • 「最近 N 次」= git log <from> -N --reverse --format='%H'不是相对目标分支的 diff,而是源分支 tip 往回数 N 个)。
    • 若用户说「main 上比 hc-0730 多出来的最近两次」,改用:
      git log origin/hc-0730..origin/main -2 --reverse(见下方「相对范围」)。
  4. 相对范围

    • --range=<A>..<B>--range=<A>...<B>
    • 例:/port-commits --range=origin/hc-0730..origin/main --to=hc-0730
    • 若再带 --last=N:在该范围内取最新 N 个,再 --reverse 成旧→新。

可选开关

开关 含义 默认
--from=<ref> 检索 Plan-Id / last N 时的源 tip origin/main
--dry-run 只列将要拣的 commits + 文件面,不改分支 默认开启(未写 --apply 即 dry-run)
--apply 真正 checkout 目标分支并 cherry-pick
--push apply 成功后 git push -u origin <to> 关(需用户明确,或与 --apply 同写才推)
--allow-empty-skip cherry-pick 空提交(已包含)时跳过并继续
--strategy=merge 不推荐;仅当用户显式要求整支 merge 时才用,并先警告风险 cherry-pick

Read the full file on GitHub · 200 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. 6d ago First seen · 200 lines · 0 tokens per session scan A 0764839473d4

Subscribe to this mod's changes

port-commits is a command published in the GitHub repository DemonDamon/AgenticX (227 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,706 tokens. 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-30.