knowledge-base

knowledge-base is a skill for Claude Code, Codex from SparkElf/deepseek-harness-plus. It costs 100 tokens per session (4,525 once invoked), scanned A, original, MIT.

A shared knowledge-base manager for finding, reading, creating, uploading, moving, renaming, and deleting documents. It separates global documents, department documents, and private personal documents by who can see them.

In plain words
What is it for?
Use it to search and cite documentation, organise files, create summaries, build document indexes, and maintain selected vector or knowledge-graph representations.
Why use it?
It helps people find authoritative documents and keeps files in the correct visibility area, with citations and permission boundaries instead of relying on chat attachments.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to search and cite documentation, organise files, create summaries, build document indexes, and maintain selected vector or knowledge-graph representations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sparkelf/deepseek-harness-plus/knowledge-base
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add SparkElf/deepseek-harness-plus --skill knowledge-base
Clone the repo
git clone --depth 1 https://github.com/SparkElf/deepseek-harness-plus

Made for: Claude Code, 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 knowledge-base

README.md
[![agentmods](https://agentmods.dev/badge/skills/sparkelf/deepseek-harness-plus/knowledge-base/github.svg)](https://agentmods.dev/skills/sparkelf/deepseek-harness-plus/knowledge-base)
Your own site
<a href="https://agentmods.dev/skills/sparkelf/deepseek-harness-plus/knowledge-base"><img src="https://agentmods.dev/badge/skills/sparkelf/deepseek-harness-plus/knowledge-base/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 knowledge-base

Your own site · 80×15
<a href="https://agentmods.dev/skills/sparkelf/deepseek-harness-plus/knowledge-base"><img src="https://agentmods.dev/badge/skills/sparkelf/deepseek-harness-plus/knowledge-base.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,525 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.00100 $0.04525
Opus 5.5 $0.00040 $0.01810
Sonnet 5.5 $0.00020 $0.00905
Haiku 4.5 $0.00010 $0.00453

Measured 4d ago against content hash c3f8e5cbdadb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

knowledge-base 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 4d ago.

The scan reads SKILL.md. This mod also ships 15 executable files (astcheck.mjs, scripts/deploy-mineru.mjs, scripts/memory-guardian.mjs, …), 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.

downstream/packages/plugins/knowledge-base/SKILL.md · 232 lines

How it starts

The opening of the file, as written. The whole thing — 232 lines — stays where its author put it; the contents beside it link to each section on GitHub.

知识库 — 增删改查

知识库是一个共享文档存储,不是聊天附件、不是临时工作区。用户看到的是他自己的一份视图:/workspace/kb(宿主侧 viewRoot)。这份视图里的三个顶层文件夹决定了文档的可见范围:

文件夹 谁能看到 用来放
global 所有人 公司制度、通用规范、全员参考
department 本部门的人 部门流程、值班表、本部门台账
personal 只有自己 草稿、个人笔记、未定稿调研

新建文档前先想清楚它属于哪一层。 放错层的后果是可见范围错了,而移动文档需要写权限——用户可能没有那个权限去纠正。

何时用

  • 用户问知识库里的某份文档、制度、条款、数据,或要求给出处(先检索,引用只用 citation token);
  • 用户要新建、上传、改名、移动、删除文档,或问某个文件/目录在哪一层;
  • 用户要整理归档、生成文档摘要、定向向量化,或读写知识图谱(按下面的参考进入专项流程);
  • 用户问权限边界、为什么看不到某个文件,或要求把文档放到另一个可见范围。

按需加载

主文件负责日常检索、增删改查与权限。专项流程只在需要时读取对应参考,不要一次全读:

一、查(Agentic RAG:先检索,再验证,最后引用)

知识库检索不是“背答案”,也不是一上来 cat 大文件。按下面的顺序工作:

  1. 先判断问题形态,再选入口:
    • 精确事实/单点条款:直接从 kb_search(query, topK=10) 开始。FTS5 + BM25 是主召回与排序路径,支持中文/英文,先按调用者身份和可见范围过滤。不要先查“知识库状态/索引状态”,没有 kb_status 工具;状态只由 UI 使用。
    • 广泛/比较/区别/全面/是否类问题(“有什么区别”“全面梳理”“是否允许”“分别有哪些”):先用 kb_outline(docId | citationToken) 拿目录(章/节/条)和已有摘要;如果 summaryStatus 是 missing,按需读取 references/summarize.md 生成摘要,再 kb_search / kb_chunk_get 读相关章节原文。用户点名了文档或给了 kb:// token 时直接 kb_outline;不知道 docId 时先 kb_search 找到文档,再 kb_outline 展开,避免只看命中 chunk 就下结论。
    • 摘要只是导航,不是引用:kb_outline 的 summary、kb_search 的 sectionSummary / docSummary / relatedSections 可能是旧 extractive 或显式生成的 llm 摘要,但都不是引用来源;引用必须使用原文 chunk 的 citation token。
  2. 比较、门槛、比例、金额、日期类问题必须先发 2 个 query 变体,再合并结果(不要只发一条长句):
    • 变体 A(精确术语):把问题里的制度术语直接拼起来,例如“普通决议 特别决议 三分之二 过半数”“董事会 表决 通过 比例”。
    • 变体 B(实体+动作):例如“董事会 会议 召开 通知 工作日”“三重一大 重大项目 金额 门槛”。
    • 数字/单位同时试常见写法:5万元 / 50000元、3000元 / 3千。
    • 两个 query 的 hits 按 citation 去重合并(不要按 path + line);优先保留同时命中两边的 chunk,再按分数取 topK。
    • 多词 query 返回 0 时不要放弃:kb_search 会自动 relaxation(按 token 逐词搜、去重合并),结果里的 relaxed: true / queries 会告诉你实际查了哪些词。
    • 如果 relaxation 后仍不足,最多再发 2 轮拆词/同义词(如 普通决议、特别决议、三分之二、过半数);禁止用 ls 逐目录翻找答案,目录列表只用于确认路径/找 .md 副本,不是检索手段。
    • 2 轮仍无证据就明确说“资料未提供/知识库没有找到”,不能无限换词,也不能凭记忆补答案。
  3. 这些查询优先(或并行)用 rg 在 /workspace/kb 视图内精确搜索:查询含 regex 元字符、引号字面量、反引号标识符、错误码、路径、file:line,或只有 1–2 个汉字。挂载隔离已保证 agent 只能看到自己的 view,普通 rg 就是权限内的,不需要额外封装安全工具。
  4. kb_search 0 结果、top score 偏低,或 snippet 不足以回答 → 用 rg 做精确/验证兜底。
  5. rg 命中很多(>30 行) → 回到 kb_search 收敛排序,或加 --glob / 更精确 pattern,不要直接读几十个文件。
  6. 引用只用 citation token:summary / sectionSummary / docSummary / relatedSections 都不是引用来源,只能用来决定“读哪一章”;每条 hit 都带 citation: kb://doc/<docId>/chunk/<key>(?terms= 只是查看器高亮提示)。回答里原样写 kb://doc/<docId>/chunk/<key> 这段(写成行内代码,省略 ?terms=/&highlight= 后缀),不要自己写 :193、第N块、path:line,也不要写 .docx.md/.xlsx.md/.pdf.md 这类派生路径。查看器会把 token 渲染成 文件名:第N块,点击会打开原文件并定位到该 chunk 的 bbox;正文只需要写条文号(如“第十五条”),位置交给 token。
  7. 看到 kb://doc/<docId>/chunk/<key> token,必须先调 kb_chunk_get:可以传 docId + chunkId,也可以直接传 citation: "kb://...";chunkId 支持数字 id 或 16 位 chunk_key。返回原文 path、quote、heading/paragraphText、sheet/cell、page/boxes、chunkOrdinal、snippet。禁止用 bash/sqlite3 查 .dataops、kb-index.sqlite 或任何内部索引来解析 token;工具不可用就明确说“当前无法解析该引用”,不要逆向内部存储。
  8. 需要核对原文时用通用 read 工具读 /workspace/kb/<view相对路径>(例:hit global/制度.md → read /workspace/kb/global/制度.md),但引用仍然用 hit 的 citation token;不要从 read 输出抄行号再拼 path:line。二进制文件用 ls -l / stat 看大小,不要用 read。
  9. 引用必须选“包含该 claim”的 chunk:引用前逐个核对 citation chunk 是否同时包含 claim 的实体、条款号/数字/单位;不得用同文档但不含该 claim 的相邻 chunk 凑引用。多个候选时选重叠最高且能覆盖 claim 的 chunk;没有任何 chunk 覆盖时,明确说“资料未提供”,不要编引用。PDF/扫描件的低 confidence 框带 approximate:true,回答里说明“近似定位”。
  10. 整题最多 3 轮检索(含 relaxation):仍无证据就明确说“知识库里没有找到”,不要凭记忆补答案。

Read the full file on GitHub · 232 lines

Files

What ships with it

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

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. 4d ago First seen · 232 lines · 100 tokens per session scan A c3f8e5cbdadb

Subscribe to this mod's changes

knowledge-base is a skill published in the GitHub repository SparkElf/deepseek-harness-plus (1 stars, last pushed today), licensed MIT. It adds 100 tokens to every session and 4,525 once invoked, about $0.0004 per session on Opus 5.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-11-26.

Related

knowledge-base compared with skills from other repositories

knowledge-base next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
knowledge-baseSparkElf/deepseek-harness-plusSkill1todayMITA100Claude Code, Codex
dsh-tui-guideccch1mneyyy/dsh-TUISkill8.4ktodayMITA41Claude Code, Codex
office-docxhuiliyi37/Tianshu-harnessSkill1.4k3d agoApache-2.0A50Claude Code, Codex
cash-flow-snapshotsandbaseai/sandbase-skillsSkill2137d agoApache-2.0A52Claude Code
excel-generatorsandbaseai/sandbase-skillsSkill2137d agoApache-2.0A46Claude Code
document-parsersandbaseai/sandbase-skillsSkill2137d agoApache-2.0A41Claude Code
write-docs-cnpingfanfan/hello-dshSkill1102mo agoMITA46Claude Code, Codex