git-commit
Format, lint, test, and commit changes. Detects repo tooling automatically.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Commit all changes in the repo with proper formatting, linting, and testing.
1. Gather Context
Check what tooling exists:
!ls -la package.json Makefile Cargo.toml pyproject.toml go.mod 2>/dev/null || true
!cat package.json 2>/dev/null | head -50 || true
Study the repo's commit message style:
!git log --oneline -20
Note the pattern: conventional commits? imperative mood? lowercase? prefix? scope? Look at casing, punctuation, length, and structure. Your commit message MUST follow this pattern.
2. Current Changes
!git status
!git diff
!git diff --cached
3. Execute
Based on what you found:
- Format: Run formatter if available (prettier, black, gofmt, cargo fmt, nixfmt, etc.)
- Lint: Run linter if available (eslint, tsc --noEmit, clippy, etc.)
- Test: Run tests related to changed files if test runner exists
- Plan commits: Look at the git log style. If the repo favors small, focused commits (one logical change each), split the staged/unstaged changes into multiple commits — group related files together by logical change. If the repo uses larger commits, a single commit is fine.
-
Stage & commit: For each logical group,
git addthe relevant files by path (nevergit add -A— avoid staging.env, credentials, or large binaries) and commit with a message matching the repo's style. Go from most independent change to most dependent.
If $ARGUMENTS is provided, use it as the commit message for a single commit of all changes. Otherwise, generate messages matching the repo's commit style, splitting into multiple commits when it matches the repo's pattern.
Fix any formatting/lint issues automatically. If tests fail, report and stop.
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-03-11
- 索引更新时间
- 2026-03-11
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!