360 Secure SkillHub
360 安全技能中心

commit

该 Skill 读取暂存区差异、当前分支和最近提交记录,按 Conventional Commits 规范推断类型与描述,生成提交信息并通过 git commit -F - 创建一次提交;明确不执行 git add 或 git push,无暂存内容时停止并提示先暂存文件。

derogab
热度 0.00
最近更新 2026-10-19 03:39:10
分类:开发依赖:代码执行应用场景:工作流 / DevOps / 模板

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add derogab/agent-kit/commit
Metadata
name
commit
description
Create a git commit following the Conventional Commits specification. Use when the user asks to commit staged changes or create a commit message.
disable-model-invocation
false
user-invocable
true
allowed-tools
Bash(git diff:*) Bash(git branch:*) Bash(git log:*)

Context

  • Staged diff: !git diff --staged
  • Branch: !git branch --show-current
  • Recent commits: !git log --oneline -5

Your task

Create a single git commit from the staged changes only.

Pre-flight checks

  1. If there are no staged changes, stop immediately and tell the user to stage files first. Do nothing else.
  2. Never run git add. Never run git push. Only commit what is already staged.

Commit message format

Follow Conventional Commits (https://www.conventionalcommits.org/en/v1.0.0/):

<type>(<optional scope>): <description>

[optional body]

Types:

  • feat – new capability
  • fix – bug fix
  • docs – documentation only
  • refactor – restructuring without functional change
  • test – test creation or modification
  • chore – routine maintenance (including dependencies)
  • build – build system or external dependencies
  • perf – performance improvement
  • ci – CI/CD changes

Append ! after the type/scope for breaking changes (e.g. feat!: change API response format).

Rules

  • Infer the correct type from the diff.
  • Write a concise description (lowercase, imperative mood, no period).
  • Add a body only when the diff is non-trivial and the "why" isn't obvious from the description.
  • Body: wrap at 72 characters, explain why not what.
  • Match the style and tone of the recent commits shown above.
  • Use a HEREDOC to pass the message to git commit -F -.
  • Do not send any text besides the tool calls.