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 commands/poter-aa/ai-code-workflow/create-branch-and-mrgit clone --depth 1 https://github.com/poter-aa/ai-code-workflowWrote 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/commands/poter-aa/ai-code-workflow/create-branch-and-mr)<a href="https://agentmods.dev/commands/poter-aa/ai-code-workflow/create-branch-and-mr"><img src="https://agentmods.dev/badge/commands/poter-aa/ai-code-workflow/create-branch-and-mr.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.00000 | $0.02532 |
| Opus 5 | $0.00000 | $0.01266 |
| Sonnet 5 | $0.00000 | $0.00506 |
| Haiku 4.5 | $0.00000 | $0.00253 |
Grade A, and why
create-branch-and-mr 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 — 221 lines — stays where its author put it; the contents beside it link to each section on GitHub.
创建分支并提交 MR
⚠️ 前置要求
必须配置 GitLab MCP 才能使用此工作流程!
在使用此工作流程之前,请确保:
- 已在 Cursor 中配置 GitLab MCP 服务器
- MCP 服务器已正确连接到 GitLab 实例(gitlab-ee.zhenguanyu.com)
- 已配置必要的认证信息(Token 等)
🚀 自动执行模式
此命令会自动执行所有步骤,无需用户确认!
执行此命令时,系统会:
- 自动检查:检查当前分支的所有改动(包括已暂存和未暂存的)
- 自动暂存:使用
git add -A自动暂存所有改动(包括新增、修改、删除的文件) - 自动提交:提交所有改动(使用最新提交的标题,或生成默认提交信息)
- 自动提取:从最新提交信息中提取标题和描述
- 自动生成:基于提交信息自动生成分支名(格式:
feature/提交信息转kebab-case) - 自动创建:创建新分支、推送到远程、创建 MR、切换回原分支
- 默认配置:
- 目标分支:当前分支(原分支,即
CURRENT_BRANCH) - 项目名:
bolt-logistics2(自动搜索项目 ID)
- 目标分支:当前分支(原分支,即
工作流程说明
此工作流程用于完成以下 Git 和 GitLab 操作:
- 自动处理所有改动:自动暂存所有改动(包括未暂存的),然后提交
- 基于当前分支创建新分支(新分支会包含刚才的提交和所有代码变更)
- 将新分支推送到远程仓库
- 在 GitLab 上创建 Merge Request(自动使用提交信息作为标题和描述)
- 切换回原分支
重要:系统会自动处理所有改动(包括未暂存的),确保新分支包含完整的代码变更。
自动执行步骤
步骤 1: 检查并提交改动(自动)
系统会自动执行:
- 检查当前分支的所有改动(包括已暂存和未暂存的):
git status - 自动暂存所有改动:
git add -A(包括新增、修改、删除的文件) - 检查是否有改动需要提交:
- 如果有改动,自动提交(使用最新提交的标题,或生成默认提交信息)
- 如果没有改动,检查是否有已提交的提交,如果有则继续下一步
- 重要:确保所有代码变更都被提交,包括未暂存的改动,这样新分支才会包含完整的代码变更
步骤 2: 提取提交信息并生成分支名(自动)
系统会自动执行:
- 获取最新提交信息(
git log -1 --pretty=%B) - 从提交信息中提取标题(第一行)
- 自动生成分支名:
- 格式:
feature/{提交标题转kebab-case} - 示例:
feat: 采购单行状态优化→feature/purchase-order-status-optimize - 移除类型前缀(feat/fix/docs等)和特殊字符
- 转换为小写并用连字符连接
- 格式:
步骤 3: 创建新分支(自动)
系统会自动执行:
# 获取当前分支名
CURRENT_BRANCH=$(git branch --show-current)
# 创建新分支(包含刚才的提交)
git checkout -b $NEW_BRANCH
步骤 4: 推送到远程仓库(自动)
系统会自动执行:
git push -u origin $NEW_BRANCH
步骤 5: 在 GitLab 上创建 Merge Request(自动)
系统会自动执行:
-
搜索项目获取项目 ID:
- 使用 MCP 工具
mcp_gitlab_search_repositories - 参数:
search: "bolt-logistics2" - 从返回结果中获取项目 ID(
id字段)
- 使用 MCP 工具
-
创建 Merge Request:
- 使用 MCP 工具
mcp_gitlab_create_merge_request project_id: 从步骤 5.1 获取的项目 IDtitle: 使用最新提交的标题description: 自动生成结构化描述(功能说明 + 主要改动)source_branch: 新分支名target_branch: 当前分支(原分支,即CURRENT_BRANCH)
- 使用 MCP 工具
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 · 221 lines · 0 tokens per session scan A 97dd4e8955f8
create-branch-and-mr is a command published in the GitHub repository poter-aa/ai-code-workflow (4 stars, last pushed 9mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,532 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-31.
Other commands, from other repositories
status
Generate a comprehensive project status report — active features, recent decisions, agent recommendations, and health assessment.
iterate
Execute a single Ralph loop iteration - complete one work unit from tasks.md with proper commits and progress tracking.
fd-done
Close the task — summarize built vs required, then commit and push on confirmation.
squash-pr
Squash branch commits into one clean commit and open a PR.
spawn-team
Spawn ClawTeam parallel workers for the current development phase.
wtfp:contribute
Guide a bounded WTF-P contribution from branch creation through a reviewable change request.