# Context Compiler Architecture (Phase 1)

## Overview
The DSS Context Compiler transforms the application from a simple token extractor into a context-aware system. It uses a 3-layer cascade to resolve the final design system context.

## Layer Cascade
1. **Base Layer** (`skins/base.json`): Universal tokens (white, black, system stacks).
2. **Skin Layer** (`skins/[name].json`): Thematic definitions (Workbench, Classic).
3. **Project Layer** (`ds.config.json`): Project-specific overrides.

## Safe Boot Protocol
If the JSON parser fails or files are missing, the compiler falls back to an in-memory `EMERGENCY_SKIN` to prevent crash loops.

## Integration
MCP Tools should now use the `with_context` wrapper or interact via the 5 new context tools:
1. `get_active_context`
2. `resolve_token`
3. `validate_manifest`
4. `list_skins`
5. `get_compiler_status`
