Khaos-Brain: Skill for Codex

.agents/skills/local-kb-retrieve/SKILL.md

local-kb-retrieve is a skill for Codex from liuyingxuvka/Khaos-Brain. It costs 97 tokens per session (3,653 once invoked), scanned A, original, MIT.

A lightweight preflight search of a local predictive knowledge base before repository work. It routes the search by task direction, domain path, and cross-index before using simple keyword matching.

In plain words
What is it for?
Use it before non-trivial repository tasks, including releases, GitHub publishing, README work, public-template cleanup, and privacy or repository-boundary reviews.
Why use it?
It surfaces relevant prior entries while keeping retrieval separate from knowledge-base repair, publishing, or automatic adoption.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: mentions subagents; installed under .agents/ (shared by several agents); mentions Codex.

This is liuyingxuvka/Khaos-Brain's own configuration. It tells Codex how to work on Khaos-Brain itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Khaos-Brain configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/liuyingxuvka/Khaos-Brain/main/.agents/skills/local-kb-retrieve/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/liuyingxuvka/Khaos-Brain

Made for: Codex.

Wrote 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.

agentmods badge for local-kb-retrieve

README.md
[![agentmods](https://agentmods.dev/badge/skills/liuyingxuvka/khaos-brain/local-kb-retrieve/github.svg)](https://agentmods.dev/skills/liuyingxuvka/khaos-brain/local-kb-retrieve)
Your own site
<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.

agentmods 80×15 button for local-kb-retrieve

Your own site · 80×15
<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>
Per session 97 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,653 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 11d ago against content hash 281206e02e89, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

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.

The scan reads SKILL.md. This mod also ships 11 executable files (scripts/kb_consolidate.py, scripts/kb_dream.py, scripts/kb_feedback.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.agents/skills/local-kb-retrieve/SKILL.md · 128 lines

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.md as the canonical source for thresholds, maintenance boundaries, and governance rules.
  • Treat docs/maintenance_runbook.md as 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-scout sidecar 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-recorder sidecar 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 confidence or status create 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.md and docs/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.

Read the full file on GitHub · 128 lines

Changes

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.

  1. 11d ago First seen · 128 lines · 0 tokens per session scan A 281206e02e89

Subscribe to this mod's changes

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.

Related

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.

Pinvou/pinvou-agent · 0 tokens

notes

Skill "notes" from Pinvou/pinvou-agent, covering ima notes, operations, write rules, examples and response handling.

Pinvou/pinvou-agent · 0 tokens

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.

varun29ankuS/shodh-memory · 53 tokens

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.

lyc403223157-source/knowledge-inbox · 112 tokens

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.

lyc403223157-source/knowledge-inbox · 86 tokens

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.

egroup-labs/kept · 45 tokens