Purpose: Extract only core concepts, not verbose explanations
Last Updated: 2026-01-06
Extract the minimum information needed for an AI agent to understand and use a concept:
Goal: Scannable in <30 seconds. Reference full docs, don't duplicate them.
Core Concept (1-3 sentences)
↓
Key Points (3-5 bullets)
↓
Quick Example (5-10 lines)
↓
Reference Link (full docs)
↓
Related Files (cross-refs)
# JWT Authentication
JSON Web Tokens (JWT) are an open standard (RFC 7519) that defines
a compact and self-contained way for securely transmitting information
between parties as a JSON object. This information can be verified and
trusted because it is digitally signed. JWTs can be signed using a
secret (with the HMAC algorithm) or a public/private key pair using RSA
or ECDSA.
[... 400 more lines of explanation, examples, edge cases ...]
# Concept: JWT Authentication
**Core Idea**: Stateless authentication using JSON Web Tokens signed
with a secret key. Token contains user data (payload) that server can
trust because signature is verified.
**Key Points**:
- Token has 3 parts: header.payload.signature (Base64 encoded)
- Server verifies signature to trust payload without database lookup
- No session storage needed (stateless)
- Tokens expire (include `exp` claim)
- Store in httpOnly cookie or Authorization header
**Quick Example**:
```js
// Sign token
const token = jwt.sign(
{ userId: 123, role: 'admin' },
SECRET_KEY,
{ expiresIn: '1h' }
)
// Verify token
const decoded = jwt.verify(token, SECRET_KEY)
console.log(decoded.userId) // 123
Reference: https://jwt.io/introduction
Related:
Why: Forces brevity. If you need more, split into multiple files or reference external docs.
Before creating a context file, verify:
If any answer is "no", apply more compression.