[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75N7K3SW83W76Y8TPDP0ME1":3,"skill-same:01M75N7K3SW83W76Y8TPDP0ME1":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M75N7K3SW83W76Y8TPDP0ME1","context-fundamentals",null,"This skill should be used when the user asks to \"understand context\", \"explain context windows\", \"design agent architecture\", \"debug context issues\", \"optimize context usage\", or discusses context components, attention mechanics, progressive disclosure, or context budgeting. Provides foundational understanding of context engineering for AI agent systems.","Kushal9889\u002Fclaude-plugins","Kushal9889","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F234108364?v=4","01M75N3MJASY98ADCZ0RNAC66K","Kushal Gaddamwar","01M75N3MK1VKFXDPK7H6DV9Y2Z",2,"MIT","https:\u002F\u002Fgithub.com\u002FKushal9889\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fcontext-engineering\u002Fskills\u002Fcontext-fundamentals\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: context-fundamentals\ndescription: This skill should be used when the user asks to \"understand context\", \"explain context windows\", \"design agent architecture\", \"debug context issues\", \"optimize context usage\", or discusses context components, attention mechanics, progressive disclosure, or context budgeting. Provides foundational understanding of context engineering for AI agent systems.\n---\n\n# Context Engineering Fundamentals\n\nContext 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. Every paragraph below earns its tokens by teaching a non-obvious technique or providing an actionable threshold.\n\n## When to Activate\n\nActivate this skill when:\n- Designing new agent systems or modifying existing architectures\n- Debugging unexpected agent behavior that may relate to context\n- Optimizing context usage to reduce token costs or improve performance\n- Onboarding new team members to context engineering concepts\n- Reviewing context-related design decisions\n\n## Core Concepts\n\nTreat 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 (typically 60-70% of the advertised window), and the U-shaped attention curve that penalizes information placed in the middle of context.\n\nApply four principles when assembling context:\n\n1. **Informativity over exhaustiveness** — include only what matters for the current decision; design systems that can retrieve additional information on demand.\n2. **Position-aware placement** — place critical constraints at the beginning and end of context, where recall accuracy runs 85-95%; the middle drops to 76-82% (the \"lost-in-the-middle\" effect).\n3. **Progressive disclosure** — load skill names and summaries at startup; load full content only when a skill activates for a specific task.\n4. **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.\n\n## Detailed Topics\n\n### The Anatomy of Context\n\n**System Prompts**\nOrganize 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.\n\nCalibrate 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.\n\nStart 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.\n\n**Tool Definitions**\nWrite 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.\n\nKeep 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).\n\n**Retrieved Documents**\nMaintain 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\u002Ffile1.json`) force unnecessary loads.\n\nWhen chunking large documents, split at natural semantic boundaries (section headers, paragraph breaks) rather than arbitrary character limits that sever mid-concept.\n\n**Message History**\nMessage 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.\n\nCyclically 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.\n\n**Tool Outputs**\nTool outputs typically dominate context — research shows observations can reach 83.9% of total tokens in agent trajectories. Apply observation masking: replace verbose outputs with compact references once the agent has processed the result. Retain only the five most recently accessed file contents; compress or evict older ones.\n\n### Context Windows and Attention Mechanics\n\n**The Attention Budget**\nFor 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.\n\nDesign for this gradient: assume effective capacity is 60-70% of the advertised window. A 200K-token model starts degrading around 120-140K tokens, and complex retrieval accuracy can drop to as low as 15% at extreme lengths.\n\n**Position Encoding Limits**\nPosition 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.\n\n**Progressive Disclosure in Practice**\nImplement progressive disclosure at three levels:\n\n1. **Skill selection** — load only names and descriptions at startup; activate full skill content on demand.\n2. **Document loading** — load summaries first; fetch detail sections only when the task requires them.\n3. **Tool result retention** — keep recent results in full; compress or evict older results.\n\nKeep 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.\n\n### Context Quality Versus Quantity\n\nReject 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.\n\nApply 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.\n\n## Practical Guidance\n\n### File-System-Based Access\n\nAgents with filesystem access implement progressive disclosure naturally. Store reference materials, documentation, and data externally. Load files only when the current task requires them. Leverage the filesystem's own structure as metadata: file sizes suggest complexity, naming conventions hint at purpose, timestamps serve as proxies for relevance.\n\n### Hybrid Context Strategies\n\nPre-load stable context for speed (CLAUDE.md files, project rules, core instructions) but enable autonomous exploration for dynamic content. The decision boundary depends on content volatility:\n\n- **Low volatility** (project conventions, team standards): pre-load at session start.\n- **High volatility** (code state, external data, user-specific info): retrieve just-in-time to avoid stale context.\n\nFor complex multi-hour tasks, maintain a structured notes file (e.g., NOTES.md) that the agent updates as it works. This enables coherence across context resets without keeping everything in the active window.\n\n### Context Budgeting\n\nAllocate explicit budgets per component and monitor during development. Implement compaction triggers at 70-80% utilization — do not wait for the window to fill. Design systems that degrade gracefully: when compaction fires, preserve architectural decisions, unresolved bugs, and implementation details while discarding redundant outputs.\n\nFor sub-agent architectures, enforce a compression ratio: a sub-agent may explore using tens of thousands of tokens but must return a condensed summary of 1,000-2,000 tokens. This converts exploration breadth into context-efficient results.\n\n## Examples\n\n**Example 1: Organizing System Prompts**\n```markdown\n\u003CBACKGROUND_INFORMATION>\nYou are a Python expert helping a development team.\nCurrent project: Data processing pipeline in Python 3.9+\n\u003C\u002FBACKGROUND_INFORMATION>\n\n\u003CINSTRUCTIONS>\n- Write clean, idiomatic Python code\n- Include type hints for function signatures\n- Add docstrings for public functions\n- Follow PEP 8 style guidelines\n\u003C\u002FINSTRUCTIONS>\n\n\u003CTOOL_GUIDANCE>\nUse bash for shell operations, python for code tasks.\nFile operations should use pathlib for cross-platform compatibility.\n\u003C\u002FTOOL_GUIDANCE>\n\n\u003COUTPUT_DESCRIPTION>\nProvide code blocks with syntax highlighting.\nExplain non-obvious decisions in comments.\n\u003C\u002FOUTPUT_DESCRIPTION>\n```\n\n**Example 2: Progressive Document Loading**\n```markdown\n# Instead of loading all documentation at once:\n\n# Step 1: Load summary\ndocs\u002Fapi_summary.md          # Lightweight overview\n\n# Step 2: Load specific section as needed\ndocs\u002Fapi\u002Fendpoints.md        # Only when API calls needed\ndocs\u002Fapi\u002Fauthentication.md   # Only when auth context needed\n```\n\n## Guidelines\n\n1. Treat context as a finite resource with diminishing returns\n2. Place critical information at attention-favored positions (beginning and end)\n3. Use progressive disclosure to defer loading until needed\n4. Organize system prompts with clear section boundaries\n5. Monitor context usage during development\n6. Implement compaction triggers at 70-80% utilization\n7. Design for context degradation rather than hoping to avoid it\n8. Prefer smaller high-signal context over larger low-signal context\n\n## Gotchas\n\n1. **Nominal window is not effective capacity**: A model advertising 200K tokens begins degrading around 120-140K. Budget for 60-70% of the nominal window as usable capacity. Exceeding this threshold causes sudden accuracy drops, not gradual degradation — test at realistic context sizes, not toy examples.\n\n2. **Character-based token estimates silently drift**: The ~4 characters\u002Ftoken heuristic for English prose breaks down for code (2-3 chars\u002Ftoken), URLs and file paths (each slash, dot, and colon is a separate token), and non-English text (often 1-2 chars\u002Ftoken). Use the provider's actual tokenizer (e.g., tiktoken for OpenAI models, Anthropic's token counting API) for any budget-critical calculation.\n\n3. **Tool schemas inflate 2-3x after JSON serialization**: A tool definition that looks compact in source code expands significantly when serialized — brackets, quotes, colons, and commas each consume tokens. Ten tools with moderate schemas can consume 5,000-8,000 tokens before a single message is sent. Audit serialized tool token counts, not source-code line counts.\n\n4. **Message history balloons silently in agentic loops**: Each tool call adds both the request and the full response to history. After 20-30 iterations, history can consume 70-80% of the window while the agent shows no visible symptoms until reasoning quality collapses. Set a hard token ceiling on history and trigger compaction proactively.\n\n5. **Critical instructions in the middle get lost**: The U-shaped attention curve means the middle of context receives 10-40% less recall accuracy than the beginning and end. Never place safety constraints, output format requirements, or behavioral guardrails in the middle of a long system prompt — anchor them at the top or bottom.\n\n6. **Progressive disclosure that loads too eagerly defeats its purpose**: Loading every \"potentially relevant\" skill or document at the first hint of relevance recreates the context-stuffing problem. Set strict activation thresholds — a skill should load only when the task explicitly matches its trigger conditions, not when the topic is merely adjacent.\n\n7. **Mixing instruction altitudes causes inconsistent behavior**: Combining hyper-specific rules (\"always use exactly 3 bullet points\") with vague directives (\"be helpful\") in the same prompt creates conflicting signals. Group instructions by altitude level and keep each section internally consistent — either heuristic-driven or prescriptive, not both interleaved.\n\n## Integration\n\nThis skill provides foundational context that all other skills build upon. It should be studied first before exploring:\n\n- context-degradation - Understanding how context fails\n- context-optimization - Techniques for extending context capacity\n- multi-agent-patterns - How context isolation enables multi-agent systems\n- tool-design - How tool definitions interact with context\n\n## References\n\nInternal reference:\n- [Context Components Reference](.\u002Freferences\u002Fcontext-components.md) - Read when: debugging a specific context component (system prompts, tool definitions, message history, tool outputs) or implementing chunking, observation masking, or budget allocation tables\n\nRelated skills in this collection:\n- context-degradation - Read when: agent performance drops as conversations grow or context fills beyond 60% capacity\n- context-optimization - Read when: token costs are too high or compaction\u002Fcompression strategies are needed\n\nExternal resources:\n- Anthropic's \"Effective Context Engineering for AI Agents\" — production patterns for compaction, sub-agents, and hybrid retrieval\n- Research on transformer attention mechanisms and the lost-in-the-middle effect\n- Tokenomics research on agentic software engineering token distribution\n\n---\n\n## Skill Metadata\n\n**Created**: 2025-12-20\n**Last Updated**: 2026-03-17\n**Author**: Agent Skills for Context Engineering Contributors\n**Version**: 2.0.0\n","# Context Engineering Fundamentals\n\nContext 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. Every paragraph below earns its tokens by teaching a non-obvious technique or providing an actionable threshold.\n\n## When to Activate\n\nActivate this skill when:\n- Designing new agent systems or modifying existing architectures\n- Debugging unexpected agent behavior that may relate to context\n- Optimizing context usage to reduce token costs or improve performance\n- Onboarding new team members to context engineering concepts\n- Reviewing context-related design decisions\n\n## Core Concepts\n\nTreat 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 (typically 60-70% of the advertised window), and the U-shaped attention curve that penalizes information placed in the middle of context.\n\nApply four principles when assembling context:\n\n1. **Informativity over exhaustiveness** — include only what matters for the current decision; design systems that can retrieve additional information on demand.\n2. **Position-aware placement** — place critical constraints at the beginning and end of context, where recall accuracy runs 85-95%; the middle drops to 76-82% (the \"lost-in-the-middle\" effect).\n3. **Progressive disclosure** — load skill names and summaries at startup; load full content only when a skill activates for a specific task.\n4. **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.\n\n## Detailed Topics\n\n### The Anatomy of Context\n\n**System Prompts**\nOrganize 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.\n\nCalibrate 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.\n\nStart 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.\n\n**Tool Definitions**\nWrite 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.\n\nKeep 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).\n\n**Retrieved Documents**\nMaintain 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\u002Ffile1.json`) force unnecessary loads.\n\nWhen chunking large documents, split at natural semantic boundaries (section headers, paragraph breaks) rather than arbitrary character limits that sever mid-concept.\n\n**Message History**\nMessage 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.\n\nCyclically 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.\n\n**Tool Outputs**\nTool outputs typically dominate context — research shows observations can reach 83.9% of total tokens in agent trajectories. Apply observation masking: replace verbose outputs with compact references once the agent has processed the result. Retain only the five most recently accessed file contents; compress or evict older ones.\n\n### Context Windows and Attention Mechanics\n\n**The Attention Budget**\nFor 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.\n\nDesign for this gradient: assume effective capacity is 60-70% of the advertised window. A 200K-token model starts degrading around 120-140K tokens, and complex retrieval accuracy can drop to as low as 15% at extreme lengths.\n\n**Position Encoding Limits**\nPosition 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.\n\n**Progressive Disclosure in Practice**\nImplement progressive disclosure at three levels:\n\n1. **Skill selection** — load only names and descriptions at startup; activate full skill content on demand.\n2. **Document loading** — load summaries first; fetch detail sections only when the task requires them.\n3. **Tool result retention** — keep recent results in full; compress or evict older results.\n\nKeep 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.\n\n### Context Quality Versus Quantity\n\nReject 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.\n\nApply 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.\n\n## Practical Guidance\n\n### File-System-Based Access\n\nAgents with filesystem access implement progressive disclosure naturally. Store reference materials, documentation, and data externally. Load files only when the current task requires them. Leverage the filesystem's own structure as metadata: file sizes suggest complexity, naming conventions hint at purpose, timestamps serve as proxies for relevance.\n\n### Hybrid Context Strategies\n\nPre-load stable context for speed (CLAUDE.md files, project rules, core instructions) but enable autonomous exploration for dynamic content. The decision boundary depends on content volatility:\n\n- **Low volatility** (project conventions, team standards): pre-load at session start.\n- **High volatility** (code state, external data, user-specific info): retrieve just-in-time to avoid stale context.\n\nFor complex multi-hour tasks, maintain a structured notes file (e.g., NOTES.md) that the agent updates as it works. This enables coherence across context resets without keeping everything in the active window.\n\n### Context Budgeting\n\nAllocate explicit budgets per component and monitor during development. Implement compaction triggers at 70-80% utilization — do not wait for the window to fill. Design systems that degrade gracefully: when compaction fires, preserve architectural decisions, unresolved bugs, and implementation details while discarding redundant outputs.\n\nFor sub-agent architectures, enforce a compression ratio: a sub-agent may explore using tens of thousands of tokens but must return a condensed summary of 1,000-2,000 tokens. This converts exploration breadth into context-efficient results.\n\n## Examples\n\n**Example 1: Organizing System Prompts**\n```markdown\n\u003CBACKGROUND_INFORMATION>\nYou are a Python expert helping a development team.\nCurrent project: Data processing pipeline in Python 3.9+\n\u003C\u002FBACKGROUND_INFORMATION>\n\n\u003CINSTRUCTIONS>\n- Write clean, idiomatic Python code\n- Include type hints for function signatures\n- Add docstrings for public functions\n- Follow PEP 8 style guidelines\n\u003C\u002FINSTRUCTIONS>\n\n\u003CTOOL_GUIDANCE>\nUse bash for shell operations, python for code tasks.\nFile operations should use pathlib for cross-platform compatibility.\n\u003C\u002FTOOL_GUIDANCE>\n\n\u003COUTPUT_DESCRIPTION>\nProvide code blocks with syntax highlighting.\nExplain non-obvious decisions in comments.\n\u003C\u002FOUTPUT_DESCRIPTION>\n```\n\n**Example 2: Progressive Document Loading**\n```markdown\n# Instead of loading all documentation at once:\n\n# Step 1: Load summary\ndocs\u002Fapi_summary.md          # Lightweight overview\n\n# Step 2: Load specific section as needed\ndocs\u002Fapi\u002Fendpoints.md        # Only when API calls needed\ndocs\u002Fapi\u002Fauthentication.md   # Only when auth context needed\n```\n\n## Guidelines\n\n1. Treat context as a finite resource with diminishing returns\n2. Place critical information at attention-favored positions (beginning and end)\n3. Use progressive disclosure to defer loading until needed\n4. Organize system prompts with clear section boundaries\n5. Monitor context usage during development\n6. Implement compaction triggers at 70-80% utilization\n7. Design for context degradation rather than hoping to avoid it\n8. Prefer smaller high-signal context over larger low-signal context\n\n## Gotchas\n\n1. **Nominal window is not effective capacity**: A model advertising 200K tokens begins degrading around 120-140K. Budget for 60-70% of the nominal window as usable capacity. Exceeding this threshold causes sudden accuracy drops, not gradual degradation — test at realistic context sizes, not toy examples.\n\n2. **Character-based token estimates silently drift**: The ~4 characters\u002Ftoken heuristic for English prose breaks down for code (2-3 chars\u002Ftoken), URLs and file paths (each slash, dot, and colon is a separate token), and non-English text (often 1-2 chars\u002Ftoken). Use the provider's actual tokenizer (e.g., tiktoken for OpenAI models, Anthropic's token counting API) for any budget-critical calculation.\n\n3. **Tool schemas inflate 2-3x after JSON serialization**: A tool definition that looks compact in source code expands significantly when serialized — brackets, quotes, colons, and commas each consume tokens. Ten tools with moderate schemas can consume 5,000-8,000 tokens before a single message is sent. Audit serialized tool token counts, not source-code line counts.\n\n4. **Message history balloons silently in agentic loops**: Each tool call adds both the request and the full response to history. After 20-30 iterations, history can consume 70-80% of the window while the agent shows no visible symptoms until reasoning quality collapses. Set a hard token ceiling on history and trigger compaction proactively.\n\n5. **Critical instructions in the middle get lost**: The U-shaped attention curve means the middle of context receives 10-40% less recall accuracy than the beginning and end. Never place safety constraints, output format requirements, or behavioral guardrails in the middle of a long system prompt — anchor them at the top or bottom.\n\n6. **Progressive disclosure that loads too eagerly defeats its purpose**: Loading every \"potentially relevant\" skill or document at the first hint of relevance recreates the context-stuffing problem. Set strict activation thresholds — a skill should load only when the task explicitly matches its trigger conditions, not when the topic is merely adjacent.\n\n7. **Mixing instruction altitudes causes inconsistent behavior**: Combining hyper-specific rules (\"always use exactly 3 bullet points\") with vague directives (\"be helpful\") in the same prompt creates conflicting signals. Group instructions by altitude level and keep each section internally consistent — either heuristic-driven or prescriptive, not both interleaved.\n\n## Integration\n\nThis skill provides foundational context that all other skills build upon. It should be studied first before exploring:\n\n- context-degradation - Understanding how context fails\n- context-optimization - Techniques for extending context capacity\n- multi-agent-patterns - How context isolation enables multi-agent systems\n- tool-design - How tool definitions interact with context\n\n## References\n\nInternal reference:\n- [Context Components Reference](.\u002Freferences\u002Fcontext-components.md) - Read when: debugging a specific context component (system prompts, tool definitions, message history, tool outputs) or implementing chunking, observation masking, or budget allocation tables\n\nRelated skills in this collection:\n- context-degradation - Read when: agent performance drops as conversations grow or context fills beyond 60% capacity\n- context-optimization - Read when: token costs are too high or compaction\u002Fcompression strategies are needed\n\nExternal resources:\n- Anthropic's \"Effective Context Engineering for AI Agents\" — production patterns for compaction, sub-agents, and hybrid retrieval\n- Research on transformer attention mechanisms and the lost-in-the-middle effect\n- Tokenomics research on agentic software engineering token distribution\n\n---\n\n## Skill Metadata\n\n**Created**: 2025-12-20\n**Last Updated**: 2026-03-17\n**Author**: Agent Skills for Context Engineering Contributors\n**Version**: 2.0.0\n",{"name":5,"description":7},"main","e49a897c0789a26d4e8cf16b3e0322b9032f584a","context-engineering\u002Fskills\u002Fcontext-fundamentals",0,"https:\u002F\u002Fgithub.com\u002FKushal9889\u002Fclaude-plugins","https:\u002F\u002Fgithub.com\u002FKushal9889","https:\u002F\u002Fkushal-portfolio-223.netlify.app","AI Engineer · MSCS @ BU · Open PRs: vLLM #56846, LlamaIndex #23053 · Reported deepagents #4846 (maintainer fix #4925)","2026-11-13 01:03:25",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Kushal9889\u002Fclaude-plugins --skill context-fundamentals",{"tool":39,"command":40},"bunx","bunx skills add Kushal9889\u002Fclaude-plugins --skill context-fundamentals",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Kushal9889\u002Fclaude-plugins --skill context-fundamentals","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FKushal9889\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fcontext-engineering\u002Fskills\u002Fcontext-fundamentals\u002FSKILL.md",true,[47,53],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Fcontext-components.md","REFERENCE","参考文档",7970,"https:\u002F\u002Fgithub.com\u002FKushal9889\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fcontext-engineering\u002Fskills\u002Fcontext-fundamentals\u002Freferences\u002Fcontext-components.md",{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"scripts\u002Fcontext_manager.py","SCRIPT","脚本",18349,"https:\u002F\u002Fgithub.com\u002FKushal9889\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fcontext-engineering\u002Fskills\u002Fcontext-fundamentals\u002Fscripts\u002Fcontext_manager.py",[60,67,73,79,86,93],{"skillNo":61,"name":62,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":66},"01M78TAEHR7PW92YHTBFTJRMYP","higgsfield-skills","https:\u002F\u002Fgithub.com\u002FKushal9889\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Finstalled\u002Fhiggsfield-skills\u002Fskills\u002Fhiggsfield-skills\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":68,"name":69,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":66},"01M78TAB9MCR7QH3NZJKH5PJFJ","cutaway","https:\u002F\u002Fgithub.com\u002FKushal9889\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Finstalled\u002Fcutaway\u002Fskills\u002Fcutaway\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":66},"01M78TA9YK7YE80960SFP5QJ6D","cracked","https:\u002F\u002Fgithub.com\u002FKushal9889\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Finstalled\u002Fcracked\u002Fskills\u002Fcracked\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M75NWKDRSD7GPTBD80S8P5KW","spec","Create, amend, or backprop bugs into SPEC.md at repo root. Sole mutator\nof the project spec. Triggers when the user asks to write a spec, start\na new spec, distill a spec from existing code, add invariants, amend\nsections (§G, §C, §I, §V, §T, §B), or record a bug via backprop.\nCommon phrasings: \"write the spec for...\", \"new spec\", \"bug: ...\",\n\"amend §V.3\", \"distill spec from code\", \"spec this idea\". Reads and\nfollows FORMAT.md for the caveman encoding rules and pipe-table shape\nof §T and §B.","https:\u002F\u002Fgithub.com\u002FKushal9889\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fworkflow\u002Fskills\u002Fspec\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M75NWFNN2NFMPZY5X9Q2DTBT","check","Read-only drift detector. Diffs SPEC.md against current code and reports\nviolations grouped by severity. Writes nothing — suggests remedies via\nthe spec or build skills but never invokes them. Triggers when the user\nasks to check drift, audit the spec, verify invariants, or ask whether\ncode still matches the spec. Phrasings: \"check drift\", \"audit the spec\",\n\"does the code still match §V\", \"check invariants\", \"spec vs code\".","https:\u002F\u002Fgithub.com\u002FKushal9889\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fworkflow\u002Fskills\u002Fcheck\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M75NWCP6RRA3PFBPN8B94FYE","backprop","Bug → spec protocol. When a bug is found or a test fails, trace the cause,\ndecide whether a new §V invariant would catch recurrence, append to §B.\nThis is the one non-obvious thing SDD does that plan-then-execute doesn't.\nTriggers on test failure, bug report, post-mortem, or explicit user ask.","https:\u002F\u002Fgithub.com\u002FKushal9889\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fworkflow\u002Fskills\u002Fbackprop\u002FSKILL.md",[],[]]