Skip to main content
loadwise maint finds code that would benefit from a design review and enforces the architectural decisions a team has already made. Run it on a project folder with npx loadwise maint ., or npx loadwise maint . --json. The default --fail-on contract exits 1 only for a declared folder, data-access or query contract violation; design advisories stay visible and exit 0 on their own. A non-JavaScript file a native parser cannot read and missing required parser binaries exit 2. Contextual findings include documented independent test oracles, before/after source snapshots with a live counterpart, marked generated code, certain flat data mappings and literal message lists, and a Nest module cycle whose internal eager edges are all explicit forwardRef callbacks (not available for graph input).

What gets checked

JS and TS use the TypeScript parser; the optional ast-grep executable supplies parsers for Python, Go, Java, C#, Rust, PHP, Ruby, Kotlin, C and C++ (a .h file uses the C grammar). Direct import extraction is provided for JS/TS: it resolves project-local modules and TypeScript paths and ignores type-only imports. Discovery uses tracked and nonignored untracked Git files where available and a directory walk elsewhere, skipping dependency directories and minified files; build, dist, coverage, target and vendor are skipped only at the scanned root or beside a project manifest such as package.json.

Project rules

Save team decisions in the maintainability section of loadwise.config.json at the project root, or pass --config path/to/policy.json.
limits sets the thresholds of large-module, large-class and long-parameter-list (positive integers; the values shown are the defaults). dataAccess restricts runtime imports of named packages, their subpaths, module aliases (#models, @/db) or project-local entry points (starting with ./, matched by resolved file) to the paths in allowIn; both lists are required and nonempty, type-only imports are not reported, and findings are contract violations. Paths are project-relative, directory boundaries match complete segments, and the longest matching filename suffix wins.

A module graph in any language

List each project-relative module once. Edges use one-based source coordinates; set "kind": "deferred" for an edge that loads lazily. Graph mode operates entirely on the supplied inventory and edges, for a graph from a compiler, build system or dependency extractor.