Prompting and Context
Good prompts are specific. Good projects give the model persistent context so you stop repeating yourself.
This section covers what you say (prompt structure), what you attach (files, search, MCP), and what the repo remembers (rules and AGENTS.md). Together they reduce hallucinations and scope creep more than switching models alone.
How the Pages Relate
| Page | Solves |
|---|---|
| Prompting for Code | One-off tasks — spec, plan, implement, test templates |
| Context Engineering | Token budgets, @ references, search vs paste |
| Project Rules | Persistent conventions — AGENTS.md, .cursor/rules |
| Rules vs AGENTS.md vs Skills | Which mechanism to use when |
Order: Write Project Rules once, then use Prompting for Code daily and tune attachments with Context Engineering.
Learning Paths
Solo developer
- Prompting for Code — learn the four-step pattern
- Project Rules — encode your stack once
- Context Engineering — when the model misses files
- AI Prompting cheat sheet — keep open while coding
Team lead
- Project Rules — team rollout and CODEOWNERS
- Team AI Policy — what may be pasted into prompts
- Context Engineering —
.cursorignoreand secret boundaries - Verifying AI Output — required review gates
Start Here If…
| Your problem | Start with |
|---|---|
| Model writes essays instead of diffs | Prompting for Code |
| Model ignores your stack (App Router vs Pages) | Project Rules |
| Context window full / wrong files attached | Context Engineering |
| Team repeats the same instructions in Slack | Project Rules (team section) |
| Need copy-paste prompt templates | AI Prompting cheat sheet |
Guides
Prompting for Code
Spec → plan → implement → test prompt structure.
Context Engineering
What to attach, token budgets, and codebase search.
Project Rules
AGENTS.md, .cursor/rules, and team conventions.
Rules vs Skills
When to use AGENTS.md, Cursor rules, or SKILL.md.
Quick References
Related
- Tokens and Context — theory behind token budgets
- Common AI Coding Mistakes — when bad prompts cause bad code
- Building MCP Servers — dynamic context beyond static @ files