context-engineering

Solid

Master the four operations of context engineering — Write, Select, Compress, Isolate. Manage token budgets, compaction strategies, and context partitioning to keep AI sessions sharp and efficient.

AI & Automation 2,862 stars 286 forks Updated 1 weeks ago

Install

View on GitHub

Quality Score: 84/100

Stars 20%
100
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
0
Description 5%
100

Skill Content

# Context Engineering Four operations control everything about how context flows through an AI coding session. Master them and you control the quality of every response. ## The Four Operations ### 1. Write — Persist Info Outside Context Move information out of the context window into durable storage so it survives compaction and session boundaries. **Where to write:** | Target | When | Example | |--------|------|---------| | CLAUDE.md | Permanent project rules | "Always use pnpm, never npm" | | NOTES.md / scratchpad | Working state for current task | Architecture decisions, open questions | | `.claude/memory/` | Learnings and patterns | `[LEARN]` rules from corrections | | External files | Data too large for context | Test plans, migration checklists | **Pattern — Scratchpad workflow:** ```text 1. Start complex task → create NOTES.md with goals and constraints 2. After research → write findings to NOTES.md 3. After compaction → NOTES.md survives, context does not 4. Resume → read NOTES.md to recover full state ``` ### 2. Select — Retrieve Relevant Info Pull the right information into context at the right time. Precision matters more than volume. **Methods ranked by precision:** 1. `@file` references — exact file injection 2. `grep` / `Glob` — targeted pattern search 3. Subagent exploration — delegated deep search 4. RAG / embeddings — semantic retrieval for large codebases **Key principle: Focused 300 tokens > unfocused 113K tokens.** A surgical grep result that ...

Details

Author
rohitg00
Repository
rohitg00/pro-workflow
Created
7 months ago
Last Updated
1 weeks ago
Language
JavaScript
License
None

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

context-engineering

Engineer what goes into the LLM context window — system prompts, retrieved docs, tool schemas, conversation history, memory, examples. Apply the four operations write/select/compress/isolate to manage context as a finite resource. Enforce the 40% rule on context utilization. Use whenever the user is designing system prompts, debugging quality degradation in long conversations, hitting context limits, managing per-step retrieval, dealing with sub-agent context isolation, or asking about "context engineering" / "prompt engineering" / CLAUDE.md / AGENTS.md / instruction files.

14 Updated 1 months ago
Moai-Team-LLC
AI & Automation Listed

context-engineering

Workflow for context packets, context audits, compaction, handoffs, session memory, and deciding what AI-agent context to load, retrieve, trim, summarize, refresh, or omit. Use for context rot, context flooding, stale or missing context, task switching, and long-running agent sessions. Do not use when prompt wording, repo file discovery for a story card, or AGENTS.md authoring is the main artifact.

4 Updated 5 days ago
n-n-code
AI & Automation Listed

context-engineering

Use when the agent needs better context — assembling the right files, definitions, and prior decisions before implementing, or explaining existing code to a user. Triggers on "agent lacks context", "what files matter", "解释这段代码", "这个模块怎么工作", "带我过一遍代码库".

3 Updated 1 weeks ago
int2t05