- Home
- Skills
- Amnadtaowsoam
- Cerebraskills
- Retrieval Playbook For Ai
retrieval-playbook-for-ai_skill
- Python
1
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill amnadtaowsoam/cerebraskills --skill retrieval-playbook-for-ai- SKILL.md6.0 KB
Overview
This skill provides a practical playbook for retrieving only the right context for AI tasks. It explains what to include, what to exclude, and how to prioritize snippets and files to save tokens and improve results. The guidance is task-oriented so retrieval is efficient and repeatable.
How this skill works
The playbook inspects the task type and pulls a minimal, prioritized set of context elements: the offending file or snippet, error messages, relevant types/interfaces, and direct dependencies. It uses rules (direct dependencies, snippets over full files, recency, and examples-only-when-needed) plus simple filtering (recency, relevance score, size) to assemble a compact context package.
When to use it
- Preparing context for bug fixes to include the exact failing code and error trace
- Assembling inputs for feature work to include similar implementations and API contracts
- Preparing diffs and related files for code reviews to keep scope narrow
- Scoping refactors by including the file, importers, and tests only
- Any time you need to reduce token usage while preserving task success
Best practices
- Always start with a one-line summary and the error or goal before code snippets
- Prefer 10–40 line snippets that contain the relevant logic rather than whole files
- Limit retrieval to the last few commits or recent changes, not full history
- Score and sort candidate files by relevance, then take the top 3–5
- Track metrics like filesRetrieved, tokensUsed, relevanceScore, and taskSuccess
Example use cases
- Fixing an authentication bug: include validateToken snippet, types, and error message
- Adding a feature: include one similar feature example, types, and API contract
- Code review: include changed files (diff) and any imported files that changed
- Refactoring a module: include the module, its importers, and its tests
FAQ
Aim for 3–5 files or fewer, focusing on snippets that directly affect the task.
When should I include examples?
Include 1–2 examples only for new patterns, complex logic, or when the user asks.