AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Git Commit

skill-nicholyx-ai-skills-git-commit · by nicholyx

使用约定式提交规范执行 git commit

— No reviews yet
0 installs
2 views
0.0% view→install

Install

$ agentstack add skill-nicholyx-ai-skills-git-commit

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • ✓ Prompt-injection patterns
  • ✓ Secret / credential exfiltration
  • ✓ Dangerous shell & filesystem operations
  • ✓ Untrusted network calls
  • ✓ Known-malicious package signatures

What it can access

  • ✓ Network access No
  • ✓ Filesystem access No
  • ✓ Shell / process execution No
  • ● Environment & secrets Used
  • ✓ Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-nicholyx-ai-skills-git-commit)

Reliability & compatibility

✓ Security review passed
0 installs to date
— no reviews yet
● today

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Git Commit? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Git 约定式提交

概述

使用约定式提交(Conventional Commits)规范创建标准化、语义化的 git commit。分析实际 diff 来确定合适的 type、scope 和消息。

语言设置

默认生成中文提交消息。 用户可通过参数指定其他语言,例如:

  • 无参数 → 中文消息
  • --lang=en → 英文消息

约定式提交格式

[可选 scope]: 

[可选正文]

[可选脚注]

中文消息示例

feat(auth): 引入 JWT 验证以保护接口安全

实现 JWT Token 验证中间件,解决接口未鉴权的安全风险:
- 验证 Token 签名和过期时间,防止伪造请求
- 从 Payload 提取用户声明,供下游使用
- 将用户上下文注入请求对象,避免重复查询
- 处理 Refresh Token 轮换,保持会话连续性

英文消息示例

feat(auth): add JWT validation to secure API endpoints

提交类型

| 类型 | 用途 | | ---------- | ---------------------------- | | feat | 新功能 | | fix | 修复缺陷 | | docs | 仅文档变更 | | style | 代码格式/风格(不影响逻辑) | | refactor | 重构(非功能/非修复) | | perf | 性能优化 | | test | 新增/更新测试 | | build | 构建系统/依赖变更 | | ci | CI/配置变更 | | chore | 维护/杂项 | | revert | 回退提交 |

破坏性变更

# type/scope 后加感叹号
feat!: 移除已废弃的接口以简化 API 维护

# BREAKING CHANGE 脚注
feat: 支持配置继承以减少重复配置

BREAKING CHANGE: `extends` 键的行为已变更

提交拆分策略

当检测到以下情况时,应建议拆分为多个提交:

  1. 混合类型:新功能 + 缺陷修复在同一提交中
  2. 多关注点:不相关的变更混在一起
  3. 大范围变更:跨越多个模块的修改
  4. 文件模式混合:源码 + 测试 + 文档混杂
  5. 依赖混杂:依赖更新与功能代码混合

工作流程

1. 分析差异

# 首先检查暂存区
git diff --staged

# 同时检查状态,判断暂存区和工作区情况
git status --porcelain

默认只提交暂存区(staged)的代码。 流程如下:

  1. 先检查暂存区是否有内容(git diff --staged 是否有输出)
  2. 暂存区有内容 → 直接使用暂存区差异生成提交消息
  3. 暂存区无内容 → 提示用户:"暂存区没有文件,是否要提交工作区的变更?" — 等待用户确认后再执行

2. 暂存文件(如需要)

仅在用户确认提交工作区变更后,或需要按逻辑分组时暂存:

# 暂存指定文件
git add path/to/file1 path/to/file2

# 按模式暂存
git add *.test.*
git add src/components/*

绝不能提交密钥文件(.env、credentials.json、私钥等)。

3. 生成提交消息

分析 diff 来确定:

  • Type:这是什么类型的变更?
  • Scope:影响哪个区域/模块?
  • 描述:一行概括为什么要做这个变更(现在时态、祈使语气、[scope]: "

多行,含正文/脚注

git commit -m "$(cat [scope]:

EOF )"


### 5. Push 规则

**默认不执行 `git push`。** 只有当用户明确说了"push"或"推送"时,才在提交后执行 push。

## 最佳实践

- 一个提交只包含一个逻辑变更
- 使用现在时态:"添加" 而非 "添加了"
- 使用祈使语气:"修复缺陷" 而非 "修复了缺陷"
- 引用议题:`Closes #123`、`Refs #456`
- 描述保持在 72 字符以内

## Git 安全协议

- 禁止修改 git config
- 未经用户明确要求,禁止执行破坏性命令(--force、hard reset)
- 未经用户要求,禁止跳过钩子(--no-verify)
- 禁止 force push 到 main/master
- 如果提交因钩子失败,修复问题后创建新提交(不要 amend)

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [nicholyx](https://github.com/nicholyx)
- **Source:** [nicholyx/ai-skills](https://github.com/nicholyx/ai-skills)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.