.agents/skills/git-commit/SKILL.md
Generate accurate Angular-style Git commit messages from staged changes only.
Follow this sequence exactly:
git statusGIT_PAGER=cat git --no-pager diff --staged --no-ext-diff --no-textconv --unified=5git branch --show-currentgit log --oneline -10git add . once, then collect
git status and the staged raw patch command again before continuing.git add. Keep
the workflow limited to the current staged scope.git add .. Ask the user to stage files first.-- <path> instead of falling back to bare git diff --staged.type(scope): subject.commit_message.txtgit commit -F commit_message.txtcommit_message.txtgit add . only when the initial staged diff is empty, and only once.git add when staged changes already exist.git push.git commit together with file creation or cleanup in a single shell command.git commit as the only step that needs repository write access. Keep message-file creation and cleanup as separate commands.git commit fails with sandbox-style permission errors such as Operation not permitted while creating .git/index.lock, immediately rerun git commit -F commit_message.txt with the required escalation instead of retrying the same non-privileged command..git, prefer requesting the needed escalation for git commit directly after the user approves the message.commit_message.txt afterward. If commit fails, keep the file unless cleanup is clearly safe and intentional.Use this structure for every commit:
type(scope): subject
First body paragraph explaining the current context or motivation.
Second body paragraph explaining the main change.
Third body paragraph explaining the result or impact.
Optional footer for breaking changes or special notes when applicable.
Apply these formatting rules:
type(scope): subject.subject as an imperative summary, start it with a lowercase letter, and do not end it with a period.body is required for every commit and must use exactly three short
paragraphs separated by one blank line.Problem:, Change:, or Summary:.footer only for breaking changes or special considerations.Every commit must use three short natural paragraphs in this order:
!, with a BREAKING CHANGE: footer, or with
both when the title should signal the break immediately and the footer needs
to explain migration impact.! after the type or scope in the title when the incompatible change
should be visible at a glance.BREAKING CHANGE: footer when migration work, removed behavior, or
compatibility impact needs explicit explanation.Choose the narrowest commit type that matches the staged diff:
feat: introduce user-facing behavior or a new capability. Focus the three
paragraphs on the missing capability, the feature added, and the user-facing
benefit or rollout impact.fix: correct a bug, regression, or broken behavior. Focus the three
paragraphs on the broken behavior, the fix approach, and the restored
outcome or reduced risk.docs: update documentation only. Focus the three paragraphs on the reader
gap, the documentation update, and the clarity or maintenance benefit.style: apply formatting or non-functional code style updates. Focus the
three paragraphs on the readability issue, the style cleanup, and the
consistency benefit.refactor: improve internal structure without changing behavior. Focus the
three paragraphs on the structural pain point, the code reorganization, and
the maintainability gain while preserving behavior.perf: improve performance or reduce resource usage. Focus the three
paragraphs on the bottleneck, the optimization, and the measured or expected
efficiency gain.test: add or adjust tests without changing production behavior. Focus the
three paragraphs on the coverage gap, the test update, and the regression
protection gained.build: change dependencies, packaging, or build configuration. Focus the
three paragraphs on the build or dependency context, the configuration
change, and the resulting build or release impact.ci: update CI workflows or automation pipelines. Focus the three
paragraphs on the pipeline issue, the workflow change, and the resulting
reliability or maintenance improvement.chore: make routine maintenance changes that do not fit other types. Focus
the three paragraphs on the maintenance need, the housekeeping change, and
the resulting repository health benefit.revert: roll back a previous change. Focus the three paragraphs on why the
earlier change must be undone, what is being reverted, and the restored or
stabilized state afterward.Choose scope from the touched module, feature, service, or component name whenever possible. Prefer specific scopes such as openai, screenshot, or settings over broad labels like app or misc.
{English commit message}
{Simplified Chinese translation}
commit_message.txt or run git commit before explicit approval.commit_message.txt.This example shows the required complete format for a compliant commit message.
fix(screenshot): defer overlay capture until view appears
Overlay capture started before the view hierarchy was stable, which caused a startup race and could crash screenshot translation.
Move screenshot capture out of the overlay initializer and begin it only after the view appears and layout is ready.
This restores stable screenshot translation startup and prevents the layout conflicts caused by the race.
fix(screenshot): 推迟悬浮层截图直到视图出现后再执行
悬浮层在视图层级尚未稳定时就启动截图,触发了启动阶段的竞态,并可能导致截图翻译崩溃。
将截图操作从悬浮层初始化方法中移出,改为在视图出现且布局就绪后再开始执行。
此修改恢复了截图翻译启动流程的稳定性,并避免了该竞态导致的布局冲突问题。