context-engineering
Skill3 starsChanged 4 months agoMITView on GitHub
Design context assembly strategy: what information enters the model context, in what order, with what budget, and how to handle overflow. Use when working on prompt engineering, AI workflows, agents, context design, or LLM optimization.
131 other projects use a version of this.
Adopted by
Most recently taken up by
- thistleknot/skillstheir own version, first seen Nov 8, 2026
- gerivdb/SKILLStheir own version, first seen Nov 8, 2026
- ishandutta2007/Awesome-Agent-Skillstheir own version, first seen Nov 8, 2026
- MMACABRE/SKILLStheir own version, first seen Nov 8, 2026
- gopalparashar421/agent-skillstheir own version, first seen Nov 8, 2026
- komluk/scaffoldingtheir own version, first seen Nov 7, 2026
Used with
Projects with it also use using-agent-skills, idea-refine and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
LLl0k0laDSkillusing-agent-skills
Use when starting a session or when you need to discover which skill applies to the current task. This is the meta-skill that governs how all other skills are discovered and invoked.
Also in 36 projects that use this
LLl0k0laDSkillidea-refine
Refine ideas through structured divergent and convergent thinking. Use "idea-refine" or "ideate" to trigger.
Also in 44 projects that use this
HK-hubSkilldeprecation-and-migration
Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when deciding whether to maintain or sunset existing code.
Also in 40 projects that use this
MrCipherSmithSkillconstraint-driven-development
Use when a project needs a persistent, measurable quality bar — starting a project without documented standards, 'set up constraints', or when coverage/perf/a11y thresholds get re-debated per-PR. Produces CONSTRAINTS.md with enforceable numbers, ratchets, and a guard against silent weakening. NOT for throwaway prototypes or a one-off CI setup.
Also in 14 projects that use this
HK-hubSkillsource-driven-development
Grounds every implementation decision in official documentation. Use when you want authoritative, source-cited code free from outdated patterns. Use when building with any framework or library where correctness matters.
Also in 44 projects that use this
- +6 more from LLl0k0laD
- +1 more from HK-hub
Other versions131 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 131
- addyosmani/agent-skills★ 114ksame name
- bojieli/ai-agent-book-projects★ 53ksame name
- bojieli/ai-agent-book★ 53ksame name
- rohitg00/pro-workflow★ 2.9ksame name
- mrgoonie/claudekit-skills★ 2.2ksame name
- kdlbs/kandev★ 1.1ksame name
- liza-mas/liza★ 418same name
- typv/nest-turbo-starter★ 224same name
- VAMFI/claude-user-memory★ 206same name
- shashankswe2020-ux/whoop-mcp★ 174same name
121 more not listed
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 repository59 other files it gives its agents.
- agent-memory-designerSkill
- ai-cost-optimizerSkill
- ai-evaluation-builderSkill
- ai-latency-optimizerSkill
- ai-solution-architectSkill
- ai-workflow-builderSkill
- human-in-the-loop-designerSkill
- multi-agent-plannerSkill
- prompt-engineerSkill
- prompt-optimizerSkill
- prompt-reviewerSkill
- adr-generatorSkill
- api-designerSkill
- architecture-reviewSkill
- component-diagram-builderSkill
- container-diagram-builderSkill
- data-flow-analyzerSkill
- integration-plannerSkill
- observability-plannerSkill
- scalability-advisorSkill
- solution-architectureSkill
- system-context-builderSkill
- experiment-designerSkill
- go-to-market-plannerSkill
- pricing-strategy-advisorSkill
- mcp-best-practicesSkill
- mcp-client-generatorSkill
- mcp-security-reviewSkill
- mcp-server-generatorSkill
- mcp-tool-generatorSkill
- acceptance-criteria-generatorSkill
- analytics-instrumentation-plannerSkill
- competitive-analysisSkill
- epic-generatorSkill
- feature-prioritizationSkill
- idea-validatorSkill
- north-star-metric-advisorSkill
- okr-builderSkill
- persona-generatorSkill
- prd-generatorSkill
- problem-statement-builderSkill
- product-discovery-assistantSkill
- product-vision-builderSkill
- sprint-plannerSkill
- story-mappingSkill
- user-story-generatorSkill
- value-proposition-designerSkill
- chunking-strategy-advisorSkill
- embedding-strategy-advisorSkill
- hybrid-search-advisorSkill
- knowledge-ingestion-plannerSkill
- rag-architecture-designerSkill
- retriever-optimizerSkill
- ai-governance-advisorSkill
- ai-threat-modelingSkill
- guardrails-builderSkill
- owasp-llm-reviewerSkill
- prompt-injection-detectorSkill
- skill-nameSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 117 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 50
Document ranking/scoring for retrieved content.
- Distinctive: line 112
Put most relevant context closest to user query.
- Distinctive: line 113
Use semantic ranking for RAG chunks.
“Common” is measured: kept by at least 6 in 10 of the 117 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Context Engineering
Purpose
Design context assembly strategy: what information enters the model context, in what order, with what budget, and how to handle overflow.
Input: AI architecture, data sources, prompt template, context window limit
Output: Context Engineering specification with budget allocation, assembly pipeline, and truncation rules
Examples: See examples.md for worked input/output.
Workflow
Step 1: Define context budget
| Segment | Token budget | Priority |
Segments: system instructions, retrieved docs, conversation history, tool results, user query.
Total must fit within model context window minus output reserve (typically 20-30%).
Step 2: Inventory context sources
| Source | Type | Typical size | Freshness | Required |
Sources: RAG chunks, user profile, session history, API tool outputs, documents.
Step 3: Design assembly pipeline
Order of assembly (recommended):
- System instructions (fixed)
- Critical constraints
- Retrieved context (ranked)
- Recent conversation (truncated)
- User query
Document ranking/scoring for retrieved content.
Step 4: Define truncation strategies
| When overflow | Strategy |
| History too long | Summarize older turns / sliding window |
| RAG too large | Re-rank and top-k truncate |
| Document too large | Chunk and select best chunks |
| Tool output large | Summarize or extract fields |
Step 5: Plan caching opportunities
| Content | Cacheable | TTL | Savings |
Static system prompts, frequent retrievals, embeddings.
Step 6: Validate
Run Validation checklist.
Decision Rules
| Condition | Action |
| No context window limit specified | Use conservative default; state assumption |
| Required source exceeds budget alone | Recommend summarization, RAG, or larger model |
| PII in context sources | Apply redaction before assembly |
| Conflicting info across sources | Define precedence rules |
| No truncation strategy | Block; overflow will cause failures |
Validation
- Token budget allocated per segment
- Budget fits within context window minus output reserve
- All context sources inventoried
- Assembly order documented
- Truncation strategy for each overflow scenario
- Ranking method for retrieved content defined
- Caching opportunities identified
- PII handling addressed if applicable
Anti-patterns
- Stuff everything — no budget, no truncation.
- Wrong order — user query buried under irrelevant context.
- Stale context — no freshness consideration for dynamic data.
- Duplicate content — same info from multiple sources wasting tokens.
- No output reserve — using 100% context for input.
Best Practices
- Reserve 20-30% of context for model output.
- Put most relevant context closest to user query.
- Use semantic ranking for RAG chunks.
- Summarize long histories rather than drop silently.
- Measure context utilization in production metrics.
Output Structure
# Context Engineering: [System Name]
## Model & Budget
- **Context window:** [tokens]
- **Output reserve:** [tokens]
- **Available input:** [tokens]
## Budget Allocation
| Segment | Budget | Priority |
|---------|--------|----------|
## Sources
| Source | Size | Freshness | Required |
|--------|------|-----------|----------|
## Assembly Pipeline
1. [Step]
## Truncation Rules
| Scenario | Strategy |
|----------|----------|
## Caching
| Content | TTL | Expected savings |
|---------|-----|------------------|
## Metrics
| Metric | Target |
|--------|--------|
| Context utilization | <80% |
| Retrieval precision | [target] |Next Skills
| Outcome | Recommended Skill |
| Design RAG pipeline | rag/rag-architecture-designer |
| Optimize prompts | ai/prompt-optimizer |
| Chunking strategy | rag/chunking-strategy-advisor |
| AI architecture update | ai/ai-solution-architect |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

