/wbCheck — Exhaustive Simulation ()
/wbCheck is the static analyzer. It validates code health (types, signatures) and documentation integrity (broken links, spelling, schema adherence) without executing anything. The hard distinction: /wbAudit finds logic and security flaws (dynamic analysis), /wbValid runs CI tests (dynamic execution), /wbCheck verifies syntactic and referential contracts (purely static). No code runs. No tests execute.
Read this if you want to know which analysis engine fires per file type, what --fix can and cannot auto-correct, and why link checking is a first-class feature for a monorepo with 50+ markdown files.
1. Role & target
| Aspect | Behavior |
|---|---|
| Role | The Static Analyzer & Compliance Checker. |
| Target | Source code (type checking), markdown (link checking, grammar), JSON/config (schema validation). |
| Cell scope | None. /wbCheck is purely diagnostic. |
| Side effects allowed | With --fix: auto-correcting trivial errors (typos, basic type casts). |
| Side effects forbidden | Modifying execution logic, running tests, altering plan state. |
The "purely static" constraint means /wbCheck can run on any commit, any branch, any state — it doesn't need a running environment, installed dependencies, or a valid build. Compare to /wbValid which needs the test suite to execute, or /wbAudit which reads runtime behavior.
2. Argument resolution
The analysis engine is auto-selected by file extension:
| Form | Example | Engine fired |
|---|---|---|
.js/.ts file | Command: /wbCheck src/WBC.js | Type checker — JSDoc/TypeScript type validation. |
.md file | Command: /wbCheck docs/readme.md | Link checker + grammar engine. |
.json file | Command: /wbCheck tsconfig.json | Schema validator. |
| Directory | Command: /wbCheck src/ | Type checker on all .js/.ts files. |
| Glob | Command: /wbCheck **/*.md | Link checker across the entire doc tree. |
The engine selection is deterministic — no guessing. A .js file always gets type checking; a .md file always gets link checking. To override (e.g., grammar check on a .js file's comments), use the flag to force.
3. Flag matrix
| Flag | Shortcut | Purpose |
|---|---|---|
--fix | -f | Auto-corrects trivial errors (typos, basic type casts). |
--fix limitations. Auto-fix handles:
- ✅ Spelling corrections in markdown
- ✅ Simple type widening (
string | undefinedwhen a param is optional) - ❌ Ambiguous type inference (won't guess between
numberandstring) - ❌ Broken link rewiring (can't know where the file moved to)
- ❌ Logic-level type errors (won't cast
anyto a specific type)
When --fix can't resolve an error, it leaves it in place with a ⚠️ Manual fix required annotation. The principle: auto-fix is conservative. A wrong auto-fix is worse than no fix.
4. Pipelines (the agent-native scenarios)
/wbCheck frontEnd/wbc-ui/core2/packages/wb-flow/templates/**/*.md -l -g> /wbCheck frontEnd/wbc-ui/core2/packages/wb-flow/templates/**/*.md -l -g💠 Pipeline Documentation integrity sweep for frontEnd/wbc-ui/core2/packages/wb-flow/templates
The frontEnd/wbc-ui/core2/packages/wb-flow/templates/ directory has 50+ markdown files with extensive cross-linking. After the v4 documentation overhaul, verify nothing is broken:
💠 Pipeline Strict type gate on wb-core source
The team is migrating from vanilla JS to JSDoc-typed JS. Report all remaining loose types:
💠 Pipeline Auto-fix typos after grammar check
5. Edge cases & refusals
| Trigger | What /wbCheck does |
|---|---|
--fix on an ambiguous type error | ⚠️ Cannot auto-fix implicit 'any' in processToken(). Manual casting required. |
| Empty directory (no files match glob) | ℹ️ No files found matching pattern. Nothing to check. |
The unifying principle: /wbCheck is the integrity layer. It answers "is the codebase internally consistent?" — do the types match, do the links resolve, is the spelling correct? It's the static complement to /wbAudit (dynamic logic) and /wbValid (dynamic tests). All three can run on the same codebase and find different classes of problems.
