Architecture
The JSON contract
Section titled “The JSON contract”chisel check . --json and chisel-js check . --json are designed for
agent and CI consumption. Two things make them pleasant to consume:
- Deduplicated messages. Repeated messages across many files are
stored once in a top-level
messagesarray. Each violation references its message bymessage_ref(Python) /messageRef(TypeScript). - Skill cross-reference. Each message carries
skill_name/skillName: the bundled skill that teaches the pattern being violated. An agent can read that skill next if it needs more context.
See the Commands reference for the full JSON shape.
The layered shape
Section titled “The layered shape”Both checkers share the same layered architecture, the very architecture they enforce on your code:
For everything the rules cover, see the Python rules and TypeScript rules references.
Self-validating
Section titled “Self-validating”Both checkers enforce their own rules on their own source code. CI runs:
chisel check . --strict # Python checker checks itselfchisel-js check . # TypeScript checker checks itselfBoth are expected to produce zero violations. If a rule slips past the checker in its own repo, CI fails. This keeps the rulebook and the implementation honest.
Adding a rule
Section titled “Adding a rule”A new rule is one check method in a service plus one describeRules()
entry. The CLI commands (rules, explain, check --json) discover it
automatically and attach the relevant bundled skill name. Because both
checkers are shaped the same way, the rulebook maps 1:1 onto services in
each.