Relevant memory selection by header

From ychampion/cskill-agents · View interactive version

Relevant memory selection by header is an AI agent skill from the GitHub repository ychampion/cskill-agents. Select the most useful memory files by comparing headers/descriptions via a JSON-schema-guided assistant check.

How to use this skill

Skill file

SKILL: Relevant Memory Selection By Header

Domain: memory-selection

Trigger: Apply whenever you have a query and a directory of memory files; reuse this method to pick up to five headers whose descriptions best match the prompt.

Source Pattern: Distilled from reviewed memory-header ranking and selective context-injection implementations.

Core Method

Scan the memory directory for file headers, build a compact manifest of filename and description pairs, and ask a constrained ranking model to choose the most relevant entries for the current query. Validate the returned filenames against the scanned manifest so hallucinated results are dropped safely. Return the selected paths plus enough metadata to load or rank them later, and record that the selector ran even if it picked nothing.

Key Rules

Example Application

When answering a question about an old API and you have dozens of memory files, run the manifest-ranking loop to surface only the few headers whose descriptions signal genuine warnings or relevant history, then inject only those paths back into the main context.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.