{
  "markdown": "# kb-research\n\nA reusable **Claude Code plugin** that turns any project into an agent-operated\nknowledge base, built on the\n[Open Knowledge Format (OKF) v0.1](plugins/okf-knowledge-base/references/okf-spec.md)\nand run as a Karpathy-style\n[LLM wiki](plugins/okf-knowledge-base/references/llm-wiki.md): knowledge is\ncompiled once into structured, cross-linked markdown pages so it **compounds**\nover time instead of being re-discovered on every query.\n\nThe repo is a **marketplace** hosting **three variants of the plugin**, and it\ndogfoods them against the example KB in `kb/`.\n\n## The three plugins\n\nAll give you the same five skills — `kb-init-domain`, `kb-ingest` (routes a\nsource to a domain by its description), `kb-search` (ranked, cited retrieval),\n`kb-lint` (OKF conformance + hygiene), and `kb-consolidate` (find duplicate/\noverlapping pages and merge them to shrink the KB, recommend-then-apply) — plus a\n`knowledge-curator` agent with an end-of-turn capture sweep and a `SessionStart`\nhook that detects a KB in the working directory. They differ only in *how the\nwork happens*:\n\n| Plugin | How it works | Dependencies |\n|--------|--------------|--------------|\n| **`okf-knowledge-base`** | skills call bundled pure-stdlib Python scripts | Python 3 |\n| **`okf-knowledge-base-powershell`** | skills call bundled PowerShell scripts — output identical to the Python variant | PowerShell 7+ |\n| **`okf-knowledge-base-scriptless`** | skills instruct the agent to do the work directly with built-in file tools | none |\n\nPick a scripts variant (Python or PowerShell — whichever runtime you have) for\nlarge KBs, CI, and reproducible output; the scriptless variant for zero-setup use\nor locked-down environments. **Install exactly one** — they share skill names.\nSee [`benchmarks/`](benchmarks/) for a measured comparison.\n\n## Install\n\n```text\n/plugin marketplace add CoderNumber1/kb-research\n/plugin install okf-knowledge-base@kb-research               # Python scripts\n# ...or one of:\n/plugin install okf-knowledge-base-powershell@kb-research    # PowerShell scripts\n/plugin install okf-knowledge-base-scriptless@kb-research    # no scripts\n```\n\nThen, in any project that has (or should have) a `kb/` bundle, ask naturally\n(\"add this doc to the KB\", \"what does the wiki say about X?\", \"lint the KB\"), or\ninvoke the skills directly. No `kb/` yet? Ask to initialize a domain and one is\ncreated for you.\n\n## Layout\n\n```\nkb-research/\n├── .claude-plugin/marketplace.json     # marketplace listing both plugins\n├── plugins/\n│   ├── okf-knowledge-base/             # scripts variant\n│   │   ├── .claude-plugin/plugin.json\n│   │   ├── skills/{kb-init-domain,kb-ingest,kb-search,kb-lint}/SKILL.md\n│   │   ├── agents/knowledge-curator.md\n│   │   ├── hooks/hooks.json            # SessionStart KB detector (kb_detect.py)\n│   │   ├── scripts/                    # kb_common, init/detect/search/lint, kb_detect\n│   │   └── references/{okf-spec.md,llm-wiki.md}\n│   ├── okf-knowledge-base-powershell/  # PowerShell variant\n│   │   ├── .claude-plugin/plugin.json\n│   │   ├── skills/… agents/… references/…\n│   │   ├── hooks/hooks.json            # SessionStart detector (kb_detect.ps1)\n│   │   └── scripts/                    # KbCommon.psm1 + *.ps1 (parity with Python)\n│   └── okf-knowledge-base-scriptless/  # scriptless variant (no scripts/)\n│       ├── .claude-plugin/plugin.json\n│       ├── skills/… agents/… references/…\n│       └── hooks/hooks.json            # SessionStart detector (inline shell)\n├── benchmarks/                         # cross-variant benchmark harness + results\n├── kb/                                 # example / dogfood KB (one OKF bundle)\n│   ├── index.md                        # root catalog of domains (okf_version)\n│   ├── log.md\n│   └── <domain>/                       # domain.md, index.md, log.md, raw/, concepts\n│       └── <sub-domain>/               # optional nesting, e.g. billing/eu\n├── tests/                              # pytest suite (scripts, skills, agent, plugin)\n├── docs/ci.example.yml                 # CI workflow (add under .github/workflows/)\n└── CLAUDE.md                           # KB operating guide / schema layer\n```\n\n## The three operations (Karpathy) over one format (OKF)\n\n- **Ingest** (`kb-ingest`) — add sources; the target (sub-)domain is auto-detected\n  by matching the source's topic against each domain's description.\n- **Query** (`kb-search`) — answer from the compiled wiki, with citations.\n- **Lint** (`kb-lint`) — check conformance and hygiene (broken links, orphans,\n  index drift, stale pages, …).\n\nPlus `kb-init-domain` to open a new subject area (or a nested sub-domain), and\n`kb-consolidate` to find and merge duplicate/overlapping pages (within a domain,\nor across domains into a canonical home or a new common domain) — recommending\nfirst and applying only what you approve, to shrink the KB without losing\nknowledge.\n\n## Running the scripts directly\n\nEvery script is pure-stdlib Python 3 and autodetects the KB in the working\ndirectory:\n\n```bash\nS=plugins/okf-knowledge-base/scripts\npython3 $S/kb_lint.py                 # health check (exit 1 on conformance errors)\npython3 $S/kb_search.py \"webhooks\"    # search\npython3 $S/detect_domain.py --list    # list domains\n```\n\nUnder the installed plugin the skills call these via `${CLAUDE_PLUGIN_ROOT}`.\n\n## Development\n\n```bash\npip install -r requirements-dev.txt\npytest                                # scripts, skills, agents, all three plugins\npython3 benchmarks/run_benchmarks.py  # Python vs PowerShell timings + parity\n```\n\nThe PowerShell parity tests run only where `pwsh` is installed and skip otherwise\n(GitHub's `ubuntu-latest` runners have PowerShell preinstalled).\n\nCI: copy `docs/ci.example.yml` to `.github/workflows/ci.yml` (kept out of the repo\nhistory because pushing workflow files needs a token with the Workflows scope).\n\n## Design references\n\n- Open Knowledge Format v0.1 — Google Cloud\n  ([spec](plugins/okf-knowledge-base/references/okf-spec.md),\n  [announcement](https://cloud.google.com/blog/products/data-analytics/how-the-open-knowledge-format-can-improve-data-sharing/)).\n- LLM Wiki — Andrej Karpathy\n  ([gist](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f),\n  [notes](plugins/okf-knowledge-base/references/llm-wiki.md)).\n",
  "bytes": 6288,
  "sha": "ec62797f1a4b494ae838fc2f155017415729b5e2c884594eb6dd8eb095f7ea80",
  "repo_slug": "codernumber1/kb-research",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/okf_codernumber1_kb_research_kb_index_md_f3915285/readme"
}