context-fundamentals

Teaches context engineering principles and provides Python utilities for token budgeting and context assembly.

Updated Apr 17, 2026
One-click install
npx skills add https://github.com/Syedyasir001/RVULibPass --skill context-fundamentals-syedyasir001
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: context-fundamentals
Source: https://github.com/Syedyasir001/RVULibPass/tree/main/.agent/skills/library/context-fundamentals
Command: npx skills add https://github.com/Syedyasir001/RVULibPass --skill context-fundamentals-syedyasir001

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? AI agents degrade as context windows fill: attention dilutes, critical instructions get lost in the middle, and token costs balloon. This Skill provides the foundational mental models and concrete utilities to design, budget, and debug context for agent systems. ## Core Features & Use Cases - Context Engineering Principles: Covers attention budgets, the lost-in-the-middle effect, progressive disclosure, position-aware placement, and compaction triggers at 70-80% utilization. - Context Management Utilities: A Python module offering token estimation, priority-aware context assembly (ContextBuilder), message truncation, structure validation, and lazy file loading (ProgressiveDisclosureManager). - Technical Reference: Detailed guidance on system prompt sectioning, tool description engineering, document chunking, observation masking, and context budget allocation tables. - Use Case: When an agent's reasoning quality collapses after 20-30 tool calls, use this Skill to diagnose history bloat, apply observation masking, and set compaction triggers before the window fills. ## Quick Start Ask the agent to explain how to design a context budget for a new agent system and review your current system prompt structure.

Frequently Asked Questions about context-fundamentals

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

FAQPage Schema
How do I prevent context window overflow in AI agents?▼

Implement compaction triggers at 70-80% utilization rather than waiting for the window to fill. Replace stale tool outputs with compact summaries, retain only the five most recently accessed files, and enforce compression ratios for sub-agent results.

What is progressive disclosure in agent context management?▼

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

Why does agent accuracy drop before reaching the token limit?▼

Effective capacity is typically 60-70% of the advertised window because attention computes n-squared relationships that degrade with length. A 200K-token model starts degrading around 120-140K tokens, with retrieval accuracy dropping sharply at extreme lengths.

How accurate is the 4 characters per token estimate?▼

The 4 characters per token heuristic works only for English prose and breaks down for code (2-3 chars/token), URLs, and non-English text. For budget-critical calculations, use a real tokenizer like tiktoken or the provider's token counting API.

Where should critical instructions go in a system prompt?▼

Place critical constraints at the beginning or end of the prompt, where recall accuracy runs 85-95%. The middle of context suffers the lost-in-the-middle effect, dropping to 76-82% recall, so never place safety constraints or output format rules there.