PRAGMATIC ARCHITECTURE ZERO LOCK-IN • FULLY CONFIGURABLE

The Pragmatic Guide to LLM Blast Radius

You are never locked into an inflexible box. Chemical X is designed to give you surgical control over AI blast radius, token budgets, and slop detection via a simple .chemxrc configuration file.

THE PRAGMATIC ARCHITECT COGNITIVE LOAD & BLAST RADIUS

Architecture Designed for LLM Blast Radius

Why enforce compact components? Because LLMs hallucinate when asked to edit 400-line files with 12 nested hooks. Chemical X defaults to bounded component weight—colocating state, enforcing single responsibility, and preventing silent regressions. Configurable out of the box via .chemxrc.

Dogmatic Misconception

Arbitrary 100-line rules enforced for aesthetic purism or stylistic pedantry.

Pragmatic Architect Reality

Bounded Blast Radius. When an LLM edits a 60-line component, its attention focus is laser-sharp. In a 450-line file with 12 hooks, the model hallucinates variable state and introduces silent regressions.

Dogmatic Misconception

Strictly ban native HTML tags everywhere outside an arbitrary 'atom' directory.

Pragmatic Architect Reality

Design-system boundary enforcement and encapsulated primitive auditing. Ensure raw tags carry consistent accessibility, focus states, and design tokens rather than ad-hoc inline mutations.

Dogmatic Misconception

An inflexible framework that forces you to rewrite your entire tech stack from scratch.

Pragmatic Architect Reality

100% configurable via .chemxrc. Adjust line limits, ignore legacy paths, customize AI slop thresholds, and configure token budgets to match your team's existing conventions.

Custom rules for your codebase: explore the Pragmatic Guide

See how to configure .chemxrc with custom line budgets, excluded directories, and AI slop detection.

Read .chemxrc Guide

Why Enforce Bounded Component Weight?

The 500-line ceiling and 100-line molecule targets are not arbitrary aesthetic dogma. They are empirical boundaries designed around machine attention mechanics:

Unbounded Monoliths (400+ LOC)

When asked to modify a single button state inside a 500-line file with 12 nested hooks, an LLM must ingest and predict attention weights across all 500 lines. It hallucinates missing imports, inadvertently mutates neighboring reactive state, and burns thousands of unnecessary prompt tokens.

Bounded Capsules (50-150 LOC)

When state, styling, and markup are encapsulated into compact single-purpose capsules, the LLM’s blast radius is strictly bounded. The model reads 60 lines, executes the modification with 100% precision, and exits in under 2 seconds for ~30 tokens.

.chemxrc Configuration Reference JSON FORMAT

Place in your repository root to override defaults and customize thresholds.

{
  "$schema": "https://chemicalx.xophz.com/schema/chemxrc.json",
  "version": "1.0",
  "rules": {
    "lineBudget": {
      "enabled": true,
      "maxFileLines": 500,
      "maxCapsuleLines": 100,
      "severity": "warn"
    },
    "aiSlopDetection": {
      "enabled": true,
      "conversationalResidue": true,
      "echoComments": true,
      "lazyPlaceholders": true,
      "shallowTryCatch": true,
      "severity": "error"
    },
    "tokenBudget": {
      "enabled": true,
      "maxTokensPerFile": 3000,
      "warnAt": 2000
    },
    "designSystemBoundaries": {
      "enabled": true,
      "encapsulateRawPrimitives": true,
      "allowedPrimitivePaths": ["src/components/atoms/**"]
    }
  },
  "mcp": {
    "masterGateway": true,
    "sqliteWalMode": true,
    "concurrencyLeases": true
  },
  "exclude": [
    "node_modules/**",
    ".nuxt/**",
    "dist/**",
    "legacy/**",
    "**/*.spec.ts"
  ]
}
rules.lineBudget
Adjust max lines per file or molecule. Set to "warn" during migrations to avoid blocking CI builds.
rules.aiSlopDetection
Catch conversational residue, empty try/catches, and lazy comments before code is committed.
rules.designSystemBoundaries
Enforce that raw DOM tags are encapsulated inside primitives to ensure accessible tokens.
exclude
Glob patterns to exempt vendor directories, test files, and legacy modules from strict checks.

4-Step Progressive Adoption Strategy

STEP 01
Zero-Install Audit

Run npx chemx audit to benchmark your baseline token burn and MHI score without changing any code.

STEP 02
Set Pragmatic Rules

Create a .chemxrc with your team's file limits and exclude legacy modules so you migrate iteratively.

STEP 03
Silent Verification

Switch your agent scripts and pre-commit hooks to chemx verify, saving 99% of verification tokens.

STEP 04
Master MCP Gateway

Equip Cursor, Claude Code, and Cline with chemx for 1-click approvals and SQLite symbol lookups.