skills/vibe-commit/SKILL.md
Use when the user wants to classify dirty changes, create serial commits, split work into one PR or multiple PRs, and prepare publication from the correct flow without handling merge or post-merge closure.
npx skillsauth add jacobcy/vibe-coding-control-center vibe-commitInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
编排提交与创建 PR,不负责 merge、关 issue、关 task、关 flow。
核心职责:
PR 创建后停止,输出:
/vibe-integrate 检查 CI / review 并推进合并docs/standards/v3/git-workflow-standard.md — 提交流程核心规范docs/standards/v3/command-standard.md — 命令用法规范docs/standards/github-labels-standard.md — PR 标签规则/vibe-commit [--strategy <single|parallel|stacked>]
├─ Step 1: 读取当前任务与交接状态
│ ├─ uv run python src/vibe3/cli.py task show
│ ├─ uv run python src/vibe3/cli.py handoff status
│ └─ 检查 issue、task、branch、pr
│
├─ Step 2: 检查主分支是否已更新
│ ├─ git fetch origin main
│ ├─ git log HEAD..origin/main --oneline
│ └─ 若有新提交:先 rebase 或 merge,处理冲突
│
├─ Step 3: 判断是否仍需提交
│ ├─ 检查改动是否已被其他 PR 覆盖
│ ├─ 若已不需要:handoff append 说明理由 → 标记 state/handoff → 停止
│ └─ 若仍需提交:继续
│
├─ Step 4: 审计工作区
│ ├─ git status --short
│ ├─ git diff --stat
│ └─ 分类:commit now / stash / discard
│
├─ Step 5: Pre-commit 强制验证与格式化
│ ├─ uv run black src tests/vibe3
│ ├─ uv run ruff check --fix src tests/vibe3
│ ├─ 若有修改:提交临时 commit → 软重置(检查 commit 是否为临时)
│ ├─ pre-commit run --all-files
│ └─ Hard block: 任何错误必须修复,禁止跳过
│
├─ Step 6: 组织 commit
│ ├─ 每组变更包含哪些文件(含格式化修改)
│ ├─ 每条 commit 草案
│ └─ git hooks 自动格式化 commit message
│
├─ Step 7: 处理串行多 PR(如需要)
│ ├─ 列出待发布分组
│ ├─ 从正确基线进入新的逻辑 flow
│ ├─ cherry-pick(需处理冲突)
│ └─ 依次验证、发 PR
│
├─ Step 8: 发 PR 前复核
│ ├─ LOC 强制检查(Hard Block)
│ │ ├─ ENFORCE_LOC_LIMITS=true bash scripts/hooks/check-per-file-loc.sh
│ │ ├─ ENFORCE_LOC_LIMITS=true bash scripts/hooks/check-test-file-loc.sh
│ │ └─ 任何文件超限必须修复,禁止创建 PR
│ ├─ 工作区已干净
│ ├─ commit 只服务一个交付目标
│ └─ uv run python src/vibe3/cli.py pr create --base <ref>
│
└─ Step 9: 写入 handoff 并停止
├─ vibe3 handoff append
└─ 停止,等待用户确认后运行 /vibe-integrate
只要 shell 参数、子命令或 flag 有任何不确定,先运行对应命令的 --help。
uv run python src/vibe3/cli.py pr create/vibe-donepr_ref,只能处理该 PR 的 follow-up;若用户要开始下一个 PR,必须切到新 flow原则:如果对话中已有足够的上下文(清楚当前 issue/branch/PR 状态),跳过命令检查。
需要执行命令检查的情况:
可以跳过命令检查的情况:
task show 或 handoff status命令检查(仅在需要时执行):
uv run python src/vibe3/cli.py task show
uv run python src/vibe3/cli.py handoff status
检查点:
issue / task / branch / prpr_refhandoff status 里上一环节留下了什么交接记录若 handoff 与当前真源或现场不一致,必须在退出前修正,不能继续沿用旧判断。
在提交前必须检查 origin/main 是否有新提交,避免提交过时代码:
# 获取远程最新状态
git fetch origin main
# 检查是否有新提交
git log HEAD..origin/main --oneline
处理策略:
git rebase origin/main(保持线性历史,PR diff 清晰)git merge origin/mainHard Block:冲突未解决前禁止提交。
在执行提交前,必须检查改动是否仍然必要:
检查项:
origin/main 或相关分支)wontfix若已不需要提交:
# 记录原因
uv run python src/vibe3/cli.py handoff append "vibe-commit: 不再需要提交,理由:<具体原因>" --kind note
# 更新 issue 标签为 state/handoff (移除 state/merge-ready)
gh issue edit <issue-number> --add-label "state/handoff" --remove-label "state/merge-ready"
# 停止,等待 manager 决定
若仍需提交:继续下一步。
先运行:
git status --short
git diff --stat
git diff --cached --stat
必要时再读精确 diff。把未提交内容明确分成三类:
commit nowstashdiscard检查临时调试文件:
在审计工作区时,需要检查根目录下是否有临时调试文件:
# 检查根目录下的临时调试文件
ls debug_*.py debug_*.sh tmp_*.py 2>/dev/null || echo "No debug files found"
若发现临时调试文件(如 debug_*.py、debug_*.sh、tmp_*.py),应归类为 discard(删除),不进入 commit:
rm debug_*.py debug_*.sh tmp_*.py 清理执行前必须向用户说明:
这是硬规定,不可跳过。未经用户明确允许,禁止使用 --no-verify。
强制两步流程:
理由:防止 E501 等格式问题进入代码库,保证所有提交都经过质量门禁。
在组织任何 commit 之前,必须确保所有待提交文件通过 pre-commit 检查。项目使用 Python pre-commit 框架,配置见 .pre-commit-config.yaml。
核心理念:先对所有改动统一格式化,再按功能分组提交,避免单独的格式化 commit 打乱提交历史。
执行步骤:
运行格式化工具(对所有改动):
# 格式化所有 Python 代码
uv run black src tests/vibe3
# 运行 ruff linter 并自动修复
uv run ruff check --fix src tests/vibe3
检查是否有格式化修改:
# 查看哪些文件被修改
git status --short
git diff --stat
提交临时格式化 commit(如果有修改):
若有文件被 black 或 ruff 修改:
# 只暂存格式化修改的文件(避免包含敏感文件)
git add <formatted-files>
# 提交临时格式化 commit
git commit -m "temp: pre-commit format (will be squashed)"
撤销临时 commit(保留修改在工作区):
# 检查最近一次提交是否为临时格式化 commit
if git log -1 --format="%s" | grep -q "temp: pre-commit format"; then
# Soft reset:撤销 commit,但保留所有修改在工作区
git reset HEAD~1
fi
# 确认修改已回到工作区
git status --short
运行 pre-commit 验证:
# 对所有文件运行 pre-commit 检查
pre-commit run --all-files
处理错误:
git commit --no-verify 跳过关键点:
边界约束:
--no-verify 跳过 pre-commit每个 commit 只对应一个独立交付目标。生成 commit 草案前,先说明:
若当前分支历史已经混入多个交付目标,不得继续硬挤进一个 PR。
对"当前已有一串待发布 commit,需要串行拆成多个 PR"的场景,固定按以下步骤执行:
commit now / stash / discard--save-stashgit cherry-pick <commit...>git cherry-pick --continuegit cherry-pick --abort 放弃并重新规划uv run python src/vibe3/cli.py pr create --base <ref> 发当前这一组 PRLOC 强制检查(Hard Block):
在发 PR 前,必须确认所有文件(含测试文件)未超过 LOC 限制。
执行命令:
# 检查源代码文件 LOC
ENFORCE_LOC_LIMITS=true bash scripts/hooks/check-per-file-loc.sh
# 检查测试文件 LOC
ENFORCE_LOC_LIMITS=true bash scripts/hooks/check-test-file-loc.sh
Hard Block 规则:
修复方案(按优先级):
config/v3/loc_limits.yaml 中申请 exception(需有合理理由)注意:此检查使用 ENFORCE_LOC_LIMITS=true 模式,与 CI 一致。即使 pre-push hook 仅 advisory,此步骤始终强制执行。
先读取:
uv run python src/vibe3/cli.py pr create --help
git log --oneline <base>..HEAD
只有同时满足以下条件,才能继续发 PR:
git branch -vv 显示任务分支 tracking 到 origin/main,先修 upstream,再继续发 PR发布入口只用:
人类用户使用 vibe3 pr create --yes:
vibe3 pr create --yes
Agent 使用 vibe3 pr create --agent:
重要:Agent 模式必须提供 -t (title) 和 -b (body),不允许交互式输入。
vibe3 pr create --agent -t "..." -b "..."
说明:
vibe3 pr create --agent 是 Agent 专用入口,自动获取 base branch、flow metadata、Contributors 块,创建 draft PRvibe3 pr create --yes 是人类专用入口,需要明确确认,创建 draft PR--ai 参数(与 --agent 冲突)-t (title) 和 -b (body),否则报错vibe3 pr create --agent 仍然依赖当前 git 现场正确;若任务分支被错误 tracking 到 origin/main,请先修正 branch/upstream,再重试发 PR 前的最小 upstream 检查:
git branch -vv
如果当前任务分支显示类似:
task/issue-337 [origin/main: ahead 1, behind 1]
说明 upstream 错绑到了 origin/main。此时不要继续运行 vibe3 pr create --agent;先修正 git 现场,必要时直接改用 gh pr create 完成人工收口。
失败时的收口:
git branch -vv 摘要写进 issue commentContributors 块自动生成:
PR 创建时,系统会自动从 flow state 中读取 actor 信息并生成 Contributors 块:
planner_actor、executor_actor、reviewer_actor、latest_actor---
## Contributors
claude/sonnet-4.6, gemini, jacob
vibe3 flow update --actor <identity>手动添加:如果自动生成失败,可在 PR body 末尾手动添加 Contributors 块。
默认不执行。仅在用户明确要求时触发。
智能审查策略:
| 标签类型 | 审查方式 | 触发方式 |
| --------------- | ------------ | ------------------------------ |
| type/feat | Codex 审查 | 在 PR 中评论 @codex review |
| type/fix | Copilot 审查 | 在 PR 中评论 @copilot review |
| type/refactor | claude 审查 | 在 PR 中评论 @claude review |
| type/docs | 人工审查 | 无自动触发 |
| type/test | 人工审查 | 无自动触发 |
| type/chore | 人工审查 | 无自动触发 |
执行方式(仅在用户要求时):
# 查看当前 PR
gh pr view <pr-number>
# 添加标签
gh pr edit <pr-number> --add-label "type/feature"
# 触发审查(可选)
gh pr comment <pr-number> --body "@codex review"
PR 创建成功后,当前 task 进入 open + had_pr 状态,skill 在此停止。
此阶段:
/vibe-integrate 检查 review、CI、merge 阻塞/vibe-done若用户问"下一步是什么",回答:
运行
/vibe-integrate检查 CI 状态和 review,确认合并条件后推进。
写入 handoff:
# actor 使用 agent 自身的 backend/model,若不确定则留空
uv run python src/vibe3/cli.py handoff append "vibe-commit: PR created" --kind note
git commit --no-verify 跳过 pre-commit 检查ENFORCE_LOC_LIMITS=true)origin/main 是否有新提交handoff append 说明理由state/handoff,等待 manager 决定git commitstash 当垃圾桶discard 当默认处理方式development
Use after `vibe init` to verify project configuration completeness. Interactively prompts user to fill missing items. Orchestrates existing commands without adding Python code. Do not use for system-level installation issues (use vibe-onboard instead).
development
Use when the user wants a comprehensive review using the multi-agent team workflow. Applies to PRs, code changes, architecture decisions, and any task requiring team-based analysis.
development
Use when manager has signaled flow terminal state cleanup via handoff indicate. Reads cleanup instructions and executes FlowCleanupService. Do not use for code changes or PR creation.
testing
Use for handling blocked and RFC issues, making decisions that may form ADRs (Architecture Decision Records). Processes problem issues requiring human judgment, dependency resolution, and architectural decisions. Do not use for routine issue monitoring (use vibe-orchestra) or roadmap planning (use vibe-roadmap).