Git safety
Portable playbook for coding agents: always-on principles, user rules, and triggered skills.
npx -y skills add Tsurai7/agentic-playbook --skill git-safetyAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Safe git commit workflow. Use when the user asks to create a commit, or before running git commit. Covers staging, message style, HEREDOC format, amend rules, and hook failures.
SKILL.md
1.7 KB, as published. Nobody here has run it
Git commit safety
Only create commits when requested by the user. If unclear, ask first.
Before committing
Run in parallel:
git status— untracked filesgit diff— staged and unstaged changesgit log— recent messages for style
Message
- 1–2 sentences focused on why, not only what
- Match the repo's message convention (from
git log); default types if none: add / update / fix / refactor / test / docs - Do not commit secrets (
.env, credentials, etc.)
Commit command
Pass message via HEREDOC:
git commit -m "$(cat <<'EOF'
Commit message here.
EOF
)"
Protocol
- NEVER update git config
- NEVER destructive commands (
push --force,hard reset, etc.) unless explicitly requested - NEVER skip hooks (
--no-verify,--no-gpg-sign) unless explicitly requested - NEVER force push to
main/master— warn if requested - Avoid
git commit --amendunless ALL:- User requested amend, OR commit succeeded but pre-commit hook modified files
- HEAD commit was created in this session by you
- Commit has not been pushed
- If commit failed or was rejected by hook — never amend; fix and new commit
- If already pushed — never amend unless user explicitly requests (needs force push)
- Do not push unless user asks
Sequence
- Stage relevant files
- Commit with HEREDOC message
git statusto verify
Hook failure
Fix the issue and create a new commit — do not amend a failed commit.