Skip to content

Getting started

Signposts to the right CodeCharter docs for writing your own rules.

Custom rules are what turn CodeCharter from a static checker into a team tool. Where you start depends on how familiar you already are with the DSL.

Writing your first custom rule

First custom rule in the quick-start walks you through the full workflow: create the file, validate it, drop it into ./.codecharter/rules/, run the analyzer.

Getting to know the DSL

Hello-world DSL is the smallest meaningful rule, explained line by line. From there, File structure covers the .codecharter directory and Syntax overview is the compact language reference.

Going deeper

Once you are comfortable with the DSL, the next three pages are where the interesting material lives:

  • DSL grammar: formal EBNF reference for the exact shape the parser accepts.
  • Predicate catalog: full list of every property available on each code-model entity.
  • Rule examples: a gallery of ready-to-copy rules grouped by use case.

What makes a good rule

Best practices collects the rules of thumb we follow ourselves when writing the rules that ship with CodeCharter.