pi-steering-hooks — Prompts
Verbatim Excerpt 1: src/index.ts (Default Rules)
const DEFAULT_RULES: Rule[] = [
{
name: "no-force-push",
tool: "bash",
field: "command",
pattern: "\\bgit\\s+push\\b.*--force(?!-with-lease)",
reason: "Force push rewrites remote history and can destroy teammates' work. Use `git push --force-with-lease` if you must, or better yet, create a new commit.",
},
{
name: "no-hard-reset",
tool: "bash",
field: "command",
pattern: "\\bgit\\s+reset\\s+--hard\\b",
reason: "Hard reset discards uncommitted changes permanently. Use `git stash` to save work first, or `git reset --soft` to keep changes staged.",
},
{
name: "no-rm-rf-slash",
tool: "bash",
field: "command",
pattern: "\\brm\\s+-[a-zA-Z]*r[a-zA-Z]*f[a-zA-Z]*\\s+/(?:\\s|$)",
reason: "Recursive force-delete from root is catastrophic. Specify a safe path.",
noOverride: true,
},
{
name: "conventional-commits",
tool: "bash",
field: "command",
pattern: "\\bgit\\s+commit\\b.*-m\\s+[\"'](?!(feat|fix|style|refactor|docs|test|chore|perf|ci|build|revert)(\\(.+\\))?(!)?: )",
reason: "Commit message must use Conventional Commits format: `type(scope): description`. Types: feat, fix, style, refactor, docs, test, chore, perf, ci, build, revert.",
},
Technique: reason-as-documentation — each rule's reason field is not just an error message but a teaching moment explaining why the rule exists and what the safe alternative is. This enables agents to self-correct rather than just retry blindly.
Verbatim Excerpt 2: README (Override Mechanism)
When a rule fires, the agent can retry with an override comment:
```bash
git push --force origin main # steering-override: no-force-push — deploying hotfix to unblock prod
The override is allowed through but logged to the session for audit. Rules with noOverride: true (like no-rm-rf-slash) cannot be overridden.
**Technique**: escape-hatch design — the override mechanism acknowledges that rules can have legitimate exceptions while preserving audit accountability. This is a key design choice: strict-by-default but pragmatic in exceptions. Unlike clauder (which requires human approval for some operations), pi-steering-hooks trusts the agent to self-authorize with a stated reason.