SLIM replaces Markdown for AI prompts, agent configs, and tool schemas. Strip orchestrator metadata before the LLM call. Save 43% of tokens on average.
---
model: claude-opus-4-7
agent: CodeReviewer
task: PR-942
retry: 3
---
<!-- System prompt -->
# Role
You are a senior code reviewer for PR-942.
# Instructions
- Check for security vulnerabilities
- Flag breaking changes
- Be concise and direct
```python
def review(diff):
return analyze(diff)
```
@slim: 1.0 @model: claude-opus-4-7 ← stripped @retry: 3 ← stripped @+agent: CodeReviewer @+task: PR-942 ~ System prompt # Role You are a senior code reviewer for $task. # Instructions - Check for security vulnerabilities - Flag breaking changes - Be concise and direct === REVIEW [python] def review(diff): return analyze(diff) === /REVIEW
Every token costs money and latency. Markdown makes you pay for metadata that the LLM never needs.
Model name, retry count, timeouts — orchestrator config that the LLM never reads still gets sent to it, wasting tokens on every call.
Markdown has no concept of block boundaries. A user who pastes --- or a frontmatter key can silently override your system config.
There's no standard way to define tool schemas, declare variables, write directives, or separate orchestrator intent from LLM instructions.
Injecting dynamic values like agent name or task ID requires ad-hoc string interpolation outside the format, making prompts brittle.
Six first-class primitives that cover every AI workflow need — all in one clean, human-writable format.
@key headers are consumed by the orchestrator and never forwarded to the LLM. Zero extra tokens for config metadata.
Define values in headers and reference them with $var anywhere in the body. Resolved before the LLM call — no template engine needed.
Named, typed content blocks with hard injection boundaries. Escaped content can't break out of its block.
First-class :tool_name syntax for AI function call schemas. Required/optional fields, defaults, and typed return values.
Structured > KEYWORD workflow primitives for AI agent pipelines. CALL, ASSERT, YIELD, EMIT, LOG, ABORT, WAIT, RETRY.
Built-in sanitize_user_content() escapes all SLIM sigils before user text is embedded. Header injection prevention by design.
Six real-world AI config and prompt files converted from Markdown. Measured with cl100k_base (OpenAI/Anthropic tokenizer).
Measured as: (MD tokens − SLIM stripped tokens) / MD tokens × 100
"Stripped" means orchestrator-only @headers and ~ comments removed before LLM call.
| Sigil | Zone | Description | In LLM Text? |
|---|---|---|---|
| @key: value | Header | Orchestrator-only metadata. Model name, retry count, timeout. Auto-coerced to int/float/bool/null/list. | stripped |
| @+key: value | Header | LLM-visible header. Appears at the top of LLM text. Also available as $key variable. |
visible |
| ~ text | Any | Comment line. Stripped before LLM call. Great for author notes, change logs, debugging hints. | stripped |
| $var | Body | Variable reference. Resolved from @key or @+key headers. Dot-path access: $obj.field. |
substituted |
| === NAME [type] === /NAME |
Body | Named block with optional type tag. Hard injection boundary — \=== inside is literal. Blocks can be nested one level. |
visible |
| > KEYWORD args | Body | Directive. CALL, ASSERT, YIELD, EMIT, LOG, ABORT, WAIT, RETRY. ALL_CAPS only — prose > is not parsed. |
visible |
| :tool_name | Body | Schema definition block. Indented properties with ! (required), ? (optional). Return type with ->. |
visible |
~ SLIM v1.0 complete example @slim: 1.0 @model: claude-opus-4-7 ~ stripped from LLM @retry: 3 ~ stripped from LLM @timeout: 30 ~ stripped from LLM @+agent: SecurityBot ~ LLM-visible @+task: PR-942 ~ LLM-visible + interpolatable # Role You are $agent, a security-focused code reviewer assigned to $task. # Instructions - Check for OWASP Top 10 vulnerabilities - Review SQL queries for injection risks - Flag insecure deserialization patterns === CONTEXT [markdown] PR title: Fix authentication flow Changed files: auth.py, session.py === /CONTEXT > CALL analyze_pr(id: $task, depth: full) > ASSERT $result.severity != "critical" > YIELD $result.summary
@slim: 1.0s ~ Tool definitions for function calling :search_web desc: Search the internet for recent information query!: str max_results?: int = 10 safe_search?: bool = true -> results: json :run_code desc: Execute code in a sandboxed environment language!: [python|javascript|bash] code!: str timeout?: int = 30 -> output: str -> exit_code: int :send_email desc: Send an email via the outbox queue to!: str subject!: str body!: str cc?: str priority?: [low|normal|high] = normal -> message_id: uuid
~ Primitive types @count: 42 → int @ratio: 0.85 → float @active: true → bool @ctx: null → None/null @name: Alice → str (default) @id: "42" → str (quoted, prevents int) ~ List (comma-separated) @stack: python, js, go → ["python", "js", "go"] ~ Multi-line continuation @desc: First line second line → "First line second line" ~ Schema types name!: str → required string age?: int = 18 → optional int, default 18 env!: [prod|staging|dev] → enum items?: list<str> → typed list meta?: dict<str,any> → typed dict
Paste your Markdown, JSON, or plain text — get SLIM output instantly. See how many tokens you save.