From golang-dev
This skill should be used when writing commit messages in Go-centric codebases (go.mod present or known from context). Triggers on user requests like "write a commit message", "commit these changes", "generate commit", or "author a commit". Also triggers proactively when the agent completes a task and decides to commit, prepares to run git commit, or needs to craft a commit message for staged changes. Covers commits for Go packages, documentation, configs, CI, tooling, and all other files.
npx claudepluginhub notorious-ai/claude-plugins --plugin golang-devThis skill uses the workspace's default tool permissions.
Write commit messages that match Go project conventions - for Go packages and all supporting files (docs, configs, CI, scripts) in Go-centric codebases.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides MCP server integration in Claude Code plugins via .mcp.json or plugin.json configs for stdio, SSE, HTTP types, enabling external services as tools.
Write commit messages that match Go project conventions - for Go packages and all supporting files (docs, configs, CI, scripts) in Go-centric codebases.
Commits tell the story of a codebase. Follow these rules for every commit:
When generating a commit message:
git diff --cached # staged changes
git diff # if nothing staged
Before deciding on target format, check how similar files were committed:
git log --oneline -10 -- <changed-file>
git log --oneline -20
Look for patterns:
ci: or github: for workflow files?Respect local conventions when they exist and are consistent.
Classify the changes to load appropriate guidance:
| Content Type | Files | Load Reference |
|---|---|---|
| Go packages | *.go files in module paths | references/go-package-commits.md |
| Non-Go content | docs, configs, CI, scripts | references/non-go-commits.md |
| Mixed changes | Both types | Consider splitting into separate commits |
Apply the decision algorithm from the appropriate reference file.
Quick reference for targets:
| Category | Target Format | Example |
|---|---|---|
| Go package | pkg or pkg/sub | net/http:, context: |
| Documentation | docs: | All .md files, docs/ |
| GitHub | github: | .github/ directory |
| Git config | git: | .gitignore, .gitattributes |
| Dependencies | go.mod: | Module changes |
| Build | build: | Makefile, build scripts |
| CI (non-GitHub) | ci: | CI configuration |
| Tool config | Tool name | golangci:, docker: |
Find the verb that describes WHAT the target does after the change.
Fill in the blank: "This change modifies TARGET to _____"
Common verbs by intent:
Avoid developer-action verbs: add, create, write, implement, make
When the target area or verb is ambiguous, use AskUserQuestion to prompt interactively:
Present prioritized suggestions:
1. Most likely target based on file paths
2. Alternative targets if applicable
3. Let user select or provide custom
Do not guess - ask when:
pkg/ and docs/)Format: target: verb phrase
Rules:
Consult references/body-guidelines.md for when and how to write commit body.
Include body when:
Skip body when:
Format the complete message:
target: verb phrase
Body paragraph explaining context and reasoning.
Hard wrap at 72 characters per line.
target: verb phrase completing "This change modifies TARGET to..."
[blank line]
Paragraph explaining key implications and reasoning.
Include context that helps future readers understand why.
[blank line]
[optional project-tracking references]
Line length limits:
Before presenting the commit message:
One-liner:
Body (if present):
Overall:
Load these as needed based on content type:
| File | Contains | Load When |
|---|---|---|
references/go-package-commits.md | Go package targeting, verb selection, examples | Changes include *.go files |
references/non-go-commits.md | Non-Go target identification, category-specific guidance | Changes include docs, configs, CI |
references/body-guidelines.md | Body writing guidelines, when to include | Need to write commit body |
| File | Contains |
|---|---|
examples/go-code-examples.md | Real Go package commit examples |
examples/non-go-examples.md | Docs, config, CI commit examples |
When to load examples:
Trivial changes - Skip examples. The workflow above suffices for straightforward commits where target and verb are obvious.
Ambiguous target or verb - Search examples for clues. Use grep to find similar patterns:
grep -i "verb-keyword" examples/go-code-examples.md
Sparse repository history - Load examples in full. When the working repository lacks good commit samples to learn from, use the example files as primary reference for style and verb selection.
XML tags for selective searching:
| Tag | Purpose | Context |
|---|---|---|
<example> | Full example with context, diff, explanation | Detailed learning |
<examples category="..."> | Grouped one-liners by work type | Quick verb/pattern lookup |
<message> | Commit message to emulate | Good examples; also baseline in Verb Alternatives |
<better> | Improved alternative to <message> | Only in Verb Alternatives section |
<anti-pattern> | What NOT to do | Anti-Patterns section |
<bad> | Bad commit message | Inside <anti-pattern> |
<good> | Corrected version of <bad> | Inside <anti-pattern> |
Tag relationships:
<message> + <better>: In Verb Alternatives, <message> is acceptable, <better> is preferred<bad> + <good>: In Anti-Patterns, <bad> is wrong, <good> is the fixWhen changes span both Go code and non-Go files:
all: only for truly cross-cutting refactoringWhen Go changes span multiple packages:
all:Always check the repository's commit history first. If the project has established conventions that differ slightly from these guidelines, follow local conventions for consistency.