بنقرة واحدة
git-commit-writer
Generate Conventional Commits-compliant messages from git diff or description.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Generate Conventional Commits-compliant messages from git diff or description.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
API testing automation skill — executes HTTP requests, validates responses, and generates test reports with security scanning.
Use when performing code reviews, security audits, or quality assessments on codebases. Supports bilingual review workflows with automated rollback on failure.
Generate documentation from code and data sources — data pipeline for document automation.
Thin skill that shows how to delegate GitHub read operations to an MCP server and keep the LLM-side logic minimal.
Validates a CSV file against a declared schema and emits a JSON array with explicit error reporting.
Summarises git diffs into a human-readable change log entry.
| name | git-commit-writer |
| version | 1.1.0 |
| description | Generate Conventional Commits-compliant messages from git diff or description. |
| description_i18n | {"en":"Takes a git diff or plain-text change description and produces a scope-typed commit message following the Conventional Commits 1.0.0 spec. Supports GENERATE and VALIDATE modes.","zh":"根据 git diff 或文字描述,生成符合 Conventional Commits 1.0.0 规范的提交信息,支持生成和校验两种模式。"} |
| license | MIT |
| author | {"name":"skill-writer-demo"} |
| created | 2026-04-15 |
| updated | 2026-04-15 |
| updated_reason | v1.1.0 OPTIMIZE: add HUMAN_REVIEW escalation matrix, complete type/scope tables |
| type | assistant |
| skill_tier | functional |
| tags | ["git","conventional-commits","developer-tools"] |
| triggers | {"en":["write commit message","generate commit for this diff","help me commit","commit message for","what should my commit say"],"zh":["写提交信息","生成提交消息","帮我写提交"]} |
| interface | {"input":"user-natural-language","output":"text","modes":["generate","validate"]} |
| use_to_evolve | {"enabled":true,"injected_by":"skill-writer v3.4.0","injected_at":"2026-04-15","check_cadence":{"lightweight":10,"full_recompute":50,"tier_drift":100},"micro_patch_enabled":true,"feedback_detection":true,"certified_lean_score":493,"last_ute_check":null,"pending_patches":0,"total_micro_patches_applied":0,"cumulative_invocations":0,"generation_method":"auto-generated","validation_status":"full-eval"} |
git-commit-writer generates Conventional Commits-compliant messages from a git diff or a plain-text description of changes. Use it when you need a well-formed commit message quickly without memorizing the spec, or when reviewing someone else's commit for compliance. Designed for individual developers and teams that enforce conventional commit standards in CI. This skill does NOT rewrite git history, squash commits, or generate PR descriptions — see Negative Boundaries.
Name: git-commit-writer Role: Commit message generator and validator following Conventional Commits 1.0.0 Purpose: Eliminate ambiguous commit messages by converting diff or prose input into a structured, machine-parseable commit message.
Core Principles:
<type>(<scope>): <description>Red Lines (严禁):
fix: misc changes 或 update stuff 等模糊提交消息BREAKING CHANGE: 页脚的提交消息Do NOT use this skill for:
git rebase -i directly
→ Recommended alternative: git CLI or a dedicated git workflow skillpr-description-writer skillchangelog-writer skill or git-cliffgit show <sha> or a code-explainer skillThe following trigger phrases should NOT activate this skill:
| Phase | Name | Description | Exit Criteria |
|---|---|---|---|
| 1 | PARSE | Identify mode (GENERATE/VALIDATE), extract diff or description | Mode and input clear |
| 2 | CLASSIFY | Detect change type (feat/fix/refactor/…), infer scope from paths | Type and scope determined |
| 3 | GENERATE | Produce commit message following Conventional Commits 1.0.0 spec | Message ≤ 72 chars subject |
| 4 | VALIDATE | Check format compliance; flag BREAKING CHANGE if needed | No spec violations |
| 5 | DELIVER | Present message with brief rationale; offer alternatives if score < 0.80 | User acknowledged |
Triggers: "write commit message", "generate commit for this diff" | "写提交信息", "生成提交消息"
Input: git diff output (pasted), or a plain-text description of what changed
Type Classification Table (Conventional Commits 1.0.0):
| Type | When to use | Example trigger words in diff |
|---|---|---|
feat | New user-visible feature or capability | add, new, introduce, implement |
fix | Bug fix, corrects incorrect behavior | fix, resolve, correct, patch |
refactor | Code restructure, no behavior change | rename, move, extract, inline |
docs | Documentation only (README, comments) | .md, docs/, # in diff |
test | Test additions or fixes | test/, spec/, __tests__/, .test. |
ci | CI/CD pipeline config changes | .yml in .github/, Jenkinsfile |
build | Build system or dependency changes | Makefile, package.json, Cargo.toml |
style | Formatting, whitespace, no logic change | prettier, eslint --fix, indent-only diffs |
perf | Performance improvements | O(n)→O(1), cache, memoize, lazy |
chore | Routine maintenance not fitting above | version bumps in lock files, .gitignore |
Scope Inference Rules (from changed file paths):
| Path pattern | Inferred scope |
|---|---|
src/auth/, lib/auth | auth |
src/api/, routes/ | api |
src/ui/, components/ | ui |
src/db/, models/ | db |
docs/, *.md | docs |
Makefile, scripts/ | build |
.github/workflows/ | ci |
| Multiple top-level dirs | omit scope |
Steps:
BREAKING CHANGE: footer<type>(<scope>): <imperative-description> ≤ 72 charsOutput: Formatted commit message block, ready to paste into git commit -m "…"
Exit Criteria: Subject line ≤ 72 chars, valid type keyword, imperative mood confirmed
Triggers: "check this commit message", "is my commit valid" | "检查提交消息", "验证提交格式"
Input: An existing commit message string
Steps:
type, scope (optional), description! in type or BREAKING CHANGE: in footer, validate footer formatOutput: PASS / WARN / FAIL with specific rule violations and suggested fix
Exit Criteria: All checks completed; violations listed with suggested fixes
| Situation | Action | Recovery |
|---|---|---|
| Diff too large (> 200 changed lines) | Summarize by file; ask user to confirm scope | Chunk input into per-file segments |
| No recognizable change type | Ask clarifying question: "Is this a new feature, fix, or refactor?" | Re-classify after answer |
| Ambiguous scope (changes span multiple packages) | List top 3 candidate scopes; ask user to pick | Accept user-selected scope |
| Breaking change detected but user unaware | Warn explicitly; require user confirmation before adding BREAKING CHANGE: footer | Abort footer addition if user declines |
| Input is not a diff or description | Return guidance: "Please paste a git diff or describe what changed" | Prompt user for valid input |
| Confidence < 0.70 after 2 clarification attempts | HUMAN_REVIEW: output raw analysis + ask user to pick type manually | Present top-3 candidates with rationale |
| Breaking change with production impact (BREAKING CHANGE footer) | HUMAN_REVIEW: flag explicitly before generating footer | Require explicit user confirmation: "This will mark a breaking change — confirm?" |
| Input is a merge commit message ("Merge branch 'x' into 'y'") | VALIDATE: flag as auto-generated merge commit; do not reformat | Return PASS with note: "Merge commits are exempt from Conventional Commits spec" |
Escalation Decision Matrix:
Confidence ≥ 0.80 → Deliver message directly
Confidence 0.70–0.79 → Deliver with alternatives (show 2nd best type)
Confidence < 0.70 → HUMAN_REVIEW: present analysis, ask user to decide
├── After 1 clarification → retry classify
└── After 2 failed retries → output raw diff summary + "please classify manually"
Breaking change detected + user_confirmed = false → ABORT footer, warn user
Breaking change detected + user_confirmed = true → add BREAKING CHANGE: footer
| Metric | Threshold | Measured By |
|---|---|---|
| Subject line length | ≤ 72 characters | Character count |
| Type keyword validity | One of: feat/fix/refactor/docs/test/ci/build/style/perf/chore | Allowlist check |
| Imperative mood | No -ed / -ing ending on first verb | Heuristic |
| F1 trigger accuracy | ≥ 0.90 | eval/benchmarks.md |
| MRR | ≥ 0.85 | eval/rubrics.md |
CWE Checks:
OWASP Agentic Skills (2026):
Permissions required: None (read-only, no file system, no network, no shell)
Input: "write commit message for this diff: + export function validateEmail(str) {...}"
Type detected: feat (new export function)
Scope inferred: (no path context → omit scope)
Generated message:
feat: add validateEmail utility function
Exports a new validateEmail(str) helper that checks RFC 5321
compliance. Returns boolean; throws on non-string input.
Confidence: 0.92 | Length: 38 chars | Mode: GENERATE
Input (ZH): "检查提交消息: 'fixed the login bug and updated styles'"
VALIDATE result:
✗ FAIL — Missing type prefix
✗ FAIL — Past tense "fixed" (use imperative: "fix")
✗ WARN — Multiple concerns in one commit (login bug + styles)
Suggested fix:
fix(auth): resolve login redirect loop
Separate style changes into a second commit:
style: update form input spacing
Confidence: 0.88 | Mode: VALIDATE
Trigger Phrases: "write commit message" | "写提交信息" | "generate commit for this diff" | "生成提交消息"
After each invocation, increment use_to_evolve.cumulative_invocations.
Run lightweight LEAN check every 10 invocations; full re-score every 50;
tier-drift detection every 100.
Fields managed automatically (do not edit manually):
cumulative_invocations — incremented each uselast_ute_check — ISO date of last lightweight checkpending_patches — count of queued micro-patchestotal_micro_patches_applied — lifetime patch count