context_engineering

Applies compaction, masking, caching, and partitioning techniques to optimize LLM context windows.

Updated Jan 14, 2026
One-click install
npx skills add https://github.com/jvsandhu/agentic-skills --skill context-engineering-jvsandhu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context_engineering
Source: https://github.com/jvsandhu/agentic-skills/tree/main/skills/context_engineering
Command: npx skills add https://github.com/jvsandhu/agentic-skills --skill context-engineering-jvsandhu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Long conversations and verbose tool outputs quickly exhaust limited LLM context windows, degrading response quality, increasing latency, and raising token costs. This Skill provides systematic techniques to extend effective context capacity without requiring larger models. ## Core Features & Use Cases - Compaction Strategies: Summarize old conversation turns and tool outputs when approaching context limits, preserving key decisions and findings while cutting token usage by 50-70%. - Observation Masking: Replace verbose tool outputs with compact references once they have served their purpose, reclaiming the 80%+ of tokens that tool outputs often consume. - KV-Cache Optimization: Order prompts with stable content first (system prompts, tool definitions) to maximize prefix cache hits and reduce latency and cost. - Context Partitioning: Split work across sub-agents with isolated contexts so each subtask operates in a clean window. - Use Case: A long-running coding agent hits 80% context utilization mid-task. Apply compaction to summarize early turns, mask stale tool outputs, and reorder the prompt for cache stability, letting the agent continue without quality loss. ## Quick Start Ask the agent to audit the current conversation's token usage and apply compaction and observation masking to reduce context consumption below 70% of the limit.

Frequently Asked Questions about context_engineering

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

FAQPage Schema
How do I reduce token usage in long LLM conversations?

Apply compaction to summarize old conversation turns when utilization exceeds 80%, preserving key decisions and commitments. Combine this with observation masking to replace verbose tool outputs with compact references once they have served their purpose.

What is observation masking in agent systems?

Observation masking replaces verbose tool outputs with compact references after the agent has used them, since tool outputs can consume over 80% of tokens in agent trajectories. The full output remains retrievable by ID but no longer occupies context continuously.

How does KV-cache optimization reduce LLM latency?

KV-cache optimization reuses cached key-value tensors across requests sharing identical prefixes, avoiding recomputation. Place stable content like system prompts and tool definitions first, and avoid dynamic elements like timestamps to maximize cache hit rates above 70%.

When should I use context partitioning with sub-agents?

Use partitioning when a single context cannot hold all subtask details, such as multi-part research or large codebases. Each sub-agent works in an isolated clean context, and a coordinator aggregates validated results for synthesis.

What are the limitations of context compaction?

Compaction typically achieves 50-70% token reduction but risks losing details if summaries omit key facts. Never compress the system prompt, and validate with recall tests like needle-in-a-haystack to confirm quality degradation stays under 5%.