Apr 20, 2026

Master Context Engineering: Build Better AI Agent Systems

How to use muratcankoylan/agent-skills-for-context-engineering to design, optimize, and evaluate context windows for production AI agents.

#tutorial#context-engineering#ai-agents#architecture

Context engineering is not prompt engineering. Prompt engineering crafts instructions. Context engineering manages everything that enters your agent's context window: system prompts, tool definitions, retrieved documents, conversation history, and tool outputs. As context windows grow but model attention does not improve proportionally, managing what goes into the context becomes a skill in itself.

The muratcankoylan/agent-skills-for-context-engineering collection provides 14 skills that teach your AI agent how to design, optimize, and evaluate context for production systems.

The 14 Skills

CategorySkills
Foundationscontext-fundamentals, context-degradation, context-compression
Architecturemulti-agent-patterns, memory-systems, tool-design, filesystem-context, hosted-agents
Operationscontext-optimization, latent-briefing, evaluation, advanced-evaluation
Methodologyproject-development
Cognitivebdi-mental-states

Each skill is kept under 500 lines for optimal context performance. They use progressive disclosure: agents load only names and descriptions at startup, and pull full content only when a relevant task triggers activation.

Installation

# Claude Code plugin marketplace
claude plugin marketplace add muratcankoylan/Agent-Skills-for-Context-Engineering
claude plugin install context-engineering@context-engineering-marketplace

# Or install individual skills manually
mkdir -p .claude/skills
curl -o .claude/skills/context-fundamentals.md \
  https://raw.githubusercontent.com/muratcankoylan/Agent-Skills-for-Context-Engineering/main/skills/context-fundamentals/SKILL.md

Real Workflow: Diagnose Context Degradation

Your agent's output quality degrades in long sessions. Responses become generic, it forgets earlier instructions, and starts contradicting itself.

Diagnose why the agent loses focus after 20+ turns in a coding session.
Apply context degradation patterns to identify the root cause.

The context-degradation skill recognizes four failure patterns:

  1. Lost-in-middle: The agent ignores information in the middle of long contexts
  2. Context poisoning: Bad tool outputs corrupt subsequent reasoning
  3. Attention distraction: Too many active skills compete for attention
  4. Context clash: Contradictory instructions from different sources

The skill walks through each pattern with diagnostic questions and remediation strategies.

Real Workflow: Design a Multi-Agent System

You are building a system where multiple agents collaborate on a task.

Design a multi-agent architecture for an automated code review pipeline.
One agent reads the diff, one checks for security issues, one verifies tests,
and an orchestrator synthesizes findings.

The multi-agent-patterns skill covers three architectures:

  • Orchestrator pattern: Central coordinator dispatches tasks to workers
  • Peer-to-peer: Agents communicate directly via shared state
  • Hierarchical: Manager delegates to sub-managers

For the code review pipeline, the orchestrator pattern fits best. The skill helps you define communication protocols, error handling, and context sharing between agents.

Real Workflow: Optimize Context for Cost

Your agent uses expensive models and context windows are large. You want to reduce token usage without losing output quality.

Analyze my agent's context usage and recommend compression strategies
that preserve output quality while reducing token count.

The context-compression skill covers:

  • Summary-based compression for conversation history
  • Selective retrieval instead of full document loading
  • Tool output truncation strategies
  • Progressive disclosure patterns for skill content

Tips

  • Start with context-fundamentals before using the architecture or optimization skills. The foundational concepts inform everything else.
  • The evaluation skill pairs well with advanced-evaluation (LLM-as-a-Judge techniques) for measuring whether context changes actually improve agent performance.
  • The included digital-brain-skill example demonstrates all 14 skills applied to a real product: a personal operating system with 6 modules, 4 automation scripts, and progressive loading.

When Not to Use This

Skip this if you are building simple, single-turn agent interactions. Context engineering matters when sessions are long, agents use tools, or multiple agents collaborate. For basic chatbot use cases, prompt engineering is sufficient.


Explore more agent architecture skills on the SkillMap leaderboard.