with one click
commit
Use when ready to commit changes to git repository
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Use when ready to commit changes to git repository
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Clean up accumulated junk in ~/.claude/ — failed telemetry queue, stale auto-named plans, old file-history snapshots. Use this skill whenever the user mentions their .claude directory getting large, clearing disk space in Claude Code, 清理 Claude Code 垃圾, 瘦身, reclaiming space, or asks anything like "why is ~/.claude so big". Also trigger if the user says they want to clean stale plans, telemetry, or edit history even without naming .claude explicitly.
Sync config files to the bare dotfiles repo (~/.dotfiles.git, worktree $HOME). Use when the user runs /dotfiles, asks to commit/push dotfiles, 固化配置, or sync ~/.claude changes into version control. Stages tracked modifications and untracked claude config files (rules/hooks/skills), blocks secrets, then commits and pushes.
Send a message to a Telegram chat via the Bot API directly. Self-contained — reads its own .env at the skill root and has no dependency on any Telegram plugin. Use when the user asks to push a Telegram notification to their phone, test the bot token, send from a hook or one-shot script, or 给 telegram 发消息 / 推送消息到手机. Push policy — default is NO push (terminal output is the notification); push ONLY for /loop or /schedule task results, explicit requests ("发给我" / "notify me"), or completion of long tasks (>5 min). Never push for routine replies, errors/permission prompts (hooks handle those), or intermediate progress. When unsure, don't push.
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
| name | commit |
| description | Use when ready to commit changes to git repository |
| model | sonnet |
Structured git commit workflow that enforces project-specific requirements (version bumps, quality checks) and prevents common mistakes (missing files, wrong scope, duplicate commits).
When NOT to use:
cargo clippy cycles within a single logical change are preparation steps, not separate commits (formatting is handled automatically by the git pre-commit hook). Commit only after the full logical change is complete and verified.digraph commit_flow {
"User requests commit" [shape=doublecircle];
"Run git status/diff/log in parallel" [shape=box];
"Check unpushed commits" [shape=box];
"Should squash?" [shape=diamond];
"Squash first" [shape=box];
"Check project requirements" [shape=box];
"Missing version bump?" [shape=diamond];
"Bump version + update lock" [shape=box];
"Has CLAUDE.md?" [shape=diamond];
"Check CLAUDE.md consistency" [shape=box];
"Inconsistent?" [shape=diamond];
"Draft CLAUDE.md updates" [shape=box];
"User confirms update?" [shape=diamond];
"Update CLAUDE.md + stage" [shape=box];
"Analyze change type" [shape=box];
"Draft commit message" [shape=box];
"Run quality checks" [shape=box];
"Stage files + commit" [shape=box];
"Show commit report" [shape=box];
"Done" [shape=doublecircle];
"User requests commit" -> "Run git status/diff/log in parallel";
"Run git status/diff/log in parallel" -> "Check unpushed commits";
"Check unpushed commits" -> "Should squash?";
"Should squash?" -> "Squash first" [label="yes"];
"Should squash?" -> "Check project requirements" [label="no"];
"Squash first" -> "Check project requirements";
"Check project requirements" -> "Missing version bump?";
"Missing version bump?" -> "Bump version + update lock" [label="yes"];
"Missing version bump?" -> "Has CLAUDE.md?" [label="no"];
"Bump version + update lock" -> "Has CLAUDE.md?";
"Has CLAUDE.md?" -> "Check CLAUDE.md consistency" [label="yes"];
"Has CLAUDE.md?" -> "Analyze change type" [label="no"];
"Check CLAUDE.md consistency" -> "Inconsistent?";
"Inconsistent?" -> "Draft CLAUDE.md updates" [label="yes"];
"Inconsistent?" -> "Analyze change type" [label="no"];
"Draft CLAUDE.md updates" -> "User confirms update?";
"User confirms update?" -> "Update CLAUDE.md + stage" [label="yes"];
"User confirms update?" -> "Analyze change type" [label="no, manual"];
"Update CLAUDE.md + stage" -> "Analyze change type";
"Analyze change type" -> "Draft commit message";
"Draft commit message" -> "Run quality checks";
"Run quality checks" -> "Stage files + commit";
"Stage files + commit" -> "Show commit report";
"Show commit report" -> "Done";
}
git status
git diff
git log --oneline -10
git log @{u}..HEAD || git log origin/master..HEAD || git log origin/main..HEAD
If unpushed commits exist and belong to same logical change → squash before new commit.
Common patterns:
CLAUDE.md, Cargo.toml, package.json, pyproject.toml)Cargo.lock, package-lock.json, uv.lock)Quality checks: run the per-language QA chain defined in ~/.claude/rules/languages.md — that file is the canonical definition (always loaded in context); do not restate commands here. At commit time use the applying variants (cargo fmt, uv run ruff format .), not --check. Mixed projects: run chains for all detected languages.
If project has CLAUDE.md at repo root:
git diff --cached):
If inconsistency detected:
If consistent or no CLAUDE.md exists:
Bypass:
[skip-claudemd] tag, skip this check entirelyMap changes to commit type:
feat: new featurefix: bug fixrefactor: code restructure, no behavior changeperf: performance improvementtest: test additions/changesdocs: documentation onlychore: maintenance (deps, config, release)style: formatting, whitespacebuild: build system changesci: CI/CD changesFormat: <type>[optional scope]: <imperative summary> (max 72 chars)
Good:
feat: add rate limiting to auth endpointsfix(parser): handle empty input without panicchore(release): bump version to v1.2.0Bad:
updated stuff (vague)Fixed bug (not imperative, no context)feat: added new feature for handling user authentication with JWT tokens and refresh token rotation (too long)Add body (separated by blank line) when WHY isn't obvious from diff.
Run the verification QA chain — cargo clippy / cargo test (commands per rules/languages.md) — BEFORE any git add. Do NOT run cargo fmt / ruff format manually: the global git pre-commit hook formats staged files and re-stages them automatically at commit time.
# QA commands: see ~/.claude/rules/languages.md (canonical, always in context).
# Separate commands are fine — the QA gate accumulates each passing check.
<per-language QA chain>
# ONLY after all checks pass, stage and commit
git add <specific files>
git commit -m "$(cat <<'EOF'
<commit message>
<Co-Authored-By trailer — use the one the current harness specifies; never hardcode a model name here>
EOF
)"
Critical ordering rule: run verification (cargo clippy, plus cargo test when a suite exists — the qa-gate requires these, no longer fmt) BEFORE git add. These compile and rewrite Cargo.lock, so staging before they finish desyncs the index. After QA passes, run git diff --name-only to check which lock files changed (Cargo.lock, uv.lock, etc.) and include every changed lock file in git add — failing to do so leaves a dirty working tree after commit. Formatting is not your job at commit time: the global git pre-commit hook (~/.config/git/hooks/pre-commit) runs cargo fmt / ruff format on the staged files and re-stages them during git commit. So the flow is: clippy/test → check for changed lock files → git add <files + lock files> → git commit (hook formats). Never run cargo fmt before git add — that reintroduces the exact desync this hook exists to remove.
Detection logic:
Cargo.toml → Rustpyproject.toml → Pythonpackage.json → JS/TSAfter successful commit, display a structured report:
✓ 提交完成
提交信息:
<type>(<scope>): <summary>
已提交文件:
- path/to/file1.rs
- path/to/file2.rs
- Cargo.toml (v0.1.5 → v0.1.6)
- Cargo.lock
质量检查:
✓ cargo fmt passed
✓ cargo clippy passed
提交哈希:<short-hash>
Report must include:
feat/description, fix/description, chore/description| Mistake | Fix |
|---|---|
| Commit without checking unpushed commits | Always check git log @{u}..HEAD first |
| Forget version bump | Check project CLAUDE.md for requirements |
| Commit unrelated changes | Explicitly list files to stage, not git add . |
| QA updated lock file but wasn't staged | After clippy/test, run git diff --name-only and include any changed lock files in git add |
| Skip quality checks | Run project-specific checks before commit |
| Vague commit message | Use conventional commits format with clear summary |
| Commit with failing tests | Verify tests pass before committing |
| Missing commit report | Always show structured report after commit |
| CLAUDE.md out of sync with code | Check CLAUDE.md consistency before commit, update if needed |