context-fundamentals

Codify context components to manage token usage in agent systems.

Updated Dec 5, 2025
One-click install
npx skills add https://github.com/mhismail3/dotfiles --skill context-fundamentals
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-fundamentals
Source: https://github.com/mhismail3/dotfiles/tree/main/claude/skills/context-fundamentals
Command: npx skills add https://github.com/mhismail3/dotfiles --skill context-fundamentals

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill explains how context components such as system prompts, tool definitions, retrieved documents, and tool outputs shape agent behavior and how to manage the attention budget.

Core Features & Use Cases

  • Anatomy of context: System prompts, tool guidance, retrieved documents, and history
  • Context windows & attention mechanics
  • Tool outputs and retrieval management

Quick Start

Define a minimal context blueprint: system prompt, tool guidance, and a small retrieved doc set to influence a single-turn task.

Frequently Asked Questions about context-fundamentals

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

FAQPage Schema
How do I manage context in AI agent systems to avoid mismanagement issues?

Context management involves structuring system prompts, tool definitions, retrieved documents, and message history to shape agent behavior. Design a minimal blueprint with a focused system prompt, clear tool guidance, and selective retrieved documents to control inference and optimize token usage across your agent architecture.

What components make up an agent's context window and how do they affect performance?

Agent context comprises system prompts, tool definitions, retrieved documents, and tool outputs. Each component influences attention and inference; managing their size and order affects token budget and performance. Understanding this anatomy lets you debug context-related failures and balance completeness against efficiency.

How do I optimize token usage across system prompts, tool definitions, and retrieved documents?

Token optimization requires selective content loading and context budgeting across all components. Estimate token counts for each section, prioritize high-value information, and progressively disclose details only when needed. This approach reduces waste while maintaining the context necessary for accurate agent reasoning.

Why does my agent's output quality degrade with large retrieved document sets?

Large document sets increase context noise and compete for attention budget, degrading reasoning quality. Selective retrieval and progressive disclosure—loading only relevant documents per task—improves focus. Context design principles help diagnose whether the issue stems from retrieval strategy, tool output verbosity, or prompt clarity.

Can I use context fundamentals to debug why my agent isn't using tools correctly?

Yes. Tool output and retrieval management are core context components. If an agent ignores or misuses tools, context design reveals whether the issue is unclear tool definitions, insufficient guidance in the system prompt, or competing attention signals from other context components.

What's the best way to structure tool definitions within an agent's context budget?

Tool definitions must balance clarity with brevity. Document parameters, purpose, and expected outputs concisely; remove redundant or rarely-used details. Situate definitions in system prompt or tool guidance sections and measure their token cost against the attention budget to ensure room for retrieved data and history.