1.3 KiB
1.3 KiB
name, description, compatibility
| name | description | compatibility |
|---|---|---|
| native-hook-authoring | Create, revise, validate, or troubleshoot trusted personal pi-native-hooks diagnostic and verification policies and ast-grep fixtures. Use when adding focused post-mutation policies without duplicating lifecycle, process execution, state, or delivery logic. | pi-native-hooks on Node >=22.19 |
Native hook authoring
- Read contracts. Import policy contracts with
import typeonly. - Keep evaluators pure. Request analyzer keys and consume immutable snapshots; never spawn analyzers, linters, LSPs, or shell processes from a policy.
- Add or revise a fixture under the package's
tests/fixtures/personal-config, not the live personal root. - For syntax steering, create warning/info/hint ast-grep rules with language-specific IDs and a rationale-bearing
ast-grep-ignoreexample. - Run the focused fixture,
npm run typecheck, andnpm testas described in testing. - Preview personal installation with
/hooks-init --dry-run. Never write~/.config/pi-native-hookswithout explicit interactive authorization. Existing files must not be overwritten.
Personal modules are trusted arbitrary code with Pi's authority. Validation is not sandboxing. Use Node's erasable TypeScript subset only.