Skill: levineam/agent-skills-context-engineering (version 1.2.0)

--- name: agent-skills-context-engineering description: > OpenClaw wrapper for Muratcan Koylan's Agent Skills for Context Engineering. 13 skills covering context optimization, multi-agent patterns, memory systems, tool design, and evaluation frameworks for production AI agents. Auto-read triggers proactively load the right sub-skill during normal operation (compaction, multi-agent spawns, failure recovery, tool building, memory setup). version: "1.2.0" --- # Context Engineering Skill OpenClaw wrapper for [Agent Skills for Context Engineering](https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering) by [Muratcan Koylan](https://x.com/koylanai). ## Trigger Phrases Activate when user mentions: - "optimize context", "reduce token costs", "context compression" - "design multi-agent system", "implement supervisor pattern" - "implement memory", "build memory system" - "debug agent failure", "diagnose context problems" - "build agent tools", "evaluate agent performance" ## Available Sub-Skills | Skill | Purpose | |-------|---------| | context-fundamentals | Core context concepts and anatomy | | context-degradation | Lost-in-middle, poisoning, attention patterns | | context-compression | Compaction strategies for long sessions | | context-optimization | Token budgeting, caching, masking | | multi-agent-patterns | Orchestrator, peer-to-peer, hierarchical | | memory-systems | Short-term, long-term, graph-based memory | | tool-design | Building effective agent tools | | filesystem-context | File-based context management | | hosted-agents | Background agents with sandboxed execution | | evaluation | Agent performance frameworks | | advanced-evaluation | LLM-as-judge techniques | | project-development | LLM project methodology | | bdi-mental-states | BDI cognitive architecture | ## Post-Install Setup (IMPORTANT — check on first load) The first time this skill is loaded, check whether context engineering auto-triggers are wired into the user's always-loaded config (typically AGENTS.md, TOOLS.md, or equivalent). **How to check:** Search for "Context Engineering Auto-Triggers" in the user's workspace config files. **If NOT found**, prompt the user: > "I notice the context engineering auto-triggers aren't set up yet. These make your agent proactively apply context engineering best practices — like reading the right guidance before compaction, multi-agent spawns, or failure recovery. Want me to add them to your config? It's 6 rules, takes 30 seconds." **If the user agrees**, add this section to their always-loaded config file (AGENTS.md, TOOLS.md, or equivalent): ```markdown ## Context Engineering Auto-Triggers When these conditions are detected, read the corresponding sub-skill before proceeding: - Before compaction or context exceeds ~80K tokens → read context-compression - When spawning 2+ subagents in one session → read multi-agent-patterns - On 3+ task retries or agent loop → read context-degradation - When building/designing agent tools → read tool-design - When setting up memory/persistence → read memory-systems - When reading 5+ files as context → read filesystem-context Load from: https://raw.githubusercontent.com/muratcankoylan/Agent-Skills-for-Context-Engineering/main/skills/<sub-skill>/SKILL.md ``` **If already wired**, skip silently. ## Auto-Read Triggers These triggers fire **automatically during normal operation** — no user prompt required. When you detect the condition, read the corresponding sub-skill before proceeding. | Condition | Sub-Skill | When to Fire | |---|---|---| | Context approaching compaction or token count exceeds ~80K | `context-compression` | Before compaction fires or at compaction boundary | | Spawning 2+ subagents in one session | `multi-agent-patterns` | Before first spawn in a multi-agent sequence | | Repeated task failure (3+ retries) or agent stuck in loop | `context-degradation` | Before the next retry attempt | | Building, designing, or refactoring agent tools/MCP scripts | `tool-design` | When tool construction begins | | Setting up memory, JSONL store, vector DB, or persistence layer | `memory-systems` | When memory architecture work begins | | Reading 5+ files as context in one session | `filesystem-context` | Before bulk file-loading begins | **Loading instruction:** ``` https://raw.githubusercontent.com/muratcankoylan/Agent-Skills-for-Context-Engineering/main/skills/<sub-skill>/SKILL.md ``` Read the sub-skill's SKILL.md, apply its guidance to the current task, then continue. No need to announce this to the user unless they ask why you paused. ## How to Load a Sub-Skill **Primary method (no setup required):** ``` Read: https://raw.githubusercontent.com/muratcankoylan/Agent-Skills-for-Context-Engineering/main/skills/<sub-skill>/SKILL.md ``` **Optional (for offline use):** Clone the submodule locally, then read from `references/context-engineering-skills/skills/<sub-skill>/SKILL.md` ## Attribution All credit for the underlying context engineering principles belongs to [Muratcan Koylan](https://x.com/koylanai) and contributors to the [original repository](https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering).

path: README.md
content: # context-engineering

> **Comprehensive context engineering guidance for AI agent systems.**

