Context Engineering: The Complete Guide
Everything you need to know about managing LLM context at production scale — from token budgets to progressive disclosure strategies.
Design System
A cohesive design system built entirely on Iosevka type variants. Multi-theme, responsive, and compatible with Tailwind CSS, shadcn/ui, and Radix UI. Every token, component, and pattern used to build this blog — available to drop into any project.
Portable files — drop into any project
design-system/tokens.cssAll CSS custom properties — 7 themes, type scale, spacingdesign-system/components.cssBase resets + component patternsdesign-system/tailwind.config.jsTailwind v3 configdesign-system/tailwind-v4-theme.cssTailwind v4 @theme blockdesign-system/llm-context.mdCompact reference optimized for LLM context windowsdesign-system/tokens.jsonMachine-readable token dataThemes
Apply themes by setting data-theme on <html>. All color tokens update automatically via CSS custom properties.
<head> before any CSS to prevent a flash of the wrong theme on page load:
(()=>{ const t=localStorage.getItem('theme')||'dusk'; document.documentElement.dataset.theme=t; })() Colors
Every color is a CSS custom property. They update automatically when the theme changes — no JS required for color switching.
Typography
One type family across all roles. Iosevka Etoile (quasi-proportional slab) reads like a traditional serif. Iosevka Curly Slab gives headings texture. Pure Iosevka handles code. Deep coherence at every level.
Body · Iosevka Etoile
Signal over hype. Production notes on agents, context engineering, and software that survives contact with reality.
@fontsource/iosevka-etoile · --font-family-body Headings · Iosevka Curly Slab
Three-Layer AI Operations
@fontsource/iosevka-curly-slab · --font-family-heading Code · Iosevka
const agent = new Agent({
model: "claude-sonnet-4",
tools: [readFile, bash]
}); @fontsource/iosevka · --font-family-mono All sizes use clamp(min, preferred, max) — smooth scaling from 375px to 1280px with no breakpoints.
Apply via data-typography on <html>. Controls body line-height, font-weight, letter-spacing, and size multipliers.
Spacing & Scale
All spacing uses --space-N tokens. Never use raw px or rem values for layout spacing — always go through the scale.
Spacing scale
--space-1 4px--space-2 8px--space-3 12px--space-4 16px--space-5 20px--space-6 24px--space-8 32px--space-10 40px--space-12 48px--space-16 64px--space-2080pxBorder radius
--radius-sm 10px · Code, inputs, buttons --radius-md 18px · Modals, tables, forms --radius-lg 28px · Cards, large surfaces --radius-full 9999px · Tags, pills, buttons Transitions
--transition-fast120ms ease · Micro-interactions--transition-base180ms ease · Hover states--transition-slow280ms ease · Background changes(theme switch)500ms ease · All color propertiesComponents
Every component uses only design system tokens. Switch themes above to see them all respond.
Uppercase label with glowing accent dot. Use above section headings to establish context.
Featured Article
.section-kicker {
display: inline-flex; align-items: center; gap: 0.65rem;
font-family: var(--font-family-heading);
font-size: var(--text-xs); font-weight: 500;
text-transform: uppercase; letter-spacing: 0.11em;
color: var(--color-foreground-muted);
}
.section-kicker::before {
content: ""; width: 0.62rem; height: 0.62rem;
border-radius: var(--radius-full);
background: var(--color-accent-primary);
box-shadow: 0 0 0 0.4rem var(--color-accent-muted);
} Monospace pills. Primary uses --color-accent-muted; muted uses a near-transparent background.
data-theme attribute on <html>. No JS needed for color changes.
<head> before your CSS links. This prevents a flash of the wrong theme on cold page loads.
--space-N scale.
--primary, --card, --ring, --destructive, etc. Components from shadcn/ui work out of the box.
Semi-transparent card with backdrop blur. The primary elevated surface in the design system.
Inside a surface-card
Background: var(--card) · Border: 1px solid var(--border) · Radius: var(--radius-lg) · Blur: backdrop-filter: blur(14px)
Left accent border lead paragraph. Used for TL;DR and key takeaways at the top of posts.
Production AI engineering is about context, not code. The difference between a demo and a deployed system is usually one thing: how you feed information to the model.
Uppercase mono links with accent underline on active state. The ::after underline sits 0.45rem below the baseline.
Compact date-column grid for listing multiple posts.
Everything you need to build production LLM systems with reliable context management.
Why the humble standalone script is one of the most powerful patterns in AI tooling.
Using filesystem events as the coordination layer for distributed agent systems.
LLM Access
The design system exposes structured formats optimized for AI agent consumption. Paste the LLM context into any agent's system prompt to generate consistently styled components.
Markdown
Compact structured reference (~3K tokens) covering all tokens, component patterns, and usage rules. Optimized for LLM context windows.
Use in system prompt:
Attach design-system/llm-context.md to your coding agent's context llm-context.md into your agent's context. The agent can then generate components that correctly use var(--space-N) spacing, the right font families, and theme-aware colors — without guessing.
Add this to any coding agent's system prompt when working in this codebase:
# Design System Rules
You are working in the ACIDBATH design system. Follow these rules strictly:
## Colors — ALWAYS use CSS custom properties
- Background: var(--color-background), var(--color-background-alt), var(--color-background-elevated)
- Text: var(--color-foreground), var(--color-foreground-alt), var(--color-foreground-muted)
- Accent: var(--color-accent-primary), var(--color-accent-secondary), var(--color-accent-muted)
- Borders: var(--border) — NEVER rgba() values directly
- Cards: var(--card) for card backgrounds
## Fonts — ONLY Iosevka variants
- Body: var(--font-family-body) [Iosevka Etoile]
- Headings: var(--font-family-heading) [Iosevka Curly Slab]
- Code/mono: var(--font-family-mono) [Iosevka]
- UI chrome: var(--font-family-ui) [same as body]
## Spacing — ONLY --space-N tokens
var(--space-1) = 4px var(--space-2) = 8px var(--space-3) = 12px
var(--space-4) = 16px var(--space-5) = 20px var(--space-6) = 24px
var(--space-8) = 32px var(--space-10)= 40px var(--space-12)= 48px
## Radii
--radius-sm: 10px (inputs, inline)
--radius-md: 18px (modals, blocks)
--radius-lg: 28px (cards, surfaces)
--radius-full: 9999px (pills, tags)
## Typography sizes
--text-xs through --text-4xl (all use clamp() for fluid scaling)
## Themes
Apply via data-theme on html. Available: dusk, parchment, seaside, olive, ink, moss, azure (+ -dark variants)
Default: dusk
## NEVER
- Hardcode hex colors
- Use font-family other than the --font-family-* tokens
- Use raw px/rem for spacing
- Use opacity on text for muting — use --color-foreground-muted