ka-style-kb-rules

Personal LLM-Wiki knowledge-base management standard: distilled from Ka personal v2 practice and the 'use-then-distill' methodology. Includes a 4-layer architecture, 4-segment wiki format, 6 hard rules, 4 workflows, 5 standard commands, an error-code lint, and a SKILL practical distillation process. First-use includes three questions (path/rules/scope). Managed via a zero-dependency single script. Suitable for KB management, distillation, and calibration.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "ka-style-kb-rules" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-ce8a32eba4217ed1284fe84a90b8f4710bf8f6ca4f27062991aa305796c2bde9. Verify the upstream source and version against https://skillhub.cn/skills/user_35ba0b94/ka-style-kb-rules before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Personal LLM-Wiki knowledge-base management standard: distilled from Ka personal v2 practice and the 'use-then-distill' methodology. Includes a 4-layer architecture, 4-segment wiki format, 6 hard rules, 4 workflows, 5 standard commands, an error-code lint, and a SKILL practical distillation process. First-use includes three questions (path/rules/scope). Managed via a zero-dependency single script. Suitable for KB management, distillation, and calibration.

0 Downloads

Introduction source: third_party · user_35ba0b94 · 0.4.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Inputs and outputs
python3 lint_kb.py --json > lint.json
Software, accounts and paid services
KB_ROOT=~/Notes python3 lint_kb.py
Limits and differences
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: ka-style-kb-rules
description: 个人 LLM-Wiki 知识库通用管理规范(v0.2,蒸馏自 Ka 个人 v2 实践)。基于 Karpathy LLM-Wiki 理念,但做了 4 项关键差异化:①首次使用三问引导(路径/规则/范围),避免硬编码降低门槛;②零依赖单脚本 + 通用路径参数(--root / KB_ROOT),适配 OB/Logseq/VSCode 任何 KB;③通用敏感文件保护(不绑定具体文件名);④5 个标准命令(/lint /compile /query /ingest /health),命令协议化。提供 4 大工作流(Ingest/Compile/Query/Lint)+ 6 大红线 + 4 段式 wiki 模板 + 错误码体系 lint(E001-E009/W001-W009/I001-I009),4 项检查(根目录残留/死链/重复/命名规范)。Use when user says '管知识库 / 整理 wiki / 写一条日记 / 导入到 KB / KB 健康检查 / KB lint / 查 KB 里的 X / LLM Wiki / Karpathy Wiki / 第二大脑'。NOT a team collaboration tool (designed for single-user personal KB).
slug: ka-style-kb-rules
displayName: Ka 式知识管理规范
version: 0.4.0
summary: 个人 LLM-Wiki 知识库通用管理规范——蒸馏自 Ka 个人 v2 实践 + "先用后蒸馏"方法论。4 层架构 + 4 段式 wiki + 6 大红线 + 4 大工作流 + 5 个标准命令 + 错误码体系 lint + SKILL 实战蒸馏流程。首次使用三问(路径/规则/范围)。零依赖单脚本。Use when user says '管知识库 / 整理 wiki / 写一条日记 / 导入到 KB / KB 健康检查 / KB lint / 查 KB 里的 X / LLM Wiki / 蒸馏 SKILL / SKILL 实战校准'.
license: MIT
platforms:
- linux
- macos
- windows
display_name: Ka 式知识管理规范
metadata:
  hermes:
    tags:
    - knowledge-base
    - llm-wiki
    - pkm
    - obsidian
    - rules
    - lint
    - personal-kb
    - methodology
    - second-brain
    - karpathy
    related_skills:
    - obsidian
    - file-archive
    - ob-knowledge-base-rules

Ka 式知识管理规范

蒸馏自 Ka 个人实践(基于 RULES.MD 长期维护经验), 同时融合 Karpathy 2025.11 公开推荐的 LLM Wiki 方法论。 适用于任何"想用 LLM 辅助管理个人知识库"的人。 零工具绑定(OB / Logseq / VSCode / 纯 md 通用)。 v0.4 通用版说明:本版本清理了 v0.3 本地版的个人记录(具体日期戳),仅保留规则/方法/命令/脚本示例。本地完整版见 ~/.hermes/skills/ka-style-kb-rules/SKILL.md。

🎯 为什么需要这个 Skill?

痛点 现状 Ka 式方案
1 年后素材命名看不懂 文件名五花八门 强制 YYYY-MM-DD-来源简称-核心标题
写完就吃灰,无法实现知识复利 "信息墓地" Ingest/Compile 工作流 + 4 段式 wiki
死链/重复/命名问题积累 没人维护 错误码体系 lint(4 项自动检查)
AI 误操作 KB 缺乏约束 6 大红线 + 通用敏感文件保护
首次使用不知道从哪开始 工具太复杂 三问引导(路径/规则/范围)

