بنقرة واحدة
smart-commit
智能分组提交代码。按功能/模块划分未提交的代码,分批次有条理地 commit。当用户提到"提交"、"commit"、"分组提交"、"smart commit"时使用。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
智能分组提交代码。按功能/模块划分未提交的代码,分批次有条理地 commit。当用户提到"提交"、"commit"、"分组提交"、"smart commit"时使用。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Automates Google Chrome and Chromium-based browsers via JXA with AppleScript dictionary discovery. Use when asked to "automate Chrome tabs", "control browser with JXA", "Chrome AppleScript automation", "Chromium browser scripting", or "browser tab management". Covers windows, tabs, execute(), tunneling patterns, and permissions.
使用 Chrome DevTools MCP 自动浏览官方文档并查找内容。当用户使用 /docs 命令、请求查询官方文档、需要在文档网站中搜索特定API/功能说明、或提到"查一下文档"、"看看官方文档"、"文档中怎么说"时触发。支持任意URL的官方文档查询。
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Gemini CLI's capabilities with specialized knowledge, workflows, or tool integrations.
| name | smart-commit |
| description | 智能分组提交代码。按功能/模块划分未提交的代码,分批次有条理地 commit。当用户提到"提交"、"commit"、"分组提交"、"smart commit"时使用。 |
| allowed-tools | Bash, Read, Glob, Grep, TodoWrite, AskUserQuestion |
按功能或模块划分当前未提交的代码,分批次创建有条理的 commit 记录。
Co-Authored-By 或类似的 AI 生成标识@commitlint/config-conventional 规范# 查看当前 git 用户配置
git config user.name
git config user.email
# 查看所有未提交的变更(不使用 -uall 避免大仓库内存问题)
git status
# 查看未暂存的变更
git diff --stat
# 查看已暂存的变更
git diff --cached --stat
# 查看最近的 commit 风格
git log --oneline -10
根据 X-CLI 项目结构对变更进行分组:
| 目录 | Scope | 说明 |
|---|---|---|
bin/ | bin | CLI 入口文件 |
common/command/new/ | new | 项目创建命令 |
common/command/plugin/ | plugin | 插件管理命令 |
common/command/create/ | create | 组件创建命令 |
common/command/remove/ | remove | 组件删除命令 |
common/command/xi/ | xi | 安装命令 |
common/command/xu/ | xu | 卸载命令 |
common/command/xr/ | xr | 运行命令 |
common/constants/ | constants | 常量配置 |
common/utils/ | utils | 工具函数 |
common/utils/manager/ | manager | 包管理器 |
esbuild.config.js | build | 构建配置 |
package.json | deps | 依赖管理 |
readme.md, *.md | docs | 文档 |
.commitlintrc, .czrc 等 | config | 项目配置 |
.husky/, .lintstagedrc | hooks | Git hooks 配置 |
| Type | 说明 |
|---|---|
feat | 新功能 |
fix | Bug 修复 |
refactor | 代码重构(不改变功能) |
style | 样式/格式调整(空格、分号等) |
docs | 文档更新 |
chore | 构建/工具/配置变更 |
test | 测试相关 |
perf | 性能优化 |
revert | 回滚提交 |
refactor 或 chore 提交feat(plugin) 提交fix(<command>) 提交chore(config) 提交使用 AskUserQuestion 工具向用户展示分组方案并确认:
建议将变更分为以下 N 个 commit:
1. refactor(create): 移除 create 命令相关代码
- common/command/create/create.js (deleted)
- common/command/create/templates/*.js (deleted)
2. feat(manager): 添加 bun 包管理器支持
- common/utils/manager/bun.js (new)
- common/utils/manager/manager.js (modified)
请确认或调整分组方案。
对每个分组执行:
# 1. 先重置暂存区(如果需要)
git reset HEAD
# 2. 添加该分组的文件
git add <file1> <file2> ...
# 3. 提交(使用 HEREDOC 确保格式正确,不带 Co-Authored-By)
git commit -m "$(cat <<'EOF'
<type>(<scope>): <description>
EOF
)"
<type>(<scope>): <subject>
[可选的正文]
type: 必填,见上方类型表scope: 可选,表示影响范围subject: 必填,简短描述(不超过 72 字符)feat(plugin): add eslint plugin auto-configuration
fix(manager): resolve pnpm detection on Windows
refactor(new): simplify project template generation
chore: update dependencies
docs: update CLI usage in readme
本项目的 pre-commit hook 配置为始终通过(exit 0),但如果遇到 lint-staged 报错:
# 查看当前暂存的文件
git diff --cached --name-only
# 创建临时 stash 备份
git stash push -m "backup-before-fix-$(date +%Y%m%d-%H%M%S)"
# 运行 prettier 格式化
npx prettier --write <files>
# 恢复 stash
git stash pop
# 重新添加并提交
git add <files>
git commit -m "<message>"
git status# 撤销最后一次 commit(保留变更)
git reset --soft HEAD~1
# 撤销 add(保留变更)
git reset HEAD <file>
Co-Authored-By 或任何 AI 相关信息--amend 修改已推送的 commit--force 强制推送--no-verify)除非用户明确要求每次提交后输出:
✓ Commit 1/N: <type>(<scope>): <description>
- <file1>
- <file2>
SHA: <short-sha>
✓ Commit 2/N: <type>(<scope>): <description>
...
提交完成!共创建 N 个 commit。
当存在大量文件删除时,按功能模块归类:
# 删除整个目录
git add common/command/create/
git commit -m "refactor: remove create command (moved to separate package)"
优先按功能关联分组,而非按操作类型:
# 同一功能的增删改放在一起
git add common/utils/manager/bun.js common/utils/manager/manager.js common/constants/manager.const.js
git commit -m "feat(manager): add bun package manager support"
配置类变更可以合并为一个 commit:
git add .commitlintrc .czrc .prettierrc
git commit -m "chore(config): update linting configuration"