Agent skill
commit
This skill should be used when the user asks to "commit changes", "push my code", "commit and push", "save my work", or wants to stage all changes and push to remote.
Install this agent skill to your Project
npx add-skill https://github.com/ianphil/my-skills/tree/main/commit
SKILL.md
Commit
Stage changes, record observations, commit, and push.
Phase 1: Review Changes
git status
git diff --stat
git diff
Understand what changed and why. This context feeds Phase 2.
Phase 2: Write AI Notes
This phase is mandatory. Every commit must evaluate whether observations belong in .ainotes/log.md.
Setup (first time only)
If .ainotes/ does not exist in the repo root:
mkdir .ainotes
Create .ainotes/memory.md:
# AI Notes — <project name>
Create .ainotes/log.md:
# AI Notes — Log
Append Observations
Reflect on the entire session — not just the diff. Consider:
- Architecture patterns or gotchas discovered
- Build/test commands that aren't documented
- Surprising behavior, race conditions, edge cases
- File relationships or conventions not obvious from code
- Dependency quirks or version constraints
Append to .ainotes/log.md using this exact format:
## YYYY-MM-DD
- <area>: <one-line observation>
- <area>: <one-line observation>
If today's date header already exists, append bullets under it. Otherwise create a new header.
What NOT to write
- Anything already in
README.mdorAGENTS.md - Generic statements ("the code is well-structured")
- Descriptions of what you just changed — that's what the commit message is for
When to skip
Only skip if genuinely nothing new was learned in this session. This should be rare. If you touched code, you almost certainly learned something. When in doubt, write a note.
Phase 3: Commit
git log -3 --oneline
Match the existing commit style. Stage files explicitly:
git add <changed files>
git add .ainotes/log.md # always include if modified
git add .ainotes/memory.md # include if created
git add .ainotes/rules.md # include if created or modified
Prefer git add <file> over git add -A.
Commit message format:
<type>: <short description>
<optional body explaining why>
Types: feat, fix, chore, docs, refactor, test
Phase 4: Push
git push
If push is rejected (behind remote):
git pull --rebase
git push
Rules
- Do NOT add Co-Authored-By, Signed-off-by, or any trailer attributions
- Do NOT use
git add -Aunless every changed file should be staged - Do NOT skip Phase 2 without explicitly stating why nothing was learned
- If on
mainormaster, warn the user before pushing
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
prime-feat
This skill should be used when the user asks to "load feature context", "resume feature work", "prime feature N", "continue feature N", or wants to load all planning artifacts for a specific feature number.
implement-agents
This skill should be used when the user asks to "implement in parallel", "run phases concurrently", "parallel implement", "implement-agents phase X phase Y", or wants to orchestrate multiple agents running /implement simultaneously.
code-walkthrough
Generate structured, hallucination-proof code walkthroughs using Showboat. Use when the user asks to "walk me through this code", "explain this codebase", "create a walkthrough", "document how this works", "give me a tour of this repo", or wants a readable narrative document that explains code with real verified snippets. Also triggers on "showboat", "linear walkthrough", or "code documentation". Not for quick code questions — this produces a full markdown document.
ainotes
This skill should be used when the user asks to "consolidate notes", "summarize ainotes", "clean up notes", "ainotes", or wants to consolidate accumulated agent observations into a compact summary.
implement
This skill should be used when the user asks to "implement phase N", "implement task T001", "do TDD for phase", "implement T001-T009", or wants to execute tasks following strict TDD red-green-refactor workflow.
work-plan
This skill should be used when the user asks to "show work plan", "what's the plan for feature N", "show progress", "view execution plan", or wants to see phase breakdown, progress status, and next actions for a feature.
Didn't find tool you were looking for?