Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计通过

git-commitGit 提交

Agent Skill

git-commit 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

847

周安装

36

GitHub Stars

3

下载量

297
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:git-commit(Git 提交)
来源仓库:https://github.com/alpoxdev/hypercore
仓库路径:skills/git-commit
安装命令:
npx skills add https://github.com/alpoxdev/hypercore --skill git-commit
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/alpoxdev/hypercore --skill git-commit

简介

git-commit 用于创建符合规范的 Git 提交,基于实际仓库状态自动生成 Conventional Commits。

  • 适用于需要按逻辑分组提交代码变更的场景,支持多仓库识别与状态检查。
  • 通过脚本自动检测并提交 staged 文件,确保提交信息结构化。
  • 安装前需确认是否有写入权限及是否影响现有分支状态。
  • 注意避免在非 Git 目录或未 staged 变更时误用。

SKILL.md

Git Commit Skill

Available scripts

ScriptPurpose
scripts/repo-discover.sh [start_dir]Detect current-repo vs descendant-repo layout
scripts/repo-status.sh [repo]Show branch, status, staged summary, and unstaged summary
scripts/git-commit.sh [--repo path] "msg" [files...]Commit staged or selected files in one repository
scripts/git-push.sh [--repo path] [--force]Push the current branch safely in one repository
  • Create one or more Conventional Commits from the current repository state, one per logical change group.
  • Base every decision on actual git status and diff output.
  • When multiple logical groups of changes exist, identify each group and commit them separately in sequence.

<trigger_conditions>

User intentActivate
"commit these changes"yes
"make a git commit"yes
"/git-commit"yes
requests that only ask for push/rebase/resetno, unless commit creation is also requested

</trigger_conditions>

<argument_validation>

If ARGUMENT is missing:

  • Default to the files, repositories, and logical change units touched in the current session.
  • Verify the session-derived candidate set against actual git status and git diff output before staging or committing.
  • If the candidate set contains multiple logical change groups, identify each group and commit them separately in sequence. Do not stop or ask for clarification — iterate through all groups.
  • If the current session's work is already fully committed, allow the remaining uncommitted changes to become the next candidate set and apply the same grouping logic.

If ARGUMENT is "ALL" or "all":

  • Take ALL uncommitted changes in the repository, regardless of whether they were touched in the current session.
  • Group all changes into logical change sets based on related functionality, feature area, or purpose.
  • Commit each group separately in sequence. Do not stop, do not ask for confirmation, do not skip any files.
  • Every uncommitted file must be included in exactly one commit group. No file may be left behind.

If ARGUMENT is present (other than ALL):

  • Treat ARGUMENT as the primary commit target or filter.
  • Use it to narrow repository discovery, file selection, staging, and commit message generation.
  • If the filtered set contains multiple logical groups, commit each group separately.
  • Stop if ARGUMENT does not match the actual repository state.

</argument_validation>

<scope_assumptions>

  • Start from the current working directory. If it is not a git repository, inspect descendant directories for git repositories before proceeding.
  • Commit only. Do not push, amend, rebase, or rewrite history unless the user explicitly asks.
  • After a successful commit, ask whether to push. In Codex, do this with a plain-text confirmation question. In OpenCode, prefer the runtime-native approval prompt when available.
  • Use Bash commands only.

</scope_assumptions>

