context-fundamentals

Explains context engineering principles for designing and debugging AI agent systems.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/scoots31/engineering-playbook --skill context-fundamentals-scoots31
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-fundamentals
Source: https://github.com/scoots31/engineering-playbook/tree/main/references/context-fundamentals
Command: npx skills add https://github.com/scoots31/engineering-playbook --skill context-fundamentals-scoots31

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? AI agents often degrade unpredictably as conversations grow, tool outputs pile up, and instructions get lost in long prompts. This Skill provides the foundational mental models and concrete thresholds needed to design, debug, and optimize how context is assembled for language model agents. ## Core Features & Use Cases - Context anatomy guidance: Covers system prompts, tool definitions, retrieved documents, message history, and tool outputs with actionable engineering patterns for each component. - Attention and budgeting mechanics: Explains the lost-in-the-middle effect, effective capacity limits (60-70% of nominal windows), and compaction triggers at 70-80% utilization. - Progressive disclosure patterns: Describes three-level loading strategies for skills, documents, and tool results to keep context high-signal. - Use Case: When an agent's reasoning quality collapses after 30 tool calls, use this Skill to diagnose message-history bloat and apply observation masking and compaction strategies. ## Quick Start Ask the AI to explain why your agent loses track of instructions in long conversations and how to fix its context budget.

Frequently Asked Questions about context-fundamentals

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
When should I compact message history in an agent loop?

Compact when utilization reaches 70-80% of the window, since tool outputs can reach over 80% of total tokens in agent trajectories. Preserve architectural decisions and unresolved bugs while replacing stale tool outputs with compact summaries.