Agent skill
context-engineering
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, compression strategies, memory architectures, multi-agent patterns, evaluation, tool design, and project development.
Install this agent skill to your Project
npx add-skill https://github.com/siviter-xyz/dot-agent/tree/main/skills/context-engineering
SKILL.md
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
Core Principles
- Context quality > quantity - High-signal tokens beat exhaustive content
- Attention is finite - U-shaped curve favors beginning/end positions
- Progressive disclosure - Load information just-in-time
- Isolation prevents degradation - Partition work across sub-agents
- Measure before optimizing - Know your baseline
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
- Write: Save context externally (scratchpads, files)
- Select: Pull only relevant context (retrieval, filtering)
- Compress: Reduce tokens while preserving info (summarization)
- 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
- Place critical info at beginning/end of context
- Implement compaction at 70-80% utilization
- Use sub-agents for context isolation, not role-play
- Design tools with clear descriptions (what, when, inputs, returns)
- Optimize for tokens-per-task, not tokens-per-request
- Validate with probe-based evaluation
- Monitor token usage in production
- Start minimal, add complexity only when proven necessary
Skill Coordination
When multiple skills are active:
- Load only relevant skill content
- Use skill metadata for discovery
- Avoid loading full skill definitions unless needed
- Reference skills by pattern detection, not direct names
References
For detailed guidance, see:
references/fundamentals.md- Context anatomy, attention mechanicsreferences/degradation.md- Debugging failures, lost-in-middle, poisoningreferences/optimization.md- Compaction, masking, caching, partitioningreferences/compression.md- Long sessions, summarization strategiesreferences/memory.md- Cross-session persistence, knowledge graphsreferences/multi-agent.md- Coordination patterns, context isolationreferences/evaluation.md- Testing agents, LLM-as-Judge, metricsreferences/tool-design.md- Tool consolidation, description engineering
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
frontend-engineer
Frontend development guidelines for React/TypeScript applications. Modern patterns including Suspense, lazy loading, useSuspenseQuery, file organization with features directory, MUI v7 styling, TanStack Router, performance optimization, and TypeScript best practices. Use when creating components, pages, features, fetching data, styling, routing, or working with frontend code.
debugging
Root cause analysis and debugging protocols. Use when encountering errors, test failures, unexpected behavior, stack traces, or when code behaves differently than expected.
code-review
Code review practices emphasizing technical rigor, evidence-based claims, and verification. Use when receiving code review feedback, completing tasks requiring review, or before making completion claims.
cursor-best-practices
Best practices for working with Cursor. Use when learning how to effectively use Cursor features or optimizing your workflow.
create-skill
Guide for creating effective skills following best practices. Use when creating or updating skills that extend agent capabilities.
semantic-git
Manage Git commits using conventional commit format with atomic staging. Always generate plain git commands before running them and offer to let the user run them manually.
Didn't find tool you were looking for?