skills/git-commit/SKILL.md
处理 git 提交/推送/分支命名与提交信息规范;当任务涉及 commit、push、起分支或整理 commit message 时使用。
npx skillsauth add dcjanus/prompts git-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.
git status -sb
Assisted-by 信息。<skill_dir> 是当前 SKILL.md 文件所在文件夹。脚本必须直接当作可执行命令运行,不要用 uv run python 或 python。
(cd <skill_dir> && ./scripts/codex_git_commit.py)
错误示例:
uv run python skills/git-commit/scripts/codex_git_commit.py
python skills/git-commit/scripts/codex_git_commit.py
git commit --only \
-m "type(scope): concise summary" \
-m "Assisted-by: <agent-name>:<model-name>" \
-- <paths-owned-by-current-task>
git show --name-status --oneline --no-renames HEAD
<paths-owned-by-current-task> 必须只包含当前任务负责的文件或目录;多个 Agent 共用同一个 worktree 时也按这个规则执行。<paths-owned-by-current-task> 可以是文件,也可以是当前任务完整负责的目录。gen/,不要把几千个文件展开成命令参数。git add;git commit --only -- <paths> 会直接提交这些路径的当前工作区内容。type(scope): short summary,遵循 Conventional Commits。type:feat、fix、refactor、docs、test、choresummary 保持简短,聚焦结果;若无合适 scope,可省略。Assisted-by: <agent-name>:<model-name> trailer。git commit -m ... 时,不要在提交标题或正文里直接放未转义的反引号 `。git switch,恢复工作区或暂存区优先使用 git restore,尽量避免 git checkout。git commit、git push 或其他写操作。.git/index.lock,先判断是否有其他活跃 Git 进程。git status -sb 确认本次提交、分支和工作区状态符合预期。development
为当前 Codex thread 设置名称;仅当用户手动调用或明确要求命名、重命名、整理当前 Codex 会话标题时使用,永远不要自动调用。
testing
编写或更新 GitHub/GitLab Issue、PR、MR 的标题与正文;适用于创建、修改、重写 reviewer-facing 描述、Validation、Risks、Breaking Change、避免本地路径泄露等场景。
tools
使用 GitLab CLI(glab)与 GitLab 资源交互;适用于 project、issue、MR、comment、wiki 等查看、更新或创建场景,含自建实例。
tools
使用 GitHub CLI 与 GitHub 资源交互;适用于 repo、issue、PR、comment、release、workflow 等查看、更新或创建场景。