SKILL·BAA324

git-commit

eduardo-sl
Updated Yesterday
1 views
63
9
63
View on GitHub
Metageneral

About

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.

Quick Install

Claude Code

Recommended
Primary
npx skills add eduardo-sl/go-agent-skills -a claude-code
Plugin CommandAlternative
/plugin add https://github.com/eduardo-sl/go-agent-skills
Git CloneAlternative
git clone https://github.com/eduardo-sl/go-agent-skills.git ~/.claude/skills/git-commit

Copy and paste this command in Claude Code to install this skill

Documentation

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 Repository

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

Frequently asked questions

What is the git-commit skill?

git-commit is a Claude Skill by eduardo-sl. Skills package instructions and resources that Claude loads on demand, so Claude can perform git-commit-related tasks without extra prompting.

How do I install git-commit?

Use the install commands on this page: add git-commit to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.

What category does git-commit belong to?

git-commit is in the Meta category, tagged general.

Is git-commit free to use?

Yes. git-commit is listed on AIMCP and free to install.

Related Skills

content-collections
Meta

This skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.

View skill
polymarket
Meta

This skill enables developers to build applications with the Polymarket prediction markets platform, including API integration for trading and market data. It also provides real-time data streaming via WebSocket to monitor live trades and market activity. Use it for implementing trading strategies or creating tools that process live market updates.

View skill
creating-opencode-plugins
Meta

This skill helps developers create OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It provides the plugin structure, event API specifications, and implementation patterns for JavaScript/TypeScript modules. Use it when you need to intercept, monitor, or extend the OpenCode AI assistant's lifecycle with custom event-driven logic.

View skill
sglang
Meta

SGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.

View skill