What problem does it solve? LLM agents lose instructions, forget earlier conversation, or overflow the context window because no one designed what information enters the window at each turn. This Skill provides a step-by-step procedure for budgeting tokens, assembling context dynamically, and managing memory across long conversations. ## Core Features & Use Cases - Token Budgeting: Allocate explicit token budgets across system prompt, history, RAG chunks, tool results, and response reserve using real tokenizers like tiktoken. - Dynamic Context Assembly: Build the context window from prioritized, typed blocks with automatic truncation of low-priority sources when over budget. - Memory Architecture: Choose and implement buffer, sliding window, summary, entity, vector, or hybrid memory patterns with working code for each. - Use Case: Your agent hallucinates or forgets instructions after 30 turns. Use this Skill to add a sliding-window-plus-summary memory, truncate oversized tool results, and log per-turn context snapshots to debug exactly what the model sees. ## Quick Start Use the context-engineering skill to design a token budget and memory strategy for my agent running on GPT-4o with a 128K window that keeps losing instructions after long conversations.