360 Secure SkillHub
360 安全技能中心

Git Commit Workflow

核心功能是按规范流程生成单个干净Git提交:先检查仓库状态等信息,暂存仅相关变更,起草贴合变更原因的简洁消息,非交互完成提交并反馈结果。典型场景为用户需将当前工作树生成干净提交、或要求暂存正确文件并生成合规提交消息。输入为当前diff、分支状态、近期提交风格,输出为单个未修改的提交及准确提交消息,严格遵循安全规则。

wimi321
wimi321
热度 40.64
最近更新 2026-05-11 17:39:12
分类:开发依赖:代码执行应用场景:DevOps

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add claude-code-git-commit-workflow
Metadata
name
git_commit_workflow
description
Use when the user wants a single clean commit created from current changes with safe staging, message drafting, and non-interactive git usage.

Git Commit Workflow

Use this skill when the task is to create one commit from current work.

Workflow

  1. Inspect git status, diff, branch, and recent commit style.
  2. Stage only relevant changes.
  3. Draft a concise commit message that reflects why the change exists.
  4. Create a new commit non-interactively.
  5. Report the resulting commit summary.

Guardrails

  • Never amend unless explicitly asked.
  • Never bypass hooks unless explicitly asked.
  • Avoid staging secrets or unrelated files.
  • Do not create an empty commit.

Example Requests

  • Make one clean commit from the current working tree.
  • Stage the right files and create a proper commit message.

Inputs

  • Current diff
  • Branch state
  • Recent commit style

Outputs

  • One non-amended commit
  • Accurate commit message

Success Criteria

  • Only relevant changes were committed.
  • No empty commit was created.
  • Hooks and safety rules were respected.

Non-Goals

  • Amend flows unless explicitly asked
  • Committing secrets or unrelated changes

Source Provenance

Derived from src/commands/commit.ts.