Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
A comprehensive collection of Agent Skills for context engineering, multi-agent architectures, and production agent systems.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: context-engineering-collection3description: A comprehensive collection of Agent Skills for context engineering, multi-agent architectures, and production agent systems. Use when building, optimizing, or debugging agent systems that require effective context management.4---56# Agent Skills for Context Engineering78This collection provides structured guidance for building production-grade AI agent systems through effective context engineering.910## When to Activate1112Activate these skills when:13- Building new agent systems from scratch14- Optimizing existing agent performance15- Debugging context-related failures16- Designing multi-agent architectures17- Creating or evaluating tools for agents18- Implementing memory and persistence layers1920## Skill Map2122### Foundational Context Engineering2324**Understanding Context Fundamentals**25Context is not just prompt text—it is the complete state available to the language model at inference time, including system instructions, tool definitions, retrieved documents, message history, and tool outputs. Effective context engineering means understanding what information truly matters for the task at hand and curating that information for maximum signal-to-noise ratio.2627**Recognizing Context Degradation**28Language models exhibit predictable degradation patterns as context grows: the "lost-in-middle" phenomenon where information in the center of context receives less attention; U-shaped attention curves that prioritize beginning and end; context poisoning when errors compound; and context distraction when irrelevant information overwhelms relevant content.2930### Architectural Patterns3132**Multi-Agent Coordination**33Production multi-agent systems converge on three dominant patterns: supervisor/orchestrator architectures with centralized control, peer-to-peer swarm architectures for flexible handoffs, and hierarchical structures for complex task decomposition. The critical insight is that sub-agents exist primarily to isolate context rather than to simulate organizational roles.3435**Memory System Design**36Memory architectures range from simple scratchpads to sophisticated temporal knowledge graphs. Vector RAG provides semantic retrieval but loses relationship information. Knowledge graphs preserve structure but require more engineering investment. The file-system-as-memory pattern enables just-in-time context loading without stuffing context windows.3738**Filesystem-Based Context**39The filesystem provides a single interface for storing, retrieving, and updating effectively unlimited context. Key patterns include scratch pads for tool output offloading, plan persistence for long-horizon tasks, sub-agent communication via shared files, and dynamic skill loading. Agents use `ls`, `glob`, `grep`, and `read_file` for targeted context discovery, often outperforming semantic search for structural queries.4041**Hosted Agent Infrastructure**42Background coding agents run in remote sandboxed environments rather than on local machines. Key patterns include pre-built environment images refreshed on regular cadence, warm sandbox pools for instant session starts, filesystem snapshots for session persistence, and multiplayer support for collaborative agent sessions. Critical optimizations include allowing file reads before git sync completes (blocking only writes), predictive sandbox warming when users start typing, and self-spawning agents for parallel task execution.4344**Tool Design Principles**45Tools are contracts between deterministic systems and non-deterministic agents. Effective tool design follows the consolidation principle (prefer single comprehensive tools over multiple narrow ones), returns contextual information in errors, supports response format options for token efficiency, and uses clear namespacing.4647### Operational Excellence4849**Context Compression**50When agent sessions exhaust memory, compression becomes mandatory. The correct optimization target is tokens-per-task, not tokens-per-request. Structured summarization with explicit sections for files, decisions, and next steps preserves more useful information than aggressive compression. Artifact trail integrity remains the weakest dimension across all compression methods.5152**Context Optimization**53Techniques include compaction (summarizing context near limits), observation masking (replacing verbose tool outputs with references), prefix caching (reusing KV blocks across requests), and strategic context partitioning (splitting work across sub-agents with isolated contexts).5455**Latent Briefing (KV Memory Sharing)**56Orchestrator-worker systems can compound tokens when supervisors accumulate long trajectories but workers see only narrow text slices. Latent Briefing compacts the orchestrator trajectory in the worker model's KV cache using task-guided attention (Attention Matching-style compaction) so workers receive relevant latent state without full-text replay when the stack exposes worker KV state and the models are compatible.5758**Evaluation Frameworks**59Production agent evaluation requires multi-dimensional rubrics covering factual accuracy, completeness, tool efficiency, and process quality. Effective patterns include LLM-as-judge for scalability, human evaluation for edge cases, and end-state evaluation for agents that mutate persistent state.6061### Development Methodology6263**Project Development**64Effective LLM project development begins with task-model fit analysis: validating through manual prototyping that a task is well-suited for LLM processing before building automation. Production pipelines follow staged, idempotent architectures (acquire, prepare, process, parse, render) with file system state management for debugging and caching. Structured output design with explicit format specifications enables reliable parsing. Start with minimal architecture and add complexity only when proven necessary.6566## Core Concepts6768The collection is organized around three core themes. First, context fundamentals establish what context is, how attention mechanisms work, and why context quality matters more than quantity. Second, architectural patterns cover the structures and coordination mechanisms that enable effective agent systems. Third, operational excellence addresses the ongoing work of optimizing and evaluating production systems.6970## Practical Guidance7172Each skill can be used independently or in combination. Start with fundamentals to establish context management mental models. Branch into architectural patterns based on your system requirements. Reference operational skills when optimizing production systems.7374The skills are platform-agnostic and work with Claude Code, Cursor, or any agent framework that supports custom instructions or skill-like constructs.7576## Integration7778This collection integrates with itself—skills reference each other and build on shared concepts. The fundamentals skill provides context for all other skills. Architectural skills (multi-agent, memory, tools) can be combined for complex systems. Operational skills (optimization, evaluation) apply to any system built using the foundational and architectural skills.7980## References8182Internal skills in this collection:83- [context-fundamentals](skills/context-fundamentals/SKILL.md)84- [context-degradation](skills/context-degradation/SKILL.md)85- [context-compression](skills/context-compression/SKILL.md)86- [multi-agent-patterns](skills/multi-agent-patterns/SKILL.md)87- [memory-systems](skills/memory-systems/SKILL.md)88- [tool-design](skills/tool-design/SKILL.md)89- [filesystem-context](skills/filesystem-context/SKILL.md)90- [hosted-agents](skills/hosted-agents/SKILL.md)91- [context-optimization](skills/context-optimization/SKILL.md)92- [latent-briefing](skills/latent-briefing/SKILL.md)93- [evaluation](skills/evaluation/SKILL.md)94- [advanced-evaluation](skills/advanced-evaluation/SKILL.md)95- [project-development](skills/project-development/SKILL.md)96- [bdi-mental-states](skills/bdi-mental-states/SKILL.md)9798External resources on context engineering:99- Research on attention mechanisms and context window limitations100- Production experience from leading AI labs on agent system design101- Framework documentation for LangGraph, AutoGen, and CrewAI102103---104105## Skill Metadata106107**Created**: 2025-12-20108**Last Updated**: 2026-04-14109**Author**: Agent Skills for Context Engineering Contributors110**Version**: 1.3.0111