agentleFS
rui66648rui66648/agents-dev-rules/skills/git-commit/SKILL.md

git-commit

Skill0 starsChanged 12 days agoApache-2.0View on GitHub

verification 通过后、finishing-branch 之前执行 git commit 时使用。遵循 Conventional Commits 规范,智能分析变更、安全暂存并生成提交信息。触发词: 提交、commit、提交代码。

  • Reads credentials

194 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use git-pr, github-pr-create and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • klauswgSkill

    git-pr

    Prepare, review, publish, or update a complete GitHub pull request for the current repository, including local commit readiness, safe push strategy, semantic title validation, repository-native PR templates, issue linking, and checks verification. Use when the user asks to draft, create, submit, publish, open, or update a pull request. Always require the user to review and explicitly approve the exact final PR before any push or GitHub write.

    Also in 12 projects that use this

  • mjun0812Skill

    github-pr-create

    Pull Requestを作成するSkill。現在のbranchからpull requestを作成する。言語指定可能。 ユーザーが「PR作って」「pull request作成して」のように依頼したら使うこと。

    Also in 3 projects that use this

  • klauswgSkill

    git-issue

    Prepare, review, create, or update evidence-based GitHub issues for the current repository with duplicate detection, repository-native templates, valid labels, and post-publication verification. Use when the user asks to draft, file, submit, publish, edit, or refine a GitHub issue, bug report, feature request, performance issue, or technical proposal. Always require the user to review and explicitly approve the exact final issue before any GitHub write.

    Also in 3 projects that use this

  • nielsmadanSkill

    review-perf

    Performance analysis for algorithmic complexity, memory leaks, N+1 queries, and render issues. Use when code feels slow, after adding loops/queries, or before scaling up.

    Also in 3 projects that use this

  • gologo13Skill

    git-push

    Push current branch to origin and sync with remote updates; keywords: git, rebase. Use only on explicit request; before execution, review diffs and list impact scope.

    Also in 6 projects that use this

  • GitHubSkill

    multi-stage-dockerfile

    Create optimized multi-stage Dockerfiles for any language or framework

    Also in 4 projects that use this

The file

Files
SKILL.md

Git Commit

负责代理

architect — 提交规范由架构师代理统一把关;所有 Agent 在提交代码时均需调用本技能。

何时使用

  • 功能开发完成,需要提交代码时
  • 用户说"提交一下"、"commit"、"提交代码"时
  • verification 技能确认检查通过后
  • 在进入 finishing-branch 之前

触发关键词: "提交"、"commit"、"提交代码"、"git commit"

前置条件

在进入此技能前,必须确认:

  • verification 已确认所有测试通过
  • ai-safety-check 已确认无安全漏洞(RULE-016)
  • 代码已通过 Linter 检查(RULE-028)

执行流程

1. 分析变更

git status          # 查看未跟踪/修改文件
git diff            # 查看未暂存变更
git diff --cached   # 查看已暂存变更
git log --oneline -5  # 查看最近提交风格

2. 智能暂存

  • 优先按文件名精确暂存(git add <file>),避免误提交敏感文件
  • 禁止使用 git add -A / git add .(可能包含 .env、凭据等敏感文件)
  • 发现 .env、credentials.json 等敏感文件时,禁止提交并警告用户

3. 生成提交信息(Conventional Commits)

<type>(<scope>): <subject>

<body>
type用途示例
feat新功能feat: 新增用户注册接口
fixBug 修复fix: 修复登录超时问题
refactor重构refactor: 拆分 UserService
docs文档docs: 更新 API 文档
test测试test: 补充边界用例
chore杂项chore: 升级依赖版本
perf性能优化perf: 优化查询索引
style样式style: 格式化代码

提交信息要求:

  • subject 用祈使句,简洁(< 50 字符)
  • 聚焦"为什么"而非"做了什么"
  • 不引用当前任务/修复编号(属于 PR 描述)

4. 提交

git commit -m "feat(scope): subject"

5. 验证提交

git log --oneline -1   # 确认提交成功
git status             # 确认工作树干净

禁止事项

  • ❌ 禁止提交敏感文件(.env、凭据、密钥)
  • ❌ 禁止使用 git add -A 全量暂存
  • ❌ 禁止跳过 pre-commit hooks(--no-verify)
  • ❌ 禁止在提交信息中引用内部任务编号
  • ❌ 禁止修改 git config(git config 变更需用户确认)

输出

  • 提交成功后的 commit hash
  • 变更文件清单
  • 提交信息摘要

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.