Treats filling the context window as a discipline: indexing, chunking, references and multi-agent context, art and science.
Context Engineering 入门
Overview
Who it's for
Anyone who has used Claude Code or similar coding assistants but finds it hard to get the AI to reliably finish whole tasks; beginners can follow the template too.
What you'll learn
01Core idea: what Context Engineering is
The repo contrasts levels of AI coding: Vibe Coding is 'casually chat and generate code', Prompt Engineering is 'get things done with clever wording', and Context Engineering is designing the entire context as a system — including docs, examples, rules, patterns and validation. It likens prompt engineering to handing someone a sticky note, and context engineering to writing a full screenplay with every detail spelled out.
02Why it's more reliable: most agent failures are context failures
The core argument: most agent failures are not model failures but 'context failures' — the AI never got the information needed to finish the job end to end. With the right context, the AI follows your project's patterns and conventions (consistency), handles multi-step features, and self-corrects through validation loops. That's what '10x better than prompt engineering, 100x better than vibe coding' means.
03Template structure: CLAUDE.md + INITIAL.md + examples/ + PRP
The template is a clone-and-go project skeleton: CLAUDE.md holds global rules (code structure, file size limits, testing requirements, style conventions); INITIAL.md is where you write the initial feature request; examples/ holds reference code patterns (called 'critical'); PRPs/ stores generated implementation blueprints; and .claude/commands/ defines the /generate-prp and /execute-prp slash commands. It's Claude Code-first, but the ideas port to other coding assistants.
04The PRP workflow: from request to validation-gated implementation
The core loop is two slash commands: write INITIAL.md, run /generate-prp so the AI researches your codebase patterns, finds relevant docs, and produces a complete PRP; then run /execute-prp to break the blueprint into a plan, implement step by step, run tests and lint, and iterate on failures. A PRP is like a PRD but crafted specifically to instruct an AI coding assistant — each one carries validation gates to raise the odds of getting it right the first time.
05Best practices: be specific, feed plenty of examples
Key takeaways: write INITIAL.md explicitly — FEATURE should not be 'build a scraper' but 'build an async scraper with BeautifulSoup, handle rate limiting, store in PostgreSQL'; fill examples/ with reference patterns (the AI performs dramatically better with patterns to follow, and examples should show both what to do and what not to do); add validation gates (test commands that must pass); leverage official docs and MCP resources; and customize CLAUDE.md per project.
Practice tips
- Clone the template, adapt CLAUDE.md to your project's rules and conventions, and run one real session to see the difference.
- Write a feature you want in INITIAL.md — try both a one-line request and a fully filled-out one, then compare the resulting PRPs.
- Drop your most typical module into examples/ and ask the AI to mimic its structure for new code.
- Run one small feature through the full /generate-prp → /execute-prp loop and watch how validation gates force the AI to self-test.
Companion workflows
Related resources
A comprehensive survey of Context Engineering: hundreds of resources from prompt engineering to production AI systems.
Get Shit Done (GSD)
64.8kA lightweight, powerful meta-prompting and spec-driven development system — spec-first context engineering for Claude.