An OpenClaw skill that routes to 13 specialized sub-skills for production agent work — covering context optimization, memory systems, multi-agent coordination, evaluation, and more.

---

## Attribution

This skill is an OpenClaw wrapper for [Agent Skills for Context Engineering](https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering), created by [Muratcan Koylan](https://x.com/koylanai). All credit for the underlying context engineering principles, skills, and documentation belongs to Muratcan and the original contributors.

---

## What It Does

This skill does two things:

**1. On-demand routing:** When you ask about context windows, token costs, memory systems, multi-agent design, or production LLM architecture, the skill routes your request to the most relevant specialized sub-skill and loads its guidance before responding.

**2. Proactive auto-read triggers (v1.1.0):** The skill also fires automatically during normal operation — no user prompt needed. When the agent detects specific conditions (approaching compaction, spawning multiple agents, repeated failures, tool construction, memory setup, heavy file reads), it proactively loads the right sub-skill before proceeding. This improves context quality without interrupting the user.

Sub-skill documentation is fetched directly from GitHub — **no local setup required**.

---

## Trigger Phrases

- "optimize context", "reduce token costs", "KV-cache", "context budgeting"
- "context compression", "summarize history", "compaction", "long sessions"
- "design multi-agent system", "supervisor pattern", "swarm architecture", "agent handoffs"
- "implement memory", "memory frameworks", "Mem0", "Zep", "Letta", "vector RAG"
- "offload context to files", "filesystem memory", "scratch pads", "dynamic discovery"
- "debug agent failure", "lost-in-middle", "context poisoning", "context degradation"
- "build agent tools", "tool descriptions", "MCP tools", "tool consolidation"
- "evaluate agent", "LLM-as-judge", "test framework", "quality gates"
- "understand context", "context windows", "attention mechanics", "fundamentals"
- "build background agent", "sandboxed execution", "hosted coding agent"
- "implement BDI", "belief-desire-intention", "mental state modeling"
- "start an LLM project", "batch pipeline", "task-model fit"
- Any discussion of context degradation, attention patterns, multi-agent coordination, or production agent architecture

---

## 13 Sub-Skills

| Sub-skill | What it covers |
|---|---|
| `context-optimization` | Token budgeting, KV-cache, reduce costs |
| `context-compression` | Summarizing history, compaction for long sessions |
| `multi-agent-patterns` | Supervisor pattern, swarm architecture, agent handoffs |
| `memory-systems` | Memory frameworks, Mem0, Zep, Letta, vector RAG |
| `filesystem-context` | Filesystem memory, scratch pads, dynamic discovery |
| `context-degradation` | Lost-in-middle, context poisoning, debugging agent failures |
| `tool-design` | Tool descriptions, MCP tools, tool consolidation |
| `evaluation` | LLM-as-judge, test frameworks, quality gates |
| `advanced-evaluation` | Rubrics, pairwise comparison, position bias |
| `context-fundamentals` | Context windows, attention mechanics, core concepts |
| `hosted-agents` | Background agents, sandboxed execution, hosted coding agents |
| `bdi-mental-states` | Belief-desire-intention architecture, mental state modeling |
| `project-development` | Starting LLM projects, batch pipelines, task-model fit |

---

## Setup

**No local setup required.** Sub-skill documentation is loaded directly from GitHub raw URLs:

```
https://raw.githubusercontent.com/muratcankoylan/Agent-Skills-for-Context-Engineering/main/skills/<sub-skill>/SKILL.md
```

### Optional: Offline / Faster Local Access

If you want offline access or faster reads, initialize the git submodule (from your OpenClaw workspace root):

```bash
git submodule update --init
```

This populates `references/context-engineering-skills/` locally. When local files are present, the skill prefers them over GitHub fetches.

---

## How Sub-Skill Routing Works

**On-demand (user-triggered):**
1. Your request is matched to the closest row in the routing table.
2. The sub-skill's `SKILL.md` is loaded (local if available, GitHub otherwise).
3. Deep reference files within each sub-skill are loaded progressively — only the patterns relevant to your current task.
4. If your task spans two sub-skills (e.g., memory + multi-agent), both `SKILL.md` files are loaded before responding.

**Proactive (auto-triggered, v1.1.0):**

| Condition | Sub-Skill Loaded |
|---|---|
| Context nearing compaction / exceeds ~80K tokens | `context-compression` |
| Spawning 2+ subagents in one session | `multi-agent-patterns` |
| 3+ task retries or agent loop detected | `context-degradation` |
| Building or designing agent tools | `tool-design` |
| Setting up memory or persistence layers | `memory-systems` |
| Reading 5+ files as context in one session | `filesystem-context` |

Auto-triggers fire silently — the agent loads the sub-skill and applies guidance without interrupting the user.

---

## License

MIT — same as the [source repository](https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering).


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: suspicious | SkillSpector: suspicious (HIGH)