agent-skills-context-engineering
```markdown
What this skill does
```markdown
---
name: agent-skills-context-engineering
description: Comprehensive collection of Agent Skills for context engineering, multi-agent architectures, memory systems, and production agent systems using Claude Code, Cursor, and other AI platforms.
triggers:
- "context engineering for agents"
- "build multi-agent system"
- "install agent skills claude code"
- "context window management"
- "agent memory architecture"
- "optimize agent context"
- "implement BDI mental states"
- "design agent evaluation framework"
---
# Agent Skills for Context Engineering
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
A comprehensive, open collection of Agent Skills focused on context engineering — the discipline of curating what enters an LLM's context window to maximize agent effectiveness. Covers foundational context mechanics, multi-agent architectures, memory systems, tool design, evaluation, and cognitive modeling.
## What This Project Does
Context engineering is about managing the **holistic set of tokens** that enter a model's attention budget: system prompts, tool definitions, retrieved documents, message history, and tool outputs. This repository provides structured, installable skills that teach AI coding agents these principles across any platform.
Key problems addressed:
- **Lost-in-the-middle**: Models degrade when relevant content is buried in long contexts
- **Context poisoning/distraction**: Irrelevant tokens degrade reasoning quality
- **Attention scarcity**: More tokens ≠ better outcomes; fewer high-signal tokens do
- **Multi-agent coordination**: How agents hand off context without loss
## Installation
### Claude Code (Plugin Marketplace)
```bash
# Register the marketplace
/plugin marketplace add muratcankoylan/Agent-Skills-for-Context-Engineering
# Install individual plugin bundles
/plugin install context-engineering-fundamentals@context-engineering-marketplace
/plugin install agent-architecture@context-engineering-marketplace
/plugin install agent-evaluation@context-engineering-marketplace
/plugin install agent-development@context-engineering-marketplace
/plugin install cognitive-architecture@context-engineering-marketplace
```
### Cursor
Listed on [Cursor Plugin Directory](https://cursor.directory/plugins/context-engineering). Install via the Cursor plugin panel or reference `.plugin/plugin.json` directly.
### Manual / Custom Agent
Clone and reference skill files directly:
```bash
git clone https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering.git
```
Load skill content from `skills/<skill-name>/SKILL.md` into your agent's system prompt or context.
## Plugin Bundles
| Plugin | Skills Included |
|--------|-----------------|
| `context-engineering-fundamentals` | context-fundamentals, context-degradation, context-compression, context-optimization |
| `agent-architecture` | multi-agent-patterns, memory-systems, tool-design, filesystem-context, hosted-agents |
| `agent-evaluation` | evaluation, advanced-evaluation |
| `agent-development` | project-development |
| `cognitive-architecture` | bdi-mental-states |
## Repository Structure
```
Agent-Skills-for-Context-Engineering/
├── .plugin/
│ └── plugin.json # Open Plugins manifest
├── skills/
│ ├── context-fundamentals/ # Context anatomy, token budgets
│ ├── context-degradation/ # Failure modes and diagnostics
│ ├── context-compression/ # Compression and summarization
│ ├── context-optimization/ # Caching, masking, compaction
│ ├── multi-agent-patterns/ # Orchestrator, peer, hierarchical
│ ├── memory-systems/ # Short/long-term, graph memory
│ ├── tool-design/ # Effective tool construction
│ ├── filesystem-context/ # File-based context offloading
│ ├── hosted-agents/ # Sandboxed background agents
│ ├── evaluation/ # Agent evaluation frameworks
│ ├── advanced-evaluation/ # LLM-as-a-Judge techniques
│ ├── project-development/ # LLM project methodology
│ └── bdi-mental-states/ # BDI cognitive architecture
└── examples/
├── digital-brain-skill/ # Personal OS for founders
├── x-to-book-system/ # Multi-agent X→book pipeline
├── llm-as-judge-skills/ # TypeScript evaluation tools
└── book-sft-pipeline/ # Style transfer fine-tuning
```
## Core Concepts
### Context Window Anatomy
```python
# The five components competing for attention budget
context = {
"system_prompt": "...", # Role, instructions, constraints
"tool_definitions": [...], # Available tools and schemas
"retrieved_documents": [...], # RAG results, memory lookups
"message_history": [...], # Conversation turns
"tool_outputs": [...], # Results from tool calls
}
# Token budget allocation example
TOTAL_BUDGET = 128_000 # tokens
budget = {
"system_prompt": 2_000, # 1.6% — keep tight
"tool_definitions": 5_000, # 3.9% — prune unused tools
"retrieved_documents":40_000, # 31% — highest ROI
"message_history": 70_000, # 55% — compress aggressively
"tool_outputs": 11_000, # 8.5% — offload to filesystem
}
```
### Context Degradation Patterns
```python
# Pattern 1: Lost-in-the-middle
# Critical information placed in the center of a long context
# degrades recall significantly. Always place key info at edges.
def order_context_for_attention(documents: list[str], query: str) -> list[str]:
"""Place most relevant documents first and last."""
scored = rank_by_relevance(documents, query)
n = len(scored)
ordered = [None] * n
# High relevance → positions 0 and -1
for i, doc in enumerate(scored):
if i % 2 == 0:
ordered[i // 2] = doc # fill from front
else:
ordered[n - 1 - i // 2] = doc # fill from back
return ordered
# Pattern 2: Context poisoning
# Contradictory or stale information causes unpredictable behavior
def validate_context_consistency(facts: list[dict]) -> list[dict]:
"""Remove contradicting or outdated facts before injection."""
seen_keys = {}
clean = []
for fact in sorted(facts, key=lambda f: f["timestamp"], reverse=True):
key = fact["subject"] + fact["predicate"]
if key not in seen_keys:
seen_keys[key] = True
clean.append(fact)
return clean
```
### Context Compression
```python
import anthropic
client = anthropic.Anthropic() # uses ANTHROPIC_API_KEY env var
def compress_conversation(
messages: list[dict],
keep_last_n: int = 10,
model: str = "claude-opus-4-5",
) -> list[dict]:
"""
Compress long conversation history into a summary + recent tail.
Preserves decisions, outcomes, and key entities.
"""
if len(messages) <= keep_last_n:
return messages
to_compress = messages[:-keep_last_n]
recent = messages[-keep_last_n:]
summary_prompt = f"""Summarize this conversation segment.
Preserve: decisions made, key entities, open questions, errors encountered.
Discard: pleasantries, repetition, superseded plans.
Conversation:
{format_messages(to_compress)}
"""
response = client.messages.create(
model=model,
max_tokens=1024,
messages=[{"role": "user", "content": summary_prompt}],
)
summary_message = {
"role": "assistant",
"content": f"[COMPRESSED HISTORY]\n{response.content[0].text}",
}
return [summary_message] + recent
def format_messages(messages: list[dict]) -> str:
return "\n".join(
f"{m['role'].upper()}: {m['content']}" for m in messages
)
```
### Multi-Agent Patterns
```python
# Orchestrator pattern — one agent routes, subagents execute
class OrchestratorAgent:
def __init__(self, subagents: dict[str, "SubAgent"]):
self.subagents = subagents
self.client = anthropic.Anthropic()
def route(self, task: str) -> str:
"""DRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.