Contributing¶
Setup¶
git clone https://github.com/cdot65/prisma-airs-cursor-hooks.git
cd prisma-airs-cursor-hooks
npm install
Development Workflow¶
Source Changes¶
Edit TypeScript in src/. After changes:
Development Mode Hooks¶
For rapid iteration, point hooks.json at TypeScript source (no rebuild needed):
This adds ~1.5s per invocation. Switch back to compiled JS for production:
Running Tests¶
Tests include:
- Unit tests: config, scanner, code-extractor, circuit-breaker, DLP masking, logger, log rotation
- Integration tests: end-to-end hook execution via
npx tsxand compilednodewith piped JSON
Adding a Test¶
Tests live in test/ and use vitest. Each module has a corresponding test file:
Project Structure¶
src/ TypeScript source
hooks/ Hook entry points (stdin → scan → stdout)
adapters/ Multi-IDE adapter layer
dist/ Compiled JS (git-ignored)
scripts/ CLI utilities (install, validate, stats)
test/ Vitest test suites
docs/ MkDocs documentation
Pull Request Guidelines¶
- Branch from
main - Ensure
npm testandnpm run typecheckpass - Include tests for new functionality
- Run
npm run buildto verify compilation