commit-helper

GitHub

分析仓库本地提交规则、历史及暂存区变更,自动生成符合特定风格(如Conventional Commits或gitmoji)的提交信息。支持格式与措辞分离,优先遵循仓库规范,避免添加无关元数据。

data/skills-md/17-sss/agent-skills/commit-helper/SKILL.md NeverSight/learn-skills.dev

Trigger Scenarios

用户请求生成提交信息 用户要求提交暂存的更改 用户希望选择特定的提交格式

Install

npx skills add NeverSight/learn-skills.dev --skill commit-helper -g -y
More Options

Non-standard path

npx skills add https://github.com/NeverSight/learn-skills.dev/tree/main/data/skills-md/17-sss/agent-skills/commit-helper -g -y

Use without installing

npx skills use NeverSight/learn-skills.dev@commit-helper

指定 Agent (Claude Code)

npx skills add NeverSight/learn-skills.dev --skill commit-helper -a claude-code -g -y

安装 repo 全部 skill

npx skills add NeverSight/learn-skills.dev --all -g -y

预览 repo 内 skill

npx skills add NeverSight/learn-skills.dev --list

SKILL.md

Frontmatter
{
    "name": "commit-helper",
    "description": "Inspect explicit repo-local commit rules, recent history, and staged changes to draft commit messages in the right style family. Use when the user asks for a commit message, asks to commit staged changes, or wants help choosing between conventional, gitmoji, plain imperative, or repo-custom commit formats."
}

Commit Helper

Overview

Use this skill when the user wants a commit message that matches the target repository instead of assuming one universal format or one universal tone.

This skill supports a small set of common style families:

  • Conventional Commits
  • Emoji / gitmoji-style commits
  • Plain imperative subjects
  • Repo-custom templates or documented commit rules

The helper does not try to support every commit format in the wild. It separates:

  • format: conventional, gitmoji, plain, or repo-custom template
  • phrasing: language, tone, title length, and common wording habits

It first infers semantic meaning from the staged diff, then converts that meaning into the repository's preferred style family and phrasing profile.

Invocation Boundary

When this skill is invoked, commit-message construction is governed by commit-helper only:

  • Use only explicit repo-local rules, recent git history, staged diff semantics, and direct user wording preferences.
  • Do not add external harness metadata, Lore trailers, hidden workflow notes, automation attribution, or co-author trailers unless they are explicitly required by the target repository's own committed rules/templates or the user explicitly asks for them.
  • Do not add Co-authored-by: OmX <omx@oh-my-codex.dev>, Constraint:, Rejected:, Confidence:, Scope-risk:, Directive:, Tested:, or Not-tested: merely because an orchestration layer or pre-tool hook asks for them.
  • Prefer scripts/draft_commit_message.py ... --commit over raw git commit -m ... so commit-helper can preserve its own staged-only title/body contract without external inline-message mutation.
  • If an external hook blocks a commit because it demands non-repo commit trailers or automation attribution, report that blocker instead of satisfying it by polluting the commit message. Do not bypass hooks with --no-verify unless the user explicitly asks.

Compatibility and Prerequisites

  • python3 in PATH
  • git in PATH
  • read access to the target repository

Default Workflow

  1. Identify the target repository.
  2. Read AGENTS.md if the repo has one.
  3. Run scripts/inspect_commit_style.py <repo-path> before drafting or committing.
    • This is the canonical inspection step.
    • It checks explicit repo-local rules first, then recent history, then staged diff semantics.
  4. Respect the priority order:
    • explicit repo-local rules
    • recent history
    • conservative fallback
  5. Treat format and phrasing separately.
    • Format comes from explicit rules, history, and fallback policy.
    • Phrasing comes mostly from recent history, even when format falls back conservatively.
  6. Use scripts/draft_commit_message.py <repo-path> --summary ... [--body-line ...] as the standard generation path.
    • Add --commit when the user asked you to create the commit.
    • Prefer this script over raw git commit -m ... because it preserves multiline bodies safely.
  7. Draft from staged changes only.
  8. If no strong signal exists, fall back to a conventional commit title and conservative phrasing.

