Commit Changes Skill
Use this skill when the user asks to commit changes made by the agent.
Workflow
- •Summarize changes and ask for commit confirmation.
- •Detect mixed changes:
- •Run
git status -sb - •Run
git diff(andgit diff --stagedif needed) - •Identify files modified by the agent in this session.
- •Run
- •Stage only agent changes:
- •Use
git add <files>orgit add -pfor mixed files. - •Leave user changes unstaged; notify the user.
- •Use
- •Commit with model prefix:
- •Format:
[MODEL_NAME]: <type>: <short description> - •Use conventional types when appropriate (feat/fix/refactor/docs/test/chore).
- •Format:
- •Report result:
- •Provide commit hash and short summary.
- •Offer to push if appropriate (never auto-push).
Safety & Rules
- •Never commit user changes without explicit permission.
- •Never amend unless explicitly requested.
- •Never force push or rewrite history.
- •If the pre-commit hook fails, report the failure and ask whether to fix or proceed.
- •If git is not initialized, inform the user and ask to initialize.
Mixed Changes Message Template
If user changes are present, say:
- •"I detected uncommitted changes you made in: <files>. I will only commit my changes: <files>. Your changes remain unstaged."
Model Prefix
Use the current model identifier. If unknown, use [AI].