@biaoo/tiangong-wiki 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +167 -0
- package/README.zh-CN.md +167 -0
- package/SKILL.md +116 -0
- package/agents/openai.yaml +4 -0
- package/assets/config.example.env +18 -0
- package/assets/templates/achievement.md +32 -0
- package/assets/templates/bridge.md +33 -0
- package/assets/templates/concept.md +47 -0
- package/assets/templates/faq.md +31 -0
- package/assets/templates/lesson.md +31 -0
- package/assets/templates/method.md +31 -0
- package/assets/templates/misconception.md +35 -0
- package/assets/templates/person.md +31 -0
- package/assets/templates/research-note.md +34 -0
- package/assets/templates/resume.md +34 -0
- package/assets/templates/source-summary.md +35 -0
- package/assets/vllm/qwen3_5_openai_developer.jinja +182 -0
- package/assets/wiki.config.default.json +193 -0
- package/dist/commands/check-config.js +77 -0
- package/dist/commands/create.js +32 -0
- package/dist/commands/daemon.js +186 -0
- package/dist/commands/dashboard.js +112 -0
- package/dist/commands/doctor.js +22 -0
- package/dist/commands/export-graph.js +28 -0
- package/dist/commands/export-index.js +31 -0
- package/dist/commands/find.js +36 -0
- package/dist/commands/fts.js +32 -0
- package/dist/commands/graph.js +35 -0
- package/dist/commands/init.js +48 -0
- package/dist/commands/lint.js +35 -0
- package/dist/commands/list.js +28 -0
- package/dist/commands/page-info.js +24 -0
- package/dist/commands/search.js +32 -0
- package/dist/commands/setup.js +15 -0
- package/dist/commands/stat.js +20 -0
- package/dist/commands/sync.js +38 -0
- package/dist/commands/template.js +71 -0
- package/dist/commands/type.js +88 -0
- package/dist/commands/vault.js +64 -0
- package/dist/core/agent.js +201 -0
- package/dist/core/cli-env.js +129 -0
- package/dist/core/codex-workflow.js +233 -0
- package/dist/core/config.js +126 -0
- package/dist/core/db.js +292 -0
- package/dist/core/embedding.js +104 -0
- package/dist/core/frontmatter.js +287 -0
- package/dist/core/indexer.js +241 -0
- package/dist/core/onboarding.js +967 -0
- package/dist/core/page-files.js +91 -0
- package/dist/core/paths.js +161 -0
- package/dist/core/presenters.js +23 -0
- package/dist/core/query.js +58 -0
- package/dist/core/runtime.js +20 -0
- package/dist/core/sync.js +235 -0
- package/dist/core/synology.js +412 -0
- package/dist/core/template-evolution.js +38 -0
- package/dist/core/vault-processing.js +742 -0
- package/dist/core/vault.js +594 -0
- package/dist/core/workflow-context.js +188 -0
- package/dist/core/workflow-result.js +162 -0
- package/dist/core/workspace-bootstrap.js +30 -0
- package/dist/core/workspace-skills.js +220 -0
- package/dist/daemon/client.js +147 -0
- package/dist/daemon/server.js +807 -0
- package/dist/daemon/state.js +53 -0
- package/dist/dashboard/assets/index-1FgAUZ28.css +1 -0
- package/dist/dashboard/assets/index-6A0PWT4X.js +154 -0
- package/dist/dashboard/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
- package/dist/dashboard/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
- package/dist/dashboard/assets/jetbrains-mono-cyrillic-500-normal-DJqRU3vO.woff +0 -0
- package/dist/dashboard/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
- package/dist/dashboard/assets/jetbrains-mono-cyrillic-700-normal-BWTpRfYl.woff2 +0 -0
- package/dist/dashboard/assets/jetbrains-mono-cyrillic-700-normal-CEoEElIJ.woff +0 -0
- package/dist/dashboard/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
- package/dist/dashboard/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
- package/dist/dashboard/assets/jetbrains-mono-greek-500-normal-D7SFKleX.woff +0 -0
- package/dist/dashboard/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
- package/dist/dashboard/assets/jetbrains-mono-greek-700-normal-C6CZE3T8.woff2 +0 -0
- package/dist/dashboard/assets/jetbrains-mono-greek-700-normal-DEigVDxa.woff +0 -0
- package/dist/dashboard/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/dist/dashboard/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/dist/dashboard/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/dist/dashboard/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/dist/dashboard/assets/jetbrains-mono-latin-700-normal-BYuf6tUa.woff2 +0 -0
- package/dist/dashboard/assets/jetbrains-mono-latin-700-normal-D3wTyLJW.woff +0 -0
- package/dist/dashboard/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- package/dist/dashboard/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
- package/dist/dashboard/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
- package/dist/dashboard/assets/jetbrains-mono-latin-ext-500-normal-ckzbgY84.woff +0 -0
- package/dist/dashboard/assets/jetbrains-mono-latin-ext-700-normal-CZipNAKV.woff2 +0 -0
- package/dist/dashboard/assets/jetbrains-mono-latin-ext-700-normal-CxPITLHs.woff +0 -0
- package/dist/dashboard/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
- package/dist/dashboard/assets/jetbrains-mono-vietnamese-500-normal-DNRqzVM1.woff +0 -0
- package/dist/dashboard/assets/jetbrains-mono-vietnamese-700-normal-BDLVIk2r.woff +0 -0
- package/dist/dashboard/assets/space-grotesk-latin-400-normal-BnQMeOim.woff +0 -0
- package/dist/dashboard/assets/space-grotesk-latin-400-normal-CJ-V5oYT.woff2 +0 -0
- package/dist/dashboard/assets/space-grotesk-latin-500-normal-CNSSEhBt.woff +0 -0
- package/dist/dashboard/assets/space-grotesk-latin-500-normal-lFbtlQH6.woff2 +0 -0
- package/dist/dashboard/assets/space-grotesk-latin-700-normal-CwsQ-cCU.woff +0 -0
- package/dist/dashboard/assets/space-grotesk-latin-700-normal-RjhwGPKo.woff2 +0 -0
- package/dist/dashboard/assets/space-grotesk-latin-ext-400-normal-CfP_5XZW.woff2 +0 -0
- package/dist/dashboard/assets/space-grotesk-latin-ext-400-normal-DRPE3kg4.woff +0 -0
- package/dist/dashboard/assets/space-grotesk-latin-ext-500-normal-3dgZTiw9.woff +0 -0
- package/dist/dashboard/assets/space-grotesk-latin-ext-500-normal-DUe3BAxM.woff2 +0 -0
- package/dist/dashboard/assets/space-grotesk-latin-ext-700-normal-BQnZhY3m.woff2 +0 -0
- package/dist/dashboard/assets/space-grotesk-latin-ext-700-normal-HVCqSBdx.woff +0 -0
- package/dist/dashboard/assets/space-grotesk-vietnamese-400-normal-B7xT_GF5.woff2 +0 -0
- package/dist/dashboard/assets/space-grotesk-vietnamese-400-normal-BIWiOVfw.woff +0 -0
- package/dist/dashboard/assets/space-grotesk-vietnamese-500-normal-BTqKIpxg.woff +0 -0
- package/dist/dashboard/assets/space-grotesk-vietnamese-500-normal-BmEvtly_.woff2 +0 -0
- package/dist/dashboard/assets/space-grotesk-vietnamese-700-normal-DMty7AZE.woff2 +0 -0
- package/dist/dashboard/assets/space-grotesk-vietnamese-700-normal-Duxec5Rn.woff +0 -0
- package/dist/dashboard/index.html +18 -0
- package/dist/index.js +86 -0
- package/dist/operations/dashboard.js +1231 -0
- package/dist/operations/export.js +110 -0
- package/dist/operations/query.js +649 -0
- package/dist/operations/type-template.js +210 -0
- package/dist/operations/write.js +143 -0
- package/dist/types/config.js +1 -0
- package/dist/types/page.js +1 -0
- package/dist/utils/case.js +22 -0
- package/dist/utils/errors.js +26 -0
- package/dist/utils/fs.js +77 -0
- package/dist/utils/output.js +33 -0
- package/dist/utils/process.js +60 -0
- package/dist/utils/segmenter.js +24 -0
- package/dist/utils/slug.js +10 -0
- package/dist/utils/time.js +24 -0
- package/package.json +64 -0
- package/references/cli-interface.md +312 -0
- package/references/env.md +122 -0
- package/references/template-design-guide.md +271 -0
- package/references/vault-to-wiki-instruction.md +110 -0
- package/references/wiki-maintenance-instruction.md +190 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Biao
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# @biaoo/tiangong-wiki
|
|
2
|
+
|
|
3
|
+
[中文](./README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
> Inspired by Karpathy's [LLM Wiki](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) — instead of re-deriving answers from raw documents on every query (like RAG), the LLM **builds and maintains a persistent wiki** that compounds over time.
|
|
6
|
+
|
|
7
|
+
`@biaoo/tiangong-wiki` is the infrastructure for this pattern: a CLI that turns a directory of Markdown files into a queryable knowledge base with full-text search, semantic search, knowledge graph, and an interactive dashboard.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
| | |
|
|
12
|
+
|---|---|
|
|
13
|
+
| **Knowledge that compounds** | Every source and every question makes the wiki richer — compiled once, kept current |
|
|
14
|
+
| **Your files, your data** | Plain Markdown you own; no cloud, no database server, no lock-in |
|
|
15
|
+
| **Find anything** | Metadata filters, keyword search, and semantic search in one CLI |
|
|
16
|
+
| **See connections** | Relationships auto-extracted into a navigable knowledge graph |
|
|
17
|
+
| **Ingest raw materials** | Drop files into a vault; AI reads and converts them to structured pages |
|
|
18
|
+
| **AI-agent native** | Ships as a [Codex / Claude Code skill](./SKILL.md) for autonomous knowledge work |
|
|
19
|
+
| **Visual dashboard** | Browse the graph, inspect pages, and search from a web UI |
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install -g @biaoo/tiangong-wiki
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
<details>
|
|
28
|
+
<summary><strong>Use as an AI Agent Skill</strong></summary>
|
|
29
|
+
|
|
30
|
+
After installing the npm package, register it with your agent:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx skills add Biaoo/tiangong-wiki -a codex # Codex
|
|
34
|
+
npx skills add Biaoo/tiangong-wiki -a claude-code # Claude Code
|
|
35
|
+
npx skills add Biaoo/tiangong-wiki -a codex -g # Global (cross-project)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Or let the setup wizard handle everything:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
tiangong-wiki setup
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
</details>
|
|
45
|
+
|
|
46
|
+
## Quick Start
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
tiangong-wiki setup # interactive config wizard
|
|
50
|
+
tiangong-wiki doctor # verify configuration
|
|
51
|
+
tiangong-wiki init # initialize workspace
|
|
52
|
+
tiangong-wiki sync # index Markdown pages
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
tiangong-wiki find --type concept --status active # structured query
|
|
57
|
+
tiangong-wiki fts "Bayesian" # full-text search
|
|
58
|
+
tiangong-wiki search "convergence conditions" # semantic search
|
|
59
|
+
tiangong-wiki graph bayes-theorem --depth 2 # graph traversal
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
tiangong-wiki daemon run # start dashboard & HTTP API
|
|
64
|
+
tiangong-wiki dashboard # open dashboard in browser
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
> Environment variables are managed via `.wiki.env` (created by `tiangong-wiki setup`). See [references/env.md](./references/env.md) for the full reference.
|
|
68
|
+
|
|
69
|
+
## CLI
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
Setup setup · doctor · check-config
|
|
73
|
+
Indexing init · sync
|
|
74
|
+
Query find · fts · search · graph
|
|
75
|
+
Inspect list · page-info · stat · lint
|
|
76
|
+
Create create · template · type
|
|
77
|
+
Vault vault list | diff | queue
|
|
78
|
+
Export export-graph · export-index
|
|
79
|
+
Daemon daemon run | start | stop | status
|
|
80
|
+
Dashboard dashboard
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
See [references/cli-interface.md](./references/cli-interface.md) for the full command reference.
|
|
84
|
+
|
|
85
|
+
## Architecture
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
┌──────────────────────────────────────────────────────────┐
|
|
89
|
+
│ Vault (raw input) │
|
|
90
|
+
│ PDFs, docs, notes, bookmarks, clippings │
|
|
91
|
+
└────────────────────────┬─────────────────────────────────┘
|
|
92
|
+
│ vault diff / vault queue
|
|
93
|
+
▼
|
|
94
|
+
┌──────────────────────────────────────────────────────────┐
|
|
95
|
+
│ Agentic Workflow (Codex SDK) │
|
|
96
|
+
│ │
|
|
97
|
+
│ ┌─────────┐ read ┌────────────┐ discover ┌─────┐ │
|
|
98
|
+
│ │ Parser │ ──────► │ tiangong-wiki-skill │ ────────► │ LLM │ │
|
|
99
|
+
│ │ Skills │ source │ find / fts │ + decide │ │ │
|
|
100
|
+
│ └─────────┘ └────────────┘ └─────┘ │
|
|
101
|
+
│ pdf · docx · pptx │
|
|
102
|
+
│ │
|
|
103
|
+
│ → skip / create page / update page / propose only │
|
|
104
|
+
└────────────────────────┬─────────────────────────────────┘
|
|
105
|
+
│ write pages
|
|
106
|
+
▼
|
|
107
|
+
┌──────────────────────────────────────────────────────────┐
|
|
108
|
+
│ Markdown Pages (SSOT) │
|
|
109
|
+
│ wiki/pages/**/*.md │
|
|
110
|
+
└────────────────────────┬─────────────────────────────────┘
|
|
111
|
+
│ tiangong-wiki sync
|
|
112
|
+
▼
|
|
113
|
+
┌──────────────────────────────────────────────────────────┐
|
|
114
|
+
│ SQLite Index (index.db) │
|
|
115
|
+
│ │
|
|
116
|
+
│ pages structured metadata (dynamic columns) │
|
|
117
|
+
│ pages_fts FTS5 full-text search │
|
|
118
|
+
│ vec_pages sqlite-vec vector embeddings │
|
|
119
|
+
│ edges knowledge graph (source → target) │
|
|
120
|
+
└──┬───────────┬───────────┬───────────┬───────────────────┘
|
|
121
|
+
│ │ │ │
|
|
122
|
+
▼ ▼ ▼ ▼
|
|
123
|
+
find fts search graph
|
|
124
|
+
│ │ │ │
|
|
125
|
+
└───────────┴───────────┴───────────┘
|
|
126
|
+
│
|
|
127
|
+
▼
|
|
128
|
+
JSON stdout / HTTP daemon
|
|
129
|
+
│
|
|
130
|
+
┌────────────┴────────────┐
|
|
131
|
+
▼ ▼
|
|
132
|
+
CLI / Scripts Web Dashboard
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Vault → Pages** — Raw materials land in the vault. An agentic workflow reads each file, discovers the current ontology via `tiangong-wiki type list / find / fts`, and decides whether to skip, create, or update a page.
|
|
136
|
+
|
|
137
|
+
**Dual engine** — Markdown files are the source of truth. SQLite is a derived index rebuilt by `tiangong-wiki sync`, enabling queries that plain files cannot support.
|
|
138
|
+
|
|
139
|
+
**Flexible schema** — Three-tier column model (fixed, deploy-level, template-level) with automatic `ALTER TABLE` on config changes.
|
|
140
|
+
|
|
141
|
+
## Tech Stack
|
|
142
|
+
|
|
143
|
+
| | |
|
|
144
|
+
|---|---|
|
|
145
|
+
| Language | TypeScript (ESM) |
|
|
146
|
+
| Runtime | Node.js >= 18 |
|
|
147
|
+
| CLI | [Commander.js](https://github.com/tj/commander.js) |
|
|
148
|
+
| Database | [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) + [sqlite-vec](https://github.com/asg017/sqlite-vec) |
|
|
149
|
+
| Dashboard | [Preact](https://preactjs.com/) + [G6](https://g6.antv.antgroup.com/) |
|
|
150
|
+
| Build | [Vite](https://vite.dev/) |
|
|
151
|
+
| Test | [Vitest](https://vitest.dev/) |
|
|
152
|
+
|
|
153
|
+
## Development
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
git clone https://github.com/Biaoo/tiangong-wiki.git
|
|
157
|
+
cd tiangong-wiki
|
|
158
|
+
npm install && npm run build
|
|
159
|
+
|
|
160
|
+
npm run dev -- --help # CLI from source
|
|
161
|
+
npm run dev:dashboard # dashboard dev server
|
|
162
|
+
npm test # run tests
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Contributing
|
|
166
|
+
|
|
167
|
+
Issues and pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# @biaoo/tiangong-wiki
|
|
2
|
+
|
|
3
|
+
[English](./README.md)
|
|
4
|
+
|
|
5
|
+
> 受 Karpathy 的 [LLM Wiki](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) 启发 —— 不再像 RAG 那样每次从原始文档重新推导答案,而是让 LLM **构建并维护一个持久化的 wiki**,知识随使用不断积累。
|
|
6
|
+
|
|
7
|
+
`@biaoo/tiangong-wiki` 为这个模式提供基础设施:一个 CLI,将 Markdown 文件目录变为可查询的知识库,支持全文搜索、语义搜索、知识图谱和交互式仪表盘。
|
|
8
|
+
|
|
9
|
+
## 特性
|
|
10
|
+
|
|
11
|
+
| | |
|
|
12
|
+
|---|---|
|
|
13
|
+
| **知识持续积累** | 每添加一个素材、每提出一个问题,wiki 都变得更丰富 —— 编译一次,持续更新 |
|
|
14
|
+
| **你的文件,你的数据** | 纯 Markdown,你完全拥有;无需云端、无需数据库服务、无锁定 |
|
|
15
|
+
| **随时找到任何知识** | 元数据过滤、关键词搜索、语义搜索,一个 CLI 搞定 |
|
|
16
|
+
| **看见知识关联** | 自动提取页面间关系,构建可导航的知识图谱 |
|
|
17
|
+
| **摄入原始素材** | 将文件放入 vault,AI 自动阅读并转化为结构化页面 |
|
|
18
|
+
| **AI Agent 原生** | 作为 [Codex / Claude Code Skill](./SKILL.md) 使用,支持自主知识工作 |
|
|
19
|
+
| **可视化仪表盘** | 通过 Web 界面浏览图谱、查看页面、搜索内容 |
|
|
20
|
+
|
|
21
|
+
## 安装
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install -g @biaoo/tiangong-wiki
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
<details>
|
|
28
|
+
<summary><strong>作为 AI Agent Skill 使用</strong></summary>
|
|
29
|
+
|
|
30
|
+
安装 npm 包后,将其注册到你的 Agent:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx skills add Biaoo/tiangong-wiki -a codex # Codex
|
|
34
|
+
npx skills add Biaoo/tiangong-wiki -a claude-code # Claude Code
|
|
35
|
+
npx skills add Biaoo/tiangong-wiki -a codex -g # 全局安装(跨项目可用)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
或使用配置向导一步完成:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
tiangong-wiki setup
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
</details>
|
|
45
|
+
|
|
46
|
+
## 快速开始
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
tiangong-wiki setup # 交互式配置向导
|
|
50
|
+
tiangong-wiki doctor # 验证配置
|
|
51
|
+
tiangong-wiki init # 初始化工作区
|
|
52
|
+
tiangong-wiki sync # 索引 Markdown 文件
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
tiangong-wiki find --type concept --status active # 结构化查询
|
|
57
|
+
tiangong-wiki fts "贝叶斯" # 全文搜索
|
|
58
|
+
tiangong-wiki search "优化算法的收敛条件" # 语义搜索
|
|
59
|
+
tiangong-wiki graph bayes-theorem --depth 2 # 图遍历
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
tiangong-wiki daemon run # 启动仪表盘和 HTTP API
|
|
64
|
+
tiangong-wiki dashboard # 在浏览器中打开仪表盘
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
> 环境变量通过 `.wiki.env` 管理(由 `tiangong-wiki setup` 创建)。完整参考见 [references/env.md](./references/env.md)。
|
|
68
|
+
|
|
69
|
+
## CLI
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
配置引导 setup · doctor · check-config
|
|
73
|
+
索引管理 init · sync
|
|
74
|
+
查询 find · fts · search · graph
|
|
75
|
+
自省 list · page-info · stat · lint
|
|
76
|
+
创建 create · template · type
|
|
77
|
+
Vault vault list | diff | queue
|
|
78
|
+
导出 export-graph · export-index
|
|
79
|
+
守护进程 daemon run | start | stop | status
|
|
80
|
+
仪表盘 dashboard
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
完整命令参考见 [references/cli-interface.md](./references/cli-interface.md)。
|
|
84
|
+
|
|
85
|
+
## 技术架构
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
┌──────────────────────────────────────────────────────────┐
|
|
89
|
+
│ Vault(原始素材) │
|
|
90
|
+
│ PDF、文档、笔记、书签、剪藏 │
|
|
91
|
+
└────────────────────────┬─────────────────────────────────┘
|
|
92
|
+
│ vault diff / vault queue
|
|
93
|
+
▼
|
|
94
|
+
┌──────────────────────────────────────────────────────────┐
|
|
95
|
+
│ Agentic Workflow(Codex SDK) │
|
|
96
|
+
│ │
|
|
97
|
+
│ ┌─────────┐ 解析 ┌────────────┐ 发现体系 ┌─────┐ │
|
|
98
|
+
│ │ Parser │ ──────► │ tiangong-wiki-skill │ ────────► │ LLM │ │
|
|
99
|
+
│ │ Skills │ 素材 │ find / fts │ + 决策 │ │ │
|
|
100
|
+
│ └─────────┘ └────────────┘ └─────┘ │
|
|
101
|
+
│ pdf · docx · pptx │
|
|
102
|
+
│ │
|
|
103
|
+
│ → 跳过 / 创建页面 / 更新页面 / 仅提议 │
|
|
104
|
+
└────────────────────────┬─────────────────────────────────┘
|
|
105
|
+
│ 写入页面
|
|
106
|
+
▼
|
|
107
|
+
┌──────────────────────────────────────────────────────────┐
|
|
108
|
+
│ Markdown 页面(唯一真实来源) │
|
|
109
|
+
│ wiki/pages/**/*.md │
|
|
110
|
+
└────────────────────────┬─────────────────────────────────┘
|
|
111
|
+
│ tiangong-wiki sync
|
|
112
|
+
▼
|
|
113
|
+
┌──────────────────────────────────────────────────────────┐
|
|
114
|
+
│ SQLite 索引 (index.db) │
|
|
115
|
+
│ │
|
|
116
|
+
│ pages 结构化元数据(动态列) │
|
|
117
|
+
│ pages_fts FTS5 全文搜索 │
|
|
118
|
+
│ vec_pages sqlite-vec 向量嵌入 │
|
|
119
|
+
│ edges 知识图谱(source → target) │
|
|
120
|
+
└──┬───────────┬───────────┬───────────┬───────────────────┘
|
|
121
|
+
│ │ │ │
|
|
122
|
+
▼ ▼ ▼ ▼
|
|
123
|
+
find fts search graph
|
|
124
|
+
│ │ │ │
|
|
125
|
+
└───────────┴───────────┴───────────┘
|
|
126
|
+
│
|
|
127
|
+
▼
|
|
128
|
+
JSON stdout / HTTP daemon
|
|
129
|
+
│
|
|
130
|
+
┌────────────┴────────────┐
|
|
131
|
+
▼ ▼
|
|
132
|
+
CLI / 脚本 Web 仪表盘
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Vault → Pages** — 原始素材进入 vault,Agentic Workflow 逐个阅读,通过 `tiangong-wiki type list / find / fts` 发现当前知识体系,决定跳过、创建或更新页面。
|
|
136
|
+
|
|
137
|
+
**双引擎** — Markdown 文件是唯一真实来源,SQLite 是由 `tiangong-wiki sync` 构建的衍生索引,提供纯文件无法实现的查询能力。
|
|
138
|
+
|
|
139
|
+
**灵活 Schema** — 三级列模型(固定列、部署列、模板列),配置变更时自动 `ALTER TABLE`,无需手动迁移。
|
|
140
|
+
|
|
141
|
+
## 技术栈
|
|
142
|
+
|
|
143
|
+
| | |
|
|
144
|
+
|---|---|
|
|
145
|
+
| 语言 | TypeScript (ESM) |
|
|
146
|
+
| 运行时 | Node.js >= 18 |
|
|
147
|
+
| CLI 框架 | [Commander.js](https://github.com/tj/commander.js) |
|
|
148
|
+
| 数据库 | [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) + [sqlite-vec](https://github.com/asg017/sqlite-vec) |
|
|
149
|
+
| 仪表盘 | [Preact](https://preactjs.com/) + [G6](https://g6.antv.antgroup.com/) |
|
|
150
|
+
| 构建 | [Vite](https://vite.dev/) |
|
|
151
|
+
| 测试 | [Vitest](https://vitest.dev/) |
|
|
152
|
+
|
|
153
|
+
## 开发
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
git clone https://github.com/Biaoo/tiangong-wiki.git
|
|
157
|
+
cd tiangong-wiki
|
|
158
|
+
npm install && npm run build
|
|
159
|
+
|
|
160
|
+
npm run dev -- --help # 从源码运行 CLI
|
|
161
|
+
npm run dev:dashboard # 仪表盘开发服务器
|
|
162
|
+
npm test # 运行测试
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## 参与贡献
|
|
166
|
+
|
|
167
|
+
欢迎提 Issue 和 Pull Request。如果是较大的改动,请先开 Issue 讨论。
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tiangong-wiki-skill
|
|
3
|
+
description: "Local-first wiki query and page-maintenance interface over Markdown knowledge pages indexed into SQLite. Use when an agent should discover existing knowledge before answering, inspect vault changes or queue state, choose how new durable knowledge fits the current ontology, or create/update wiki pages in a local knowledge workspace."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Wiki Skill
|
|
7
|
+
|
|
8
|
+
## Core Goal
|
|
9
|
+
- Use the local wiki as the durable knowledge layer for future work, not just the current conversation.
|
|
10
|
+
- Query SQLite first, then read or edit the Markdown files that remain the source of truth.
|
|
11
|
+
- Treat page types as runtime-discovered ontology. Do not hardcode a default destination for new knowledge.
|
|
12
|
+
|
|
13
|
+
## Use When
|
|
14
|
+
Use `tiangong-wiki-skill` when:
|
|
15
|
+
- You should check whether the answer already exists in the local wiki before writing a fresh answer.
|
|
16
|
+
- You need to inspect the current ontology, template structure, or type recommendations before creating a page.
|
|
17
|
+
- A durable insight, correction, workflow, lesson, or source-derived knowledge should be preserved for reuse.
|
|
18
|
+
- New files appeared in `vault/` and you need to inspect `vault diff` or `vault queue` before deciding what knowledge work to do.
|
|
19
|
+
- You need a structured view of the graph, stale content, orphan pages, provenance, or general workspace health.
|
|
20
|
+
- You need to create or update a page and immediately re-index it.
|
|
21
|
+
|
|
22
|
+
## Retrieval Strategy
|
|
23
|
+
- Exact metadata, type, tag, status, node id, or dynamic column filter: `tiangong-wiki find`
|
|
24
|
+
- Keyword or short literal clue: `tiangong-wiki fts`
|
|
25
|
+
- Fuzzy natural-language retrieval with embeddings configured: `tiangong-wiki search`
|
|
26
|
+
- Graph neighborhood, prerequisites, or multi-hop relations: `tiangong-wiki graph`
|
|
27
|
+
- Single-page metadata, edges, provenance, or file path: `tiangong-wiki page-info`
|
|
28
|
+
- Workspace inventory or health: `tiangong-wiki list`, `tiangong-wiki stat`, `tiangong-wiki lint`
|
|
29
|
+
- Ontology discovery: `tiangong-wiki type list`, `tiangong-wiki type show`, `tiangong-wiki type recommend`
|
|
30
|
+
- Vault ingestion status: `tiangong-wiki vault diff`, `tiangong-wiki vault list`, `tiangong-wiki vault queue`
|
|
31
|
+
|
|
32
|
+
## Knowledge Capture Workflow
|
|
33
|
+
Use this when new knowledge should become part of the wiki.
|
|
34
|
+
|
|
35
|
+
1. Query for close existing pages with `tiangong-wiki find`, `tiangong-wiki fts`, or `tiangong-wiki search`.
|
|
36
|
+
2. Discover the current ontology with:
|
|
37
|
+
- `tiangong-wiki type list --format json`
|
|
38
|
+
- `tiangong-wiki type show <type> --format json`
|
|
39
|
+
- `tiangong-wiki type recommend --text "<summary>" --keywords "a,b,c" --format json`
|
|
40
|
+
3. Update the best existing page when the knowledge object already exists.
|
|
41
|
+
4. Create a new page only when the knowledge object is distinct and the current ontology supports it cleanly.
|
|
42
|
+
5. Edit the Markdown file directly.
|
|
43
|
+
6. Run `tiangong-wiki sync --path <page-id>`.
|
|
44
|
+
7. Run `tiangong-wiki lint --path <page-id> --format json`.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
tiangong-wiki find --type method --tag evidence
|
|
48
|
+
tiangong-wiki type list --format json
|
|
49
|
+
tiangong-wiki type recommend --text "A repeatable workflow for evidence review" --keywords "workflow,procedure" --limit 5 --format json
|
|
50
|
+
tiangong-wiki create --type method --title "Evidence Review Workflow"
|
|
51
|
+
tiangong-wiki sync --path methods/evidence-review-workflow.md
|
|
52
|
+
tiangong-wiki lint --path methods/evidence-review-workflow.md --format json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Vault Review Workflow
|
|
56
|
+
Use this when `vault/` may contain source files that should influence wiki knowledge.
|
|
57
|
+
|
|
58
|
+
1. Run `tiangong-wiki sync` to refresh indexes, vault metadata, and queue state.
|
|
59
|
+
2. Inspect recent vault changes with `tiangong-wiki vault diff`.
|
|
60
|
+
3. Inspect queue state with `tiangong-wiki vault queue`.
|
|
61
|
+
4. Discover the ontology through `tiangong-wiki type list/show/recommend` before deciding what to create or update.
|
|
62
|
+
5. Preserve provenance with `sourceRefs` and any source-specific fields required by the chosen page type.
|
|
63
|
+
6. Remember that `source-summary` is only one possible type. A vault file may lead to `skip`, an update to an existing page, a new page of any registered type, or a proposal to evolve the ontology.
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
tiangong-wiki sync
|
|
67
|
+
tiangong-wiki vault diff
|
|
68
|
+
tiangong-wiki vault queue
|
|
69
|
+
tiangong-wiki type list --format json
|
|
70
|
+
tiangong-wiki type recommend --text "Operational brief about evidence review" --keywords "operations,evidence" --limit 5 --format json
|
|
71
|
+
tiangong-wiki find --type method --tag evidence
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Maintenance Rules
|
|
75
|
+
- Do not assume any single page type is the default landing zone for vault files.
|
|
76
|
+
- Prefer updating the best existing page before creating near-duplicates.
|
|
77
|
+
- Use CLI discovery instead of static assumptions about templates or registered types.
|
|
78
|
+
- If the current ontology is not a clean fit, consider template evolution deliberately; do not improvise undocumented structure.
|
|
79
|
+
- After every mutation, re-index and lint the changed page before trusting query results.
|
|
80
|
+
|
|
81
|
+
## Layer Boundary
|
|
82
|
+
- `SKILL.md` describes the on-demand skill interface used by agents during queries and manual knowledge maintenance.
|
|
83
|
+
- Automatic vault-to-wiki processing, daemon scheduling, queue retries, NAS polling, and workflow artifacts belong to the service layer.
|
|
84
|
+
- Service-layer operations are documented in `references/service-admin.md`.
|
|
85
|
+
|
|
86
|
+
## Environment Contract
|
|
87
|
+
Required:
|
|
88
|
+
- `WIKI_PATH`
|
|
89
|
+
|
|
90
|
+
Optional for semantic retrieval or vector-based type recommendation:
|
|
91
|
+
- `EMBEDDING_BASE_URL`
|
|
92
|
+
- `EMBEDDING_API_KEY`
|
|
93
|
+
- `EMBEDDING_MODEL`
|
|
94
|
+
- `EMBEDDING_DIMENSIONS`
|
|
95
|
+
|
|
96
|
+
Automatic vault processing uses additional `WIKI_AGENT_*` variables, but those belong to the service layer rather than the skill interface. Read `references/service-admin.md` when operating the daemon or queue worker.
|
|
97
|
+
|
|
98
|
+
## Output Contract
|
|
99
|
+
- Query commands return JSON to stdout.
|
|
100
|
+
- Mutating commands return JSON summaries or created file paths to stdout.
|
|
101
|
+
- `lint`, `check-config`, `template list/show`, `type list/show/recommend`, and `daemon status` support text or JSON output where documented.
|
|
102
|
+
- Errors are emitted as structured JSON to stderr with `type=config|runtime|not_found|not_configured`.
|
|
103
|
+
|
|
104
|
+
## References
|
|
105
|
+
- `references/cli-interface.md`
|
|
106
|
+
- `references/data-model.md`
|
|
107
|
+
- `references/template-design-guide.md`
|
|
108
|
+
- `references/runtime.md`
|
|
109
|
+
- `references/env.md`
|
|
110
|
+
- `references/wiki-maintenance-instruction.md`
|
|
111
|
+
- `references/vault-to-wiki-instruction.md`
|
|
112
|
+
- `references/service-admin.md`
|
|
113
|
+
|
|
114
|
+
## Assets
|
|
115
|
+
- `assets/wiki.config.default.json`
|
|
116
|
+
- `assets/templates/`
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Tiangong Wiki Skill"
|
|
3
|
+
short_description: "Query, route, and maintain local wiki knowledge"
|
|
4
|
+
default_prompt: "Use the tiangong-wiki CLI and tiangong-wiki-skill to inspect existing wiki knowledge, discover the current ontology, and create or update durable pages in the local workspace."
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
WIKI_PATH=/data/workspace/wiki/pages
|
|
2
|
+
VAULT_PATH=/data/workspace/vault
|
|
3
|
+
WIKI_DB_PATH=/data/workspace/wiki/index.db
|
|
4
|
+
WIKI_CONFIG_PATH=/data/workspace/wiki/wiki.config.json
|
|
5
|
+
WIKI_TEMPLATES_PATH=/data/workspace/wiki/templates
|
|
6
|
+
WIKI_SYNC_INTERVAL=86400
|
|
7
|
+
|
|
8
|
+
EMBEDDING_BASE_URL=https://api.openai.com/v1
|
|
9
|
+
EMBEDDING_API_KEY=your-embedding-api-key
|
|
10
|
+
EMBEDDING_MODEL=text-embedding-3-small
|
|
11
|
+
EMBEDDING_DIMENSIONS=384
|
|
12
|
+
|
|
13
|
+
VAULT_SOURCE=local
|
|
14
|
+
# When VAULT_SOURCE=synology, also set:
|
|
15
|
+
# VAULT_SYNOLOGY_REMOTE_PATH=/homes/user/vault
|
|
16
|
+
# SYNOLOGY_BASE_URL=https://nas.example.com:5001
|
|
17
|
+
# SYNOLOGY_USERNAME=your-username
|
|
18
|
+
# SYNOLOGY_PASSWORD=your-password
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
pageType: achievement
|
|
3
|
+
title: Achievement Title
|
|
4
|
+
nodeId: achievement-slug
|
|
5
|
+
status: draft
|
|
6
|
+
visibility: private
|
|
7
|
+
sourceRefs: []
|
|
8
|
+
relatedPages: []
|
|
9
|
+
tags: []
|
|
10
|
+
createdAt: 2026-04-06
|
|
11
|
+
updatedAt: 2026-04-06
|
|
12
|
+
achievementType:
|
|
13
|
+
date:
|
|
14
|
+
issuer:
|
|
15
|
+
verifiable: "yes"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 成就描述
|
|
19
|
+
|
|
20
|
+
简洁但具体地写出这项成就是什么,以及它代表了什么结果。
|
|
21
|
+
|
|
22
|
+
## 获得过程
|
|
23
|
+
|
|
24
|
+
说明获得这项成就经历了哪些关键步骤、难点和投入,而不是只写最终结果。
|
|
25
|
+
|
|
26
|
+
## 能力体现
|
|
27
|
+
|
|
28
|
+
解释这项成就证明了哪些能力、经验或可信度,方便后续被 resume 或 profile 引用。
|
|
29
|
+
|
|
30
|
+
## 证明材料
|
|
31
|
+
|
|
32
|
+
列出证书、链接、发布记录、截图或其他可核验证据,并同步到 sourceRefs。
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
pageType: bridge
|
|
3
|
+
title: Bridge Title
|
|
4
|
+
nodeId: bridge-slug
|
|
5
|
+
status: draft
|
|
6
|
+
visibility: private
|
|
7
|
+
sourceRefs: []
|
|
8
|
+
relatedPages: []
|
|
9
|
+
tags: []
|
|
10
|
+
createdAt: 2026-04-06
|
|
11
|
+
updatedAt: 2026-04-06
|
|
12
|
+
fromCourse:
|
|
13
|
+
toCourse:
|
|
14
|
+
transferType:
|
|
15
|
+
fromConcepts: []
|
|
16
|
+
toConcepts: []
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 来源知识
|
|
20
|
+
|
|
21
|
+
写清楚这个迁移起点来自什么课程、项目、领域或知识体系。
|
|
22
|
+
|
|
23
|
+
## 目标场景
|
|
24
|
+
|
|
25
|
+
写清楚这个迁移最终要解决什么目标问题,以及目标场景里的限制条件。
|
|
26
|
+
|
|
27
|
+
## 迁移方式
|
|
28
|
+
|
|
29
|
+
分步骤说明原知识是如何被翻译、映射或改造后用于目标场景的。
|
|
30
|
+
|
|
31
|
+
## 迁移陷阱
|
|
32
|
+
|
|
33
|
+
指出最容易误迁移的地方,以及哪些条件不满足时这个 bridge 不应复用。
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
pageType: concept
|
|
3
|
+
title: Concept Title
|
|
4
|
+
nodeId: concept-slug
|
|
5
|
+
status: draft
|
|
6
|
+
visibility: private
|
|
7
|
+
sourceRefs: []
|
|
8
|
+
relatedPages: []
|
|
9
|
+
tags: []
|
|
10
|
+
createdAt: 2026-04-06
|
|
11
|
+
updatedAt: 2026-04-06
|
|
12
|
+
confidence: medium
|
|
13
|
+
masteryLevel: medium
|
|
14
|
+
prerequisites: []
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 核心理解
|
|
18
|
+
|
|
19
|
+
用两到四句话说明这个概念到底是什么,以及它为什么值得记住。
|
|
20
|
+
|
|
21
|
+
## 前置知识
|
|
22
|
+
|
|
23
|
+
列出理解这个概念之前必须已经掌握的知识、术语或背景。
|
|
24
|
+
|
|
25
|
+
## 关键公式/定义
|
|
26
|
+
|
|
27
|
+
写下最关键的定义、公式、判别标准或符号约定,不要只写标题。
|
|
28
|
+
|
|
29
|
+
## 直觉/类比
|
|
30
|
+
|
|
31
|
+
用一个直觉模型、类比或反例帮助未来的读者快速建立感觉。
|
|
32
|
+
|
|
33
|
+
## 典型应用
|
|
34
|
+
|
|
35
|
+
说明这个概念通常在哪些问题、项目或课程场景里真正会被用到。
|
|
36
|
+
|
|
37
|
+
## 容易混淆
|
|
38
|
+
|
|
39
|
+
写出它最容易和什么混淆,以及区分它们的判断线索。
|
|
40
|
+
|
|
41
|
+
## 开放问题
|
|
42
|
+
|
|
43
|
+
记录你当前还没完全吃透的点、边界条件或后续要继续查的内容。
|
|
44
|
+
|
|
45
|
+
## 来源
|
|
46
|
+
|
|
47
|
+
说明这个概念主要来自哪些来源,并确保这些来源同步写入 frontmatter 的 sourceRefs。
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
pageType: faq
|
|
3
|
+
title: FAQ Title
|
|
4
|
+
nodeId: faq-slug
|
|
5
|
+
status: draft
|
|
6
|
+
visibility: private
|
|
7
|
+
sourceRefs: []
|
|
8
|
+
relatedPages: []
|
|
9
|
+
tags: []
|
|
10
|
+
createdAt: 2026-04-06
|
|
11
|
+
updatedAt: 2026-04-06
|
|
12
|
+
frequency:
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 问题
|
|
16
|
+
|
|
17
|
+
用用户真实会问出来的语言写下这个高频问题,而不是抽象化改写。
|
|
18
|
+
|
|
19
|
+
## 简短回答
|
|
20
|
+
|
|
21
|
+
先给出一段可以直接复用的短答案,方便快速回复。
|
|
22
|
+
|
|
23
|
+
## 详细解释
|
|
24
|
+
|
|
25
|
+
补充条件、例外、例子和判断边界,说明为什么短答案成立。
|
|
26
|
+
|
|
27
|
+
## 相关概念
|
|
28
|
+
|
|
29
|
+
列出应当一起阅读的 concept、method 或 source-summary 页面,帮助继续深入。
|
|
30
|
+
|
|
31
|
+
如果这个问题已经不再高频,也请在正文里说明是否应该降级维护或归档。
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
pageType: lesson
|
|
3
|
+
title: Lesson Title
|
|
4
|
+
nodeId: lesson-slug
|
|
5
|
+
status: draft
|
|
6
|
+
visibility: private
|
|
7
|
+
sourceRefs: []
|
|
8
|
+
relatedPages: []
|
|
9
|
+
tags: []
|
|
10
|
+
createdAt: 2026-04-06
|
|
11
|
+
updatedAt: 2026-04-06
|
|
12
|
+
context:
|
|
13
|
+
severity: medium
|
|
14
|
+
actionable: "yes"
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 发生了什么
|
|
18
|
+
|
|
19
|
+
按事实顺序描述事件经过、背景条件和真正触发结果的关键节点。
|
|
20
|
+
|
|
21
|
+
## 从中学到了什么
|
|
22
|
+
|
|
23
|
+
提炼这次事件留下的稳定认知,而不是只重复事件本身。
|
|
24
|
+
|
|
25
|
+
## 以后怎么做
|
|
26
|
+
|
|
27
|
+
写出未来遇到相似情况时的行动规则、检查步骤或预防动作。
|
|
28
|
+
|
|
29
|
+
## 验证
|
|
30
|
+
|
|
31
|
+
说明你打算如何验证这个 lesson 真的能改善结果,而不是停留在口头总结。
|