ai-rules 00-critical · HARD STOP Rules

00-critical HARD STOP Rules

GIT — Destructive Commands BANNED

This file exists because AI agents sometimes skip detailed rules. These are non-negotiable. Violating any of these = immediate session failure.

GIT — Destructive Commands BANNED

  • git reset --hard — BANNED (especially with uncommitted changes)
  • git checkout -f / git checkout -- . — BANNED
  • git clean -fd — BANNED
  • git rebase — BANNED
  • git push --force / git push -f — BANNED
  • git push origin branchA:branchB (cross-push) — BANNED
  • git stash drop / git stash clear — BANNED

GIT — Before Any Destructive Action

  1. git status — uncommitted changes exist? STOP. Ask the user.
  2. git stash push was used? → Run git stash show --stat stash@{0} to verify contents.
  3. Never assume stash succeeded without verification.

GIT — Protected Branches

  • Never commit directly to main, master, or develop
  • Always work on feature/* branches
  • PR merge only — no direct push to protected branches

DATA — User Work Protection

  • User's uncommitted changes are irreversible (R2) — treat as sacred
  • Dirty working tree = GUARD MODE — no destructive git commands without explicit user approval
  • When in doubt: ask, don't destroy

SECURITY

  • No hardcoded secrets (API keys, passwords, tokens)
  • No .env file modifications
  • No PII in logs