commit
GitHub指导在 Storage Redirect X 项目中准备、审查和创建 Git 提交。涵盖验证变更、运行检查、排除无关文件、遵循提交规范及独立格式化 Rust 代码,确保原子性提交。
触发场景
安装
npx skills add Kindness-Kismet/storage-redirection-x --skill commit -g -y
SKILL.md
Frontmatter
{
"name": "commit",
"description": "Prepare, review, and create Git commits for Storage Redirect X. Use when the user requests a commit, a commit message, or an amendment, and before any assistant-initiated git commit, including --amend. Pushing requires separate explicit approval."
}
Local Commits
Create an atomic commit promptly after each independently working requirement passes its necessary checks. Include only changes belonging to that requirement and follow AGENTS.md.
Atomic Scope
Every commit must be atomic in the main repository and in submodules, including release, formatting, and amended commits. One commit serves one independently reviewable purpose; a request containing several unrelated changes requires separate commits.
Keep the source, configuration, lockfile, and integration changes required for one purpose together. Separate independent fixes, dependency upgrades, version bumps, and formatting. When a file contains multiple purposes, stage the relevant hunks rather than bundling the whole file. Do not rewrite existing history to enforce this rule without an explicit request.
Workflow
- Confirm the repository, current branch, upstream, and worktree with
git status --short --branch. Inspect staged and unstaged changes separately. Do not switch branches or absorb unrelated changes. - Verify the final behavior using the checks appropriate to the changed paths and repository. In the main repository, run clippy for
srx_core/changes andlintDebugforandroid/changes; in a submodule, use its own manifest and supported targets. Do not add tests by default, including inline tests or test dependencies; run existing checks where relevant. Remove existing tests only within the user's requested scope. - Check each new path with
git check-ignore --no-index -v <path>. A final negated pattern permits tracking; a positive pattern excludes it. Keep build artifacts, credentials, and local plans or records out of the index. Do not bypass the allowlist withgit add -f. - Stage explicit paths with
git add -- <path>. To stop tracking an authorized file, confirm its absolute path and usegit rm --cached -- <path>so its local copy remains intact. Never use broad staging commands. - Review
git diff --cached --checkand the completegit diff --cached. Confirm scope, required build inputs, license notices, and actual verification results before committing. Do not commit incomplete work or claim failed checks passed. - Review the message against the rules below, then execute
git commit. Apply the same review before--amend. - Verify the saved message with
git log -1 --format=%Band inspectgit status --short --branch. - Complete the Rust formatting phase below before finishing. If the worktree was already clean at entry, skip creating a task commit and start that phase directly. Report all commit IDs, scopes, verification results, and remaining worktree changes.
Owned Submodules
Inspect the local worktrees of srx_core/third_party/srx_hook and srx_core/third_party/srx_inline_hook during task review. Normally do not fetch, compare remote branches, or check for upstream updates in these repositories; do so only when the user requests it or the task explicitly requires remote synchronization.
Review local changes before deciding ownership. Promptly verify and atomically commit completed, task-related changes inside each affected submodule using this skill. Preserve unrelated, unknown, or unfinished edits; a dirty submodule is not permission to commit everything.
Commit the submodule first, then record its exact gitlink together with the necessary main-repository integration changes. A source-identical submodule import needs no empty child commit. Inspect both the child diff and the parent's gitlink diff. Local commits do not authorize pushing either repository; report child commits that must be published before others can reproduce the parent revision.
Rust Formatting
- The formatting scope is the main repository plus the owned
srx_hookandsrx_inline_hooksubmodules. Start only when all three indexes and worktrees are clean. Commit completed authorized changes first; preserve unrelated or unfinished edits and defer formatting until they are resolved. Do not stash, reset, or absorb them merely to obtain clean worktrees. - Run
cargo fmt --all --checkfrom the main repository to cover its local Rust dependency graph. Only the three owned repositories may be formatted; never include LSPlant or other third-party code. If the graph gains other Rust repositories, use explicit package selections within the owned repositories instead. If the check passes, no formatting commit is needed; for formatting differences, run the same command without--check. Diagnose tool or parsing failures separately. - Review the complete diff in each affected repository and confirm it contains only formatter-generated Rust changes. Repeat the scoped formatting check and run
cargo clippy --manifest-path srx_core/Cargo.toml --target aarch64-linux-android -- -D warningsto check the integrated libraries. For a task confined to a child repository, use its manifest and supported target. - Stage only explicit formatted paths and review
git diff --cached --checkand the full staged diff in each affected repository. Create one separate formatting commit per affected child first, then one main-repository formatting commit for its own formatting changes and updated child gitlinks, such aschore: Format owned Rust sources. Do not create empty commits, mix formatting with functional changes, or amend formatting into a preceding task commit. - Verify the saved commits and all three worktrees. These formatting-only commits complete the phase; do not recursively start another formatting phase for them.
Commit Message
The subject and body must be entirely in English. Chinese response and source-comment rules do not apply to Git messages.
Use type: imperative summary, at most 70 characters. Supported types include feat, fix, build, docs, refactor, chore, and test.
Explain why the change is needed, its final behavior, and the checks actually performed. State relevant limitations without copying raw logs. Add an issue-closing reference only after reading the issue and verifying its complete acceptance criteria.
Push and Amend
Create the local commit first. Before any push, identify the repository, remote, target branches or tags, and outgoing commits; obtain explicit approval for that exact operation. A commit or PR request is not push permission.
Each approval authorizes one current push attempt and expires when that attempt is made. Ask again before retrying, changing the target or outgoing commits, pushing a submodule, or making any later push. Never reuse approval from an earlier turn, session, or repository. Do not initiate an unrelated push; retain the version-bump skill's restriction on proactively offering to push.
Amend only unpublished task-owned commits when authorized. Do not rewrite public history or force-push without separate explicit approval.
If ownership is unclear or a command fails, preserve the worktree and index, report the concrete blocker, and do not reset or delete user changes.
版本历史
- 3b9ed13 当前 2026-11-07 13:19
- e5eeb2e 2026-11-02 12:30


