Guidance
| Read | For |
|---|---|
| CONTRIBUTING.md | Setup, source conventions, tests, benchmarks, pull request rules and releases. |
| AGENTS.md | Repository rules for coding agents. CLAUDE.md imports it. |
| Contributing guide | The walkthrough of one rule from detector to verified fix, with the commands to run it. |
| AI coding agents | How an agent scans, reads findings, applies fixes and verifies outcomes. |
| changes/README.md | The changelog fragment each pull request adds. |
| docs/rules | One page per rule, grouped by checker. npm run docs:rules regenerates the indexes. |
| bench/holdout | Reviewed upstream locations and how to refresh them. |
| bench/evidence | Migration, API contract and query plan fixtures. |
Source
| Path | Holds |
|---|---|
bin/loadwise.ts | CLI entry point: top-level usage, --version, crash reporting and the heap limit. |
lib/shared/cli-dispatch.ts | Routes perf, rel, maint, sec, a11y, fix and check to their modules, loaded on demand. |
bin/github-action.ts | The GitHub Action runner behind action.yml. |
lib/<checker>/ | One folder per checker: performance, reliability, maintainability, security, accessibility. Each has cli.ts, rule-ids.ts and topic folders such as collections/. |
lib/<checker>/site-fixes/ | The automatic edit builders for that checker’s rules. |
lib/shared/analysis/ | Scanning logic shared by checkers: AST helpers, function summaries, the call graph used for hot-path ranking, and the scan cache. |
lib/shared/fix/ | loadwise fix: selection, previews, safety and type checks, patches, history and reversal. |
lib/shared/reporting/, lib/shared/formats/ | Text output and the --format reports (SARIF, JUnit, HTML and others). |
lib/shared/agent/ | loadwise agent: init, instructions, MCP server, pending reports, history and verify. |
lib/editor/ | The language server behind loadwise lsp, plus rule examples shown in hovers. |
polyglot/ | ast-grep rules for Python, Go, Java and the other non-JS languages. |
schema/ | JSON Schemas for loadwise.config.json and agent outcomes files. |
editor/ | The VS Code-compatible extension package (VSIX). |
integrations/ | Zed, Sublime Text and Eclipse clients. |
agent/hooks/, hooks/ | The after-edit hook that agent init registers, and this repository’s own pre-commit hook. |
scripts/ | Test runner (run-tests.ts, test-files.ts), rule docs, rule scaffold, changelog, corpus scoring and self-scan config. |
Tests, fixtures and benchmarks
| Path | Holds |
|---|---|
test/<checker>/ | Unit and CLI tests, in the topic that matches lib/<checker>/. Most fixtures are inline source strings in the test. |
test/performance/fixtures/, test/shared/fixtures/ | Fixture projects and shared fix-verification cases. |
examples/ | Small published examples with a finding and a clean control for each checker. |
bench/recall/ | Known bugs: manifest.json names the rule, file and line each case in cases/<id>/ must report. npm run bench:recall |
bench/holdout/ | Reviewed locations in pinned upstream files. npm run bench:holdout -- --strict |
bench/corpus/ | Pinned open-source projects, review labels and the scorecard. npm run bench:corpus |
bench/evidence/ | Migrations, API contracts and query plans. npm run bench:evidence |
bench/scanner.ts, bench/security.ts, bench/traces.ts, bench/patterns.ts | Speed benchmarks. npm run bench:scan and the matching bench:* scripts. |
Docs
README.md and CONTRIBUTING.md are the sources for the guide pages in docs/*.mdx and docs/checkers/*.mdx; change both together. Rule pages live in docs/rules/<checker>/<rule-id>.md. The Docs site section of CONTRIBUTING.md covers the generated parts.