askill
context-engineering

context-engineeringSafety 98Repository

Context lifecycle for AI agents: write, select, compress, isolate. Design high-signal context windows, instruction hierarchies, and memory strategies. Use when designing agent prompts, debugging context quality, optimizing token budgets, or reviewing CLAUDE.md / AGENTS.md files.

5 stars
1.2k downloads
Updated 2 weeks ago

Package Files

Loading files...
SKILL.md

Context Engineering

Context engineering is the discipline of designing the complete information environment an LLM operates within. Prompts are a subset — context includes system instructions, tool results, conversation history, retrieved documents, scratchpads, and memory artifacts.

Core Framework: Write / Select / Compress / Isolate

PhaseQuestionKey Technique
WriteWhat context needs to exist?Scratchpads, external memory, todo files, structured artifacts
SelectWhat context enters the window?Just-in-time loading, hybrid retrieval, progressive file discovery
CompressHow do we fit more signal?Compaction, preserve decisions, discard redundant output
IsolateHow do we prevent contamination?Sub-agents with bounded returns, clean contexts, sandboxed state

Instruction Design (Quick Reference)

Role + Objective + Latitude — the minimum viable instruction:

You're a senior engineer reviewing this PR.    # Role
Find bugs, security issues, and code smells.   # Objective
Be direct. If it's fine, say so briefly.       # Latitude

The Test: "Would I give these instructions to a senior engineer?" If you'd be embarrassed to hand a colleague a 700-line runbook, don't give it to the LLM.

Three-instruction agent bootstrap (~20% benchmark lift):

  1. Persistence — keep trying, don't give up after first failure
  2. Tool-calling — use tools to gather information before answering
  3. Planning — make a plan before acting, revise when blocked

When to Load References

SignalReference
Writing prompts, CLAUDE.md, AGENTS.md, system instructionsreferences/instruction-design.md
Designing memory, retrieval, token budgets, cachingreferences/context-lifecycle.md
Debugging degraded agent performance, context qualityreferences/context-anti-patterns.md
Choosing specificity level, autonomy boundariesreferences/altitude-calibration.md
In-code annotations for agents (@deprecated, @agent-pitfall, @migration)references/agent-annotations.md

Output Contract

When invoked for context review or design:

  1. Diagnosis — what's wrong with current context (or "clean" if nothing)
  2. Context Delta — specific additions/removals/restructuring
  3. Instruction Delta — prompt rewrites with before/after
  4. First-Pass Reliability Risks — what might fail on first attempt
  5. Eval Assertions — suggested test cases for the context change

Absorbed Skills

  • llm-communicationreferences/instruction-design.md

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

85/100Analyzed 6 days ago

High-quality technical reference for context engineering. Excellent framework with clear phases (Write/Select/Compress/Isolate), actionable instruction patterns, and structured output contracts. Tags and reference matrix enhance discoverability. Depth of 5 triggers minor penalty but dedicated skills folder location provides offset. Strong bonus from clear 'when to use' trigger in description.

98
85
88
78
80

Metadata

Licenseunknown
Version-
Updated2 weeks ago
Publisherphrazzld

Tags

llmpromptingsecuritytesting