Open-source language · semantic review · AGPL-3.0
KERN is a compact source format, compiler, and semantic review engine for AI-assisted software. Describe the product, let an LLM draft readable .kern, compile it to your stack, then run review rules that understand effects, guards, taint, routes, and framework contracts.
What it is
Raw generated code is long, framework-specific, and easy to misunderstand. KERN gives the model a structured language and gives your team a compiler plus review layer around the result.
Write less
KERN is indentation-based: nodes, props, style shorthands, handlers, types, routes, machines, and tests in a format that is easy to read and cheap for LLMs to generate.
Compile wider
The compiler emits framework-aware code for web, backend, terminal, MCP, Python, Go, and library targets from the same semantic source.
Review deeper
kern review combines AST rules, concept extraction, taint analysis, confidence scoring, native .kern rules, and MCP security checks.
Why LLMs improve
LLMs are strongest when the output format is small, regular, and explicit. KERN keeps layout, routes, types, effects, and review intent in one source tree, so the model has fewer tokens to juggle and humans have a smaller artifact to inspect before compiling.
prompt → .kern → compiled code → review
page name=Checkout
metadata title="Checkout"
schema name=Order
field name=email type=string
route path="/api/order" method=POST
validate schema=Order
handler
do expr={{ await db.orders.create(input) }}Compiler sees page, schema, route, validation, and effect boundaries.
Review can flag missing guards, tainted input, route drift, and unsafe side effects.
Before you ship
Kern looks for the bugs that appear when generated code crosses boundaries: database writes, network calls, auth guards, LLM prompts, client/server drift, and MCP tool handlers.
kern review src/ --recursive
! indirect-prompt-injection
DB result flows into an LLM prompt
without sanitization
~ unguarded-effect
write/network effect is not protected
by an auth or validation guardreview rule registry entries in source
MCP security rule IDs
concept extraction for TypeScript and Python
confidence scores and suppression metadata
Compiles to
Language evolution
The evolve pipeline scans TypeScript, detects recurring patterns, proposes templates or structural nodes, validates them, and stages the approved result. It is a way to turn local conventions into reviewable language constructs.
kern evolve:discover src/
scan
detect gaps
analyze patterns
propose templates
validate proposals
stage only approved outputStart here
Install the CLI, ask an LLM for .kern, compile to your target, and run kern review on the generated code.