# Context Engineering

> Context engineering knowledge base for designing context stacks, memory, retrieval, orchestration, and AI system reliability in a Windsurf-compatible way.

- Skill: `majiayu000/context-engineering-9` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/context-engineering-9`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/context-engineering-9/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Research & Search
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/context-engineering-9

---


# Context Engineering

Use this skill when designing or reviewing how context is assembled for AI systems.

## Use Cases

- Context stack design
- Retrieval and RAG planning
- Memory design
- Multi-step orchestration
- AI system reliability reviews

## Core Principle

Deliver the smallest high-signal context that makes the task solvable and safe.

## Layers

Think in layers:

1. System policy
2. Developer instructions
3. Tool contracts
4. Runtime state
5. Retrieved knowledge
6. Memory
7. Examples
8. Output contract

## Repository Mapping

- Root and scoped `AGENTS.md` -> developer instructions and runtime context
- `.windsurf/skills/*` -> reusable task workflows and knowledge
- Project files and retrieved docs -> knowledge context
- Structured outputs or explicit response formats -> output contract

## Companion Resources

- `context-stack-model.md`
- `memory-engineering.md`
- `agent-harness-patterns.md`
- `rag-engineering.md`
- `multi-agent-patterns.md`
- `production-checklists.md`
- `reference-templates.md`
- `privacy-compliance-ai.md`
