Borrowing it
Nothing to install: this file belongs to liuyingxuvka/Khaos-Brain. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/liuyingxuvka/Khaos-Brain/main/.agents/skills/local-kb-retrieve/SKILL.mdgit clone --depth 1 https://github.com/liuyingxuvka/Khaos-BrainWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/liuyingxuvka/khaos-brain/local-kb-retrieve)<a href="https://agentmods.dev/skills/liuyingxuvka/khaos-brain/local-kb-retrieve"><img src="https://agentmods.dev/badge/skills/liuyingxuvka/khaos-brain/local-kb-retrieve/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/liuyingxuvka/khaos-brain/local-kb-retrieve"><img src="https://agentmods.dev/badge/skills/liuyingxuvka/khaos-brain/local-kb-retrieve.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00097 | $0.03653 |
| Opus 5 | $0.00048 | $0.01826 |
| Sonnet 5 | $0.00019 | $0.00731 |
| Haiku 4.5 | $0.00010 | $0.00365 |
Grade A, and why
local-kb-retrieve scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 128 lines — stays where its author put it; the contents beside it link to each section on GitHub.
When this skill is used, follow this workflow:
Rule authority:
- Treat
PROJECT_SPEC.mdas the canonical source for thresholds, maintenance boundaries, and governance rules. - Treat
docs/maintenance_runbook.mdas the canonical operational runbook for sleep maintenance. - Keep this skill focused on the workflow shape. If this skill and the spec disagree, follow the spec.
Default stance: run a quick scan first for repository tasks; keep the scan lightweight unless the returned entries are clearly relevant. This includes GitHub publish work, release audits, README presentation passes, public template cleanup, and repo-boundary/privacy review. Those still count as repository tasks and should not bypass the scan. Keep the active path mathematically simple and easy to audit. During normal task flow, retrieval should use explicit additive rules and should not try to normalize or repair the KB inline.
Preferred Codex operating pattern:
- For non-trivial work, start a read-oriented
kb-scoutsidecar sub-agent before the main task so the primary agent can stay focused on the critical path. - For long mixed tasks, add phase-change KB checkpoints to the plan. Re-run retrieval before a substantially different action class or risk surface begins, such as moving from analysis to code edits, from edits to packaging, from local validation to GitHub push/tag/release, or into privacy-sensitive, organization-KB, automation, or public-publication work. Do not rerun retrieval for every repeated same-type subtask.
- After the main task, treat KB postflight as part of done. Start a
kb-recordersidecar sub-agent whenever the task exposed feedback worth keeping, comments, misses, route gaps, card weaknesses, or candidate lessons. - Run deeper consolidation in a separate scheduled maintenance conversation or automation rather than inside the main task thread.
- If sub-agents are unavailable, or if the task is trivial, fall back to a lightweight inline scan and inline feedback note.
Rule discipline:
- Keep retrieval scoring as a simple additive rule: structural route evidence + lexical evidence + small confidence/status adjustment.
- Do not let
confidenceorstatuscreate a hit by themselves. They may rerank plausible matches, but they should not turn unrelated entries into matches. - Keep runtime survival separate from KB repair. A malformed lexical candidate may be excluded, but missing or inconsistent exact LogicGuard authority is a visible failure. Never continue through a readable-card, legacy-YAML, or floating-head fallback; leave repair and republication to Sleep or the versioned upgrade owner.
- Keep parameters few and fixed. Prefer counts, weights, and thresholds that a human can inspect over adaptive or opaque heuristics.
- Keep canonical machine interfaces separate from localized display projection. CLI tools, installed launchers, automation payloads, and installer checks should use canonical machine output and encoding-stable JSON; Chinese display belongs in
i18n.zh-CN, route display labels, and UI view models.
Sleep maintenance lanes:
deterministic repair: schema normalization, field-type cleanup, canonical path alignment, low-ambiguity formatting, and other fixes that can be expressed as fixed rules and validated mechanically.semantic repair: LogicGuard model revisions, ModelMesh membership or grounded relation changes, candidate creation, merges, promotions, deprecations, taxonomy changes, and other changes that depend on accumulated evidence rather than a single malformed field.- Keep semantic auto-apply thresholds simple. Do not restate every threshold here; use the canonical thresholds from
PROJECT_SPEC.mdanddocs/maintenance_runbook.md. - If a change does not satisfy a deterministic rule or a simple semantic threshold, leave it as a proposal for a later maintenance pass.
Independent maintenance thread:
- Use a separate maintenance chat or automation for the library's "sleep" workflow. Do not let deep consolidation interrupt the user's main task thread.
- In the current implementation, Sleep may safely publish exact model generations, deterministic card projections, history events, consolidation artifacts, rollback manifests, candidate models, and explicit decision traces for ignored observations, rejected candidates, model gaps, and confidence reviews.
- Do not treat the current tooling as permission to rewrite trusted models or restructure taxonomy silently inside a main task. Durable model and mesh changes belong to Sleep; Dream and ordinary retrieval remain read-only.
- A practical active-build cadence is once per day. For calmer periods, two or three times per week is usually enough.
What ships with it
14 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- agents/openai.yaml 42 B
- DREAM_PROMPT.md 3.3 KB
- MAINTENANCE_PROMPT.md 5.5 KB
- scripts/kb_consolidate.py 3.8 KB runs code
- scripts/kb_dream.py 1.5 KB runs code
- scripts/kb_feedback.py 8.3 KB runs code
- scripts/kb_lane_status.py 3.1 KB runs code
- scripts/kb_maintenance.py 2.9 KB runs code
- scripts/kb_nav.py 1.6 KB runs code
- scripts/kb_proposals.py 1.3 KB runs code
- scripts/kb_rollback.py 3.7 KB runs code
- scripts/kb_search.py 1.7 KB runs code
- scripts/kb_sleep.py 2.5 KB runs code
- scripts/kb_taxonomy.py 1.3 KB runs code
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 128 lines · 0 tokens per session scan A 281206e02e89
local-kb-retrieve is a skill published in the GitHub repository liuyingxuvka/Khaos-Brain (37 stars, last pushed 1mo ago), licensed MIT. It adds 97 tokens to every session and 3,653 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
knowledge-base
Skill "knowledge-base" from Pinvou/pinvou-agent, covering ima knowledge base, operations, routing rules, examples and file upload guard.
notes
Skill "notes" from Pinvou/pinvou-agent, covering ima notes, operations, write rules, examples and response handling.
shodh-memory
Persistent memory system for AI agents. Use this skill to remember context across conversations, recall relevant information, and build long-term knowledge. Activate when you need to store decisions, learnings, errors, or context that should persist beyond the current session.
knowledge-ingestion
A skill for saving links, social posts, videos, podcasts, screenshots, PDFs, local files, or text into an Obsidian knowledge base, a personal collection of searchable notes. The ingestion tools analyse and format the material for storage.
personal-knowledge-ingestion
A skill for saving links, videos, social posts, local files, screenshots, PDFs, or text into an Obsidian vault, a folder used for personal notes and knowledge. It uses connected knowledge tools to process and format the saved item.
vault
Search, read, write, and manage files in the Kept conversation vault. Use when the user asks about past conversations, wants to save notes, needs to find specific content, or wants to organize their vault.