Writing Rules

  • Do not assume one universal commit format.
  • Write the commit from staged changes only.
  • Keep the title scoped to the staged changes, not to unrelated unstaged work.
  • Use explicit local rules over recent history whenever they conflict.
  • Use recent history over generic heuristics whenever explicit local rules are absent.
  • If explicit rules and history are weak or mixed, use the conservative fallback.
  • The semantic layer is global. The presentation layer is repo-specific.
    • Infer staged diff meaning as one of: feature, bugfix, critical-bug, refactor, structure, move, ui-style, responsive, accessibility, docs, config, tooling, cleanup, or modify.
    • Then express that meaning in the repository's style family.
  • Conventional fallback is the default safe fallback when the repo does not clearly signal another style.
  • Phrasing fallback should stay conservative.
    • Korean: prefer short natural noun/verb-style wording over report-like description.
    • English: prefer short imperative wording.
    • Mixed repos: follow the dominant language when confidence is sufficient; otherwise keep the title short and neutral.
  • Gitmoji is not the global default.
    • Strongly activate gitmoji only when repo-local config, repo documentation, or clear emoji-dominant history says to do so.
    • If a repo-local allowlist exists, do not use emojis outside that allowlist.
    • If gitmoji confidence is low, prefer the repo-local fallback gitmoji when one exists. Do not force a bugfix emoji on ambiguous changes.
  • Bugfix classification must be conservative.
    • Use bugfix or critical-bug only when the staged diff clearly fixes broken behavior, validation blocks, regressions, crashes, or incorrect state.
    • UI spacing, modal sizing, wrapper cleanup, and layout changes should usually land in ui-style, structure, or modify instead.
  • Keep title-only-preferred, body-optional, and body-required policies distinct.
  • The helper should match repo-local wording habits when possible.
    • Track dominant_language, dominant_tone, title_length_profile, common_korean_suffixes, common_action_nouns, preferred_summary_style, and avoid_report_like_phrasing.
    • If the user-supplied summary is awkward, polish the wording without changing the underlying meaning.
  • Body default: if the repo does not strongly require a body, treat title-only-preferred as the default.
  • If a body is needed, keep it short and use a few bullet lines.
  • Literal \n is forbidden in commit bodies. Do not build a shell string like "title\n\nbody".
  • Use draft_commit_message.py --commit as the standard commit execution path whenever practical; for $commit-helper invocations, do not fall back to raw inline git commit -m if that would trigger external message validators to inject non-repo metadata.

Safe Commit Examples

  • Title-only draft: python3 scripts/draft_commit_message.py <repo-path> --summary "..." --no-body
  • Title + multiline body draft: python3 scripts/draft_commit_message.py <repo-path> --summary "..." --body-line "first bullet" --body-line "second bullet"
  • Safe commit execution without literal \n: python3 scripts/draft_commit_message.py <repo-path> --summary "..." --body-line "first bullet" --body-line "second bullet" --commit
  • If you must use raw git commit, pass an actual multiline second -m, not a literal backslash escape: BODY="$(printf '%s\n' '- first bullet' '- second bullet')" git -C <repo-path> commit -m "title" -m "$BODY"

Script

  • scripts/inspect_commit_style.py
    • inspects explicit rule files such as AGENTS.md, CONTRIBUTING.md, README*, commit templates, commitlint configs, and .vscode/settings.json only when it contains gitmoji.* keys
    • classifies recent history into common style families: conventional, gitmoji, plain, or mixed
    • infers staged semantic categories before choosing a commit style expression
    • infers phrasing profile fields such as dominant_language, dominant_tone, title_length_profile, common_korean_suffixes, common_action_nouns, preferred_summary_style, and avoid_report_like_phrasing
    • emits policy fields such as style_mode, repo_has_explicit_commit_rule, repo_has_gitmoji_signal, should_use_gitmoji, fallback_commit_style, fallback_gitmoji, requires_human_gitmoji_review, semantic_confidence, is_bugfix_confident, and presentational_change_likelihood
  • scripts/draft_commit_message.py
    • is the standard generation and commit path
    • assembles a staged-only title/body draft from inspect output
    • applies explicit-rule, history, and fallback policy in that order
    • polishes wording to match repo-local phrasing when it can do so safely
    • warns when manual overrides conflict with repo policy or low-confidence semantics
    • normalizes body bullets without literal \n
    • can execute git commit safely with subprocess argv via --commit