🔄 "先用后蒸馏"开发方法论(v0.3 新增)

核心教训(来自实际跑通 yunjian-zhiyi SKILL 后蒸馏的经验): SKILL.md 不是设计稿,是实战后的压缩。 先把 SKILL 跑通,记录痛点,再蒸馏回 SKILL.md。

传统流程(设计驱动,写完才用):

设计 SKILL.md → 发布到 skillhub → 用户用 → 发现问题 → 改 SKILL.md
❌ 痛点:SKILL.md 写的"理想体验",真实使用大概率跑偏

Ka 式流程(实战驱动,先跑后写):

设计 v0 草稿 → 自己先用 1-2 周记录问题 → 基于真实数据蒸馏 v1 → 发布
✅ 好处:每个字都有真实使用背书,AI 评审的 "R 可靠性" 高

实操模板(基于 yunjian-zhiyi 实战)

阶段 时间 做什么 产出
1. 跑通 第 1-2 周 每天手动用 SKILL,记录痛点(每天 1 分钟) 痛点清单(5-10 条)
2. 萃取 第 3 周 痛点 → 反推 SKILL 哪些场景真用、哪些是伪需求 场景优先级表
3. 蒸馏 第 4 周 重写 SKILL.md + 加 scripts(基于真实数据) v1.0
4. 发布 第 4 周末 skillhub publish + 提交 AI 技能大赛 公开版

痛点记录表(建议放 KB 内)

## 2026-XX-XX 用 [SKILL 名] 记录

### 用了哪个场景?场景 1 / 2 / 3 / ...
### 体验分(1-5):___ 分
### 哪里卡住 / 不爽?(一句话)
### 有没有"我以为会 X,结果 Y"的情况?
### 想改的地方?(具体说)

为什么这个方法有效:

  1. AI 评审扣 R 可靠性的主因是"看起来像设计稿"——实战后蒸馏能彻底规避
  2. 实战中发现的高频场景比设计时的"想要场景"真实 10 倍
  3. 自己用过的 SKILL 才写得"有人味",不是"AI 味"

🆚 LLM Wiki vs RAG(核心定位)

来自 Astro-Han/karpathy-llm-wiki(1232⭐)的对比框架。

维度 RAG LLM Wiki(Ka 式)
知识存储 向量库(碎片) 编译后的 Markdown(结构化)
综合时机 查询时(一次性) 摄入时(持续积累)
知识形态 临时片段 复利资产
检索方式 相似度 双向链接 + 结构化字段
适合 临时问题 长期知识资产
一致性 易矛盾 强一致(4 段式 + Frontmatter)

我们的核心定位:不是 RAG 替代品,是长期复利资产的构建规范。

🎬 首次使用 — 三问

首次加载此 skill 时,AI 必须问 3 个问题确定上下文。后续使用可跳过(已在 session 上下文中确认过)。

Q1:知识库根路径?

兜底默认:~/Documents/ObsidianVault/

Q2:是否有"入口规则文件"?

用户情况 AI 行为
有(RULES.MD / KB-RULES.md / config/RULES.md) 先读该文件作为权威(严格遵守)
没有 询问:"要不要我帮你生成一份通用规则?或沿用本 skill 自带的 4 层架构?"

⚠️ 读取规则文件时,绝不能读任何标记为"敏感"的文件(账号、密码、API Key 等),即使在 KB 根目录下。

Q3:本次操作范围?

选项 触发词 AI 行为
Ingest 导入 "导入这篇"/"把 X 加到 KB" 按命名规范入 raw
Compile 编译 "整理 KB"/"编译 wiki" 全局聚合 → 4 段式重排
Query 查询 "查 KB 里的 X" 只读 wiki
Lint 自检 "KB 健康检查"/"KB lint" 跑 scripts/lint_kb.py

🏛 4 层架构

<KB_ROOT>/
├── raw/      # 原始素材(按来源分类,永久只读)
├── wiki/     # 编译后结构化知识(对外唯一权威)
├── index/    # 极简主索引(仅 INDEX-MAIN.md)
└── config/   # 规则层 + LINT-REPORT.md
层 作用 AI 操作权限
raw/ 原始素材、事实溯源底库 ⚠️ 只读(禁止修改/删除/重命名)
wiki/ 结构化知识、对外权威 ✅ 可写(按 4 段式 + Frontmatter)
index/ 极简主索引 ✅ 可改 INDEX-MAIN.md
config/ 规则层 ⚠️ 只读规则文件;❌ 绝不读任何敏感文件

