Contributing¶
Setup¶
Development¶
Load from local checkout instead of marketplace:
After changes:
- Rebuild:
pnpm run build - Reload in running session:
/reload-plugins
Or use watch mode:
Testing¶
pnpm run test # all tests
pnpm run test -- src/__tests__/parser.test.ts # single file
pnpm run test:watch # watch mode
pnpm run typecheck # type checking
Manual testing¶
Pipe hook JSON to the entry point:
echo '{"tool_name":"Bash","tool_input":{"command":"rm -rf /"},"session_id":"test","cwd":"/tmp"}' | pnpm run eval
Releasing¶
Releases publish via CI when a GitHub release is created - not locally.
pnpm run release # patch bump
pnpm run release:minor # minor bump
pnpm run release:major # major bump
This bumps the version, updates the changelog, commits, pushes, and updates the marketplace. Then create a GitHub release manually:
CI publishes to npm when the release is created.
Safety invariant¶
Auto-allow features (chain variable resolution, chain rm cleanup, trusted remotes) must never override user restrictions:
alwaysDenyalways checked first - no auto-allow can bypass it- Chain-resolved auto-allow only fires when no matching rules exist
- Chain-local rm checks rules before allowing
Principle: auto-allow only upgrades the default "ask" - never downgrades an explicit deny.