跳到主内容
智客 ZICQ

技能库 智客分类:Agent 工作流 git-commit

Git Commit

当用户想要做出一个 Git 执行或将更改分割成多个执行时使用此技能 。 当用户键入"/承诺"或要求常规承诺时也使用. 技能检查 diff , 分级相关文件, 写一个常规任务消息, 并运行 git 承诺 。 当用户只想要承诺消息而没有承诺时, 不要使用它 。 不要用它来推动,打开拉取请求,再基,或者改变承诺的历史.

47018 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

当用户想要做出一个 Git 执行或将更改分割成多个执行时使用此技能 。 当用户键入"/承诺"或要求常规承诺时也使用. 技能检查 diff , 分级相关文件, 写一个常规任务消息, 并运行 git 承诺 。 当用户只想要承诺消息而没有承诺时, 不要使用它 。 不要用它来推动,打开拉取请求,再基,或者改变承诺的历史.

何时用

官方 description 未单独写出 Use when。按规范,代理会在用户任务与这段 description 的关键词匹配时激活本技能。

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Git Commit with Conventional Commits、Message Format、Types、Breaking Changes、Workflow、1. Read the repository rules。 其中含规范建议的小节:分步指令。

文件分析

文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。

官方 description(原文)

Use this skill when the user wants to make a Git commit or split changes into more than one commit. Also use it when the user types "/commit" or asks for a conventional commit. The skill examines the diff, stages the related files, writes a Conventional Commits message, and runs git commit. Do not use it when the user wants only a commit message and no commit. Do not use it to push, open a pull request, rebase, or change the commit history.

Git Commit with Conventional CommitsMessage FormatTypesBreaking ChangesWorkflow1. Read the repository rules2. Examine the changes3. Stage the files4. Write the message5. Commit6. Make sure that the commit is correctSafety Rules

兼容:Requires Git. The `--resolved` option of `git add` requires Git 2.56 or later. · 许可:MIT · allowed-tools:shell(git:*)

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
git-commit
description
Use this skill when the user wants to make a Git commit or split changes into more than one commit. Also use it when the user types "/commit" or asks for a conventional commit. The skill examines the diff, stages the related files, writes a Conventional Commits message, and runs git commit. Do not use it when the user wants only a commit message and no commit. Do not use it to push, open a pull request, rebase, or change the commit history.
compatibility
Requires Git. The `--resolved` option of `git add` requires Git 2.56 or later.
allowed-tools
shell(git:*)实验字段,支持情况取决于客户端;字段声明本身不会授予工具权限。
许可
MIT
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「git-commit」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-12bf21a088cef2d7-Git-Commit.html
请存为 .cursor/skills/git-commit/SKILL.md 或 .claude/skills/git-commit/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/github/awesome-copilot' --list

