Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
daemon-blockint-tech avatar

Ai Context Engineer

  • 29 installs
  • 7 repo stars
  • Updated May 20, 2026
  • daemon-blockint-tech/agentic-enteprises-skill

Guides context engineering for LLM systems including prompt assembly, token budgeting, source prioritization, history compression, caching, and debugging context failures.

About

This skill guides engineering what enters an LLM context each turn, covering token budgeting, source prioritization, compaction, caching, and structured context blocks. A developer uses it to optimize cost and latency and fix lost-instruction or overflow failures.

  • Token budgeting and history compression
  • Debugging lost instructions, overflow, and distraction

Ai Context Engineer by the numbers

  • 29 all-time installs (skills.sh)
  • Ranked #9,369 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Jul 29, 2026 (Skillselion catalog sync)
npx skills add https://github.com/daemon-blockint-tech/agentic-enteprises-skill --skill ai-context-engineer

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs29
repo stars7
Last updatedMay 20, 2026
Repositorydaemon-blockint-tech/agentic-enteprises-skill

What it does

Guides context engineering for LLM systems including prompt assembly, token budgeting, source prioritization, history compression, caching, and debugging context failures.

Files

SKILL.mdMarkdownGitHub ↗

AI Context Engineer

When to Use

  • Designing what enters the model context each turn
  • Optimizing cost/latency via context strategy and token budgeting
  • Building context pipelines for agents (prefix, retrieval, history, user input)
  • Implementing summarization, compaction, or rolling history
  • Debugging context-related failures (lost instructions, overflow, distraction, ignored constraints)
  • Choosing delimiters, XML blocks, or structured context formats

When NOT to Use

  • Persistent memory store design or long-term recall architecture → ai-memory-developer
  • Full RAG ingest/chunk/embed/index pipelines → ai-engineer
  • AI org operations, release governance, or SLOs → ai-lead-ops
  • Structured token/cost improvement roadmaps with phased KPIs → ai-token-improvement-plan-engineer
  • Commercial/enterprise AI solution architecture → applied-ai-architect-commercial-enterprise

Related skills

NeedSkill
Memory stores and long-term recallai-memory-developer
RAG ingest/chunk/embedai-engineer
System and tool promptsprompt-engineer
Red-team injection via contextai-redteam
Cost and production SLAsai-lead-ops
Token reduction program and roadmapai-token-improvement-plan-engineer
Commercial/enterprise AI architectureapplied-ai-architect-commercial-enterprise
Token efficiency research and ablationsresearch-engineer-scientist-tokens

Core Workflows

1. Context budget and layout

Allocate tokens (example 128k window):

BlockBudget %Priority
System policy + tools15–25%Fixed, never truncated
Retrieved docs / memory30–45%High, reranked
Conversation history25–40%Compress oldest first
User current message5–10%Never drop

Use explicit XML/markdown sections: <policy>, <tools>, <context>, <history>, <user>.

See `references/context_layout.md` for templates and delimiter rules.

2. History management

StrategyWhen
Full recent windowShort chats, high-stakes instructions in last N turns
Rolling summaryLong sessions; summarize every K turns
Anchor messagesPin system + key user constraints; summarize middle
Structured stateReplace chat with JSON task state for agents

Preserve: user goals, constraints, unresolved tool errors, pending confirmations.

See `references/history_compression.md` for summarization prompts and pitfalls.

3. Retrieval into context

1. Query from user message + state summary 2. Retrieve candidates (RAG chunks, memories, tool outputs) 3. Deduplicate overlapping passages 4. Order by relevance; add source labels 5. Truncate with sentence boundaries; show "[truncated]" when cut

See `references/retrieval_packing.md` for packing algorithms and citation format.

4. Caching and prefetch

  • Cache stable prefix (system + tools) where provider supports prompt caching
  • Prefetch retrieval while user types (optional)
  • Invalidate cache on prompt version change

See `references/caching_prefetch.md` for provider notes and invalidation.

5. Debug context failures

SymptomLikely causeFix
Ignored instructionBuried in middle / summarized awayMove to system or last user turn
Hallucinated docWeak retrievalRaise threshold; require citation
Overflow errorNo budget enforcementPre-flight token count; compress
Tool confusionAmbiguous schemas in contextSeparate tool block; shorten descriptions

Log token counts per block in dev/staging.

See `references/debugging_context.md` for instrumentation checklist.

When to load references

  • Layout and budgetsreferences/context_layout.md
  • Summarizationreferences/history_compression.md
  • RAG/memory packingreferences/retrieval_packing.md
  • Cachingreferences/caching_prefetch.md
  • Debuggingreferences/debugging_context.md

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.