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.
pi-steering-commit-format gates git commit -m commands against commit-message format checkers. It ships as a sibling of pi-steering — opt-in functionality that doesn’t belong in the core engine — and mirrors the pi-steering-flags precedent for external plugin packaging. The package parses commit message strings; it does not walk bash ASTs and carries no unbash / unbash-walker dependency.
Bundled formats
"conventional"— Conventional Commits 1.0.0, restricted to the Angular preset’s 11-token type allowlist:feat,fix,docs,style,refactor,perf,test,chore,ci,build,revert. Headers likefeat: add login,fix(scope): resolve crash, andrefactor!: drop deprecated APIall pass. Types outside the Angular set (release:,merge:, etc.) are rejected even if they are otherwise 1.0.0-conformant."jira"— at least one bracketed JIRA-style ticket reference in the message body ([ABC-123],[PROJ-1234], etc.).
Install
Quickstart
when.commitFormat
The rule fires (commit is blocked) when the commit message fails any of the required format checks.
ctx.input.command, extracts the -m <msg> value via the internal extractCommitMessage helper, and runs every checker in require. All listed checkers must pass — if any fails the rule fires.
Empty require: [] is a no-op (nothing required, nothing fires).
Commands without a
-m flag — bare git commit, which opens an editor — are NOT validated by this predicate. The editor flow requires a separate hook outside pi-steering’s current scope.Custom formats with commitFormatFactory
Use commitFormatFactory to build a predicate that AND-gates the built-in checkers with your own format checker. Pass an object whose keys are format names and whose values are (msg: string) => boolean checker functions.
require argument is type-narrowed to keyof F, so TypeScript flags typos at the rule’s when: slot. Calling with an unknown format name via a JS bypass or as any fails closed — the predicate fires.
BUILTIN_FORMATS is the registry of available checkers. It is not a default-required set — callers always pick which formats to AND together via require:. Spreading BUILTIN_FORMATS into the factory makes those format names available alongside your custom checker; omitting it produces a predicate that only knows your custom formats.