Instruction file imported from vmandic/searchconsole-mcp (
.cursor/rules/git-commit.mdc). Copyright stays with the author.
Git commits (searchconsole-mcp)
When to commit
- Commit only when the user explicitly asks. If unclear, ask first.
- Do not push, tag,
npm publish, or force-push unless the user asked for that step.
Before committing
Run in parallel:
git status
git diff
git diff --staged
git log -5 --oneline
- Stage only relevant files. Never commit secrets (
.env, credentials JSON). - One logical change per commit; title focuses on why (1–2 sentences).
- Pass the message via HEREDOC:
git commit -m "$(cat <<'EOF'
fix: redact home paths in tool error messages
EOF
)"
Safety
- Never update
git config. - Never use interactive git (
-i: nogit rebase -i,git add -i). - No
--no-verifyunless the user explicitly requests it. - No force push to
main. Warn before any force push elsewhere. - Prefer a new commit over
--amendunless user amend rules apply. - Run
npm testbefore commits that touchsrc/ortest/. - Releases: .cursor/skills/ship-release/SKILL.md — no
npm publishor tag without user ask.
Red flags
| Stop | Why |
|---|---|
| Commit without user request | Owner policy |
git push --force to main |
Destructive |
--no-verify / git config edits |
Unless user asked |
Commit .env or *.json keys |
Secret leak |
