Engineering Standards for Chemical X
AI models do not just need more context; they need strictly bounded context. These 7 pillars eradicate context rot, prevent phantom imports, and keep Claude, Gemini, Antigravity, and Cursor fully reliable.
The 7 Pillars of Molecular Architecture
Every AST hazard check executed locally in under 5 seconds by the Chemical X auditor. Guarantees single-purpose files, reduces context token burn, and eliminates LLM hallucinations.
Pillar 1: File Line Budget (< 500 LOC)
LINE_BUDGET_FILECalibrated 3-tier sliding scale: Warning (500-999), Severe (1000-1999), and Extreme (2000+) monoliths.
Pillar 1: Molecule Capsule Limit (< 100 LOC)
LINE_BUDGET_MOLECULEEnforces strictly single-purpose UI capsules with declarative bindings and zero business logic bloat.
Pillar 2: Two-Stage Atomic Booleans
CONTROL_FLOW_INLINE_BOOLEANCatches multi-clause inline logic: single-concept atomic booleans composed into unified decisions.
Pillar 2: Zero Nested Ternaries
CONTROL_FLOW_NESTED_TERNARYEliminates nested conditional branches that cause AI hallucination and logical degradation.
Pillar 3: Composable Destructuring Contract
HOOK_SATURATIONLimits hooks to 3-5 return properties; flags components importing more than 5 individual hooks.
Pillar 4: Domain Type Co-Location
TYPE_COLOCATIONProhibits type monoliths; mandates co-located types/*.d.ts capsules (< 100 LOC) per feature.
Pillar 5: 4-Tier Zero-Inline-Style & Anti-Tailwind-Soup
RAW_INLINE_STYLEProhibits raw inline styles and long utility chains (> 4-5 classes); mandates Level 1 atom props or scoped classes via @apply or mixins.
Pillar 6: Self-Cleaning Lifecycle Timers
TIMER_DISCIPLINEDetects raw setInterval or setTimeout calls lacking automatic unmount disposal.
Explore the 7 Chapter Specifications
Expand each chapter below to inspect key architectural takeaways, clean molecular code patterns, and common monolith traps.
Every entity in the codebase has a single, indivisible molecular responsibility. Keep top-level views under 20 lines reading like a Table of Contents.
Quantum Architectural Rules & Code Locked
To protect our competitive edge, full code patterns and copyable AGENTS.md rules for Chapter 1 are reserved for Vault members.
Unlock the Complete Vault & Agent Directives
Get unrestricted access to the complete 7-chapter specification, ready-to-use .cursorrules, AGENTS.md, CI pre-commit gates, and the private starter repository.