npx skills add 'https://github.com/github/awesome-copilot' --skill 'git-commit'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: git-commit description: 'Use this skill when the user wants to make a Git commit or split changes into more than one commit. Also use it when the user types "/commit" or asks for a conventional commit. The skill examines the diff, stages the related files, writes a Conventional Commits message, and runs git commit. Do not use it when the user wants only a commit message and no commit. Do not use it to push, open a pull request, rebase, or change the commit history.' license: MIT compatibility: 'Requires Git. The `--resolved` option of `git add` requires Git 2.56 or later.' allowed-tools: shell(git:*) --- # Git Commit with Conventional Commits Make Git commits that follow the [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/) specification. Get the type, the scope, and the summary from the diff. ## Message Format ```text (): ``` - The scope, the body, and the footer are optional. Without a scope, write `: `. - Write the summary in the imperative mood: "add", not "added" or "adds". - Keep the first line at 72 characters or less. Do not put a period at the end. - In the body, tell what changed and why. - Write each footer as `Token: value` or `Token #value`, for example `Refs: #456` or `Closes #123`. Conventional Commits accepts the two forms, but Git reads only `Token: value` as a trailer. In a token, use `-` in place of a space. ## Types Conventional Commits defines only `feat` and `fix`. The other types come from the Angular convention ([`@commitlint/config-conventional`](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional)). If the repository has its own list, use that list. | Type | Use it for | | ---------- | ---------------------------------------------- | | `feat` | A new feature | | `fix` | A bug fix | | `docs` | Documentation only | | `style` | Formatting only, with no change to the logic | | `refactor` | A code change that is not a feature or a fix | | `perf` | A performance improvement | | `test` | New or changed tests | | `build` | The build system or the dependencies | | `ci` | The CI configuration | | `chore` | Other maintenance | | `revert` | A revert of an earlier commit | ## Breaking Changes Put `!` before the colon, or add a `BREAKING CHANGE:` footer. Write the token in uppercase. `BREAKING-CHANGE:` is also correct. ```text feat(api)!: remove the v1 endpoints BREAKING CHANGE: Clients must use the v2 endpoints. ``` ## Workflow ### 1. Read the repository rules Find the commit rules before you write a message: - A commitlint configuration, for example `commitlint.config.js` or `.commitlintrc.json`. - `CONTRIBUTING.md`. - The recent messages: `git log --oneline -10`. If a repository rule is different from this skill, use the repository rule. ### 2. Examine the changes ```bash git status --porcelain git diff --staged git diff ``` If there are no changes, tell the user. Do not make an empty commit. ### 3. Stage the files Put one logical change in each commit. If the staged files contain more than one change, first unstage the files of the other changes. Then stage the files for this change: ```bash git reset -q -- path/to/other-file1 path/to/other-file2 git add -- path/to/file1 path/to/file2 git add -- '*.test.*' git add -- src/components/ ``` - Put a glob in quotes. Without quotes, the shell expands the glob and does not find the files in subdirectories. - Do not use `git add -p` or `git add -i`. These commands wait for input from a person. - After you resolve a merge conflict, use `git add --resolved`. This command stages only the resolved files. If a file still has conflict markers, the command stops. - Examine the list of staged files with `git diff --staged --name-only`. Do not commit secrets, for example `.env` files, `credentials.json`, or private keys. ### 4. Write the message Get each part from the diff: - **Type**: The kind of change. - **Scope**: The module or the area that the change affects. - **Summary**: What changed, in one line. ### 5. Commit Give each paragraph with a different `-m` option. Git puts a blank line between the paragraphs. This command works in Bash, PowerShell, and other shells. ```bash git commit -m "feat(auth): add token refresh" git commit -m "fix(parser): accept empty input" -m "An empty file caused a crash." -m "Closes: #123" ``` For a long message, write the message to a temporary file. Then run `git commit -F `. ### 6. Make sure that the commit is correct ```bash git log -1 --stat git status --porcelain ``` ## Safety Rules - Do not change the Git configuration. - Do not use `--no-verify` unless the user tells you to. Hooks can be in `.git/hooks` or in the Git configuration. - If a hook fails, Git does not make the commit. Fix the problem, stage the files again, and run the same `git commit` command again. Do not use `--amend`, because it changes the previous commit. - Do not change the commit history unless the user tells you to. Do not use `git reset --hard`, `git rebase`, or the experimental `git history` command. - Do not push unless the user tells you to. Do not force push to the default branch.

相关技能

Agent 工作流

Skill Creator

创造有效技能指南。 当用户想创造出新的技能(或更新现有的技能),以专业知识,工作流程,或工具集成来扩展克洛德的能力时,应该使用这种技能.

Agent 工作流

Clawdhub

使用ClawdHub CLI搜索,安装,更新并发布从taladhub.com的代理技能. 需要获取苍蝇上的新技能时使用,将安装的技能同步到最新版本或特定版本,或者发布 npm-instainddhub CLI 的新/更新的技能文件夹.

Agent 工作流

Agent Team Orchestration

管弦乐团多代理团队,任务设定周期,交接协议,审查工作流程. 使用时间: (1)建立2+特派员队伍,具有不同专业,(2)确定任务路线和生命周期(收录框_ spec_建设_审查_完成),(3)在特派员之间制定交接协议,(4)建立审查和质量关口,(5)管理特派员之间的交流和文物共享.

Agent 工作流

Superpowers

Spec-first,TDD,子代理驱动的软件开发工作流程. 当:(1)构建任何新功能或应用——触发脑暴_计划_子代理执行回路,(2)调试出一个bug或测试失败——触发系统性的根起过程,(3)用户说"让我们构建","帮助我计划","我想添加X",或"这个被打破",(4)完成一个功…