
Show HN: ChemX – Architectural AST linter for LLM context bloat, AI slop
Chemical X replaces noisy compiler dumps, unstructured whole-file reads, and AI code smells with an index-first SQLite architecture. Built for Cursor, Claude Code, Cline, and terminal agents.
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
Chemical X replaces noisy compiler dumps, unstructured whole-file reads, and AI code smells with an index-first SQLite architecture. Built for Cursor, Claude Code, Cline, and terminal agents.
Scan 500-line ceilings, hook saturation, and context hazards in < 5 seconds
When an agent runs npm test, it wastes half its context window reading green checkmarks. chemx verify strips the noise and returns surgical, machine-readable diagnostics only when something breaks.
Deterministic architecture and runtime intelligence engineered for autonomous coding agents. Chemical X isolates the exact mechanical guardrails models need to operate without context rot or prompt fatigue.
Don’t force LLMs to grep blindly or dump 600-line files into prompt windows. Chemical X builds an in-memory SQLite WAL index (.chemx/index.db). Agents resolve symbol signatures, export boundaries, and hook dependencies in sub-100ms for ~30 tokens.
// 28 Tokens Ingestion (vs 2,400 raw LOC) $ chemx q useCheckout --inspect Symbol: useCheckout (Composable) Exports: [isUnlocked, openCheckout, lockAccess] File: src/composables/useCheckout.ts (48 LOC) Transitive Callers: [AppHeader, FunnelOfferSection]
PILLAR 02 AST Guardrails Against AI Code Decay
Syntactic AI Slop & Code Decay Detection
$ chemx audit --slop
Standard linters only check syntax; Chemical X detects when an LLM writes hallucinated or degrading code. Catches conversational chat residue, echo comments, shallow paranoia try/catches, and lazy truncation placeholders before they reach git.
// AST Slop Prevention in Pre-Commit ✖ AI Slop Detected in src/views/dashboard.vue: Line 42: Conversational residue comment Line 88: Lazy truncation placeholder "// ..." Line 114: Shallow empty try/catch block Result: Commit blocked before hitting git.
PILLAR 03 Zero Prompt Fatigue for Autonomous Agents
Single-Permission MCP Master Gateway
$ chemx({ action, params })
Eliminate tool sprawl and continuous permission prompts. Instead of configuring 14 disparate MCP tools, Chemical X exposes AST queries, surgical line patching, and silent verification through a single consolidated tool gateway.
// Single Master Tool Gateway (Zero Permission Spam) await mcp.callTool("chemx", { action: "patch", params: { path: "src/atoms/Button.vue", lines: "12-28", replacement: "<button :class='atomClasses'>..." } });
PILLAR 04 99.7% Context Conservation in CI & Agents
Silent Closed-Loop Verification & Telemetry
$ chemx verify
Stop blasting 15,000+ tokens of raw compiler logs into agent context windows. Chemical X orchestrates AST validation, TypeScript typechecks, and tests into a token-budgeted 45-token receipt, surfacing failure diffs only when code breaks.
// Silent Verification Receipt (45 Tokens vs 17,200) $ chemx verify ✔ AST Architecture: Clean (0 hazards, Grade A) ✔ TypeScript Check: Clean (0 errors across 48 files) ✔ Vitest Suite: 18 passed (214ms) Token Telemetry: 45 tokens ingested | $0.0001 est. Status: Pipeline verified green.
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.
Arbitrary 100-line rules enforced for aesthetic purism or stylistic pedantry.
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.
Strictly ban native HTML tags everywhere outside an arbitrary 'atom' directory.
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.
An inflexible framework that forces you to rewrite your entire tech stack from scratch.
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.
See how to configure .chemxrc with custom line budgets, excluded directories, and AI slop detection.
Beyond search and passive memory: Chemical X provides active multi-agent concurrency leases and closed-loop verification for autonomous development teams.
Eliminates per-tool confirmation prompts. A single chemx({ action, params }) call gives agents verified file patching, AST querying, line slicing, and test execution without prompt fatigue.
Dedicated file_leases and file_lock_queue SQLite tables in WAL mode prevent race conditions when multiple autonomous agents edit the same repository simultaneously.
When an agent reports a task 'Done', Chemical X automatically re-runs the rule against the AST. Completion is strictly rejected unless the violation is provably eliminated.
Zero configuration. Zero project dependencies. Run npx chemx audit directly in any project root to inspect token bloat, AI slop, and component blast radius.
██████╗██╗ ██╗███████╗███╗ ███╗██╗ ██████╗ █████╗ ██╗ ██╗ ██╗ ██╔════╝██║ ██║██╔════╝████╗ ████║██║██╔════╝██╔══██╗██║ ╚██╗██╔╝ ██║ ███████║█████╗ ██╔████╔██║██║██║ ███████║██║ ╚███╔╝ ╚██████╗██║ ██║███████╗██║ ╚═╝ ██║██║╚██████╗██║ ██║███████╗ ██╔╝ ██╗
MOLECULAR HEALTH INDEX: 94 / 100 [Grade: A • Highly Modular] Source Files Analyzed: 54 files (4,120 LOC) Token Reduction Potential: 36.8% (Estimated 48,000 excess tokens saved)
✔ PASSED: Line Budgets & Capsule Boundaries (< 100 LOC) ✔ PASSED: Two-Stage Atomic Booleans & Result Tuples ✔ PASSED: AI Slop & Conversational Residue Check ✔ PASSED: Encapsulated Primitive Auditing
SYSTEM ARCHITECTURE END-TO-END AGENT PROTOCOL
The 7 Layers of Chemical X
Chemical X is not a single CLI or scaffolder. It is an architecture-and-tooling protocol that makes software legible, bounded, and mechanically verifiable to AI coding agents.
Software shaped like small, independently understandable molecules rather than giant monoliths.
Enforces hard file bounds (<500 LOC), capsules (<100 LOC), TOC views (<20 LOC), and 2-stage atomic booleans.
Narrows the working context an agent holds in memory, eliminating hallucinated state mutations.
Run npx chemx audit locally. Zero cloud code upload. Instant MHI score and hazard detection in 5s.
Equip Claude, Gemini, or Cursor with chemx:mcp. Query AST slices and verify edits deterministically.
Unlock the complete 7-chapter specification, ready-to-use .cursorrules, and CI pre-commit gates from $27.
Launch independent interactive tools built to evaluate, benchmark, and enforce the 500-line protocol.
How 25 years of architectural discipline tames stochastic AI into clean, modular production code.
7 comprehensive engineering standards chapters for predictable, high-velocity AI coding.
Review 5 evaluation tasks tested against Claude, Gemini, GPT, Grok, and Cursor. Monoliths vs Chemical X.
Analyze real-world repositories against the 500-line protocol. Inspect grades, context leaks, and health metrics.
Drop Chemical X into your monorepo as a git submodule or standalone repository with pre-configured pre-commit hooks.
Analyze your components against the 500-line limit. Measure AI context saturation, token cost, and hallucination risk.
7 comprehensive engineering standards chapters. High-level summaries are visible below; full code patterns and copyable rules are unlocked in Vault access.
Hard Line Limits, Monolith Decomposition & Anti-Prop-Drilling
Every entity in the codebase has a single, indivisible molecular responsibility. Keep top-level views under 20 lines reading like a Table of Contents.
To protect our competitive edge, full code patterns and copyable AGENTS.md rules for Chapter 1 are reserved for Vault members.
Granular Domain types/*.d.ts Capsules, Discriminated Unions, & Result Tuples
Two-Stage Atomic Booleans & Single-Action Command Handlers
The Molecular Destructuring Contract & 3-State Async Pipelines
4-Tier Styling Hierarchy, Anti-Tailwind-Soup & 60 FPS UI
Zero setInterval & Self-Cleaning Timer Composables
Zero-Conditional Debug Proxy & Clean Typography
Select permanent self-serve developer licenses for instant access, or book hands-on pair architecture with Principal Architect Xopher Pollard.
Every 1-on-1 session ($150) includes a Single Developer License ($27 value). Every Team sprint ($500) includes Team Power Puff Unlimited ($97 value). Or apply code ONBOARD50 for 50% off private onboarding slots.
One-time purchase for permanent access. Zero recurring subscriptions. Includes book, directives, and CLI key.
Direct video screen-share with Xopher Pollard. Codebase AST audit, custom directives, and live refactoring.
A private, 60-minute screen-share and pairing session to audit your architecture, tame context rot, and calibrate AI agent directives.
A high-impact team pairing workshop to align your engineering squad on the 7 Pillars of Molecular Architecture and automated CI gates.
Your access includes a cleanly styled, multi-page PDF formatted specifically for e-readers and Amazon Kindle. Take these Molecular Architecture standards offline, print them, or distribute them directly to your engineering team.
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。