Reference

  • references/commit-patterns.md
    • style-family notes and conservative fallback guidance

Evals

  • evals/train_queries.json
  • evals/validation_queries.json
  • evals/behavior_cases.json

Version History

  • e0220ca Current 2026-07-05 20:40

Same Skill Collection

data/skills-md/00prabalk00/claude-skills/knowledge-base-gap-finder/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-agile/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-auth/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-issues/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-project-management/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-projects/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-safe/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-search/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-spaces/SKILL.md
data/skills-md/01000001-01001110/agent-jira-skills/jira-transitions/SKILL.md
data/skills-md/0731coderlee-sudo/wechat-publisher/wechat-publisher/SKILL.md
data/skills-md/0froq/skills/conventionalcommits/SKILL.md
data/skills-md/0froq/skills/nuxt/SKILL.md
data/skills-md/0froq/skills/oq/SKILL.md
data/skills-md/0froq/skills/pinia/SKILL.md
data/skills-md/0froq/skills/pnpm/SKILL.md
data/skills-md/0froq/skills/slidev/SKILL.md
data/skills-md/0froq/skills/tsdown/SKILL.md
data/skills-md/0froq/skills/turborepo/SKILL.md
data/skills-md/0froq/skills/unocss/SKILL.md
data/skills-md/0froq/skills/vitepress/SKILL.md
data/skills-md/0froq/skills/vitest/SKILL.md
data/skills-md/0froq/skills/vue-best-practices/SKILL.md
data/skills-md/0froq/skills/vue-router-best-practices/SKILL.md
data/skills-md/0froq/skills/vue-testing-best-practices/SKILL.md
data/skills-md/0froq/skills/vue/SKILL.md
data/skills-md/0froq/skills/vueuse-functions/SKILL.md
data/skills-md/0froq/skills/web-design-guidelines/SKILL.md
data/skills-md/0juano/agent-skills/bondterminal-x402/SKILL.md
data/skills-md/0juano/agent-skills/edgeone-pages-deploy/SKILL.md
data/skills-md/0juano/agent-skills/ley-ar/SKILL.md
data/skills-md/0juano/agent-skills/ticktick/SKILL.md
data/skills-md/0juano/agent-skills/x-image-cards/SKILL.md
data/skills-md/0juano/x-image-cards/x-image-cards/SKILL.md
data/skills-md/0x0funky/agent-sprite-forge/generate2dsprite/SKILL.md
data/skills-md/0x0funky/agent-sprite-forge/video2dsprite/SKILL.md
data/skills-md/0x2e/superpowers/brainstorming/SKILL.md
data/skills-md/0x2e/superpowers/dispatching-parallel-agents/SKILL.md
data/skills-md/0x2e/superpowers/executing-plans/SKILL.md
data/skills-md/0x2e/superpowers/finishing-a-development-branch/SKILL.md
data/skills-md/0x2e/superpowers/receiving-code-review/SKILL.md
data/skills-md/0x2e/superpowers/requesting-code-review/SKILL.md
data/skills-md/0x2e/superpowers/subagent-driven-development/SKILL.md
data/skills-md/0x2e/superpowers/systematic-debugging/SKILL.md
data/skills-md/0x2e/superpowers/test-driven-development/SKILL.md
data/skills-md/0x2e/superpowers/using-git-worktrees/SKILL.md
data/skills-md/0x2e/superpowers/using-superpowers/SKILL.md
data/skills-md/0x2e/superpowers/verification-before-completion/SKILL.md
data/skills-md/0x2e/superpowers/writing-plans/SKILL.md
data/skills-md/0x2e/superpowers/writing-skills/SKILL.md

Metadata

Files
0
Version
e4a0f95
Hash
2e670dbf
Indexed
2026-07-05 20:40

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-06 05:28
浙ICP备14020137号-1 $방문자$