📛 raw 强制命名规范

格式:YYYY-MM-DD-来源简称-核心标题.后缀

来源简写字典:note / web / pdf / chat / book / diary(核心标题可放松) / work / news

示例:

  • ✅ <YYYY-MM-DD>-note-<核心标题>.md
  • ✅ <YYYY-MM-DD>-diary-<一句话标题>.md
  • ❌ <核心标题>.md(无日期裸文件)
  • ❌ <YYYY>/<MM>/<DD>/<标题>.md(目录化)

二进制文件(PDF/PPT/图片):必须同名 .md 摘要文件。

📐 wiki 强制 4 段式 + Frontmatter

Frontmatter 模板

---
title: 页面标题
type: concept/terminology/practice
updated_at: YYYY-MM-DD
tags: []
backlinks: []
---

4 段式正文

  1. 核心定义 — 是什么
  2. 核心原理/关键要点 — 怎么运作
  3. 个人理解&落地经验 — 你的实践
  4. 关联知识双向链接 — [[页面名]] 双向引用

🔄 4 大工作流

工作流 触发 关键动作
Ingest 导入 "导入 X" 按命名规范命名;PDF/PPT/图片必须同名 .md 摘要
Compile 编译 "整理 KB" 全局聚合 raw → 去重 → 4 段式重排 → 维护双向链 → 同步 INDEX-MAIN
Query 查询 "查 X" 只读 wiki(不直接拼 raw)
Lint 自检 "健康检查" 跑 scripts/lint_kb.py 4 项检查

🚫 6 大红线(绝对禁止)

  1. ❌ 无 raw 溯源依据,随意推翻已有稳定知识结论
  2. ❌ 大面积删除个人历史沉淀的理解内容
  3. ❌ 随意更改 wiki 统一页面结构与排版风格
  4. ❌ AI 自由发散编造无依据的新增观点
  5. ❌ AI 自动重命名或移动 raw 层文件(命名问题只报告,由用户手工处理)
  6. ❌ 在 KB 根目录写入任何文件(必须用完整子目录路径)

🔒 通用安全约束

  • 敏感文件:AI 绝不能读取或写入任何标记为敏感的配置文件(账号、密码、API Key、个人隐私等),即使它们在 KB 目录内。
  • lint 报告:单文件机制(LINT-REPORT.MD),每次自检后覆盖更新。
  • 根目录禁写:任何 write_to_file 操作必须用完整子目录路径。

🧹 收尾规范(每次操作 KB 的固定步骤)

  1. 检查 KB 根目录是否有非目录的 .md 文件 → 如有且为空则删除
  2. 验证所有 wiki 页面 Frontmatter 完整性(title/type/updated_at/tags/backlinks)
  3. 确认 INDEX-MAIN.MD 与实际页面一致
  4. 输出本次执行报告

🛠 5 个标准命令(命令协议化)

学 memex(skillhub v1.0.0)+ Obsidian-Cursor 实践。把 4 大工作流协议化为可命令行触发。

命令 用途 对应工作流
/ingest <source> 把素材入 raw + 摘要 Ingest
/compile 全局聚合 raw → wiki Compile
/query <keyword> 只读 wiki 检索 Query
/lint [--level X] [--json] 跑 4 项检查 Lint
/health 综合健康报告(聚合 lint + 索引 + 最近改动) Lint 扩展

AI 收到上述命令时,自动加载本 skill 并执行对应工作流**——无需额外确认。

🛠 自带工具 — scripts/lint_kb.py v0.2

# 默认路径
python3 ~/.hermes/skills/ka-style-kb-rules/scripts/lint_kb.py

# 自定义路径
python3 lint_kb.py --root ~/Notes

# 错误码体系(学 tavian-dev/mdlint)
# E001-E009  error    必须修复
# W001-W009  warning  建议修复
# I001-I009  info     可选优化

# 按级别过滤
python3 lint_kb.py --level error      # 只看 error
python3 lint_kb.py --level warning    # 看 warning + error
python3 lint_kb.py --level info       # 全部(默认)

# JSON 输出(CI 友好)
python3 lint_kb.py --json > lint.json

# 环境变量
KB_ROOT=~/Notes python3 lint_kb.py

# 其他
python3 lint_kb.py --no-color         # 关闭颜色
python3 lint_kb.py --no-report        # 不写 LINT-REPORT.MD

