Skip to content
Back to skills

Meta Context Engineering

ASecurity

Master context engineering for AI agent systems. Use when designing agent architectures, debugging context failures, optimizing token usage, implementing memory systems, building multi-agent coordination, evaluating agent performance, or developing LLM-powered pipelines. Covers context fundamentals, degradation patterns, optimization techniques (compaction, masking, caching), compression strategies, memory architectures, multi-agent patterns, LLM-as-Judge evaluation, tool design, and project ...

  • 8 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 20, 2026
ai-agentsgotestingdebuggingperformance

Security analysis

A100/100

Pro scans all 17 files and shows the line behind each finding

Scanned September 20, 2026

npx -y skills add tstapler/dotfiles --skill meta-context-engineering --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Meta Context Engineering?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Meta Context Engineering
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tstapler-meta-context-engineering/badge)](https://www.skillsdirectory.com/skills/tstapler-meta-context-engineering)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: meta-context-engineering
description: >-
  Master context engineering for AI agent systems. Use when designing agent architectures,
  debugging context failures, optimizing token usage, implementing memory systems,
  building multi-agent coordination, evaluating agent performance, or developing
  LLM-powered pipelines. Covers context fundamentals, degradation patterns, optimization
  techniques (compaction, masking, caching), compression strategies, memory architectures,
  multi-agent patterns, LLM-as-Judge evaluation, tool design, and project development.
version: 1.0.0
---

# Context Engineering

Context engineering curates the smallest high-signal token set for LLM tasks. The goal: maximize reasoning quality while minimizing token usage.

## When to Activate

- Designing/debugging agent systems
- Context limits constrain performance
- Optimizing cost/latency
- Building multi-agent coordination
- Implementing memory systems
- Evaluating agent performance
- Developing LLM-powered pipelines

> For prompt structure that maximizes signal within context, apply the `meta-prompt-engineering` skill.

## Core Principles

1. **Context quality > quantity** - High-signal tokens beat exhaustive content
2. **Attention is finite** - U-shaped curve favors beginning/end positions
3. **Progressive disclosure** - Load information just-in-time
4. **Isolation prevents degradation** - Partition work across sub-agents
5. **Measure before optimizing** - Know your baseline

> For multi-agent Strands patterns and conversation manager configuration, apply the `code-strands` skill.

## Quick Reference

| Topic | When to Use | Reference |
|-------|-------------|-----------|
| **Fundamentals** | Understanding context anatomy, attention mechanics | [context-fundamentals.md](./references/context-fundamentals.md) |
| **Degradation** | Debugging failures, lost-in-middle, poisoning | [context-degradation.md](./references/context-degradation.md) |
| **Optimization** | Compaction, masking, caching, partitioning | [context-optimization.md](./references/context-optimization.md) |
| **Compression** | Long sessions, summarization strategies | [context-compression.md](./references/context-compression.md) |
| **Memory** | Cross-session persistence, knowledge graphs | [memory-systems.md](./references/memory-systems.md) |
| **Multi-Agent** | Coordination patterns, context isolation | [multi-agent-patterns.md](./references/multi-agent-patterns.md) |
| **Evaluation** | Testing agents, LLM-as-Judge, metrics | [evaluation.md](./references/evaluation.md) |
| **Tool Design** | Tool consolidation, description engineering | [tool-design.md](./references/tool-design.md) |
| **Pipelines** | Project development, batch processing | [project-development.md](./references/project-development.md) |

## Key Metrics

- **Token utilization**: Warning at 70%, trigger optimization at 80%
- **Token variance**: Explains 80% of agent performance variance
- **Multi-agent cost**: ~15x single agent baseline
- **Compaction target**: 50-70% reduction, <5% quality loss
- **Cache hit target**: 70%+ for stable workloads

## Four-Bucket Strategy

1. **Write**: Save context externally (scratchpads, files)
2. **Select**: Pull only relevant context (retrieval, filtering)
3. **Compress**: Reduce tokens while preserving info (summarization)
4. **Isolate**: Split across sub-agents (partitioning)

## Anti-Patterns

- Exhaustive context over curated context
- Critical info in middle positions
- No compaction triggers before limits
- Single agent for parallelizable tasks
- Tools without clear descriptions

## Guidelines

1. Place critical info at beginning/end of context
2. Implement compaction at 70-80% utilization
3. Use sub-agents for context isolation, not role-play
4. Design tools with 4-question framework (what, when, inputs, returns)
5. Optimize for tokens-per-task, not tokens-per-request
6. Validate with probe-based evaluation
7. Monitor KV-cache hit rates in production
8. Start minimal, add complexity only when proven necessary

## Scripts

- [context_analyzer.py](./scripts/context_analyzer.py) - Context health analysis, degradation detection
- [compression_evaluator.py](./scripts/compression_evaluator.py) - Compression quality evaluation

---

## Related Skills

| Skill | When to apply |
|-------|--------------|
| `meta-prompt-engineering` | Designing high-signal prompts that maximize context quality |
| `meta-model-selection` | Choosing model tiers to balance context cost vs. reasoning depth |
| `code-strands` | Strands-specific conversation managers, sub-agent isolation, and streaming |
| `meta-claude-technique-evaluator` | Evaluating new context optimization techniques for adoption |
| `lean-agent-loop` | Implementation of the minimal-context sub-agent pattern: temp-file outputs + structured summaries keep coordinator context constant across N iterations |

Files in this skill

  • SKILL.md4.8 KB
  • references/context-compression.md2.3 KB
  • references/context-degradation.md3 KB
  • references/context-fundamentals.md2.7 KB
  • references/context-optimization.md2.3 KB
  • references/evaluation.md2.2 KB
  • references/memory-systems.md2.5 KB
  • references/multi-agent-patterns.md2.3 KB
  • references/project-development.md2.1 KB
  • references/tool-design.md2 KB
  • scripts/compression_evaluator.py10.7 KB
  • scripts/context_analyzer.py10.1 KB
  • tests/01-basic-context-optimization.md632 B
  • tests/02-debug-lost-in-middle.md640 B
  • tests/03-multi-agent-coordination.md748 B
  • tests/04-edge-case-context-poisoning.md724 B
  • tests/05-advanced-memory-architecture.md816 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…