Git Commit Workflow
Use this skill when the task is to create one commit from current work.
Workflow
- 1. Inspect git status, diff, branch, and recent commit style.
- Stage only relevant changes.
- Draft a concise commit message that reflects why the change exists.
- Create a new commit non-interactively.
- Report the resulting commit summary.
Guardrails
- - Never amend unless explicitly asked.
- Never bypass hooks unless explicitly asked.
- Avoid staging secrets or unrelated files.
- Do not create an empty commit.
Example Requests
- - Make one clean commit from the current working tree.
- Stage the right files and create a proper commit message.
Inputs
- - Current diff
- Branch state
- Recent commit style
Outputs
- - One non-amended commit
- Accurate commit message
Success Criteria
- - Only relevant changes were committed.
- No empty commit was created.
- Hooks and safety rules were respected.
Non-Goals
- - Amend flows unless explicitly asked
- Committing secrets or unrelated changes
Source Provenance
Derived from
src/commands/commit.ts.
Git 提交工作流
当任务需要从当前工作区创建一个提交时,使用此技能。
工作流程
- 1. 检查 git 状态、差异、分支和最近的提交风格。
- 仅暂存相关更改。
- 起草一条简洁的提交信息,反映变更存在的原因。
- 以非交互方式创建新提交。
- 报告生成的提交摘要。
防护措施
- - 除非明确要求,绝不修改已有提交。
- 除非明确要求,绝不绕过钩子。
- 避免暂存机密信息或不相关文件。
- 不要创建空提交。
示例请求
- - 从当前工作树创建一个干净的提交。
- 暂存正确的文件并创建合适的提交信息。
输入
输出
成功标准
- - 仅提交了相关更改。
- 未创建空提交。
- 钩子和安全规则得到遵守。
非目标
- - 除非明确要求,不执行修改提交流程
- 不提交机密信息或不相关更改
来源追溯
源自 src/commands/commit.ts。