context-fundamentals
This skill should be used to explain or reason about the foundational concepts of context engineering: what context is, the anatomy of a context window, how…
Skill by Muratcan Koylan — Agent-Skills-for-Context-Engineering (MIT), vendored
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/rahulgupta2018-context-fundamentals
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
context-fundamentals- Description
- This skill should be used to explain or reason about the foundational concepts of context engineering: what context is, the anatomy of a context window, how attention mechanics work, the U-shaped attention curve, why context quality matters more than quantity, and the mental models needed to interpret every other context-engineering decision. Use this for conceptual explanation, onboarding, and background reading. Route operational work to the specialized skills: debugging attention failures goes to context-degradation, token-efficiency work goes to context-optimization, conversation summarization goes to context-compression, and project-shape decisions go to project-development.
- License
- MIT
- Metadata
- author: Muratcan Koylan — Agent-Skills-for-Context-Engineering (MIT), vendored · version: 0.1.0 · category: agent · last_updated: 2026-08-11
- Instructions
- 207 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (3)
- SKILL.md
- context-components.md · references/
- context_manager.py · scripts/
SKILL.md (first lines)
# Context Engineering Fundamentals Context is the complete state available to a language model at inference time: system instructions, tool definitions, retrieved documents, message history, and tool outputs. Context engineering is the discipline of curating the smallest high-signal token set that maximizes the likelihood of desired outcomes. This skill is the conceptual foundation that every other skill in the collection builds on. It explains what context is, how attention mechanics work, why context quality matters more than quantity, and the mental models needed to interpret every other context-engineering decision. It does not own operational work: debugging attention failures belongs to `context-degradation`, token-efficiency tactics belong to `context-optimization`, conversation summarization belongs to `context-compression`, file-based offloading belongs to `filesystem-context`, and project-shape decisions belong to `project-development`. ## When to Activate Activate this skill when the work is conceptual: - Explaining what context is and how attention mechanics constrain agent behavior. - Onboarding new contributors who need the mental models before diving into operational skills. - Reasoning about a context-related design decision from first principles (what does this constraint mean, why does this trade-off exist) before picking a specific tactic. - Writing or reviewing documentation that needs to ground operational guidance in the underlying mechanics. Do not activate this skill for operational work. The specialized skills handle the doing: - Diagnosing lost-in-middle, context poisoning, or attention failures: `context-degradation`. - Reducing token cost via masking, partitioning, prefix caching, budgets: `context-optimization`. - Compressing a long session into a handoff summary: `context-compression`. - Offloading large tool outputs or maintaining a durable scratchpad: `filesystem-context`. - Deciding the shape of an LLM project or pipeline: `project-development`. ## Core Concepts Treat context as a finite attention budget, not a storage bin. Every token added competes for the model's attention and depletes a budget that cannot be refilled mid-inference. The engineering problem is maximizing utility per token against three constraints: the hard token limit, the softer effective-capacity ceiling, and the U-shaped attention curve that penalizes information placed in the middle of context (claim-context-degradation-lost-middle-ruler). Apply four principles when assembling context: 1. **Informativity over exhaustiveness** — include only what matters for the current decision; design systems that can retrieve additional information on demand. 2. **Position-aware placement** — place critical constraints at the beginning and end of context because long-context evaluations show middle-position information is less reliably recovered than edge-position information (claim-context-degradation-lost-middle-ruler). 3. **Progressive disclosure** — load skill names and summaries at startup; load full content only when a skill activates for a specific task. 4. **Iterative curation** — context engineering is not a one-time prompt-writing exercise but an ongoing discipline applied every time content is passed to the model. ## Detailed Topics ### The Anatomy of Context **System Prompts** Organize system prompts into distinct sections using XML tags or Markdown headers (background, instructions, tool guidance, output format). System prompts persist throughout the conversation, so place the most critical constraints at the beginning and end where attention is strongest. Calibrate instruction altitude to balance two failure modes. Too-low altitude hardcodes brittle logic that breaks when conditions shift. Too-high altitude provides vague guidance that fails to give concrete signals for desired behavior. Aim for heuristic-driven instructions: specific enough to guide behavior, flexible enough to generalize — for example, numbered steps with room for judgment at each step. Start minimal, then add instructions reactively based on observed failure modes rather than preemptively stuffing edge cases. Curate diverse, canonical few-shot examples that portray expected behavior instead of listing every possible scenario. **Tool Definitions** Write tool descriptions that answer three questions: what the tool does, when to use it, and what it returns. Include usage context, parameter defaults, and error cases — agents cannot disambiguate tools that a human engineer cannot disambiguate either. Keep the tool set minimal. Consolidate overlapping tools because bloated tool sets create ambiguous decision points and consume disproportionate context after JSON serialization (tool schemas typically inflate 2-3x compared to equivalent plain-text descriptions). **Retrieved Documents** Maintain lightweight identifiers (file paths, stored queries, web links) and load data into context dynamically using just-in-time retrieval. This mirrors human cognition — maintain an index, not a copy. Strong identifiers (e.g., `customer_pricing_rates.json`) let agents locate relevant files even without search tools; weak identifiers (e.g., `data/file1.json`) force unnecessary loads. When chunking large documents, split at natural semantic boundaries (section headers, paragraph breaks) rather than arbitrary character limits that sever mid-concept. **Message History** Message history serves as the agent's scratchpad memory for tracking progress, maintaining task state, and preserving reasoning across turns. For long-running tasks, it can grow to dominate context usage — monitor and apply compaction before it crowds out active instructions. Cyclically refine history: once a tool has been called deep in the conversation, the raw result rarely needs to remain verbatim. Replace stale tool outputs with compact summaries or references to reduce low-signal bulk. **Tool Outputs** Tool outputs often dominate context in agent trajectories (claim-context-optimization-tool-output-dominance). Apply observation masking: replace verbose outputs with compact references once the agent has processed the result. Retain only the most recently relevant file contents; compress or evict older ones. ### Context Windows and Attention Mechanics **The Attention Budget** For n tokens, the attention mechanism computes n-squared pairwise relationships. As context grows, the model's ability to maintain these relationships degrades — not as a hard cliff but as a performance gradient. Models trained predominantly on shorter sequences have fewer specialized parameters for context-wide dependencies, creating an effective ceiling well below the nominal window size. Design for this gradient: assume effective capacity is materially below the advertised window until measured on the target workload. Large nominal context windows do not remove the need for task-specific degradation tests (claim-context-degradation-lost-middle-ruler). **Position Encoding Limits** Position encoding interpolation extends sequence handling beyond training lengths but introduces degradation in positional precision. Expect reduced accuracy for information retrieval and long-range reasoning at extended contexts compared to performance on shorter inputs. **Progressive Disclosure in Practice** Implement progressive disclosure at three levels: 1. **Skill selection** — load only names and descriptions at startup; activate full skill content on demand. 2. **Document loading** — load summaries first; fetch detail sections only when the task requires them. 3. **Tool result retention** — keep recent results in full; compress or evict older results. Keep the boundary crisp: if a skill or document is activated, load it fully rather than partially — partial loads create confusing gaps that degrade reasoning quality. ### Context Quality Versus Quantity Reject the assumption that larger context windows solve memory problems. Processing cost grows disproportionately with context length — not just linear cost scaling, but degraded model performance beyond effective capacity thresholds. Long inputs remain expensive even with prefix caching. Apply the signal-density test: for each piece of context, ask whether removing it would change the model's output. If not, remove it. Redundant content does not merely waste tokens — it actively dilutes attention from high-signal content. ## Practical Guidance This section provides conceptual application advice. Pointers to operational skills are explicit. ### Reasoning About a Context Decision When a context-related design decision needs to be made, separate the conceptual question from the operational one. The conceptual question is "what does this mean and why does it matter"; the operational question is "what specific technique do we apply." Use this skill to answer the first; route to the specialized skill that owns the second. For example, deciding whether to summarize a long agent session has two parts: (1) why summarization is needed at all (attention budget is finite, U-shaped curve degrades middle content, signal density matters more than volume - this skill) and (2) what compression strategy preserves the right state and at what utilization threshold to trigger it (`context-compression`). ### Reading Order For New Contributors A contributor coming to context engineering for the first time should read: 1. This skill, to internalize the attention-budget framing and the U-shaped curve. 2. `context-degradation`, to see what context failures look like in practice and how to diagnose them. 3. Two or three of `context-optimization`, `context-compression`, `filesystem-context`, `memory-systems` depending on which operational concern is most relevant to their project. Skipping step 1 produces operators who apply techniques without understanding why; skipping the operational skills produces theorists who do not know which technique fits which failure mode. ## Examples **Example 1: Organizing System Prompts** Illustrates the conceptual point that critical constraints belong at attention-favored positions (beginning and end), and that explicit section boundaries help the model parse the prompt: ```markdown <BACKGROUND_INFORMATION> You are a Python expert helping a development team. Current project: Data processing pipeline in Python 3.9+ </BACKGROUND_INFORMATION>
From rahulgupta2018/agent-skills, MIT.
More from rahulgupta2018/agent-skills
- 0.552score
code-reviewer
awesome-llm-apps (adapted for this library)
Reviews code changes (frontend, backend/API, and agent/workflow code) for security, performance, correctness, and maintainability, and returns a prioritised…
SkillBFreshness: B★ 1Claude Code +9 - 0.548score
cloud-architecture-patterns
AI Software Factory (fundamentals distilled from the cloud-agnostic architecture canon)
The distributed/cloud application architecture fundamentals: choose an architecture STYLE (N-tier, web-queue-worker, microservices, event-driven, big-data…
SkillBFreshness: B★ 1Claude Code +9 - 0.497score
adk-architecture
rahulgupta2018
ADK architectural knowledge — graph orchestration, resumption, execution flow, node contracts, observability, and LLM context orchestration.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
adk-agent-builder
rahulgupta2018
Central hub for building, testing, and iterating on ADK agents.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
agent-discovery
rahulgupta2018
Analyse an existing agent, agent prompt, or AGENT.md to inventory responsibilities, tool usage, reusable procedures, context-heavy sections, failure points…
SkillCFreshness: C★ 1Claude Code +9 - 0.492score
adk-sample-creator
rahulgupta2018
Author new samples for the ADK Python repository.
SkillCFreshness: C★ 1Claude Code +9 - 0.492score
adk-debug
rahulgupta2018
Use when debugging ADK agents, inspecting sessions, testing agent behavior, troubleshooting tool calls, event flow issues, or diagnosing LLM/model problems.
SkillCFreshness: C★ 1Claude Code +9 - 0.492score
adk-review
rahulgupta2018
Reviews all local changes in the repository for errors, styling compliance, unintended outcomes, and necessary documentation/test/sample updates.
SkillCFreshness: C★ 1Claude Code +9 - 0.492score
adk-setup
rahulgupta2018
Set up a local development environment for the ADK Python project.
SkillCFreshness: C★ 1Claude Code +9 - 0.492score
adk-style
rahulgupta2018
ADK development style guide for routine nits — Python idioms, codebase conventions, imports, typing, Pydantic patterns, formatting, logging…
SkillCFreshness: C★ 1Claude Code +9 - 0.490score
skill-name-in-kebab-case
Social Housing AI
Third-person, present-tense description written for discovery.
SkillCFreshness: C★ 1Claude Code +9 - 0.489score
adk-git
rahulgupta2018
Use for any git operation (commit, push, pull, rebase, branch, PR, cherry-pick, etc.).
SkillCFreshness: C★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Aug 12, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 0.1.0
- License
- MIT
- Repository
- github.com/rahulgupta2018/agent-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.765score
context-fundamentals
muratcankoylan
This skill should be used to explain or reason about the foundational concepts of context engineering: what context is, the anatomy of a context window, how…
SkillCFreshness: C★ 18.2KClaude Code +9 - 0.338score
context-fundamentals
guanyang
This skill should be used to explain or reason about the foundational concepts of context engineering: what context is, the anatomy of a context window, how…
SkillCFreshness: C★ 980Claude Code +9 - 0.315score
context-fundamentals
pretty998
This skill should be used to explain or reason about the foundational concepts of context engineering: what context is, the anatomy of a context window, how…
SkillBFreshness: BClaude Code +9
Cite this page
context-fundamentals skill. Agent Mart. https://agentmart.dev/skills/rahulgupta2018-context-fundamentals (last updated 2026-10-24)