Contributing
The most common contribution is adding a validation rule. Please read the Code of Conduct before contributing.
Getting Started
Prerequisites: Node.js 20+, npm, Git, and optionally Claude Code for testing the plugin.
git clone https://github.com/YOUR_USERNAME/claudelint.git
cd claudelint
npm install
npm run build
npm testBefore opening a PR, run npm run validate to catch lint, format, build, and test failures in one pass. See CLI Reference for all available commands.
Previewing Linter Output
Run claudelint against the test fixture projects to see what errors and warnings look like:
# All categories with intentional errors/warnings
npm run check:fixtures:invalid
# Clean run (zero issues)
npm run check:fixtures:valid
# Individual validators
npx claudelint validate-agents --path tests/fixtures/projects/invalid-all-categoriesThe invalid-all-categories fixture has intentional violations across all 10 validator categories. The valid-complete fixture should produce zero issues. Both are tested in CI via tests/integration/fixture-projects.test.ts.
Diagnostic Collection
Library code uses DiagnosticCollector instead of console for all output. See Architecture for full details.
import { DiagnosticCollector } from '../utils/diagnostics';
export function myFunction(
param: string,
diagnostics?: DiagnosticCollector
): Result {
if (invalid) {
diagnostics?.warn('Invalid param', 'MyFunction', 'MY_001');
}
}Console is only allowed in the CLI layer (src/cli/utils/logger.ts), output formatting (src/utils/reporting/), and script utilities (scripts/util/logger.ts). This is enforced by npm run check:logger-usage in CI and pre-commit hooks.
Commit Messages
Follow Conventional Commits format (enforced by commitlint). PR titles must also follow this format.
type(scope): subjectTypes: feat, fix, docs, test, refactor, chore, perf
Adding Validation Rules
claudelint uses a rule-based architecture similar to ESLint. Contributors write individual validation rules, not validators.
See the Custom Rules Guide for the full walkthrough: rule structure, validation patterns, auto-fix, and testing strategies.
Checklist:
- Create rule file in
src/rules/{category}/{rule-id}.ts - Define rule metadata (id, name, description, category, severity)
- Add
meta.docsdocumentation metadata (see schema and example below) - Implement
validate()function - Add rule to category index in
src/rules/{category}/index.ts - Write unit tests in
tests/rules/{category}/{rule-id}.test.ts - Test the rule with
npm test - Run
npm run docs:generateto verify documentation generates - Run validation on project:
npm run validate
Rule Docs Metadata
Rule documentation is auto-generated from meta.docs in each rule's source file. Include a docs property so the documentation site stays in sync automatically. See the RuleDocumentation schema for all available fields.
docs: {
recommended: true,
summary: 'Hook command references a script file that does not exist',
details: 'When a hook command points to a script, the referenced file must exist on disk...',
examples: {
incorrect: [{ description: 'Missing script', code: `command: "bash .claude/hooks/missing.sh"` }],
correct: [{ description: 'Existing script', code: `command: "bash .claude/hooks/validate.sh"` }],
},
howToFix: 'Create the missing script or update the command path.',
whenNotToUse: 'Disable if hook scripts are generated at build time.',
}For rules with configurable options, add optionExamples and relatedRules — see the schema for details.
Run npm run docs:generate after adding metadata to verify the generated page. Output appears in website/rules/{category}/{rule-id}.md.
Contributing Skills
Skills are interactive capabilities that allow Claude to help users validate, optimize, and fix their Claude Code projects through conversation.
Quality Standards
Required for all skills:
- Description with trigger phrases — must include what, when, triggers, and capabilities
- Proper naming — no single-word verbs, use suffixes like
-all,-cc,-cc-md - Automated validation — must pass
claudelint validate-skills - Manual testing — trigger phrases tested, functionality verified
Required for complex skills:
- Examples section — scenario-based examples (User says → Actions → Result)
- Troubleshooting section — for skills with >3 scripts or that edit files
For skills with >3,000 words, use a references/ directory for progressive disclosure.
Submitting a Skill
Before submitting a PR:
Validate structure:
bashclaudelint validate-skills .claude/skills/your-skillTest trigger phrases in a fresh Claude session — verify 90%+ trigger success rate
Test functionality with valid inputs, invalid inputs, and edge cases
Update README.md and
.claude-plugin/README.mdwith the new skill
Documentation Website
The documentation site is built with VitePress and lives in website/. Rule documentation pages are auto-generated from source code metadata.
npm run docs:dev # Dev server (generates rule docs + launches at localhost:5173)
npm run docs:generate # Generate rule pages only
npm run docs:build # Production build
npm run docs:preview # Preview the production build- Rule docs: edit the
meta.docsproperty in the rule's source file, then runnpm run docs:generate - Guide/API pages: edit markdown files directly in
website/ - Components: edit Vue files in
website/.vitepress/theme/components/ - Navigation: edit sidebar config in
website/.vitepress/config.mts
See Also
- Architecture - How the codebase is structured
- Custom Rules Guide - Full walkthrough for writing rules
- Rule System - How validators and rules interact
- Rules Reference - Complete list of built-in rules