错误码体系(v0.2 新增)

错误码 级别 含义
E001 error 无法读取文件
E002 error KB 根目录不存在
E003 error wiki/ 目录不存在
W001 warning 空文件
W002 warning Wiki 死链([[xxx]] 目标不存在)
W003 warning Wiki 重复 H1 标题
W004 warning Frontmatter 缺失/缺字段
W005 warning raw 命名不规范
I001 info 根目录残留 .md 文件
I002 info 孤岛页(无入链)

退出码:0 = 无 error;1 = 有 error(warning/info 不影响退出码)

🔄 与个人版的区别

维度 个人版 (ob-knowledge-base-rules) 本通用版 (ka-style-kb-rules)
路径 硬编码 OB 通用 KB_ROOT
入口规则 假设读 RULES.MD 首次询问
敏感文件 明确"绝不读" 通用化为"绝不读任何敏感文件"
lint 4 项 + 简单输出 8 错误码 + 3 级别 + JSON + 退出码
触发 显式 显式 + 首次三问
命令 4 大工作流 5 个标准命令(命令协议化)

🆚 与竞品差异化(查重结论)

基于 GitHub 12 个直接对标项目 + skillhub 8 个 LLM-Wiki / PKM 类 SKILL 查重。

竞品 关联 我们差异化
Astro-Han/karpathy-llm-wiki(1232⭐) 同名同源 我们三问引导 + 零依赖单脚本
Hosuke/llmbase(41⭐,Ingest/Compile/Query) 工作流同名 我们多 Lint + 错误码体系 + 通用跨工具
AgriciDaniel/claude-obsidian(7883⭐) "Self-organizing second brain" 我们不绑 Claude Code + 中文优先 + 5 个命令协议
tavian-dev/mdlint 错误码 + JSON 输出 我们学它 + 加 KB 路径参数 + 4 项检查更全
kytmanov/obsidian-llm-wiki-local Local-first 我们零依赖(不需 Ollama)+ 跨工具
skillhub llm-wiki / memex 类似定位 我们首次三问降低门槛 + 通用敏感文件保护

📦 版本规划

  • v0.1:SKILL.md + scripts/lint_kb.py(已发布)✅
  • v0.2:错误码体系 + --level + --json + 5 标准命令 + 差异化声明
  • v0.3(本地版):「先用后蒸馏」开发方法论 + SKILL 实战蒸馏流程(本地完整版,含个人实战记录)
  • v0.4(当前通用版):清理 v0.3 本地版的个人记录(具体日期戳),仅保留规则/方法/命令/脚本示例
  • v0.5:加 scripts/save_raw.py(按命名规范自动写 raw)+ references/通用规则模板.md
  • v0.6:加 scripts/compile_wiki.py(自动 Compile 工作流)
  • v1.0:多 KB 支持(一次管理多个 vault)+ 团队版接口

通用版与本地版的区别:通用版仅保留规则/方法/命令/脚本示例。本地完整版(含个人实战记录、实战日期戳)见 ~/.hermes/skills/ka-style-kb-rules/SKILL.md。

Current listing version

0.4.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供完整的个人知识库管理方法论,解决命名混乱、死链、重复等实际问题
  • 4层架构+4大工作流+5个标准命令形成完整闭环
  • 错误码体系(E001-E009/W001-W009/I001-I009)提升维护效率
Trigger Precision95/100

Highlights

  • 触发词覆盖全面且边界清晰,包含10+种使用场景
  • 首次三问引导机制有效降低使用门槛
  • 命令协议化(/ingest /compile /query /lint /health)提升触发准确性
Structure and Standards90/100

Areas to improve

  • 缺少When to Use独立章节 Reported severity: Minor

    使用场景描述已融入description字段,但未单独设立When to Use章节

    Recommendation: 建议增加独立的When to Use章节,更清晰展示适用场景

  • 文档长度较长 Reported severity: Minor

    SKILL.md约450行,内容详尽但略显冗长

    Recommendation: 可考虑将部分详细说明移至references目录下的补充文档

Highlights

  • 4层架构设计清晰(raw/wiki/index/config)
  • 6大红线+安全约束形成完整防护体系
  • 提供完整的Frontmatter模板和命名规范示例
Execution Reliability90/100

Highlights

  • scripts/lint_kb.py提供完整的错误码体系和异常处理
  • raw层只读保护+敏感文件保护机制完善
  • 支持JSON输出和退出码,便于CI集成
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

KB_ROOT=~/Notes python3 lint_kb.py

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.