CategoryRule
Inspect firstRun git status --short --branch before any staging or commit command.
Argument modeResolve whether execution is in session-default mode or explicit-argument mode before repository discovery and staging.
Repository discoveryDetermine whether the current working directory is a git repository. If not, inspect descendant directories and build a repository list before any git add or git commit action.
Diff sourceIf staged changes exist, treat the staged set as the default commit candidate and inspect with git diff --staged. If nothing is staged, inspect git diff.
Repository boundaryWhen multiple git repositories are discovered under the current directory, run git status, git add, and git commit inside each repository separately. Never treat multiple repositories as one commit unit.
Logical scopeEach commit covers exactly one logical change. When multiple logical groups exist, identify each group and commit them separately in sequence. Do not stop to ask — iterate through all groups.
Staging disciplineStage only the files required for the selected logical change. Do not stage everything by default.
Type selectionChoose the Conventional Commit type from the actual dominant change, not from filenames alone.
Scope selectionUse a scope only when one module, package, feature area, or subsystem clearly owns the change. Omit scope when the change spans multiple unrelated areas or the scope would be vague.
LanguageWrite commit subject and body in Korean. The Conventional Commit type and scope stay in English (e.g. feat(auth):), but the description after the colon and the body text must be in Korean.
Subject lineUse imperative mood, present tense, lowercase after the colon, and keep the subject under 72 characters.
Body/footerAdd a body only when the subject cannot capture important context. Add footers only for verified issue references, breaking changes, or explicitly requested metadata.
Push confirmationAfter git add and git commit complete successfully, ask whether to run git push. In Codex, ask in plain text. In OpenCode, prefer its native ask-style approval prompt when available; otherwise fall back to plain text.
SafetyNever commit secrets, generated credentials, or unrelated user changes. Never use --no-verify, force flags, or destructive git commands unless the user explicitly asks.
Failure handlingIf hooks fail, inspect the error. Fix and retry only when the failure is directly caused by the current change set and the fix is safe. Otherwise stop and report the blocker.
CategoryAvoid
Staginggit add. or blanket staging when unrelated changes exist (exception: ALL mode stages all files but still commits per logical group)
Argument handlingignoring an explicit ARGUMENT and committing a broader change set than requested
Cherry-picking in ALL modeskipping files or leaving uncommitted changes behind when ARGUMENT is ALL
Repository boundaryrunning git add or git commit from a non-repository root and assuming nested repositories will be included
Pushauto-running git push after commit without explicit confirmation
Hooks--no-verify unless the user explicitly requests it
History rewriteamend, rebase, reset, force push, or other history-editing commands without explicit request
Secretscommitting .env, credentials, private keys, or tokens
Guessinginventing a scope, footer, or grouped change set that is not supported by the diff

<decision_tables>

Argument mode

Input stateAction
No ARGUMENT providedStart from the current session's modified files and repositories, confirm them with git state, group into logical changes, and commit each group separately
No ARGUMENT provided, and current-session work is already committedIf uncommitted changes still remain, allow the remaining uncommitted change set to become the next candidate and apply the same grouping logic
ARGUMENT is "ALL" or "all"Take ALL uncommitted changes regardless of session, group into logical changes, and commit each group separately — no stopping, no skipping, every file must be committed
ARGUMENT provided (other than ALL) and matches one logical changeUse ARGUMENT as the primary filter for repository discovery, staging, and message generation
ARGUMENT provided (other than ALL) and covers multiple logical groupsUse ARGUMENT as the filter, then group and commit each group separately
ARGUMENT provided (other than ALL) but conflicts with git stateStop and report the mismatch

Repository discovery

Observed layoutAction
Current working directory is a git repositoryOperate in the current repository and follow the normal commit workflow
Current working directory is not a git repository, but one or more descendant directories are repositoriesBuild the repository list and run the full commit workflow separately inside each repository that has relevant changes
Current working directory is not a git repository and no descendant repository existsStop and report that no git repository was found

Change-set selection

Repository stateAction
Staged changes onlyCommit the staged set.
Staged + unstaged changes, same logical changeStage the missing files deliberately, then commit the full set.
Staged + unstaged changes, unrelated changes mixed togetherDefault to the staged set only, or stop if the intended commit target is unclear.
No staged changes, one clear logical changeStage only the relevant files, then commit.
No staged changes, multiple unrelated changesGroup changes into logical sets. Stage and commit each group separately in sequence.
No diff to commitStop and report that there is nothing to commit.

Type selection

Observed dominant changeType
User-facing capability addedfeat
Incorrect behavior fixedfix
Docs onlydocs
Formatting or style only, no behavior changestyle
Internal restructure without feature or bug fixrefactor
Performance improvementperf
Tests added or updatedtest
Build tooling or dependency managementbuild
CI workflow or automation configci
Repo maintenance, chores, metadatachore
Reverting an earlier commitrevert

