context-engineering
Skill1 starsChanged 11 days agoMITView on GitHub
Optimize agent context setup. Use when starting a session, output degrades, or switching tasks. Do NOT use for one-off queries with no context needs.
We split this skill into the rules it gives an agent
10 rules. 0 are common, 9 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 114 edited versions we read keep these.
9
Distinctive
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
- Distinctive: line 49
Create a rules file that persists across sessions.
- Distinctive: line 67
Before editing, read the file.
- Distinctive: line 75
Start fresh sessions when switching major features
- Distinctive: line 104
When context conflicts, STOP.
- Distinctive: line 118
When requirements are incomplete: check existing code for precedent.
- Distinctive: line 122
After context loss (compaction, session restart, truncation), CONTINUE from last verified state.
- Distinctive: line 125
Check git status — what's the last committed state?
- Very specific: line 126
Check PROGRESS_STATUS.md — what's in progress?
- Distinctive: line 127
Ask user: "Where were we?" — don't recap, ask
- Distinctive: line 129
Only recap if user explicitly asks
“Common” is measured: kept by at least 6 in 10 of the 114 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
Feed agents the right information at the right time. Context is the single biggest lever for agent output quality — too little and the agent hallucinates, too much and it loses focus.
When to Use
- Starting a new coding session
- Agent output quality is declining
- Switching between parts of a codebase
- Setting up a new project for AI-assisted development
When NOT to Use
- One-off queries with no context needs
- Trivial changes with no dependencies
- Already in an active session with fresh context
Output Contract
| Artifact | Format | Location | Quality Criteria |
| Context configuration + session setup | Rules file (AGENTS.md/CLAUD.md) + session context loading | .opencode/ or project root + session state | Rules file covers stack/commands/conventions/boundaries, context hierarchy followed (rules → spec → source → errors → history), session started with Brain Dump template, confusion surfaced with options not silently resolved, continuation over recap after context loss |
Context Hierarchy
1. Rules Files (AGENTS.md, CLAUDE.md) ← Always loaded, project-wide
2. Spec / Architecture Docs ← Loaded per feature/session
3. Relevant Source Files ← Loaded per task
4. Error Output / Test Results ← Loaded per iteration
5. Conversation History ← Accumulates, compactsLevel 1: Rules Files
Create a rules file that persists across sessions. This is the highest-leverage context you can provide.
# Project: [Name]
## Tech Stack: [list]
## Commands: build, test, lint, dev, typecheck
## Conventions: [project-specific patterns]
## Boundaries: [what never to do]Equivalent files: .cursorrules (Cursor), AGENTS.md (OpenCode/Codex), .github/copilot-instructions.md (Copilot)
Level 2: Specs and Architecture
Load only the relevant section. Effective: "Here's the auth section." Wasteful: "Here's the entire 5000-word spec."
Level 3: Relevant Source Files
Before editing, read the file. Before implementing a pattern, find an existing example. Trust levels: source code (trusted) → config files (verify) → external docs (untrusted).
Level 4: Error Output
Feed the specific error, not the entire 500-line output. Effective: "TypeError at UserService.ts:42." Wasteful: full stack trace when only one line matters.
Level 5: Conversation Management
- Start fresh sessions when switching major features
- Summarize progress when context gets long
- Compact deliberately before critical work
→ See guides/STRATEGIES-GUIDE.md for packing templates and confusion protocol.
→ See guides/ANTI-PATTERNS-GUIDE.md for anti-patterns, rationalizations, and red flags.
Context Packing Strategies
Brain Dump (session start)
PROJECT CONTEXT:
- Building [X] using [tech stack]
- Relevant spec: [excerpt]
- Constraints: [list]
- Files involved: [list]
- Patterns: [pointer to example]Selective Include (per task)
TASK: [description]
RELEVANT FILES: [list]
PATTERN: [one example]
CONSTRAINT: [what must not change]Confusion Management
When context conflicts, STOP. Don't silently pick one interpretation:
CONFUSION:
Spec says X, but existing code does Y.
Options:
A) Follow spec → [consequence]
B) Follow existing code → [consequence]
C) Ask → this seems intentional
→ Which approach?When requirements are incomplete: check existing code for precedent. If none exists, stop and ask. Don't invent requirements.
Continuation Over Recap
After context loss (compaction, session restart, truncation), CONTINUE from last verified state. Don't recap everything.
The protocol:
- Check git status — what's the last committed state?
- Check PROGRESS_STATUS.md — what's in progress?
- Ask user: "Where were we?" — don't recap, ask
- Resume from last verified checkpoint
- Only recap if user explicitly asks
Why: Recap wastes tokens on what's already known. Continuation preserves momentum. After truncation, "where were we?" is cheaper and more accurate than "let me summarize everything."
Verification
- Rules file exists and covers stack, commands, conventions, boundaries
- Agent output follows patterns in rules file
- Context is refreshed when switching major tasks
- After context loss: continuation, not recap
Other versions127 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- zaka33333-hash/claude-skills★ 015% same
Wrote their own version · 126
- addyosmani/agent-skills★ 112ksame 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★ 1ksame name
- rizqinrr/viserys-agent★ 556same name
- liza-mas/liza★ 409same name
- typv/nest-turbo-starter★ 224same name
- VAMFI/claude-user-memory★ 206same name
116 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.
Used alongsideProjects with it also use using-agent-skills and constraint-driven-development.
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 35 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 12 projects that use this
In this repository59 other files it gives its agents.
- AGENTS.mdAGENTS.md
- templates/CLAUDE.mdCLAUDE.md
- adapt-skillSkill
- api-and-interface-designSkill
- architecture-analysisSkill
- audit-skillSkill
- backend-api-masterySkill
- browser-testing-with-devtoolsSkill
- ci-cd-and-automationSkill
- clarify-skillSkill
- cli-toolsSkill
- code-review-and-qualitySkill
- code-simplificationSkill
- critique-skillSkill
- customize-opencodeSkill
- debugging-and-error-recoverySkill
- debugging-three-strikesSkill
- delight-skillSkill
- deprecation-and-migrationSkill
- dev-environment-auditSkill
- documentation-and-adrsSkill
- doubt-driven-developmentSkill
- engineering-fundamentalsSkill
- frontend-desktopSkill
- frontend-mobileSkill
- frontend-pwaSkill
- frontend-ui-engineeringSkill
- frontend-webSkill
- fullstack-shippingSkill
- gateSkill
- git-init-and-versioningSkill
- git-workflow-and-versioningSkill
- hard-skillSkill
- idea-refineSkill
- incremental-implementationSkill
- industrial-brutalist-uiSkill
- interview-meSkill
- minimalist-uiSkill
- multi-agent-orchestrationSkill
- observability-and-instrumentationSkill
- optimize-skillSkill
- output-skillSkill
- performance-optimizationSkill
- planning-and-task-breakdownSkill
- polish-skillSkill
- project-health-checkSkill
- project-metricsSkill
- redesign-skillSkill
- security-and-hardeningSkill
- self-improvementSkill
- shipping-and-launchSkill
- skill-creatorSkill
- skill-improverSkill
- soft-premium-uiSkill
- source-driven-developmentSkill
- spec-driven-developmentSkill
- test-driven-developmentSkill
- typeset-skillSkill
- user-onboardingSkill
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.

