ai-context-engineer
Skill8 starsChanged 6 months agoMITView on GitHub
Guides context engineering for LLM systems—assembling prompts, budgeting tokens, prioritizing sources, compressing history, caching, structured context blocks, and debugging context-related failures (lost instructions, overflow, distraction). Use when designing what enters the model context each turn, optimizing cost/latency via context strategy, building context pipelines for agents, implementing summarization or compaction, or fixing "model ignored X" issues—not for persistent memory store design (ai-memory-developer), full RAG index pipelines (ai-engineer), or AI org operations (ai-lead-ops). For a structured token/cost improvement roadmap with phased initiatives and KPIs, use ai-token-improvement-plan-engineer. For commercial/enterprise AI solution architecture (RAG, copilots, platform selection), use applied-ai-architect-commercial-enterprise. Token research and compression ablations: research-engineer-scientist-tokens.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- rade-nugroho/Agentic-Enteprises-Skillword for word, first seen May 20, 2026
Other versions1 project uses a version of this.
Word for word · 1
- rade-nugroho/Agentic-Enteprises-Skill★ 9100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository197 other files it gives its agents.
- ab-testing-engineerSkill
- actuarial-analystSkill
- actuarial-consultingSkill
- actuarySkill
- advanced-long-term-actuarial-mathematicsSkill
- advanced-persistent-threatSkill
- advanced-short-term-actuarial-mathematicsSkill
- agentic-ai-developerSkill
- ai-adversarial-robustness-engineerSkill
- ai-engineerSkill
- ai-lead-opsSkill
- ai-memory-developerSkill
- ai-redteamSkill
- ai-researcherSkill
- ai-risk-governanceSkill
- ai-skill-managerSkill
- ai-token-improvement-plan-engineerSkill
- aml-cftSkill
- aml-complianceSkill
- analytics-data-engineering-manager-productSkill
- analytics-data-engineerSkill
- anti-false-positive-decision-makingSkill
- applied-ai-architect-commercial-enterpriseSkill
- appointed-chief-actuarySkill
- asset-liability-managementSkill
- associate-actuarySkill
- assumption-settingSkill
- auditorSkill
- bcm-disaster-recovery-specialistSkill
- bi-analystSkill
- build-validatorSkill
- business-analystSkill
- business-consultantSkill
- business-model-researcherSkill
- certified-information-systems-security-professionalSkill
- chief-information-security-officerSkill
- ci-cd-engineerSkill
- cicd-engineerSkill
- cisco-certified-network-professionalSkill
- classified-cyber-security-senior-managerSkill
- classified-software-devsecops-engineerSkill
- cloud-architectSkill
- cloud-compliance-specialistSkill
- cloud-economistSkill
- cloud-engineerSkill
- cloud-security-engineerSkill
- cloud-system-administratorSkill
- cluster-deployment-engineerSkill
- code-securitySkill
- commercial-counselSkill
- communication-leadSkill
- community-executive-escalations-program-managerSkill
- compliance-engineerSkill
- compliance-specialistSkill
- compute-accounting-managerSkill
- control-software-developerSkill
- corporate-counselSkill
- country-managerSkill
- cross-department-translationSkill
- cryptographer-specialistSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 62
Use explicit XML/markdown sections: <policy>, <tools>, <context>, <history>, <user>.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
| Need | Skill |
| Memory stores and long-term recall | ai-memory-developer |
| RAG ingest/chunk/embed | ai-engineer |
| System and tool prompts | prompt-engineer |
| Red-team injection via context | ai-redteam |
| Cost and production SLAs | ai-lead-ops |
| Token reduction program and roadmap | ai-token-improvement-plan-engineer |
| Commercial/enterprise AI architecture | applied-ai-architect-commercial-enterprise |
| Token efficiency research and ablations | research-engineer-scientist-tokens |
Core Workflows
1. Context budget and layout
Allocate tokens (example 128k window):
| Block | Budget % | Priority |
| System policy + tools | 15–25% | Fixed, never truncated |
| Retrieved docs / memory | 30–45% | High, reranked |
| Conversation history | 25–40% | Compress oldest first |
| User current message | 5–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
| Strategy | When |
| Full recent window | Short chats, high-stakes instructions in last N turns |
| Rolling summary | Long sessions; summarize every K turns |
| Anchor messages | Pin system + key user constraints; summarize middle |
| Structured state | Replace 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
- Query from user message + state summary
- Retrieve candidates (RAG chunks, memories, tool outputs)
- Deduplicate overlapping passages
- Order by relevance; add source labels
- 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
| Symptom | Likely cause | Fix |
| Ignored instruction | Buried in middle / summarized away | Move to system or last user turn |
| Hallucinated doc | Weak retrieval | Raise threshold; require citation |
| Overflow error | No budget enforcement | Pre-flight token count; compress |
| Tool confusion | Ambiguous schemas in context | Separate 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 budgets →
references/context_layout.md - Summarization →
references/history_compression.md - RAG/memory packing →
references/retrieval_packing.md - Caching →
references/caching_prefetch.md - Debugging →
references/debugging_context.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

