context-fundamentals

Explains context engineering concepts including attention budgets, U-shaped attention curves, and progressive disclosure.

2|Updated May 30, 2026
One-click install
npx skills add https://github.com/virahitvin8/crafty-gis --skill context-fundamentals-virahitvin8
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-fundamentals
Source: https://github.com/virahitvin8/crafty-gis/tree/main/GIT_STAR/assignment-generator/antigravity-skills-main/antigravity-skills-main/skills/context-fundamentals
Command: npx skills add https://github.com/virahitvin8/crafty-gis --skill context-fundamentals-virahitvin8

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? LLM agents fail when context is treated as unlimited storage rather than a finite attention budget, causing lost instructions, degraded reasoning, and wasted tokens. This Skill provides the foundational mental models needed to understand why context quality matters more than quantity before applying any operational technique. ## Core Features & Use Cases - Attention Mechanics Education: Explains the U-shaped attention curve, position encoding limits, and why nominal context windows exceed effective capacity. - Context Anatomy Guidance: Covers system prompt structure, tool definition design, retrieved document management, message history, and tool output handling. - Routing to Operational Skills: Directs debugging work to context-degradation, token efficiency to context-optimization, and summarization to context-compression. - Use Case: A new contributor joins an agent development team and needs to understand why critical instructions placed mid-prompt get ignored before they start tuning token budgets or writing compaction logic. ## Quick Start Ask the assistant to explain why an LLM agent loses track of instructions placed in the middle of a long prompt and how to structure context to prevent it.

Frequently Asked Questions about context-fundamentals

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

FAQPage Schema
What is context engineering for LLM agents?

Context engineering is the discipline of curating the smallest high-signal token set that maximizes the likelihood of desired model outputs. It treats context as a finite attention budget covering system prompts, tool definitions, retrieved documents, message history, and tool outputs.

Why do LLMs lose instructions in the middle of long prompts?

The U-shaped attention curve means models recall information at the beginning and end of context more reliably than the middle, with middle positions showing 10-40% lower recall accuracy. Place critical constraints at the top or bottom of prompts, never in the middle.

Does a larger context window solve memory problems?

No. Effective capacity is typically well below the nominal window because attention quality degrades as a gradient, not a cliff. Processing cost also grows disproportionately with length, so smaller high-signal context outperforms larger low-signal context.

How accurate is the 4 characters per token estimate?

The 4 characters per token heuristic works only for English prose. Code tokenizes at 2-3 characters per token, URLs and paths tokenize per punctuation mark, and non-English text often runs 1-2 characters per token. Use the provider's actual tokenizer for budget-critical calculations.

When should conversation compaction be triggered?

Trigger compaction at 70-80% context utilization, before message history crowds out active instructions. In agentic loops, history can silently consume 70-80% of the window after 20-30 tool calls while reasoning quality collapses without visible symptoms.

What is progressive disclosure in agent systems?

Progressive disclosure loads only skill names and summaries at startup, fetching full content only when a task explicitly matches activation conditions. It applies at three levels: skill selection, document loading, and tool result retention, preventing context stuffing from eager loading.