Retrieval Playbook for AI
กลยุทธ์การ retrieve context ให้ AI อย่างมีประสิทธิภาพ - เลือกอะไร ไม่เลือกอะไร และจัดลำดับอย่างไร
Profile →npx skills add majiayu000/claude-skill-registry --skill retrieval-playbook-for-ai --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Retrieval Playbook for AI ## Overview Playbook สำหรับตัดสินใจว่าจะ retrieve context อะไรให้ AI - เลือกแค่ที่จำเป็น ตัดที่ไม่เกี่ยว จัดลำดับให้เหมาะสม ## Why This Matters - **Relevance**: เฉพาะที่เกี่ยวข้อง - **Token efficiency**: ไม่เสีย token กับข้อมูลไม่เกี่ยว - **Better results**: AI focus ได้ดีขึ้น - **Faster**: น้อย context = เร็วขึ้น --- ## Decision Tree ``` Task received ↓ Is it code-related? ├─ Yes → Retrieve code files └─ No → Skip code ↓ Need current state? ├─ Yes → Include recent changes └─ No → Skip history ↓ Need examples? ├─ Yes → Include 1-2 examples └─ No → Skip examples ↓ Assemble context ``` --- ## Retrieval Rules ### Rule 1: Only Direct Dependencies ``` ❌ Include entire codebase ✅ Include only files directly related Example: Task: Fix bug in auth.ts Include: - auth.ts (the file) - types.ts (if auth.ts imports it) - config.ts (if auth.ts uses it) Don't include: - unrelated files - test files (unless debugging tests) - documentation ``` ### Rule 2: Snippets Over Full Files ``` ❌ Include entire 500-line file ✅ Include 20-line relevant function Example: Task: Fix validateToken function Include: - validateToken function (lines 45-60) - Related types (5 lines) - Help
- Overview
- Why This Matters
- Decision Tree
- Retrieval Rules
- Rule 1: Only Direct Dependencies
- Rule 2: Snippets Over Full Files
- Rule 3: Recent Over Old
- Rule 4: Examples Only When Needed
- Context Prioritization
- Priority 1: Critical (Always Include)
- Priority 2: Important (Include if Space)
- Priority 3: Nice-to-Have (Usually Skip)
- Retrieval Strategies by Task Type
- Bug Fix
What does the Retrieval Playbook for AI skill do?
กลยุทธ์การ retrieve context ให้ AI อย่างมีประสิทธิภาพ - เลือกอะไร ไม่เลือกอะไร และจัดลำดับอย่างไร
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill retrieval-playbook-for-ai --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.