Skip to main content
The following is a complete context that demonstrates good writing in every section. Use it as a reference when reviewing what your agent produces.

Complete example: JWT authentication middleware

What makes this a good context

The Reasoning section explains the actual trade-off, not just the decision. “JWT because stateless” isn’t enough — the reasoning explains why stateless matters for this specific service. Rejected Alternatives includes real options, not strawmen. The session cookies rejection explains the specific infrastructure cost. The Paseto rejection explains the specific team constraint. Risks are actionable. Each risk is tied to either a follow-up action (“add before going to production”), an owner (“@sarah to document”), or a tracking issue (“issue #88”). Vague risks like “security could be improved” aren’t useful. Files include descriptions. src/auth/middleware.ts — new tells reviewers what the file does, not just that it changed. This is the section PR reviewers read first. Key Decisions records the rationale at the time, not a post-hoc explanation. “No refresh tokens in v1 — simplifies the implementation” captures the actual decision logic.

See also