跳到正文
Skillpedia
通用编程8.2k · #12545

create-commit

它能做什么

这项技能帮助你的 AI 把完成的工作保存到 Git 中,形成干净、小巧的提交。适合希望提交内容精准、只包含指定文件的开发者。

适用场景

  • ✓当你要求你的 AI 提交已经完成的工作的时候。
  • ✓当工作文件夹里有很多改动,而你只想提交其中一部分的时候。
  • ✓当你希望提交说明遵循 Conventional Commits 风格的时候。

技能链接

https://github.com/DevCaress/guia-entrevistas-de-programacion/blob/main/.claude/skills/create-commit/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/DevCaress/guia-entrevistas-de-programacion/blob/main/.claude/skills/create-commit/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请只提交我今天完成的那一章,附上清晰的说明,并且不要推送。”

每周 5 个新技能,1 分钟读完。

工作原理

技能会检查改动和最近的提交说明,选出最小的合理文件集,运行相关检查,然后创建提交。除非你要求,它不会推送、修正提交或切换分支。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Create Commit

Create small, reviewable commits that follow this repository's contribution rules. Do not push, amend, rebase, reset, or change branches unless the user explicitly asks.

Workflow

  1. Inspect git status --short, the staged and unstaged diffs, and recent commit messages.

  2. Determine the smallest coherent commit. Preserve unrelated user changes; never use git add -A or git add ..

  3. If the intended files or scope are unclear, ask the user before staging or committing.

  4. Stage only the chosen paths with git add <path>....

  5. Select a Conventional Commit message. Prefer a scoped type when useful:

    docs(scope): describe documentation change
    feat(scope): describe user-facing addition
    fix(scope): describe corrected behavior
    test(scope): describe test change
    chore(scope): describe maintenance work
    ci: describe workflow change
    

    Use a concise, lowercase imperative subject with no final period. Reuse an explicit user-provided message if it is suitable.

  6. Run the relevant validation commands from CONTRIBUTING.md when they are practical for the changed files. Report any pre-existing or environment-related failure; do not conceal it by weakening checks.

  7. Review the staged diff one final time, then create the commit with git commit -m "<message>".

  8. Confirm success with git status --short and git log -1 --oneline.

Safety rules

  • Do not commit secrets, generated output, local configuration, or unrelated files.
  • Do not modify existing commits, force-push, or push any branch as part of this skill.
  • Do not bypass hooks with --no-verify unless the user explicitly authorizes it after the failure is explained.
  • If validation fails because of the proposed change, fix it before committing when the user asked for a finished commit. If it is unrelated, report it clearly.
常见问题

它会把我的提交推送到服务器吗?

不会。除非你明确要求,技能不会推送。

它能一次提交所有内容吗?

不能。技能不会盲目添加所有文件,而只暂存指定的路径。

提交说明由它来写吗?

是的。它会提出一条 Conventional Commit 风格的说明,或者沿用你提供的说明。

详情

作者的原始描述

Create a safe, focused Git commit for this repository. Use when the user asks to commit completed work, prepare a commit, or choose a Conventional Commit message. Inspect the working tree, stage only intended files, validate relevant changes, and create the commit without pushing.

repo: DevCaress/guia-entrevistas-de-programacion

热度

GitHub 星标
8.2k
排名
#12545
许可证
MIT
更新时间
2026/8/8

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能