Subject/body/footer selection

ConditionOutput rule
One-line subject fully explains the changeSubject only
Why, risk, or follow-up matters for reviewersAdd a short body
Breaking API, schema, or behavior changeUse ! and/or BREAKING CHANGE: footer
Verified issue or ticket reference existsAdd Refs: or Closes: footer
Co-author requested explicitly by the userAdd Co-authored-by: footer exactly as requested

</decision_tables>

Phase 1. Inspect repository state

Decide argument mode first:

  • No ARGUMENT: derive the initial candidate set from the current session's work, then verify it with git state.
  • No ARGUMENT fallback: if that session-derived set is already fully committed, inspect the remaining uncommitted changes and allow them to become the next candidate set.
  • ARGUMENT is "ALL" or "all": take ALL uncommitted changes regardless of session scope.
  • ARGUMENT present (other than ALL): derive the initial candidate set from ARGUMENT, then verify it with git state.
scripts/repo-discover.sh

Then branch by repository layout:

  1. If git rev-parse --show-toplevel succeeds, inspect the current repository:
scripts/repo-status.sh
  1. If the current directory is not a repository but descendant repositories exist, inspect each repository independently:
scripts/repo-status.sh path/to/repo

Do not run one git add or one git commit from the non-repository root for multiple descendant repositories.

Phase 2. Identify logical change groups

Analyze the full candidate set and partition it into logical change groups. Each group should contain files that belong to the same feature, fix, module, or purpose.

Grouping heuristics (apply in order):

  1. Files that implement the same feature or fix belong together.
  2. Test files belong with their corresponding implementation files.
  3. Config/build changes related to the same feature belong with that feature.
  4. Unrelated standalone changes each form their own group.

In ALL mode: every uncommitted file must appear in exactly one group. No file may be left behind.

Phase 3. Stage and commit each group (loop)

For each logical group identified in Phase 2, repeat the following:

3a. Stage the group

Use targeted staging commands. Stage only the files in the current group.

git add path/to/file1 path/to/file2
git add -p
git restore --staged path/to/file

3b. Generate the commit message for this group

Build:

  1. type
  2. optional scope
  3. subject
  4. optional body
  5. optional footer

Message format:

<type>[optional scope]: <subject>

[optional body]

[optional footer]

3c. Execute the commit

Subject only:

scripts/git-commit.sh "<type>[scope]: <subject>"
scripts/git-commit.sh --repo path/to/repo "<type>[scope]: <subject>"

Body or footer included:

scripts/git-commit.sh "$(cat <<'EOF'
<type>[scope]: <subject>

<optional body>

<optional footer>
EOF
)"
scripts/git-commit.sh --repo path/to/repo "$(cat <<'EOF'
<type>[scope]: <subject>

<optional body>

<optional footer>
EOF
)"

3d. Continue to next group

Move to the next logical group. Repeat 3a–3c until all groups are committed.

Stop within a group only if:

  • secrets or credential files appear in the candidate set
  • ARGUMENT (other than ALL) conflicts with the actual modified files or repositories

If multiple descendant repositories are in scope, repeat Phase 2 and Phase 3 inside each repository separately.

Phase 4. Ask whether to push

After a successful commit, ask for explicit push confirmation.

  • In Codex: ask a plain-text question such as Commit created. Run git push?
  • In OpenCode: prefer the runtime-native approval prompt rather than assuming a generic Y/N flow
  • In other runtimes with interactive confirmation UI: use the native confirmation surface when available, but explicit confirmation is still required before push

Phase 5. Handle commit failures or push follow-up

Failure caseResponse
Hook or lint failure caused by current changesFix the issue, restage the affected files, and create a new commit attempt
Hook failure unrelated to the current change setStop and report the blocker
Empty commit after staging decisionStop and report that nothing remains to commit
Merge conflict or index lockStop and report the repository state
User declines pushStop after reporting the successful commit
User approves pushRun scripts/git-push.sh in the relevant repository, then report the result

