rule-script-generatorlisted
Install: claude install-skill Eliyce/paqad-ai
## What It Does
For every rule in `rule-script-map.yml` whose `verifiability.kind ∈ {deterministic, heuristic}` and whose `enforced_by` is empty, authors one or more Node ESM scripts under `.paqad/scripts/rules/<mirror>/<rule-file>/NNN-name.mjs`, each with `__fixtures__/pass/` and `__fixtures__/fail/`. Each script:
- Carries the `@paqad-rule-script` header (validated against the header schema).
- Reads `{ projectRoot, files }` from stdin and writes the findings JSON contract to stdout.
- Is validated against its own fixtures **before** registration. Pass fixtures must yield zero findings; fail fixtures at least one. A script that fails is rejected and surfaced — never registered.
No `.sh` scripts are ever produced. See `references/script-authoring.md` for the full contract.
## Use This When
- A user prompt matches the priority-225 router rules `generate rule scripts` or `regenerate scripts for rule RL-<id>`.
- After `analyze rules` has produced a reviewed `rule-script-map.yml`.
## Inputs
- `docs/instructions/rules/rule-script-map.yml` (read for rules + classifications; written only via the bundled `register-script.mjs` → `src/rule-scripts/apply.ts`).
- The rule text for each target rule (to author the detection logic).
- Existing in-scope source files, used for the over-flagging dry-run guard.
## Procedure
1. Load the map. Select target rules: `kind ∈ {deterministic, heuristic}` and `enforced_by == []`. If `only_rule_id` is set, restrict to it.
2. For each target rul