Auto Commit Skill
Core Instruction
When you complete a user request that involves modifying files or code, you MUST automatically create a git commit to save the changes. This ensures that every successful AI intervention is snapshotted.
Procedure
After finishing the code modifications for the user's request:
- 1. Surgical Staging: Do NOT use
git add .. Instead, stage ONLY the files you have explicitly modified:
-
git add <file_path1> <file_path2> ...
- 2. Filter by Type: If multiple files were changed, ensure you are only staging source code files (e.g.,
.py, .go, .sol, .js, .ts, .md). Avoid staging environment files (.env), binaries, or large assets. - Verify: If unsure, run
git status to confirm only the intended changes are staged. - Commit: Run
git commit -m "<message>" with a concise, descriptive summary of your changes.
Do not ask for permission; execute the commit automatically. If the user explicitly asks not to commit, respect their request. Skip if not a git repository or no changes were made.
自动提交技能
核心指令
当您完成涉及修改文件或代码的用户请求时,必须自动创建git提交以保存更改。这确保每次成功的人工智能干预都被快照记录。
操作流程
完成用户请求的代码修改后:
- 1. 精准暂存:不要使用git add .。仅暂存您明确修改过的文件:
- git add <文件路径1> <文件路径2> ...
- 2. 按类型筛选:如果更改了多个文件,请确保只暂存源代码文件(例如.py、.go、.sol、.js、.ts、.md)。避免暂存环境文件(.env)、二进制文件或大型资源文件。
- 验证:如有疑问,运行git status确认仅暂存了预期更改的文件。
- 提交:运行git commit -m <信息>,提供简洁且描述性的更改摘要。
无需请求许可,自动执行提交。如果用户明确要求不提交,请尊重其请求。如果不是git仓库或未进行任何更改,则跳过此操作。