Engineer what enters the model's context window for reliability and cost using Write, Select, Compress, and Isolate. Use when: context engineering, context window budget, context rot, prompt caching, just-in-time retrieval, context compaction, sub-agent context isolation, tool output distillation.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Context Engineering Skill
## Goal
Engineer what enters the model's context window — and what stays out — so an agent stays reliable and cheap as its task grows. The context window is a finite, contended resource: every token of system prompt, tool schema, message history, retrieved document, and tool output competes for the same budget, and quality degrades as the window fills ("context rot"). The objective is to deliberately decide, at each step, what the model needs to see right now, using four strategies — **Write**, **Select**, **Compress**, **Isolate** — rather than letting history accumulate by default.
## Steps
1. **Set a context-window budget**
- Treat the window as a budget, not a container. Reserve named slices: a fixed allocation for system/developer instructions and tool schemas, a slice for retrieved knowledge, a slice for working history, and headroom for the model's own output.
- Account for "context rot": retrieval accuracy and instruction-following degrade well before the hard token limit, so target a soft ceiling (often a fraction of the maximum) rather than filling to the edge.
…
The line at the top of this page pins the label git:20261014.de0823c, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
A 17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
pass: Frontmatter block present
pass: Frontmatter declares a name
pass: Frontmatter declares a description
pass: Size between 200 bytes and 200 KB (8516 bytes)
pass: No zero-width or bidi control characters
pass: No instruction hidden inside an HTML comment
pass: No link to an exfiltration or paste host
pass: No credential-shaped string
pass: No instruction to send local credentials anywhere
pass: No text hidden with inline styles
pass: No prompt-injection phrasing
pass: No curl or wget piped into a shell
pass: No recursive delete of root, home or parent
pass: No instruction to read or print local credentials
pass: No base64 blob over 200 characters
pass: No link to a raw IP address
pass: No script tag
Source
GitHub
andreibesleaga/gabbe · 23 stars · license a license file GitHub does not identify · pushed 2026-11-02 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_cskye67jpaoitkyt
GET https://markdownregistry.com/api/v1/resolve?ref=andreibesleaga/gabbe/context-engineering
GET https://markdownregistry.com/api/v1/blob/28cdbaaceb1a584f98faff6996fe05c0a57b9b69c72bbc6fab9185377a466880
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
andreibesleaga/gabbe · plugins/gabbe-ai/skills/actor-agent-frameworks/SKILL.md · Implement and manage Actor and Agent Frameworks (e.g. LangGraph). Use when: setup langgraph, implement actor framework…
andreibesleaga/gabbe · plugins/gabbe-ai/skills/agent-ui/SKILL.md · Build specialized user interfaces for interacting with Agents. Use when: build agent ui, create tracing dashboard…
andreibesleaga/gabbe · plugins/gabbe-ai/skills/llm-as-judge/SKILL.md · Score open-ended LLM/agent outputs with another LLM as evaluator while controlling for known judge biases. Use when…
addyosmani/agent-skills · skills/context-engineering/SKILL.md · Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching…
mvschwarz/openrig · packages/daemon/specs/agents/shared/skills/process/context-engineering/SKILL.md · Use when designing, reviewing, or debugging how an agent's context window gets filled, pruned, or shared — choosing…
mvschwarz/openrig · skills/_canonical/process/context-engineering/SKILL.md · Use when designing, reviewing, or debugging how an agent's context window gets filled, pruned, or shared — choosing…
a5c-ai/babysitter · library/methodologies/gsd/skills/context-engineering/SKILL.md · Context window monitoring and budget management. Keeps orchestrator at 15-30% context usage while subagents get full…
shashankswe2020-ux/whoop-mcp · .github/skills/context-engineering/SKILL.md · Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching…