PABCD Initiative Documentation Hub pabcd_initiative codexclaw cli-jaw

Static Analysis Gate — Toolchain Commands & Rule Mapping

Source: dev/references/static-analysis-gate.md

Static Analysis Gate — Toolchain Commands & Rule Mapping

Companion to dev/SKILL.md §7. Read when running the static-analysis part of the

verification gate or configuring lint/typecheck for a project.

Per-Toolchain Gate Commands

ToolchainCommandMust Pass
TypeScripttsc --noEmitZero errors
Python (typed)mypy . or pyrightZero errors on changed files
ESLint / Biomenpx eslint . or npx biome check .Zero errors
Gogo vet ./...Zero issues
Rustcargo clippy -- -D warningsZero warnings
C#dotnet build /warnaserrorZero warnings

Per-Language Type Annotation Rules

LanguageRule TypeScriptstrict: true in tsconfig. Avoid implicit any; explicit any requires a line comment with justification. PythonType hints on all function params and returns (def fetch(url: str) -> Response:).
GoAlready enforced by compiler — ensure exported types have doc comments.
C# / JavaUse nullability annotations (?, @Nullable). Avoid raw Object or dynamic.
GeneralIf the language supports a strict/pedantic mode, enable it.

Common Rule ↔ Prose Mapping

Anti-Pattern (prose)ESLint / Biome Rule
Unused variable/importno-unused-vars, @typescript-eslint/no-unused-vars
Unsafe any type@typescript-eslint/no-explicit-any
Loose equality (==)eqeqeq
Circular importimport/no-cycle (ESLint), noBarrelFile/useImportRestrictions (Biome)
Unhandled async@typescript-eslint/no-floating-promises
var usageno-var, prefer-const
Complex functioncomplexity, max-depth, max-lines-per-function

This table is not exhaustive — the project's own config is the canonical rule set.

New-File Language Default

For new JavaScript/TypeScript source files, prefer TypeScript:

  • Use .ts for logic and .tsx for typed UI components when the project already supports

TypeScript or is greenfield JS/TS.

  • Use .js/.jsx only when the repo is clearly JS-only, build or runtime constraints

require JS, or the user asks for JS.

  • Do not introduce TypeScript tooling, convert existing JS, or change tsconfig without

user approval. Migrating a language is a decision with a cost the user is paying.

New TypeScript is strict-compatible from the first patch, not after a cleanup pass:

  • No implicit any.
  • Explicit any requires a nearby justification comment.
  • Prefer unknown plus narrowing over any.
  • Type exported function parameters and return values.
  • Handle null and undefined deliberately.
  • Avoid code that only passes because strict is disabled — it becomes someone else's

failure the moment the flag is turned on.

Verification: run the project's configured typecheck when available. If TypeScript is

present but no typecheck script exists, use the closest safe equivalent (tsc --noEmit).

If strict compatibility cannot be verified, say so rather than implying it was checked.

Escape Hatches

When bypassing the type system is unavoidable:

  • Add a comment explaining why the escape is needed — not what it does.
  • Scope it minimally: cast at the narrowest point, not the broadest.
  • Prefer assertion functions over raw casts (assertIsString(x) over x as string).
  • A double cast through unknown requires a linked issue or TODO. It defeats the checker

entirely, so it should be traceable to a reason that can expire.

  • A blanket type-checker suppression must name the specific error code it suppresses, so

it stops applying when that error stops being the one that occurs.

Sources

ClaimSourceChecked
Biome barrel-file rule exists (noBarrelFile)https://biomejs.dev/linter/rules/no-barrel-file/2026-07-02
ponytail necessity-gate discipline (DEV-NECESSITY-01 source)https://github.com/DietrichGebert/ponytail2026-07-02