Git Commit Message Generator
Auto-generates conventional commit messages from git diffs with tiered format enforcement
Purpose
Analyze staged git changes and generate concise, meaningful commit messages following a tiered Conventional Commits specification. This skill examines file modifications, additions, and deletions to infer the type and scope of changes, producing commit messages that match the importance of the change - from detailed documentation for critical features to concise messages for minor updates.
Key Innovation: Three-tier format system that balances thoroughness for critical commits (feat, fix, security) with efficiency for routine changes (docs, chore, style).
When This Skill Activates
- When
/commit-msg command is invoked
- When invoked from a
commit-msg/prepare-commit-msg hook (if installed)
- When user requests commit message suggestions
- When analyzing changes before creating a commit
Core Capabilities
1. Diff Analysis
- Parse
git diff --staged output
- Identify modified, added, and deleted files
- Analyze code changes (additions, deletions, modifications)
- Detect patterns across multiple files
2. Change Classification
- Determine commit type from changes:
feat: New features or functionality
fix: Bug fixes
security: Security fixes or hardening
refactor: Code restructuring without behavior change
docs: Documentation changes
style: Formatting, whitespace, code style
test: Adding or modifying tests
chore: Build process, dependencies, tooling
perf: Performance improvements
ci: CI/CD configuration changes
build: Build system changes
revert: Reverting previous commits
3. Scope Detection
- Infer scope from file paths and patterns:
- Directory names (e.g.,
api, auth, ui)
- File name patterns (e.g.,
*.test.js → tests)
- Framework conventions (e.g.,
components/, services/)
4. Message Generation
- Format:
type(scope): description
- Enforce tier limits: Tier 1 summary max 50 chars; Tier 2/3 summary max 72 chars (ideal 50)
- Use imperative mood ("add" not "added")
- Focus on "what" and "why", not "how"
- Provide 2-3 alternative suggestions
Tier System: Smart Format Enforcement
This skill uses a three-tier format system that matches message detail to commit criticality:
Tier 1: Critical Commits (feat, fix, perf, security)
Requirements: Detailed documentation with impact statement
Format:
type(scope): summary line (max 50 chars)
- Detailed description point 1
- Detailed description point 2
- Detailed description point 3
This change [impact statement describing user-facing benefit or risk addressed].
Affected files/components:
- path/to/file1
- path/to/file2
Why: Features, fixes, and performance changes affect users directly and need thorough documentation for future reference and changelog generation.
Tier 2: Standard Commits (refactor, test, build, ci)
Requirements: Brief context and file list
Format:
type(scope): summary line (max 72 chars)
Brief explanation of what changed and why (1-2 sentences).
Files: path/to/file1, path/to/file2
Why: Internal improvements need context for maintainability but don't require extensive documentation.
Tier 3: Minor Commits (docs, style, chore)
Requirements: Summary line, optional description
Format:
type(scope): summary line (max 72 chars)
[Optional: Additional context if helpful]
Why: Documentation and routine maintenance are self-explanatory from the diff; verbose messages add noise.
Workflow
0. Pre-staging typecheck (if project uses TypeScript):
- Run `tsc --noEmit` on changed files before staging
- Fix type errors before committing (avoids pre-commit hook retry loops)
1. Get staged changes (staged only, not working tree):
- git diff --staged --name-status
- git diff --staged --stat
- git diff --staged
2. Load config → frameworks/shared-skills/skills/dev-git-commit-message/config.yaml
3. Analyze changes:
- Count files modified/added/deleted
- Identify primary change type using analysis patterns
- Detect scope from project structure (config.yaml)
- Determine tier (1/2/3) based on commit type
- Extract key modifications
4. Generate commit messages:
- Apply tier-appropriate format
- Primary suggestion (best match)
- Alternative 1 (different scope/angle)
- Alternative 2 (broader/narrower focus)
5. Validate against rules:
- Check forbidden patterns
- Verify required elements present
- Ensure length limits
6. Present to user with explanation and tier info
Optional Modes (If Supported By The Caller)
--validate "<message>": Validate a commit message without generating suggestions (format/type/scope/length/forbidden patterns; then report required Tier 1/2/3 elements if missing).
--tier <1|2|3>: Force the tier format (overrides auto-detection).
--interactive or -i: Ask for confirmation of type, scope, and summary before final output.
Output Format
[NOTE] Suggested Commit Messages (based on X files changed)
PRIMARY:
feat(api): add user authentication endpoints
ALTERNATIVES:
1. feat(auth): implement JWT token validation
2. feat: add user authentication system
ANALYSIS:
- 3 files modified in src/api/
- New functions: authenticateUser, generateToken
- Primary change: new feature (authentication)
- Scope detected: api/auth
Conventional Commits Quick Reference
Type Guidelines:
feat: User-facing features or API additions
fix: Corrects incorrect behavior
refactor: Improves code without changing behavior
docs: README, comments, documentation files
style: Formatting only (prettier, eslint --fix)
test: Test files or test utilities
chore: Build scripts, package updates, config
perf: Measurable performance improvements
ci: GitHub Actions, CircleCI, build pipelines
Scope Guidelines:
- Use lowercase
- Be specific but not too narrow
- Match your project's module structure
- Omit if changes span multiple unrelated areas
Description Guidelines:
- Start with lowercase verb
- No period at the end
- Be specific and concise
- Focus on user impact for
feat and fix
Edge Cases
Multiple unrelated changes:
- Suggest splitting into separate commits
- If forced to combine, use broader scope or omit scope
Breaking changes:
- Append exclamation mark after type/scope (example: feat(api)!: change auth flow)
- Include BREAKING CHANGE in body (handled by user)
WIP or experimental:
- Use
chore(wip): description or feat(experimental): description
No meaningful changes:
- Detect and warn: "No staged changes detected"
- Suggest
git add commands
Integration Points
Pre-commit hook: Triggered before commit (if installed/configured)
Slash command: Manual invocation via /commit-msg
Direct skill call: From other skills or tools
Best Practices
- Analyze context: Look at file paths, function names, import statements
- Prioritize clarity: Prefer obvious descriptions over clever ones
- Respect conventions: Follow project's existing commit patterns if detected
- Avoid hallucination: Only describe what's actually in the diff
- Be concise: 50 chars is ideal, 72 is maximum for first line
- Stage specific files: Use
git add <file1> <file2>, not git add -A or git add ., to avoid pulling in unrelated changes or sensitive files
- Avoid heredoc in sandboxed shells: Sandboxed environments may block temp file creation for here-documents. Use
git commit -m "$(cat <<'EOF'\nmessage\nEOF\n)" or pass -m "message" directly
- Pre-commit typecheck: Run
tsc --noEmit on the staged surface before committing to catch type errors early and avoid retry cascades from pre-commit hooks
Example Analyses
Scenario 1: New React component
Files: src/components/UserProfile.tsx, src/components/UserProfile.test.tsx
Changes: +120 lines, component definition, props interface, tests
Message: feat(components): add UserProfile component
Scenario 2: Bug fix in API
Files: src/api/auth.ts
Changes: -5 +8 lines, fix token expiration check
Message: fix(auth): correct token expiration validation
Scenario 3: Documentation update
Files: README.md, docs/api.md
Changes: +45 lines documentation
Message: docs: update API documentation and README
Scenario 4: Dependency update
Files: package.json, package-lock.json
Changes: version bumps for eslint, typescript
Message: chore(deps): update eslint and typescript
Analysis Patterns: Smart Type Detection
The skill uses pattern matching to intelligently detect commit types from diffs:
feat Detection
- New files created (especially in src/, components/, api/)
- New functions/classes exported (
export function, export class)
- New API routes (
app.get, router.post, etc.)
- New assets/skills (in .claude/, custom-gpt/, etc.)
- Threshold: 20+ lines added typically indicates feature
fix Detection
- Test file changes (often indicates bug reproduction)
- New conditionals (validation fixes)
- Error handling additions (
try, catch, throw)
- Input validation (
validate, sanitize, check)
- Commit message hints: Words like "bug", "issue", "error", "crash"
refactor Detection
- Balanced changes (similar additions and deletions)
- Function renames/moves (same logic, different location)
- No new features or fixes
- Test coverage unchanged
- Keywords: "extract", "move", "rename", "reorganize"
docs Detection
- File patterns:
.md, .txt, README, CHANGELOG, /docs/
- Pure documentation changes (no code modifications)
- Mixed code+docs: Prefer code type, note docs in description
test Detection
- File patterns:
test.js, spec.ts, __tests__/, /tests/
- Test framework patterns:
describe, it, test, expect, assert
style Detection
- CSS/styling files:
.css, .scss, .sass, .less
- Formatter configs:
prettier, eslint
- Whitespace-only changes
- Keywords: "formatting", "indent", "whitespace"
chore Detection
- Dependency files:
package.json, requirements.txt, Gemfile
- Lock files:
package-lock.json, yarn.lock
- Config files:
.gitignore, .env
- Keywords: "dependency", "deps", "upgrade", "bump"
Configuration
Project-specific configuration loaded from config.yaml:
- Scope mapping: Maps directory patterns to scope names (e.g.,
frameworks/claude-code-kit/** → claude-kit)
- Tier rules: Defines which commit types require which tier format
- Forbidden patterns: Blocks commits with generic messages or assistant/tool attribution
- Analysis patterns: Customizes type detection logic for your codebase
- Validation mode:
strict (block), warning (warn), or disabled
Forbidden Patterns (Validation)
The skill automatically blocks commits with these patterns:
Generic/Vague Messages
- [FAIL] "Update files" → [OK] "docs: update API reference"
- [FAIL] "Fix stuff" → [OK] "fix(auth): correct token validation"
- [FAIL] "Change code" → [OK] "refactor(utils): simplify date formatting"
Assistant/Tool Attribution (Per Repository Policy)
- [FAIL] "Generated with Claude Code"
- [FAIL] "Co-Authored-By: Claude noreply@anthropic.com"
- [FAIL] Any assistant/tool attribution in commit messages
Work-in-Progress Markers
- [WARNING] "WIP: feature" (warning - should be squashed before merge)
- [WARNING] "temp: quick fix" (warning - should be squashed)
Missing Type
- [FAIL] Commits without type prefix (feat, fix, docs, etc.)
Error Handling
- No staged changes: Run
git status and guide user to git add files
- Binary files only: Note that commit message should mention file types
- Merge conflicts: Detect and suggest
chore: resolve merge conflicts
- Git not available: Graceful failure with helpful error message
- Forbidden pattern detected: Show error with examples and block commit (strict mode)
- Missing required elements: List what's missing based on tier requirements
- Length exceeded: Show character count and suggest shortening
Integration with Repository
This skill integrates with the AI-Agents repository standards:
- CLAUDE.md reference: Mandatory skill usage before commits
- config.yaml: Project-specific scope mappings and rules
- Pre-commit hook: Automatic activation before git commits
- CONTRIBUTING.md: Commit guidelines for contributors
Commit Message Template
assets/template-commit-message.md — Copy-paste template and good/bad examples.
Use it to standardize type(scope): summary messages and keep history automation-friendly.
Security-Sensitive Commits
assets/template-security-commits.md — Guide for handling security-sensitive changes.
Key Sections
- Pre-Commit Security Checklist — Secrets detection, prohibited patterns
- Security-Related Commit Types — Security fix, enhancement, configuration
- Accidental Secret Commits — Immediate response, rotation, history cleanup
- Sensitive File Patterns — .gitignore templates, files that should never be committed
- Audit Trail Requirements — CVE, CVSS, CWE metadata for security commits
Do / Avoid
GOOD: Do
- Run secrets scan before every commit
- Rotate secrets immediately if exposed
- Use environment variables for credentials
- Document security fixes with CVE/CVSS
- Require security team review for auth changes
- Keep .gitignore updated for secret patterns
BAD: Avoid
- Committing secrets "temporarily"
- Using hardcoded credentials in tests
- Storing real credentials in example files
- Assuming deleted secrets are safe
- Committing before secrets scan completes
- Using generic commit messages for security fixes
Anti-Patterns
| Anti-Pattern |
Problem |
Fix |
| "Add secrets later" |
Secrets committed accidentally |
Use env vars from start |
| Secrets in tests |
Real credentials in repo |
Use mocks/test credentials |
| Force push to hide |
History still recoverable |
Rotate + document |
| Vague security commits |
No audit trail |
Include CVE/CVSS |
| No pre-commit scan |
Secrets reach remote |
Install gitleaks hook |
Optional: AI/Automation
Note: AI suggestions should preserve human intent.
- Commit message suggestions — Draft from diff analysis
- Type detection — Pattern-based commit type inference
- Scope detection — Auto-detect from changed paths
Bounded Claims
- AI-generated messages need human review and modification
- Automated type detection may miss context
- Security commits always need human judgment
Resources
| Resource |
Purpose |
| references/conventional-commits-guide.md |
Conventional Commits spec and tooling |
| references/commit-message-antipatterns.md |
Common bad patterns, detection, linting |
| references/monorepo-commit-conventions.md |
Scope strategies for multi-package repos |
| references/changelog-generation-guide.md |
Changelog tooling setup, CI integration |
| data/sources.json |
Curated external sources |
Version: 2.1.1
Last Updated: 2026-01-26
Repository: AI-Agents (documentation repository)
Conventional Commits Spec: https://www.conventionalcommits.org/
Fact-Checking
- Use web search/web fetch to verify current external facts, versions, pricing, deadlines, regulations, or platform behavior before final answers.
- Prefer primary sources; report source links and dates for volatile information.
- If web access is unavailable, state the limitation and mark guidance as unverified.
1---2name: dev-git-commit-message3description: Generates conventional commit messages from git diffs. Use when you need well-formatted commit messages following Conventional Commits.4---5
6# Git Commit Message Generator
7
8**Auto-generates conventional commit messages from git diffs with tiered format enforcement**
9
10## Purpose
11
12Analyze staged git changes and generate concise, meaningful commit messages following a tiered Conventional Commits specification. This skill examines file modifications, additions, and deletions to infer the type and scope of changes, producing commit messages that match the importance of the change - from detailed documentation for critical features to concise messages for minor updates.
13
14**Key Innovation**: Three-tier format system that balances thoroughness for critical commits (feat, fix, security) with efficiency for routine changes (docs, chore, style).
15
16## When This Skill Activates
17
18- When `/commit-msg` command is invoked
19- When invoked from a `commit-msg`/`prepare-commit-msg` hook (if installed)
20- When user requests commit message suggestions
21- When analyzing changes before creating a commit
22
23## Core Capabilities
24
25**1. Diff Analysis**
26- Parse `git diff --staged` output
27- Identify modified, added, and deleted files
28- Analyze code changes (additions, deletions, modifications)
29- Detect patterns across multiple files
30
31**2. Change Classification**
32- Determine commit type from changes:
33 - `feat`: New features or functionality
34 - `fix`: Bug fixes
35 - `security`: Security fixes or hardening
36 - `refactor`: Code restructuring without behavior change
37 - `docs`: Documentation changes
38 - `style`: Formatting, whitespace, code style
39 - `test`: Adding or modifying tests
40 - `chore`: Build process, dependencies, tooling
41 - `perf`: Performance improvements
42 - `ci`: CI/CD configuration changes
43 - `build`: Build system changes
44 - `revert`: Reverting previous commits
45
46**3. Scope Detection**
47- Infer scope from file paths and patterns:
48 - Directory names (e.g., `api`, `auth`, `ui`)
49 - File name patterns (e.g., `*.test.js` → `tests`)
50 - Framework conventions (e.g., `components/`, `services/`)
51
52**4. Message Generation**
53- Format: `type(scope): description`
54- Enforce tier limits: Tier 1 summary max 50 chars; Tier 2/3 summary max 72 chars (ideal 50)
55- Use imperative mood ("add" not "added")
56- Focus on "what" and "why", not "how"
57- Provide 2-3 alternative suggestions
58
59## Tier System: Smart Format Enforcement
60
61This skill uses a **three-tier format system** that matches message detail to commit criticality:
62
63### Tier 1: Critical Commits (feat, fix, perf, security)
64
65**Requirements**: Detailed documentation with impact statement
66
67**Format**:
68```
69type(scope): summary line (max 50 chars)
70
71- Detailed description point 1
72- Detailed description point 2
73- Detailed description point 3
74
75This change [impact statement describing user-facing benefit or risk addressed].
76
77Affected files/components:
78- path/to/file1
79- path/to/file2
80```
81
82**Why**: Features, fixes, and performance changes affect users directly and need thorough documentation for future reference and changelog generation.
83
84### Tier 2: Standard Commits (refactor, test, build, ci)
85
86**Requirements**: Brief context and file list
87
88**Format**:
89```
90type(scope): summary line (max 72 chars)
91
92Brief explanation of what changed and why (1-2 sentences).
93
94Files: path/to/file1, path/to/file2
95```
96
97**Why**: Internal improvements need context for maintainability but don't require extensive documentation.
98
99### Tier 3: Minor Commits (docs, style, chore)
100
101**Requirements**: Summary line, optional description
102
103**Format**:
104```
105type(scope): summary line (max 72 chars)
106
107[Optional: Additional context if helpful]
108```
109
110**Why**: Documentation and routine maintenance are self-explanatory from the diff; verbose messages add noise.
111
112## Workflow
113
114```text
1150. Pre-staging typecheck (if project uses TypeScript):
116 - Run `tsc --noEmit` on changed files before staging
117 - Fix type errors before committing (avoids pre-commit hook retry loops)
1181. Get staged changes (staged only, not working tree):
119 - git diff --staged --name-status
120 - git diff --staged --stat
121 - git diff --staged
1222. Load config → frameworks/shared-skills/skills/dev-git-commit-message/config.yaml
1233. Analyze changes:
124 - Count files modified/added/deleted
125 - Identify primary change type using analysis patterns
126 - Detect scope from project structure (config.yaml)
127 - Determine tier (1/2/3) based on commit type
128 - Extract key modifications
1294. Generate commit messages:
130 - Apply tier-appropriate format
131 - Primary suggestion (best match)
132 - Alternative 1 (different scope/angle)
133 - Alternative 2 (broader/narrower focus)
1345. Validate against rules:
135 - Check forbidden patterns
136 - Verify required elements present
137 - Ensure length limits
1386. Present to user with explanation and tier info
139```
140
141## Optional Modes (If Supported By The Caller)
142
143- `--validate "<message>"`: Validate a commit message without generating suggestions (format/type/scope/length/forbidden patterns; then report required Tier 1/2/3 elements if missing).
144- `--tier <1|2|3>`: Force the tier format (overrides auto-detection).
145- `--interactive` or `-i`: Ask for confirmation of type, scope, and summary before final output.
146
147## Output Format
148
149```
150[NOTE] Suggested Commit Messages (based on X files changed)
151
152PRIMARY:
153feat(api): add user authentication endpoints
154
155ALTERNATIVES:
1561. feat(auth): implement JWT token validation
1572. feat: add user authentication system
158
159ANALYSIS:
160- 3 files modified in src/api/
161- New functions: authenticateUser, generateToken
162- Primary change: new feature (authentication)
163- Scope detected: api/auth
164```
165
166## Conventional Commits Quick Reference
167
168**Type Guidelines**:
169- `feat`: User-facing features or API additions
170- `fix`: Corrects incorrect behavior
171- `refactor`: Improves code without changing behavior
172- `docs`: README, comments, documentation files
173- `style`: Formatting only (prettier, eslint --fix)
174- `test`: Test files or test utilities
175- `chore`: Build scripts, package updates, config
176- `perf`: Measurable performance improvements
177- `ci`: GitHub Actions, CircleCI, build pipelines
178
179**Scope Guidelines**:
180- Use lowercase
181- Be specific but not too narrow
182- Match your project's module structure
183- Omit if changes span multiple unrelated areas
184
185**Description Guidelines**:
186- Start with lowercase verb
187- No period at the end
188- Be specific and concise
189- Focus on user impact for `feat` and `fix`
190
191## Edge Cases
192
193**Multiple unrelated changes**:
194- Suggest splitting into separate commits
195- If forced to combine, use broader scope or omit scope
196
197**Breaking changes**:
198
199- Append exclamation mark after type/scope (example: feat(api)!: change auth flow)
200- Include BREAKING CHANGE in body (handled by user)
201
202**WIP or experimental**:
203- Use `chore(wip): description` or `feat(experimental): description`
204
205**No meaningful changes**:
206- Detect and warn: "No staged changes detected"
207- Suggest `git add` commands
208
209## Integration Points
210
211**Pre-commit hook**: Triggered before commit (if installed/configured)
212**Slash command**: Manual invocation via `/commit-msg`
213**Direct skill call**: From other skills or tools
214
215## Best Practices
216
2171. **Analyze context**: Look at file paths, function names, import statements
2182. **Prioritize clarity**: Prefer obvious descriptions over clever ones
2193. **Respect conventions**: Follow project's existing commit patterns if detected
2204. **Avoid hallucination**: Only describe what's actually in the diff
2215. **Be concise**: 50 chars is ideal, 72 is maximum for first line
2226. **Stage specific files**: Use `git add <file1> <file2>`, not `git add -A` or `git add .`, to avoid pulling in unrelated changes or sensitive files
2237. **Avoid heredoc in sandboxed shells**: Sandboxed environments may block temp file creation for here-documents. Use `git commit -m "$(cat <<'EOF'\nmessage\nEOF\n)"` or pass `-m "message"` directly
2248. **Pre-commit typecheck**: Run `tsc --noEmit` on the staged surface before committing to catch type errors early and avoid retry cascades from pre-commit hooks
225
226## Example Analyses
227
228**Scenario 1**: New React component
229```
230Files: src/components/UserProfile.tsx, src/components/UserProfile.test.tsx
231Changes: +120 lines, component definition, props interface, tests
232Message: feat(components): add UserProfile component
233```
234
235**Scenario 2**: Bug fix in API
236```
237Files: src/api/auth.ts
238Changes: -5 +8 lines, fix token expiration check
239Message: fix(auth): correct token expiration validation
240```
241
242**Scenario 3**: Documentation update
243```
244Files: README.md, docs/api.md
245Changes: +45 lines documentation
246Message: docs: update API documentation and README
247```
248
249**Scenario 4**: Dependency update
250```
251Files: package.json, package-lock.json
252Changes: version bumps for eslint, typescript
253Message: chore(deps): update eslint and typescript
254```
255
256## Analysis Patterns: Smart Type Detection
257
258The skill uses pattern matching to intelligently detect commit types from diffs:
259
260### feat Detection
261- **New files created** (especially in src/, components/, api/)
262- **New functions/classes exported** (`export function`, `export class`)
263- **New API routes** (`app.get`, `router.post`, etc.)
264- **New assets/skills** (in .claude/, custom-gpt/, etc.)
265- **Threshold**: 20+ lines added typically indicates feature
266
267### fix Detection
268- **Test file changes** (often indicates bug reproduction)
269- **New conditionals** (validation fixes)
270- **Error handling additions** (`try`, `catch`, `throw`)
271- **Input validation** (`validate`, `sanitize`, `check`)
272- **Commit message hints**: Words like "bug", "issue", "error", "crash"
273
274### refactor Detection
275- **Balanced changes** (similar additions and deletions)
276- **Function renames/moves** (same logic, different location)
277- **No new features or fixes**
278- **Test coverage unchanged**
279- **Keywords**: "extract", "move", "rename", "reorganize"
280
281### docs Detection
282- **File patterns**: `.md`, `.txt`, `README`, `CHANGELOG`, `/docs/`
283- **Pure documentation changes** (no code modifications)
284- **Mixed code+docs**: Prefer code type, note docs in description
285
286### test Detection
287- **File patterns**: `test.js`, `spec.ts`, `__tests__/`, `/tests/`
288- **Test framework patterns**: `describe`, `it`, `test`, `expect`, `assert`
289
290### style Detection
291- **CSS/styling files**: `.css`, `.scss`, `.sass`, `.less`
292- **Formatter configs**: `prettier`, `eslint`
293- **Whitespace-only changes**
294- **Keywords**: "formatting", "indent", "whitespace"
295
296### chore Detection
297- **Dependency files**: `package.json`, `requirements.txt`, `Gemfile`
298- **Lock files**: `package-lock.json`, `yarn.lock`
299- **Config files**: `.gitignore`, `.env`
300- **Keywords**: "dependency", "deps", "upgrade", "bump"
301
302## Configuration
303
304**Project-specific configuration** loaded from `config.yaml`:
305
306- **Scope mapping**: Maps directory patterns to scope names (e.g., `frameworks/claude-code-kit/**` → `claude-kit`)
307- **Tier rules**: Defines which commit types require which tier format
308- **Forbidden patterns**: Blocks commits with generic messages or assistant/tool attribution
309- **Analysis patterns**: Customizes type detection logic for your codebase
310- **Validation mode**: `strict` (block), `warning` (warn), or `disabled`
311
312## Forbidden Patterns (Validation)
313
314The skill automatically blocks commits with these patterns:
315
316### Generic/Vague Messages
317
318- [FAIL] "Update files" → [OK] "docs: update API reference"
319- [FAIL] "Fix stuff" → [OK] "fix(auth): correct token validation"
320- [FAIL] "Change code" → [OK] "refactor(utils): simplify date formatting"
321
322### Assistant/Tool Attribution (Per Repository Policy)
323
324- [FAIL] "Generated with Claude Code"
325- [FAIL] "Co-Authored-By: Claude <noreply@anthropic.com>"
326- [FAIL] Any assistant/tool attribution in commit messages
327
328### Work-in-Progress Markers
329
330- [WARNING] "WIP: feature" (warning - should be squashed before merge)
331- [WARNING] "temp: quick fix" (warning - should be squashed)
332
333### Missing Type
334
335- [FAIL] Commits without type prefix (feat, fix, docs, etc.)
336
337## Error Handling
338
339- **No staged changes**: Run `git status` and guide user to `git add` files
340- **Binary files only**: Note that commit message should mention file types
341- **Merge conflicts**: Detect and suggest `chore: resolve merge conflicts`
342- **Git not available**: Graceful failure with helpful error message
343- **Forbidden pattern detected**: Show error with examples and block commit (strict mode)
344- **Missing required elements**: List what's missing based on tier requirements
345- **Length exceeded**: Show character count and suggest shortening
346
347## Integration with Repository
348
349This skill integrates with the AI-Agents repository standards:
350
351- **CLAUDE.md reference**: Mandatory skill usage before commits
352- **config.yaml**: Project-specific scope mappings and rules
353- **Pre-commit hook**: Automatic activation before git commits
354- **CONTRIBUTING.md**: Commit guidelines for contributors
355
356---
357
358## Commit Message Template
359
360**[assets/template-commit-message.md](assets/template-commit-message.md)** — Copy-paste template and good/bad examples.
361
362Use it to standardize `type(scope): summary` messages and keep history automation-friendly.
363
364---
365
366## Security-Sensitive Commits
367
368**[assets/template-security-commits.md](assets/template-security-commits.md)** — Guide for handling security-sensitive changes.
369
370### Key Sections
371
372- **Pre-Commit Security Checklist** — Secrets detection, prohibited patterns
373- **Security-Related Commit Types** — Security fix, enhancement, configuration
374- **Accidental Secret Commits** — Immediate response, rotation, history cleanup
375- **Sensitive File Patterns** — .gitignore templates, files that should never be committed
376- **Audit Trail Requirements** — CVE, CVSS, CWE metadata for security commits
377
378### Do / Avoid
379
380#### GOOD: Do
381
382- Run secrets scan before every commit
383- Rotate secrets immediately if exposed
384- Use environment variables for credentials
385- Document security fixes with CVE/CVSS
386- Require security team review for auth changes
387- Keep .gitignore updated for secret patterns
388
389#### BAD: Avoid
390
391- Committing secrets "temporarily"
392- Using hardcoded credentials in tests
393- Storing real credentials in example files
394- Assuming deleted secrets are safe
395- Committing before secrets scan completes
396- Using generic commit messages for security fixes
397
398### Anti-Patterns
399
400| Anti-Pattern | Problem | Fix |
401|--------------|---------|-----|
402| **"Add secrets later"** | Secrets committed accidentally | Use env vars from start |
403| **Secrets in tests** | Real credentials in repo | Use mocks/test credentials |
404| **Force push to hide** | History still recoverable | Rotate + document |
405| **Vague security commits** | No audit trail | Include CVE/CVSS |
406| **No pre-commit scan** | Secrets reach remote | Install gitleaks hook |
407
408---
409
410## Optional: AI/Automation
411
412> **Note**: AI suggestions should preserve human intent.
413
414- **Commit message suggestions** — Draft from diff analysis
415- **Type detection** — Pattern-based commit type inference
416- **Scope detection** — Auto-detect from changed paths
417
418### Bounded Claims
419
420- AI-generated messages need human review and modification
421- Automated type detection may miss context
422- Security commits always need human judgment
423
424---
425
426## Resources
427
428| Resource | Purpose |
429|----------|---------|
430| [references/conventional-commits-guide.md](references/conventional-commits-guide.md) | Conventional Commits spec and tooling |
431| [references/commit-message-antipatterns.md](references/commit-message-antipatterns.md) | Common bad patterns, detection, linting |
432| [references/monorepo-commit-conventions.md](references/monorepo-commit-conventions.md) | Scope strategies for multi-package repos |
433| [references/changelog-generation-guide.md](references/changelog-generation-guide.md) | Changelog tooling setup, CI integration |
434| [data/sources.json](data/sources.json) | Curated external sources |
435
436---
437
438**Version**: 2.1.1
439**Last Updated**: 2026-01-26
440**Repository**: AI-Agents (documentation repository)
441**Conventional Commits Spec**: <https://www.conventionalcommits.org/>
442
443## Fact-Checking
444
445- Use web search/web fetch to verify current external facts, versions, pricing, deadlines, regulations, or platform behavior before final answers.
446- Prefer primary sources; report source links and dates for volatile information.
447- If web access is unavailable, state the limitation and mark guidance as unverified.