Skip to content

Development ​

Learn how to extend claudelint with custom rules, understand the architecture, and contribute to the project.

Adding project-specific validation? Start with the Custom Rules Guide to create rules in your .claudelint/rules/ directory.

Contributing a built-in rule? See Contributing for the rule checklist and meta.docs metadata format.

Understanding the codebase? Read the Architecture overview, then dive into the Rule System or Internals as needed.

Sections ​

Rule Documentation Auto-Generation ​

Rule documentation pages on this site are auto-generated from source code metadata. Each rule's TypeScript source file includes a meta.docs property that drives the generation of its documentation page.

How It Works ​

  1. Rules define inline documentation via meta.docs (type: RuleDocumentation)
  2. Running npm run docs:generate reads all rules from the registry
  3. Rules with meta.docs generate pages from the template in scripts/generate/rule-docs.ts
  4. A sidebar JSON file is auto-generated for navigation

RuleDocumentation Schema ​

FieldTypeRequiredDescription
recommendedbooleanNoWhether the rule is in the recommended config
summarystringYesOne-sentence summary for search and overviews
detailsstringYesDetailed explanation (supports markdown)
examplesobjectYes{ incorrect: ExampleBlock[], correct: ExampleBlock[] }
howToFixstringNoStep-by-step fix instructions
optionsobjectNoJSON schema for configurable options
optionExamplesConfigExample[]NoExample configurations
whenNotToUsestringNoGuidance on when to disable this rule
relatedRulesstring[]NoIDs of related rules
furtherReadingLink[]NoExternal reference links

Supporting Types ​

ExampleBlock: { description: string, code: string, language?: string }

ConfigExample: { description: string, config: Record<string, unknown> }

Link: { title: string, url: string }

Commands ​

bash
npm run docs:generate   # Generate rule pages and sidebar
npm run docs:dev        # Generate + start dev server
npm run docs:build      # Generate + production build

See the Contributing guide for examples of good metadata.