Thanks for the interest. Hardened is in early alpha — the API will change, but PRs are welcome.
pnpm install
pnpm build
pnpm testRules live in packages/rules-risk/src/ (or the future rules-config, rules-schema packages). Each rule:
- Implements the
Ruleinterface from@hardened/core - Has a
match()function that walks the AST and returns findings - Optionally has a
fix()function that returns a deterministic code transformation - Must be deterministic — same input always produces same output
- Should have a test fixture under
fixtures/
Example: see packages/rules-risk/src/http-no-timeout.ts.
If you can't write a fix that produces the same output every time for the same input — don't ship the fix. Emit a finding only and let a human decide. This is how hardened earns trust to auto-apply.
Conventional Commits: feat:, fix:, docs:, refactor:, test:, chore:.