Thank you for your interest in contributing to Sentinel!
End users install from npm — see README.md. This guide is for contributors working from a cloned repository.
Clone the repo and run from source:
npm install
npm run lint
npm test
npm run typecheck
npm run buildRun all five commands before opening a pull request. For CI parity you can also run npm run format:check.
We use Conventional Commits:
feat:— new featurefix:— bug fixdocs:— documentation onlychore:— tooling, deps, CItest:— tests onlyrefactor:— code change that neither fixes a bug nor adds a feature
Examples:
feat(cli): add --format sarif flag
fix(core): resolve template literal URLs correctly
chore: upgrade vitest to v2
Commit messages are validated by commitlint via Husky.
Sentinel enforces strict package boundaries. When adding imports, follow these rules:
| Package | May import | Must NOT import |
|---|---|---|
@sentinel-scan/core |
Node builtins, typescript (peer) |
Any other @sentinel-scan/* package |
@sentinel-scan/cli |
@sentinel-scan/core |
@sentinel-scan/ai, @sentinel-scan/cloud-sdk |
@sentinel-scan/ai |
@sentinel-scan/core |
@sentinel-scan/cli, sentinel-vscode |
@sentinel-scan/cloud-sdk |
@sentinel-scan/core |
@sentinel-scan/cli, @sentinel-scan/ai, sentinel-vscode |
@sentinel-scan/core must remain pure — zero runtime dependencies. All I/O (stdout, filesystem, network) belongs in consumer packages like CLI or cloud-sdk.
Boundary violations are caught by ESLint (no-restricted-imports) and TypeScript project references.
See ARCHITECTURE.md for how the scan pipeline, contract checking, and package boundaries fit together.
Root npm test runs Vitest across all workspace packages.
Well covered today: API extraction, file scanning, OpenAPI parsing, route matching, body diffing, contract pipeline integration (scanner.test.ts), CLI scan end-to-end (scan.test.ts), reporters, and path validation.
Areas still lacking dedicated unit tests (behavior is often exercised indirectly):
@sentinel-scan/core:url-resolver.ts,file-reader.ts@sentinel-scan/core: individual rule modules (no-hardcoded-url.ts,missing-error-handler.ts)@sentinel-scan/cli:config/loader.ts,args.ts, formatters,init.ts
Add tests for new behavior in the package you change. Backfilling every gap above is not required for each PR.
- Fork the repo and create a feature branch from
main. - Make your changes with tests where appropriate.
- Ensure
npm run lint && npm run typecheck && npm test && npm run buildall pass. - Open a PR with a clear description of what changed and why.
By contributing, you agree that your contributions will be licensed under the MIT License.
See RELEASING.md for npm publish instructions.