commit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseYou are about to create git commit(s). Follow these steps:
-
Check git status:
- Run to see all unstaged and staged files
git status - Show me what files have changed
- Run
-
Review the changes:
- Run to see the actual changes in all modified files
git diff - Analyze all changes to understand what was modified
- Run
-
Group files by related changes:
- Analyze the changes and group files into logical commits
- Grouping criteria:
- Files that implement the same feature together
- UI components in one commit, Redux changes in another
- Documentation updates separate from code changes
- Configuration files (package.json, .md files) grouped by purpose
- Agent files (.agents/) grouped together if related
- Examples:
- Group 1: (new UI component)
simple-signup-form.tsx - Group 2: ,
CLAUDE.md,redux-agent.md(documentation)ui-agent.md - Group 3: (dependency or script changes)
package.json - Group 4: ,
store/users/api.ts,store/users/slice.ts(Redux module)store/users/index.ts
- Group 1:
-
Present the grouping plan:
- Show me the proposed groups and ask for confirmation
- Format:
Commit 1: feat(ui): add simple signup form - src/components/custom/simple-signup-form.tsx Commit 2: docs: add redux and ui agent instructions - .agents/redux-agent.md - .agents/ui-agent.md - CLAUDE.md Commit 3: chore: add lint:file script to package.json - package.json - Wait for my approval or adjustments
-
Create commits sequentially: For each approved group:
- Run for only the files in that group
git add <files> - Create a meaningful commit message following conventional commit format:
- Format:
type(scope): description - Types: feat, fix, refactor, docs, style, test, chore
- Keep the first line under 72 characters
- Format:
- Run with the generated message
git commit -m "message" - Run to confirm the commit
git log -1
- Run
-
Final summary:
- Run where n = number of commits created
git log -<n> - Show me all commits that were created
- Run
Conventional Commit Examples:
feat(ui): add simple signup form with Field componentsfeat(redux): add user preferences state managementfix(auth): prevent duplicate loading states in slicesdocs: update CLAUDE.md with redux-agent instructionsdocs(agents): add ui-agent workflow documentationrefactor(auth): improve token validation logicchore: add lint:file script to package.jsonstyle(ui): update button component spacing
Important Rules:
- NEVER include unrelated files in the same commit
- ALWAYS ask for confirmation before creating commits
- DO NOT push to remote unless I explicitly ask you to
- If there's only one logical group, create a single commit
你即将创建git commit。请遵循以下步骤:
-
检查git状态:
- 运行查看所有未暂存和已暂存的文件
git status - 向我展示哪些文件发生了改动
- 运行
-
审查改动内容:
- 运行查看所有已修改文件的具体改动
git diff - 分析所有改动,了解修改的内容
- 运行
-
按关联改动分组文件:
- 分析改动,将文件分组到逻辑清晰的commit中
- 分组标准:
- 共同实现同一功能的文件放在一组
- UI组件放在一个commit,Redux改动放在另一个
- 文档更新与代码改动分开
- 配置文件(package.json、.md文件)按用途分组
- Agent文件(.agents/)如果相关则放在一组
- 示例:
- 分组1:(新增UI组件)
simple-signup-form.tsx - 分组2:、
CLAUDE.md、redux-agent.md(文档)ui-agent.md - 分组3:(依赖或脚本改动)
package.json - 分组4:、
store/users/api.ts、store/users/slice.ts(Redux模块)store/users/index.ts
- 分组1:
-
展示分组方案:
- 向我展示拟定的分组并请求确认
- 格式:
Commit 1: feat(ui): add simple signup form - src/components/custom/simple-signup-form.tsx Commit 2: docs: add redux and ui agent instructions - .agents/redux-agent.md - .agents/ui-agent.md - CLAUDE.md Commit 3: chore: add lint:file script to package.json - package.json - 等待我批准或调整
-
按顺序创建commit: 对每个获批的分组:
- 仅为该分组内的文件运行
git add <files> - 遵循conventional commit格式创建有意义的commit信息:
- 格式:
type(scope): description - 类型:feat, fix, refactor, docs, style, test, chore
- 首行长度保持在72个字符以内
- 格式:
- 使用生成的信息运行
git commit -m "message" - 运行确认commit创建成功
git log -1
- 仅为该分组内的文件运行
-
最终汇总:
- 运行,其中n = 创建的commit数量
git log -<n> - 向我展示所有已创建的commit
- 运行
Conventional Commit示例:
feat(ui): add simple signup form with Field componentsfeat(redux): add user preferences state managementfix(auth): prevent duplicate loading states in slicesdocs: update CLAUDE.md with redux-agent instructionsdocs(agents): add ui-agent workflow documentationrefactor(auth): improve token validation logicchore: add lint:file script to package.jsonstyle(ui): update button component spacing
重要规则:
- 绝对不要将不相关的文件放在同一个commit中
- 创建commit前务必请求确认
- 除非我明确要求,否则不要推送到远程仓库
- 如果只有一个逻辑分组,创建单个commit即可