一键导入
dev-git-commit-message
Generates conventional commit messages from git diffs. Use when you need well-formatted commit messages following Conventional Commits.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generates conventional commit messages from git diffs. Use when you need well-formatted commit messages following Conventional Commits.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Builds multi-repo context hubs and compiled markdown knowledge maps. Use when profiling repo portfolios or assembling LLM-ready cross-repo knowledge bases.
Builds per-repo code graphs in JSON and markdown-ready derived artifacts. Use when you need blast radius, symbol-level maps, import graphs, inheritance, or test links.
Context-driven AI development with AGENTS.md, repo knowledge bases, Claude Code, Codex, and Copilot. Use when adopting repo-native AI workflows or multi-repo setups.
Technical writing for READMEs, ADRs, API docs, and changelogs. Use when revising or consolidating a repo documentation folder.
Design, implement, and troubleshoot NUKE-based CI/CD pipelines for .NET services with fast local-to-CI feedback loops. Use when creating or refactoring `nuke/Build.cs` target graphs, tuning `DependsOn`/`After`/`Triggers`/`OnlyWhenDynamic` behavior, orchestrating unit/API/DB test categories, merging and publishing coverage and test reports, building and pushing Docker images with traceable tags and digests, producing artifact contracts such as `deploy.env`, and diagnosing flaky or slow pipeline execution. For service code changes use $software-csharp-backend, for NUnit fixture design use $qa-testing-nunit, and for safe logging rewrites use $dev-structured-logs.
Systematic debugging for crashes, regressions, flakes, and production bugs. Use when diagnosing stack traces, logs, traces, or profiling data.
| name | dev-git-commit-message |
| description | Generates conventional commit messages from git diffs. Use when you need well-formatted commit messages following Conventional Commits. |
| argument-hint | [--validate 'msg' | --tier 1|2|3] |
Auto-generates conventional commit messages from git diffs with tiered format enforcement
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).
/commit-msg command is invokedcommit-msg/prepare-commit-msg hook (if installed)1. Diff Analysis
git diff --staged output2. Change Classification
feat: New features or functionalityfix: Bug fixessecurity: Security fixes or hardeningrefactor: Code restructuring without behavior changedocs: Documentation changesstyle: Formatting, whitespace, code styletest: Adding or modifying testschore: Build process, dependencies, toolingperf: Performance improvementsci: CI/CD configuration changesbuild: Build system changesrevert: Reverting previous commits3. Scope Detection
api, auth, ui)*.test.js → tests)components/, services/)4. Message Generation
type(scope): descriptionThis skill uses a three-tier format system that matches message detail to commit criticality:
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.
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.
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.
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
--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.[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
Type Guidelines:
feat: User-facing features or API additionsfix: Corrects incorrect behaviorrefactor: Improves code without changing behaviordocs: README, comments, documentation filesstyle: Formatting only (prettier, eslint --fix)test: Test files or test utilitieschore: Build scripts, package updates, configperf: Measurable performance improvementsci: GitHub Actions, CircleCI, build pipelinesScope Guidelines:
Description Guidelines:
feat and fixMultiple unrelated changes:
Breaking changes:
WIP or experimental:
chore(wip): description or feat(experimental): descriptionNo meaningful changes:
git add commandsPre-commit hook: Triggered before commit (if installed/configured)
Slash command: Manual invocation via /commit-msg
Direct skill call: From other skills or tools
git add <file1> <file2>, not git add -A or git add ., to avoid pulling in unrelated changes or sensitive filesgit commit -m "$(cat <<'EOF'\nmessage\nEOF\n)" or pass -m "message" directlytsc --noEmit on the staged surface before committing to catch type errors early and avoid retry cascades from pre-commit hooksScenario 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
The skill uses pattern matching to intelligently detect commit types from diffs:
export function, export class)app.get, router.post, etc.)try, catch, throw)validate, sanitize, check).md, .txt, README, CHANGELOG, /docs/test.js, spec.ts, __tests__/, /tests/describe, it, test, expect, assert.css, .scss, .sass, .lessprettier, eslintpackage.json, requirements.txt, Gemfilepackage-lock.json, yarn.lock.gitignore, .envProject-specific configuration loaded from config.yaml:
frameworks/claude-code-kit/** → claude-kit)strict (block), warning (warn), or disabledThe skill automatically blocks commits with these patterns:
git status and guide user to git add fileschore: resolve merge conflictsThis skill integrates with the AI-Agents repository standards:
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.
assets/template-security-commits.md — Guide for handling security-sensitive changes.
| 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 |
Note: AI suggestions should preserve human intent.
| 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/