Good subjects

  • feat(auth): add passkey login flow
  • fix(cache): prevent stale data when reading projects
  • docs(cli): document release prerequisites
  • refactor(worker): split mailbox parsing logic

Bad subjects

  • updated stuff
  • Fix bug in the API module
  • feat: add new feature
  • chore(repo): change many things

Good multiline commit

git commit -m "$(cat <<'EOF'
feat(api): filter team memberships

Include only memberships visible to active users in the list response.

Refs: #482
EOF
)"

Good no-argument handling (single group)

/git-commit

Result:

  • inspect work done in the current session
  • confirm the matching repositories and files with git state
  • all changes belong to one logical group → commit once

Good no-argument handling (multiple groups)

/git-commit

Result:

  • inspect work done in the current session
  • session touched auth module files AND unrelated docs files
  • group 1: auth module changes → feat(auth): add passkey login flow
  • group 2: docs changes → docs(cli): document release prerequisites
  • commit group 1, then commit group 2

Good no-argument fallback handling

/git-commit

Result:

  • detect that the current session's work is already committed
  • inspect the remaining uncommitted changes
  • group and commit each remaining logical change

Good ALL mode handling

/git-commit ALL

Result:

  • take ALL uncommitted changes, regardless of current session
  • group into logical change sets
  • commit each group separately — no files left behind

Example output sequence:

scripts/git-commit.sh "feat(auth): add passkey login flow" src/auth/passkey.ts src/auth/passkey.test.ts
scripts/git-commit.sh "fix(cache): prevent stale data when reading projects" src/cache/reader.ts
scripts/git-commit.sh "docs(cli): document release prerequisites" docs/release.md
scripts/git-commit.sh "chore: update dependencies" package.json pnpm-lock.yaml

Good explicit-argument handling

/git-commit packages/api session validation fix

Result:

  • treat packages/api session validation fix as the primary target
  • limit repository discovery and staging to the matching repository and files
  • generate the commit message from that target

Good post-commit push confirmation

Commit created. Run git push?

Good OpenCode push confirmation

  • Prefer OpenCode's native ask-style approval prompt when available
  • If that prompt surface is not available in the current integration, ask in plain text before push

Good multi-repository handling

scripts/git-commit.sh --repo packages/web "fix(web): handle empty session" src/auth.ts
scripts/git-commit.sh --repo packages/api "fix(api): validate session payload" src/routes/session.ts

Bad multi-repository handling

git add packages/web/src/auth.ts packages/api/src/routes/session.ts
git commit -m "fix: update web and api"
  • Confirm the repository layout was checked before staging or commit.
  • Confirm the argument mode was resolved before repository discovery.
  • Confirm descendant repositories, if any, were handled one repository at a time.
  • Confirm the final candidate set matches the current session when no ARGUMENT was provided, matches ALL uncommitted changes when ARGUMENT is ALL, or matches ARGUMENT when another ARGUMENT was provided.
  • Confirm that no-argument mode may fall back to remaining uncommitted changes only after current-session work is already committed.
  • Confirm that when multiple logical groups exist, each group was committed separately in sequence.
  • Confirm that in ALL mode, every uncommitted file was included in exactly one commit group with no files left behind.
  • Confirm each descendant repository received its own git add and git commit sequence.
  • Confirm git push was not run until explicit confirmation was received.
  • Confirm each individual commit covers exactly one logical change.
  • Confirm the final message matches Conventional Commits format.
  • Confirm the subject is imperative, present tense, and under 72 characters.
  • Confirm no secret or credential files were included.
  • Confirm no forbidden flags or history-rewrite commands were used.
  • Confirm hook failures were handled explicitly instead of bypassed.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

31.85%
按下载量换算95

Claude

30.77%
按下载量换算91

Cursor

17.58%
按下载量换算52

Gemini CLI

9.9%
按下载量换算29

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills