Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/cad0p/pi-steering-hooks/llms.txt

Use this file to discover all available pages before exploring further.

The examples/ directory contains ready-to-use rule packs for the most common agent-workflow guardrails. Each example ships with a README.md explaining the rationale, a canonical steering.ts config you can drop straight into .pi/, and a steering.test.ts covering the adversarial command matrix. The examples are designed to be read, copied, and tweaked — not installed as a dependency.

Force Push Strict

Stricter than the default no-force-push rule — blocks git push --force-with-lease too. For shared branches and regulated environments where history must stay append-only without exception.

No Amend

Blocks git commit --amend on any branch. Includes a cwd-scoped variant that applies only within specific project directories — useful in monorepos where some subtrees enforce linear history.

Draft PRs Only

gh pr create must include --draft. Ensures all PRs start as drafts, requiring an explicit human step before the PR is marked ready for review.

Combined Git Discipline

Force-push blocking, no-amend, and draft-PR enforcement bundled into a single config. The recommended starting point for teams that want disciplined PR flow without per-agent coaching.

Work Item Plugin

A full plugin example with observers, ordering rules, and a &&-chain speculative allow. Demonstrates every v0.1.0 authoring pattern — observers, when.happened, temporal invalidation, onFire, and as const satisfies Plugin.

Quick install

Each example is a self-contained steering.ts file. Copy the one you want into your project’s .pi/ directory and you are done:
# Copy a steering.ts into your project:
cp examples/force-push-strict/steering.ts .pi/steering/index.ts
For a global policy that applies to every pi session on your machine, install to ~/.pi/ instead:
cp examples/force-push-strict/steering.ts ~/.pi/steering.ts
The walk-up loader picks up either location automatically — .pi/steering.ts in the project tree takes precedence over ~/.pi/steering.ts when both exist.
All examples include adversarial test matrices. Run pnpm test inside each example directory to see the matrix output and verify the rules compile against the current defineConfig API shape.

Build docs developers (and LLMs) love