SKILL·BAA324

git-commit

eduardo-sl
更新于 8 days ago
1 次查看
64
9
64
在 GitHub 上查看
general

关于

This Claude Skill generates structured git commit messages following Conventional Commits format specifically for Go projects. It creates well-scoped, atomic commits with clear descriptions when you're committing changes, preparing PRs, or reviewing commit history. Use it for commit-related tasks but not for changelog generation or code review, which have dedicated skills.

快速安装

Claude Code

推荐
主要方式
npx skills add eduardo-sl/go-agent-skills -a claude-code
插件命令备选方式
/plugin add https://github.com/eduardo-sl/go-agent-skills
Git 克隆备选方式
git clone https://github.com/eduardo-sl/go-agent-skills.git ~/.claude/skills/git-commit

在 Claude Code 中复制并粘贴此命令以安装该技能

技能文档

Git Commit Standards

Commits tell the story of your codebase. A good commit history is worth more than any amount of documentation — because it's always up to date.

1. Conventional Commits Format

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

[optional body]

[optional footer(s)]

Types:

TypeWhen
featNew feature (correlates with MINOR in semver)
fixBug fix (correlates with PATCH in semver)
refactorCode change that neither fixes a bug nor adds a feature
perfPerformance improvement
testAdding or correcting tests
docsDocumentation changes only
choreBuild process, tooling, dependencies
ciCI/CD configuration changes
styleFormatting, whitespace (not CSS — code formatting)

Scope:

Use the package name or module area:

feat(auth): add JWT refresh token rotation
fix(store/postgres): handle connection pool exhaustion
refactor(service): extract validation into dedicated package
test(handler): add table-driven tests for user endpoints
chore(deps): bump go.uber.org/zap to v1.27.0

Breaking changes:

feat(api)!: change pagination from offset to cursor-based

BREAKING CHANGE: The `offset` and `limit` query parameters are replaced
by `cursor` and `page_size`. All existing clients must migrate.

2. Commit Message Rules

Subject line:

  • Imperative mood: "add feature", NOT "added feature" or "adds feature"
  • Lowercase after type prefix
  • No period at the end
  • Max 72 characters
  • Must describe WHAT changed, not HOW

Body (when needed):

  • Blank line between subject and body
  • Explain WHY the change was necessary
  • Explain WHAT is different at a high level
  • Wrap at 72 characters

Footer:

  • Reference issues: Fixes #123, Closes #456, Refs #789
  • Co-authors: Co-authored-by: Name <email>
  • Breaking changes: BREAKING CHANGE: description

3. Examples

Simple change:

fix(handler): return 404 instead of 500 for missing user

With body:

refactor(service): replace manual SQL with sqlx named queries

The raw SQL string concatenation for dynamic WHERE clauses was
error-prone and difficult to maintain. sqlx named queries provide
the same flexibility with automatic parameter binding.

No behavior change — all existing tests pass.

Breaking change:

feat(config)!: migrate from YAML to environment variables

BREAKING CHANGE: Configuration is now loaded from environment
variables instead of config.yaml. See README.md for the full
list of supported variables.

Closes #234

Dependency update:

chore(deps): upgrade pgx to v5.5.0

Picks up connection pool improvements and fixes for
COPY protocol handling. See release notes:
https://github.com/jackc/pgx/releases/tag/v5.5.0

4. Atomic Commits

Each commit should be ONE logical change that:

  • Compiles on its own (go build ./... passes)
  • Tests pass (go test ./... passes)
  • Can be reverted independently without breaking other changes

Split large changes:

# ❌ Bad — one commit doing everything
feat(user): add user management with CRUD, validation, auth, and tests

# ✅ Good — atomic, reviewable commits
feat(domain): add User entity and validation rules
feat(store): implement PostgreSQL user repository
feat(service): add user service with create and get operations
feat(handler): add REST endpoints for user management
test(service): add table-driven tests for user creation
docs(api): document user endpoints in OpenAPI spec

5. Pre-Commit Verification

Before committing, run:

# Format and lint
goimports -w .
golangci-lint run

# Build
go build ./...

# Test
go test -race ./...

# Tidy modules
go mod tidy

If any step fails, fix before committing. Never commit broken code with "will fix later" — you won't.

6. Commit Workflow

# Stage specific files (not git add .)
git add internal/service/user.go
git add internal/service/user_test.go

# Review staged changes
git diff --staged

# Commit with message
git commit -m "feat(service): add user creation with email validation"

# Or use editor for longer messages
git commit  # opens $EDITOR

Interactive rebase before PR:

# Clean up commit history before opening PR
git rebase -i main

# Squash fixup commits
# Reword unclear messages
# Reorder for logical flow

7. What NOT to Commit

  • Generated files (*.pb.go unless required, mocks/)
  • IDE configuration (.idea/, .vscode/ — use global gitignore)
  • OS files (.DS_Store, Thumbs.db)
  • Binaries and build artifacts
  • .env files with secrets
  • vendor/ (unless explicitly required by project policy)

GitHub 仓库

eduardo-sl/go-agent-skills
路径: skills/(workflow)/git-commit
0
FAQ

常见问题

什么是 git-commit Skill?

git-commit 是一个 Claude Skill,作者为 eduardo-sl。Skill 将 Claude 按需加载的说明和资源打包,让 Claude 无需额外提示即可执行与 git-commit 相关的任务。

如何安装 git-commit?

使用本页的安装命令:将 git-commit 作为插件添加到 Claude Code,或将其仓库克隆到 skills 目录,然后重启 Claude 以加载该 Skill。

git-commit 属于哪个分类?

git-commit 属于元分类。

git-commit 可以免费使用吗?

可以。git-commit 已收录在 AIMCP,可免费安装。

相关推荐技能

content-collections

Content Collections 是一个 TypeScript 优先的构建工具,可将本地 Markdown/MDX 文件转换为类型安全的数据集合。它专为构建博客、文档站和内容密集型 Vite+React 应用而设计,提供基于 Zod 的自动模式验证。该工具涵盖从 Vite 插件配置、MDX 编译到生产环境部署的完整工作流。

查看技能
polymarket

这个Claude Skill为开发者提供完整的Polymarket预测市场开发支持,涵盖API调用、交易执行和市场数据分析。关键特性包括实时WebSocket数据流,可监控实时交易、订单和市场动态。开发者可用它构建预测市场应用、实施交易策略并集成实时市场预测功能。

查看技能
creating-opencode-plugins

该Skill帮助开发者创建OpenCode插件,用于接入命令、文件、LSP等25+种事件。它提供了插件结构、事件API规范和JavaScript/TypeScript实现模式,适合需要拦截操作、扩展功能或自定义事件处理的场景。开发者可通过它快速构建响应式模块来增强OpenCode AI助手的能力。

查看技能
sglang

SGLang是一个专为LLM设计的高性能推理框架,特别适用于需要结构化输出的场景。它通过RadixAttention前缀缓存技术,在处理JSON、正则表达式、工具调用等具有重复前缀的复杂工作流时,能实现极速生成。如果你正在构建智能体或多轮对话系统,并追求远超vLLM的推理性能,SGLang是理想选择。

查看技能