# Context Standard: Priming Files

## Overview
Priming files are ~500-token summaries replacing the full CLAUDE.md (23K tokens) for focused work sessions.

## When to Use Priming Files
- Starting a new task where full CLAUDE.md is unnecessary
- Micro-agent sessions with narrow scope
- Parallel workers that only need domain-specific context

## Available Priming Files

| File | Focus | When to Use |
|------|-------|-------------|
| `.morph/context/feature-prime.md` | Feature implementation | Implementing a new feature |
| `.morph/context/bug-prime.md` | Bug fixing | Fixing a reported bug |
| `.morph/context/refactor-prime.md` | Refactoring | Code improvement without behavior change |
| `.morph/context/design-prime.md` | Design phase | Creating spec.md, decisions.md |
| `.morph/context/infra-prime.md` | Infrastructure | Bicep, Docker, deployment |

## Loading a Priming File
```bash
# Load priming file into context
morph-spec prime feature

# Output: contents of feature-prime.md to stdout
# AI should read this instead of full CLAUDE.md

# For micro-agents:
morph-spec micro-agent create bug-fixer \
  --prime bug \
  --standards "core/coding.md"
```

## Creating Custom Priming Files

Keep priming files under 600 tokens (≈3000 characters):
```markdown
# {Context Name} — Quick Reference

## Stack
- Backend: .NET 10 Blazor Server
- DB: Azure SQL (EF Core)
- Deploy: Azure Container Apps

## Key Patterns
- Use IDbContextFactory<> (not DbContext directly)
- Async/await throughout
- DI order: DbContext → Services → Controllers

## Current Feature
{Feature summary in 2-3 sentences}

## Critical Files
- spec.md: [path]
- contracts.cs: [path]
- tasks.json: [path]

## Do Not Touch
- [files to avoid]
```

## Token Budget Guidelines

| Context Type | Tokens | Use Case |
|--------------|--------|----------|
| Full CLAUDE.md | ~23,000 | Full orchestrator session |
| Priming file | ~500 | Focused task session |
| Context bundle | ~15,000 | Feature resume (compressed) |
| Standards subset | ~2,000/file | Domain specialist |
| Agent prompt | ~1,000 | Micro-agent task |

## Optimization Flow
1. Start with priming file (500 tokens)
2. Load relevant standards (2,000 tokens/file, max 3 files)
3. Load spec summary from metadata.json (not full spec.md)
4. Load tasks.json for current phase only
5. Total budget: target < 8,000 tokens for routine tasks
