| skill_id | context-engineering-for-agent-work |
| name | Context Engineering For Agent Work |
| description | Design dense, task-relevant context for AI agents instead of stuffing everything into prompts. Use when building agent harnesses, selecting context, reducing prompt bloat, stage-gating workflows, structuring markdown/frontmatter data, or debugging context quality. |
| skill_type | combo |
| categories | ["technology-and-agent-systems"] |
| path | docs/research/youtube-library/skill-drafts/context-engineering-for-agent-work/SKILL.md |
| status | registered |
| promoted_to | apps/web/src/lib/services/agentic-chat/tools/skills/definitions/context_engineering_for_agent_work/SKILL.md |
| last_promoted | 2026-06-10 |
Context Engineering For Agent Work
Use this skill when an agent needs to decide what context to load, how to structure it, and how to keep an AI workflow reliable. Context engineering is not "more tokens." It is higher information density, deterministic selection, and explicit workflow control.
When to Use
- Build or debug an agent harness
- Decide what files, docs, memories, rules, or tool outputs to load
- Reduce a bloated system prompt
- Convert messy notes into AI-readable structured context
- Create stage-gated workflows instead of one giant prompt
- Design markdown and frontmatter as an agent data layer
- Decide whether to use sub-agents, deterministic pre-gathering, or one smart call
Do not use this skill when the problem is deterministic code behavior unrelated to LLM context.
Core Principles
- Density beats volume. Prefer small, specific, high-signal context over large dumps.
- Do not rely on prompts for control flow. If the steps are known, make stages explicit.
- Pre-gather deterministically when possible. Use code, search, metadata, or indexes to select context before the expensive model call.
- Keep data sliceable. Store structured metadata where tools can filter without reading full bodies.
- One model deeply understood beats constant model hopping. Prompt behavior is model-specific.
- Rules should be retrieved, not all stuffed. Long universal rule lists dilute attention.
- Build first, then evaluate. For emergent AI behavior, create a baseline, observe it, then turn important behaviors into evals.
Context Selection Workflow
- State the task. What decision or action must the model perform?
- List required facts. Identify facts the model cannot infer: user state, project state, source docs, schemas, constraints, examples, and safety rules.
- Filter by metadata first. Use file paths, frontmatter, tags, dates, ids, owners, or categories before loading full text.
- Load only what changes the answer. Exclude nice-to-have background unless it resolves ambiguity.
- Summarize stale or bulky context. Prefer concise state packets over raw history.
- Add exact excerpts when precision matters. Use full source snippets for contracts, APIs, policy, or instructions.
- Make missing context explicit. If a key fact is unavailable, ask, search, or state the uncertainty.