Skip to main content
skill CX Codex

git-commit · eduardo-sl — Claude Code skill: Conventional Commits for Go projects

A skill that makes your agent write commit messages in Conventional Commits style: typed, scoped, imperative. Useful when the repo history has turned into noise.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add eduardo-sl/go-agent-skills --skill git-commit -a claude-code
Open on GitHub

What git-commit does

The skill hands your agent a fixed shape for commit messages in Go codebases. A subject looks like <type>(<scope>): <description>, where the type is one of feat, fix, refactor, perf, test, docs, chore, ci or style, and the scope names a package or module. The body explains why the change was needed; the footer carries issue references and breaking-change notes.

What's inside: a type table, subject-line limits, worked examples for small fixes and for breaking changes, plus a section on atomic commits. Each commit should build and pass tests on its own. Before committing, the skill runs goimports -w ., golangci-lint run, go build ./..., go test -race ./... and go mod tidy. For rebases it prepares fixups without an editor, then hands the last step back to you, since git rebase -i opens $EDITOR and an agent can't drive that.

You need git installed; the verification steps assume a Go toolchain with the linter available. A project-level rule that explicitly overrides git-commit wins over this skill, so it's worth checking your repo config before relying on it.

What it helps with

  • keep commit messages in one consistent format
  • split a large change into atomic commits
  • document a breaking change with BREAKING CHANGE
  • prepare fixup commits ahead of a rebase
  • run build and tests before committing

Example prompts for the agent

  • Commit the changes in internal/service/user.go using Conventional Commits
  • Split this change into atomic commits and write the messages
  • Prepare fixup commits against main before I open a PR

How to install git-commit

1Skills CLI (Vercel)

npx skills add eduardo-sl/go-agent-skills --skill git-commit -a claude-code

2Manually: put the files in place

~/.claude/skills/git-commit/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/git-commit/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about git-commit

How do I install git-commit in Claude Code?

Run npx skills add eduardo-sl/go-agent-skills --skill git-commit -a claude-code, then check that ~/.claude/skills/git-commit/SKILL.md is in place.

What does the git-commit skill do?

It gives the agent rules for Conventional Commits: type and scope, an imperative subject, a body that explains the reason, and a footer with issue links.

How is git-commit different from a code review skill?

This one covers commit messages and PR preparation only. Reviewing code and generating changelogs sit outside it.

Source text

SKILL.md · MIT
---
name: git-commit
description: >
  Structured git commit messages following Conventional Commits format for
  Go projects. Generates well-scoped, atomic commits with clear
  descriptions. Use when committing changes, writing commit messages,
  preparing PRs, or reviewing commit history quality. Trigger examples:
  "commit these changes", "create commit", "commit message", "prepare PR",
  "squash commits".
  Not for: code review (go-code-review), changelog generation.
user-invocable: true
license: MIT
compatibility: Designed for Claude Code or similar AI coding agents. Requires git.
allowed-tools: Read Glob Grep Bash(git:*)
metadata:
  author: eduardo-sl
  version: "1.2.2"
---

# 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.

> Community default. A project skill or agent-config rule that explicitly
> supersedes `git-commit` takes precedence over this one.

## 1. Conventional Commits Format

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

[optional body]

[optional footer(s)]
```

### Types:

| Type | When |
|---|---|
| `feat` | New feature (correlates with MINOR in semver) |
| `fix` | Bug fix (correlates with PATCH in semver) |
| `refactor` | Code change that neither fixes a bug nor adds a feature |
| `perf` | Performance improvement |
| `test` | Adding or correcting tests |
| `docs` | Documentation changes only |
| `chore` | Build process, tooling, dependencies |
| `ci` | CI/CD configuration changes |
| `style` | Formatting, whitespace (not CSS — code formatting) |

### Scope:

Use the package name or module area:

```text
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:

```text
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:

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

### With body:

```text
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:

```text
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:

```text
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:

```text
# ❌ 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:

```bash
# 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

```bash
# 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:

Interactive rebase opens `$EDITOR`, so an agent cannot drive it. Prepare
fixups non-interactively, then hand the final step to the developer:

```bash
# Mark a commit as a fixup of an earlier one (no editor)
git commit --fixup <sha>

# Collapse them automatically (no editor with --autosquash + GIT_SEQUENCE_EDITOR)
GIT_SEQUENCE_EDITOR=: git rebase -i --autosquash main
```

For reordering or rewording, tell the developer to run `git rebase -i main`
themselves rather than attempting it.

## 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)

© eduardo-sl · MIT · eduardo-sl/go-agent-skills

Similar skills

All skills for Git and GitHub →

git-commit by other authors comes first.

git-commit official github This skill reviews Git changes, stages related files, and creates Conventional Commits. Use it when you want an agent to make one commit or split work into separate commits. 47,165installs git-commit fvadicamo A skill that writes git commits in Conventional Commits format with a type, a required scope and a short subject. Useful when the agent commits on your behalf. CX Codex +1 319installs git-commit ilteoood Reads your diff, picks the commit type and scope, and writes a Conventional Commits message. Handy when every commit ends up as fix or update. CX Codex +1 533installs triage Matt Pocock This skill moves issues and external PRs through triage states, verification, and agent briefs. It fits maintainers managing an issue queue. 990,453installs code-review Matt Pocock Reviews changes from a chosen reference point against repository standards and the originating spec. Use it for a branch, PR, or work in progress. 789,521installs implement Matt Pocock Implements work from a specification or tickets, following a test-driven flow and ending with review and a commit. Use it when a coding task needs a defined delivery routine. 774,700installs git-guardrails-claude-code Matt Pocock This skill adds a Claude Code hook that stops risky Git commands before they run. Use it when an agent must not push or discard working-tree changes. 499,069installs setup-pre-commit Matt Pocock This skill configures pre-commit checks for a JavaScript repository, running Prettier, type checking, and tests before each commit. 489,289installs scaffold-exercises Matt Pocock This skill builds course exercise directories with sections, problems, solutions, and explainers. Use it when starting a new course section or creating exercise stubs. 480,196installs

From the same set11

go-semantic-tools Finds function calls, interface implementations, and dependency graphs in Go via gopls and go list, not text search. Understands implicit interfaces, embedding, and cross-package dependencies that grep misses. CX Codex +1 ★ 83repo stars go-ci A skill that helps your AI agent write and set up GitHub Actions for Go projects. Use it when you need a pipeline with linting, tests, security checks, and caching. CX Codex +1 ★ 83repo stars go-troubleshooting A skill that walks the agent through Go runtime diagnosis: panics, deadlocks, goroutine and memory leaks, race reports. Useful when a program crashes or hangs and the cause is unclear. CX Codex +1 ★ 83repo stars go-observability A skill that sets conventions for Go service telemetry: structured logs with log/slog, OpenTelemetry traces and metrics, SLO alerts. Useful once a service runs in production and you need to see what it does. CX Codex +1 ★ 83repo stars go-error-handling A skill that tells your agent how to create, wrap and inspect Go errors: %w wrapping, sentinel errors, custom types, errors.Is and errors.As. CX Codex +1 ★ 83repo stars go-context A skill that makes your coding agent handle context.Context in Go correctly: cancellation, timeouts, values and the usual anti-patterns. CX Codex +1 ★ 83repo stars go-project-layout Picks a folder layout for a new Go project: cmd/, internal/, or a flat root for small tools. Useful at the start, before the structure hardens. CX Codex +1 ★ 83repo stars go-grpc A skill that steers your coding agent through gRPC work in Go: proto contracts, error codes, deadlines, interceptors and streaming. CX Codex +1 ★ 83repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor