npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ljskill-knowledge

v1.0.2

Published

将散落的 Markdown 笔记转化为结构化、可检索的知识 Wiki。支持六层模型(M1-M5 + P-index)提取、知识图谱构建、领域自动发现、Obsidian 兼容输出。

Readme

ljskill-knowledge

Wiki知识库构建skill,将散落的 Markdown 内容自动转化为结构化、可检索的Wiki知识库。

该知识库目前仅支持使用 Claude Code 构建,构建完成后可在 Claude Code、Codex、Cursor、Trae Solo 等任意 Agent 上使用。

支持obsidian检索查看,内置六层知识模型:

  • M1-M4 元模型:从文章中提取概念、方法、规则、场景
  • M5 知识卡片:每篇文章的结构化摘要
  • P-index 问题索引:支持"按问题检索"的知识入口

作者:抖音· 小红书· 视频号(老雷AI洞见);公众号(有个朋友叫雷军);微信(xxjun9527)

如何安装

Claude Code 安装方法:

方式一:进入Claude Code,输入一行命令(推荐)

npx skills add ljskill-knowledge

方式二:进入终端直接克隆git仓库

git clone https://github.com/xxjun9527/ljskill-knowledge.git ~/.claude/skills/ljskill-knowledge

方式三:直接把这段话发给你的Claude Code

帮我安装 ljskill-knowledge。请把 https://github.com/xxjun9527/ljskill-knowledge.git 克隆到 ~/.claude/skills/ljskill-knowledge,安装完成后检查 SKILL.md、assets/、references/ 是否存在。

如何更新

已经安装过的话,用这段话更新:

帮我更新 ljskill-knowledge,请进入 ~/.claude/skills/ljskill-knowledge 执行 git pull, 然后告诉我当前最新 commit。

如何使用

安装后在你的文件夹中新建raw目录,然后将要处理的内容复制过去,最后对 Claude 说:

首次构建

Claude 会自动引导你完成整个流程。

帮我用 ljskill-knowledge 构建知识库,Markdown 文件在 ./raw 目录

新增文章

Claude 会自动检测新增内容并更新。

我有新文章了,帮我更新

效果

obsidian 知识库效果

输入:

raw/
├── MVP验证.md
├── 深度工作.md
├── 内容钩子.md
└── ...

输出:

wiki/
├── index.md                    # MOC 主入口
├── knowledge-graph.md          # Mermaid 知识图谱
├── M1-概念/                    # 31 个核心概念
├── M2-方法/                    # 20 个方法流程
├── M3-规则/                    # 44 条原则规律
├── M4-场景/                    # 适用场景
├── M5-卡片/                    # 知识卡片
├── P-索引/                     # 47 个问题索引
├── 知识卡片/                   # YAML 卡片数据
└── 领域/                       # 领域索引页

用 Obsidian 打开 wiki/ 目录即可使用:

  • 双向链接自动关联
  • Mermaid 图谱可视化
  • 按领域/问题/层级多维度浏览

功能特性

  • 🧠 六层知识模型:M1-M4 元模型 + M5 卡片 + P-index 问题索引
  • 📊 知识图谱构建:节点关系图,连通率 90%+
  • 🏷️ 领域自动发现:智能识别内容领域,生成索引页
  • 🔗 Obsidian 兼容:双向链接、Mermaid 图谱、颜色分组
  • ⚡ 一键流水线:run_pipeline.py 全流程自动化
  • 🔄 增量更新:支持增量更新,包括知识图谱的增量构建
  • ✅ 质量验证:自动检测缺失字段、格式问题

六层知识模型

| 层级 | 名称 | 回答的问题 | 示例 | |------|------|-----------|------| | M1 | 概念 | 这是什么? | "MVP:最小可行产品,用最小功能集验证核心假设" | | M2 | 方法 | 怎么做? | "验证想法 → 最小成本测试 → 检查市场反应" | | M3 | 规则 | 什么规律? | "控制风险而非追逐风险——创业追求非对称交易" | | M4 | 场景 | 什么时候用? | "适用:创业初期、资金有限" | | M5 | 卡片 | 文章摘要 | 结构化知识卡片,含领域分类和质量评分 | | P-index | 问题索引 | 能回答什么? | "如何验证一个创业想法?" |

适合 / 不适合

✅ 适合:个人知识管理 / 第二大脑构建 / 文章笔记整理 / 主题研究归档

❌ 不适合:结构化程度很高的文档(如 API 文档)/ 需要实时协作的场景

环境要求

| 依赖 | 版本 | 安装方式 | |------|------|---------| | Python | 3.8+ | 系统自带或 pyenv | | PyYAML | - | pip3 install pyyaml | | Claude CLI | - | npm install -g @anthropic-ai/claude-cli |

高级用法(可选)

以下内容面向有技术基础的用户,普通用户可直接忽略。

常见命令

| 任务 | 命令 | |------|------| | 首次构建知识库 | python3 scripts/run_pipeline.py --config config.yaml | | 增量更新(只处理新文章) | python3 scripts/run_pipeline.py --resume --config config.yaml | | 从指定步骤继续 | python3 scripts/run_pipeline.py --step 5 --config config.yaml | | 预览不执行 | python3 scripts/run_pipeline.py --dry-run --config config.yaml | | 质量验证 | python3 scripts/validate_quality.py --config config.yaml |

增量更新

首次构建完成后,后续添加新文章时使用增量更新,只处理新增内容,速度更快:

# 使用流水线
python3 scripts/run_pipeline.py --resume --config config.yaml

# 分步执行
python3 scripts/scan_corpus.py --incremental --config config.yaml
python3 scripts/extract_m1m4.py --round 1 --incremental --config config.yaml
python3 scripts/extract_m1m4.py --direct --config config.yaml
python3 scripts/generate_cards.py --incremental --config config.yaml
python3 scripts/generate_p_index.py --incremental --config config.yaml
python3 scripts/generate_knowledge_graph.py --incremental --config config.yaml

增量原理:首次运行保存状态文件(wiki/_meta/graph-state.yaml),后续基于文件哈希对比,只处理新增或修改的节点。

强制全量重建

python3 scripts/generate_knowledge_graph.py --incremental --full --config config.yaml

使用流程

Skill 是结构化工作流,Agent 会逐步引导:

  1. 审计素材 — 检查文件数量、字数分布、空文件比例
  2. 扫描语料 — 生成 corpus-manifest.yaml
  3. 提取 M1-M4 — 从文章中提取概念、方法、规则、场景
  4. 生成知识卡片 — 每篇文章一张结构化卡片
  5. 构建问题索引 — 提取用户可能提出的问题
  6. 生成知识图谱 — 构建节点关系图
  7. 添加双向链接 — wiki-link 关联
  8. 生成领域页面 — 按主题聚合
  9. 质量验证 — 检查完整性和格式

详细说明见 SKILL.md。

目录结构

ljskill-knowledge/
├── SKILL.md              # Skill 主文件:工作流、原则、常见错误
├── README.md             # 本文件
├── LICENSE               # 开源许可证(CC-BY-NC-4.0)
├── VERSION               # 版本号
├── scripts/              # 核心脚本
│   ├── run_pipeline.py       # 一键流水线
│   ├── extract_m1m4.py       # M1-M4 提取
│   ├── generate_cards.py     # 知识卡片生成
│   ├── generate_p_index.py   # 问题索引提取
│   ├── generate_knowledge_graph.py  # 知识图谱(支持增量更新)
│   ├── validate_quality.py   # 质量验证
│   └── ...
├── references/           # 参考文档
│   ├── five-layer-model.md   # 六层模型说明
│   └── troubleshooting.md    # 问题排查
└── assets/               # 资源文件
    ├── demo-articles/        # 示例文章
    └── config-template.yaml  # 配置模板

核心设计原则

  1. AI 全托管 — 用户只需要回答两个问题:素材在哪、叫什么名字
  2. 质量优先 — 每个步骤都有质量检查,不达标准就暂停
  3. 结构化输出 — 六层模型确保知识可检索、可关联
  4. 增量友好 — 支持断点续跑和增量更新
  5. Obsidian 原生 — 输出即用,不需要二次处理

设计参考

  • Niklas Luhmann 的卡片盒笔记法
  • Obsidian 知识图谱
  • Zettelkasten 方法论
  • Andrej Karpathy(卡帕西) Wiki 知识库
  • 人月聊IT Wiki 知识库

FAQ

需要多少文章才能构建? 建议至少 10 篇,1000 字以上/篇。太少会影响领域发现和知识关联。

支持中文吗? 完全支持,概念命名和问题提取都针对中文优化。

能处理已有的 Obsidian 库吗? 可以。把 source_dir 指向你的 Obsidian 文件夹即可,不会修改原文件。

怎么更新到最新版? 在 skill 目录执行 git pull。

P-index 问题索引是什么? 从知识卡片中自动提取用户可能提出的问题,关联到 M1-M4 知识节点。让知识库支持"按问题检索"。

License

本项目采用 CC BY-NC 4.0 许可证。

| 使用场景 | 要求 | |---------|------| | 个人使用、学习、研究、非商业项目 | 不需要署名,不需要申请 | | 公开发布衍生作品(文章、工具、课程等) | 请注明来源 | | 商业用途 | 需要单独授权,请联系作者 |