@biaoo/tiangong-wiki 0.2.0 → 0.2.1

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.
Files changed (35) hide show
  1. package/README.md +14 -49
  2. package/README.zh-CN.md +14 -49
  3. package/SKILL.md +75 -107
  4. package/assets/templates/achievement.md +8 -8
  5. package/assets/templates/bridge.md +8 -8
  6. package/assets/templates/concept.md +14 -18
  7. package/assets/templates/faq.md +8 -10
  8. package/assets/templates/lesson.md +8 -8
  9. package/assets/templates/method.md +16 -8
  10. package/assets/templates/misconception.md +10 -10
  11. package/assets/templates/person.md +8 -8
  12. package/assets/templates/research-note.md +10 -10
  13. package/assets/templates/resume.md +11 -10
  14. package/assets/templates/source-summary.md +8 -12
  15. package/assets/tiangong-wiki-framework.png +0 -0
  16. package/assets/wiki.config.default.json +6 -3
  17. package/dist/commands/asset.js +21 -0
  18. package/dist/commands/skill.js +78 -0
  19. package/dist/commands/template.js +30 -0
  20. package/dist/core/onboarding.js +225 -100
  21. package/dist/core/workflow-context.js +58 -21
  22. package/dist/core/workspace-skills.js +496 -60
  23. package/dist/daemon/server.js +8 -0
  24. package/dist/index.js +4 -0
  25. package/dist/operations/asset.js +81 -0
  26. package/dist/operations/query.js +25 -1
  27. package/dist/operations/template-lint.js +160 -0
  28. package/dist/utils/asset.js +75 -0
  29. package/dist/utils/errors.js +6 -0
  30. package/package.json +2 -1
  31. package/references/cli-interface.md +22 -0
  32. package/references/template-design-guide.md +125 -113
  33. package/references/{env.md → troubleshooting.md} +64 -33
  34. package/references/vault-to-wiki-instruction.md +109 -51
  35. package/references/wiki-maintenance-instruction.md +15 -15
package/README.md CHANGED
@@ -41,17 +41,28 @@ Or let the setup wizard handle everything:
41
41
  tiangong-wiki setup
42
42
  ```
43
43
 
44
+ To manage workspace-local skills from arbitrary repo/path sources after setup:
45
+
46
+ ```bash
47
+ tiangong-wiki skill add ../my-skills --skill notes
48
+ tiangong-wiki skill status
49
+ tiangong-wiki skill update notes
50
+ ```
51
+
44
52
  </details>
45
53
 
46
54
  ## Quick Start
47
55
 
48
56
  ```bash
57
+ cd /path/to/your/workspace # run commands from the workspace root
49
58
  tiangong-wiki setup # interactive config wizard
50
59
  tiangong-wiki doctor # verify configuration
51
60
  tiangong-wiki init # initialize workspace
52
61
  tiangong-wiki sync # index Markdown pages
53
62
  ```
54
63
 
64
+ `tiangong-wiki setup` creates `.wiki.env`. Subsequent commands such as `doctor`, `init`, and `sync` should be run from the workspace root containing that `.wiki.env`, or with `WIKI_ENV_FILE` pointing to it explicitly.
65
+
55
66
  ```bash
56
67
  tiangong-wiki find --type concept --status active # structured query
57
68
  tiangong-wiki fts "Bayesian" # full-text search
@@ -64,12 +75,12 @@ tiangong-wiki daemon run # start dashboard & HTTP A
64
75
  tiangong-wiki dashboard # open dashboard in browser
65
76
  ```
66
77
 
67
- > Environment variables are managed via `.wiki.env` (created by `tiangong-wiki setup`). See [references/env.md](./references/env.md) for the full reference.
78
+ > Environment variables are managed via `.wiki.env` (created by `tiangong-wiki setup`). The CLI auto-discovers the nearest `.wiki.env` by walking upward from your current directory. See [references/troubleshooting.md](./references/troubleshooting.md) for the full reference.
68
79
 
69
80
  ## CLI
70
81
 
71
82
  ```
72
- Setup setup · doctor · check-config
83
+ Setup setup · skill · doctor · check-config
73
84
  Indexing init · sync
74
85
  Query find · fts · search · graph
75
86
  Inspect list · page-info · stat · lint
@@ -84,53 +95,7 @@ See [references/cli-interface.md](./references/cli-interface.md) for the full co
84
95
 
85
96
  ## Architecture
86
97
 
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
- ```
98
+ ![Tiangong-Wiki: The Persistent AI Knowledge Framework](./assets/tiangong-wiki-framework.png)
134
99
 
135
100
  **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
101
 
package/README.zh-CN.md CHANGED
@@ -41,17 +41,28 @@ npx skills add Biaoo/tiangong-wiki -a codex -g # 全局安装(跨项目
41
41
  tiangong-wiki setup
42
42
  ```
43
43
 
44
+ 如果需要把任意 repo/path 来源的 skill 作为工作区本地 managed skill 管理,可以继续使用:
45
+
46
+ ```bash
47
+ tiangong-wiki skill add ../my-skills --skill notes
48
+ tiangong-wiki skill status
49
+ tiangong-wiki skill update notes
50
+ ```
51
+
44
52
  </details>
45
53
 
46
54
  ## 快速开始
47
55
 
48
56
  ```bash
57
+ cd /path/to/your/workspace # 在工作区根目录执行命令
49
58
  tiangong-wiki setup # 交互式配置向导
50
59
  tiangong-wiki doctor # 验证配置
51
60
  tiangong-wiki init # 初始化工作区
52
61
  tiangong-wiki sync # 索引 Markdown 文件
53
62
  ```
54
63
 
64
+ `tiangong-wiki setup` 会创建 `.wiki.env`。后续的 `doctor`、`init`、`sync` 等命令应在包含该 `.wiki.env` 的工作区根目录执行;如果不在该目录执行,则需要显式设置 `WIKI_ENV_FILE` 指向它。
65
+
55
66
  ```bash
56
67
  tiangong-wiki find --type concept --status active # 结构化查询
57
68
  tiangong-wiki fts "贝叶斯" # 全文搜索
@@ -64,12 +75,12 @@ tiangong-wiki daemon run # 启动仪表盘和 HTTP
64
75
  tiangong-wiki dashboard # 在浏览器中打开仪表盘
65
76
  ```
66
77
 
67
- > 环境变量通过 `.wiki.env` 管理(由 `tiangong-wiki setup` 创建)。完整参考见 [references/env.md](./references/env.md)。
78
+ > 环境变量通过 `.wiki.env` 管理(由 `tiangong-wiki setup` 创建)。CLI 会从当前目录开始向上自动发现最近的 `.wiki.env`。完整参考见 [references/troubleshooting.md](./references/troubleshooting.md)。
68
79
 
69
80
  ## CLI
70
81
 
71
82
  ```
72
- 配置引导 setup · doctor · check-config
83
+ 配置引导 setup · skill · doctor · check-config
73
84
  索引管理 init · sync
74
85
  查询 find · fts · search · graph
75
86
  自省 list · page-info · stat · lint
@@ -84,53 +95,7 @@ Vault vault list | diff | queue
84
95
 
85
96
  ## 技术架构
86
97
 
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
- ```
98
+ ![Tiangong-Wiki:持久化 AI 知识框架](./assets/tiangong-wiki-framework.png)
134
99
 
135
100
  **Vault → Pages** — 原始素材进入 vault,Agentic Workflow 逐个阅读,通过 `tiangong-wiki type list / find / fts` 发现当前知识体系,决定跳过、创建或更新页面。
136
101
 
package/SKILL.md CHANGED
@@ -1,116 +1,84 @@
1
1
  ---
2
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."
3
+ description: "Use when you need to retrieve historically accumulated knowledge, methods, or behavioral patterns before answering or acting; when a conversation or workflow produces durable insights worth preserving for future reuse; or when you discover existing wiki content that is outdated or incorrect and needs correction."
4
4
  ---
5
5
 
6
6
  # Wiki Skill
7
7
 
8
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`
9
+
10
+ Use the local wiki as the **durable knowledge layer** — not just for the current conversation, but for all future work. Query first, then read or edit the Markdown files that remain the source of truth.
11
+
12
+ ## When to Use
13
+
14
+ Activate this skill in three scenarios:
15
+
16
+ ### 1. Knowledge Retrieval
17
+
18
+ You need historical knowledge, methods, behavioral patterns, or prior decisions before answering or acting.
19
+
20
+ **Trigger:** The current task could benefit from previously captured insights, or the user asks about something that may already exist in the wiki.
21
+
22
+ **Minimal steps:**
23
+ 1. Choose a retrieval strategy based on what you know:
24
+ - Know the type, tag, or metadata `tiangong-wiki find`
25
+ - Have a keyword or short phrase `tiangong-wiki fts`
26
+ - Fuzzy intent, embeddings configured `tiangong-wiki search`
27
+ - Need graph context or related pages `tiangong-wiki graph`
28
+ 2. Inspect the best candidate with `tiangong-wiki page-info <id>`.
29
+ 3. Read the Markdown file if you need full content.
30
+
31
+ **Stop when:** you have enough context to proceed, or no relevant pages exist.
32
+
33
+ ### 2. Knowledge Capture
34
+
35
+ A conversation, task, or other skill produced a high-value insight, method, correction, or piece of information worth preserving.
36
+
37
+ **Trigger:** You recognize durable knowledge — something that would be useful to retrieve in a future context.
38
+
39
+ **Two paths:**
40
+
41
+ - **Direct page creation** when you can clearly identify the page type and structure the content yourself:
42
+ 1. Search for existing pages to avoid duplicates (`find`, `fts`, or `search`).
43
+ 2. Discover the ontology: `tiangong-wiki type recommend --text "<summary>" --keywords "a,b,c" --format json`.
44
+ 3. Update an existing page if one covers the same knowledge object. Create a new page only when the object is distinct.
45
+ 4. After writing: `tiangong-wiki sync --path <page-id>` then `tiangong-wiki lint --path <page-id> --format json`.
46
+
47
+ - **Save to vault** when the material is raw, complex, or needs further processing:
48
+ 1. Save the file to `vault/`.
49
+ 2. The vault-to-wiki workflow will handle triage and page creation.
50
+ 3. See `references/vault-to-wiki-instruction.md` for the full decision model.
51
+
52
+ **Key rules:**
53
+ - Do not assume any page type is the default destination. Always discover via CLI.
54
+ - Prefer updating the best existing page over creating near-duplicates.
55
+ - Only use frontmatter fields declared by the chosen type (`tiangong-wiki type show <type>`). Do not invent ad-hoc fields.
56
+ - Preserve provenance with `sourceRefs` and type-specific source fields.
57
+
58
+ ### 3. Knowledge Maintenance
59
+
60
+ You discover that existing wiki content is outdated, incorrect, or incomplete during retrieval or conversation.
61
+
62
+ **Trigger:** A retrieved page contains stale information, or new evidence contradicts existing content.
63
+
64
+ **Minimal steps:**
65
+ 1. Locate the page: `tiangong-wiki find` or `tiangong-wiki page-info <id>`.
66
+ 2. Edit the Markdown file — keep edits minimal and provenance-preserving.
67
+ 3. After editing: `tiangong-wiki sync --path <page-id>` then `tiangong-wiki lint --path <page-id> --format json`.
68
+
69
+ **For systematic maintenance** (health checks, orphan cleanup, stale content review), see `references/wiki-maintenance-instruction.md`.
70
+
71
+ ## References (read on demand)
72
+
73
+ | Document | Read when... |
74
+ |----------|-------------|
75
+ | `references/cli-interface.md` | You need full command options, flags, or output format details |
76
+ | `references/vault-to-wiki-instruction.md` | Processing vault files into wiki pages |
77
+ | `references/wiki-maintenance-instruction.md` | Running systematic maintenance or health checks |
78
+ | `references/template-design-guide.md` | Designing a new page type or evolving an existing template |
79
+ | `references/troubleshooting.md` | Environment setup, configuration issues, or error diagnosis |
113
80
 
114
81
  ## Assets
115
- - `assets/wiki.config.default.json`
116
- - `assets/templates/`
82
+
83
+ - `assets/wiki.config.default.json` — default configuration template
84
+ - `assets/templates/` — Markdown page templates for each registered type
@@ -15,18 +15,18 @@ issuer:
15
15
  verifiable: "yes"
16
16
  ---
17
17
 
18
- ## 成就描述
18
+ ## What
19
19
 
20
- 简洁但具体地写出这项成就是什么,以及它代表了什么结果。
20
+ State the achievement in one factual sentence. Include the scope, level, and issuing context. Do not editorialize — let the facts speak.
21
21
 
22
- ## 获得过程
22
+ ## How
23
23
 
24
- 说明获得这项成就经历了哪些关键步骤、难点和投入,而不是只写最终结果。
24
+ Describe the key steps, investment, and challenges involved in earning this achievement. Focus on what is quantifiable or verifiable: duration, scale, constraints overcome. Do not write a narrative essay.
25
25
 
26
- ## 能力体现
26
+ ## Demonstrated Capabilities
27
27
 
28
- 解释这项成就证明了哪些能力、经验或可信度,方便后续被 resume profile 引用。
28
+ List the specific capabilities this achievement provides evidence for. Use terms that other pages (resume, person) can reference. Think of this as a reusable capability tag set.
29
29
 
30
- ## 证明材料
30
+ ## Evidence
31
31
 
32
- 列出证书、链接、发布记录、截图或其他可核验证据,并同步到 sourceRefs。
32
+ Provide verifiable proof: certificate links, publication URLs, official records, screenshots, or third-party references. If the achievement claims to be verifiable (frontmatter `verifiable: "yes"`), this section must contain at least one checkable item.
@@ -16,18 +16,18 @@ fromConcepts: []
16
16
  toConcepts: []
17
17
  ---
18
18
 
19
- ## 来源知识
19
+ ## Source Knowledge
20
20
 
21
- 写清楚这个迁移起点来自什么课程、项目、领域或知识体系。
21
+ Identify the origin domain, course, or knowledge system. Link to existing concept or method pages that represent the source-side knowledge being transferred. When a source-side concept already has a node in the wiki, record its nodeId in frontmatter `fromConcepts` instead of leaving the mapping only in prose.
22
22
 
23
- ## 目标场景
23
+ ## Target Scenario
24
24
 
25
- 写清楚这个迁移最终要解决什么目标问题,以及目标场景里的限制条件。
25
+ Describe the target problem, domain, or context where the source knowledge is being applied. State the constraints and requirements specific to the target that make direct transfer non-trivial.
26
26
 
27
- ## 迁移方式
27
+ ## Transfer Mapping
28
28
 
29
- 分步骤说明原知识是如何被翻译、映射或改造后用于目标场景的。
29
+ Describe how each source-side concept or method maps to its target-side equivalent. Use explicit A → B mappings where possible. For each mapping, note what adapts cleanly and what requires modification. Use the body to explain the mapping, and keep `fromConcepts` / `toConcepts` in sync for the key nodes so the graph retains the structure.
30
30
 
31
- ## 迁移陷阱
31
+ ## Invalid Transfers
32
32
 
33
- 指出最容易误迁移的地方,以及哪些条件不满足时这个 bridge 不应复用。
33
+ State the conditions under which this bridge breaks down. Which assumptions from the source domain do not hold in the target? What would go wrong if the transfer were applied without these caveats?
@@ -14,34 +14,30 @@ masteryLevel: medium
14
14
  prerequisites: []
15
15
  ---
16
16
 
17
- ## 核心理解
17
+ ## Definition
18
18
 
19
- 用两到四句话说明这个概念到底是什么,以及它为什么值得记住。
19
+ Provide a precise, quotable definition of this concept. A reader should be able to cite this section without additional context. Do not write an introductory paragraph — write the definition.
20
20
 
21
- ## 前置知识
21
+ ## Prerequisites
22
22
 
23
- 列出理解这个概念之前必须已经掌握的知识、术语或背景。
23
+ List the concepts, terms, or background knowledge required to understand this one. Link to existing wiki pages where possible.
24
24
 
25
- ## 关键公式/定义
25
+ ## Formal Specification
26
26
 
27
- 写下最关键的定义、公式、判别标准或符号约定,不要只写标题。
27
+ Write the key formulas, criteria, thresholds, or formal rules that define this concept's behavior. If the concept has no formal specification, describe the decision boundary — under what conditions does something qualify as this concept vs. not?
28
28
 
29
- ## 直觉/类比
29
+ ## Intuition & Analogy
30
30
 
31
- 用一个直觉模型、类比或反例帮助未来的读者快速建立感觉。
31
+ Provide one mental model, analogy, or worked example that builds correct intuition quickly. Prefer concrete examples over abstract explanations.
32
32
 
33
- ## 典型应用
33
+ ## Typical Applications
34
34
 
35
- 说明这个概念通常在哪些问题、项目或课程场景里真正会被用到。
35
+ Name specific problems, project types, or domains where this concept is actively used. Do not list hypothetical uses — list real or well-documented ones.
36
36
 
37
- ## 容易混淆
37
+ ## Boundary & Confusion
38
38
 
39
- 写出它最容易和什么混淆,以及区分它们的判断线索。
39
+ State what this concept is most easily confused with, and the specific test or criterion that distinguishes them. Do not just say "they are different" — describe what input or situation would produce a different outcome under each.
40
40
 
41
- ## 开放问题
41
+ ## Open Questions
42
42
 
43
- 记录你当前还没完全吃透的点、边界条件或后续要继续查的内容。
44
-
45
- ## 来源
46
-
47
- 说明这个概念主要来自哪些来源,并确保这些来源同步写入 frontmatter 的 sourceRefs。
43
+ Record what remains unclear, what edge cases are unresolved, or what further investigation is needed. This section is expected to shrink as confidence increases.
@@ -12,20 +12,18 @@ updatedAt: 2026-04-06
12
12
  frequency:
13
13
  ---
14
14
 
15
- ## 问题
15
+ ## Question
16
16
 
17
- 用用户真实会问出来的语言写下这个高频问题,而不是抽象化改写。
17
+ Write the question in the exact phrasing a real person would use. Do not abstract, rephrase, or make it sound formal — preserve the natural language of the asker.
18
18
 
19
- ## 简短回答
19
+ ## Quick Answer
20
20
 
21
- 先给出一段可以直接复用的短答案,方便快速回复。
21
+ Provide a self-contained answer in 2-3 sentences that can be directly reused in a reply. It must be correct and complete enough to stand alone without reading further.
22
22
 
23
- ## 详细解释
23
+ ## Full Explanation
24
24
 
25
- 补充条件、例外、例子和判断边界,说明为什么短答案成立。
25
+ Expand with conditions, exceptions, edge cases, and examples. Explain why the quick answer is correct and under what circumstances it might not apply.
26
26
 
27
- ## 相关概念
27
+ ## Related Pages
28
28
 
29
- 列出应当一起阅读的 conceptmethod source-summary 页面,帮助继续深入。
30
-
31
- 如果这个问题已经不再高频,也请在正文里说明是否应该降级维护或归档。
29
+ Link to concept, method, or source-summary pages that provide deeper context. Use relatedPages frontmatter to keep these connections in the graph.
@@ -14,18 +14,18 @@ severity: medium
14
14
  actionable: "yes"
15
15
  ---
16
16
 
17
- ## 发生了什么
17
+ ## Event
18
18
 
19
- 按事实顺序描述事件经过、背景条件和真正触发结果的关键节点。
19
+ Describe what happened — only the facts that are necessary to understand the lesson. Do not write a chronological narrative; keep only the causal chain that led to the outcome.
20
20
 
21
- ## 从中学到了什么
21
+ ## Stable Rule
22
22
 
23
- 提炼这次事件留下的稳定认知,而不是只重复事件本身。
23
+ State the durable insight extracted from this event. This should be a general rule or principle that applies beyond this specific incident. If you cannot state it as a rule, reconsider whether this is truly a lesson or just an event record.
24
24
 
25
- ## 以后怎么做
25
+ ## Action Protocol
26
26
 
27
- 写出未来遇到相似情况时的行动规则、检查步骤或预防动作。
27
+ Write the concrete actions, checklist items, or decision rules to follow when a similar situation arises. Each item should be executable — "be more careful" is not an action.
28
28
 
29
- ## 验证
29
+ ## Verification
30
30
 
31
- 说明你打算如何验证这个 lesson 真的能改善结果,而不是停留在口头总结。
31
+ Describe how you would test whether this lesson actually improves outcomes. What would you measure? What would indicate the lesson was applied correctly vs. ignored?
@@ -14,18 +14,26 @@ effectiveness:
14
14
  applicableTo: []
15
15
  ---
16
16
 
17
- ## 方法描述
17
+ ## Purpose & Mechanism
18
18
 
19
- 先用一段完整的话解释这套方法的目标、输入、输出和基本流程。
19
+ State what problem this method solves and why it works. Do not restate the title — explain the underlying mechanism or principle that makes this method effective.
20
20
 
21
- ## 适用场景
21
+ ## Steps / Procedure
22
22
 
23
- 说明这套方法在什么问题、约束和前置条件下最值得使用。
23
+ List the concrete steps to execute this method. Each step should be actionable and verifiable. If the method has variants, describe the core sequence first, then note variations.
24
24
 
25
- ## 不适用场景
25
+ ## Applicable Scenarios
26
26
 
27
- 写出哪些边界条件会让这套方法失效,避免未来被误用。
27
+ Specify the preconditions, input types, and constraints under which this method is the right choice. Be concrete — name the kind of problem, data, or situation, not just "when appropriate."
28
28
 
29
- ## 使用记录
29
+ ## Inapplicable Scenarios
30
30
 
31
- 记录真实使用过它的场景、结果、指标或反馈,支撑 effectiveness 的判断。
31
+ State when this method should NOT be used. Name the boundary conditions, failure triggers, or assumptions that must hold. If these break, what goes wrong?
32
+
33
+ ## Failure Modes
34
+
35
+ Describe how this method fails when misapplied. What does a bad outcome look like? What early signals indicate the method is not working? This section prevents blind reuse.
36
+
37
+ ## Evidence
38
+
39
+ Record real uses of this method with measurable outcomes. Include context, results, and comparison baselines where available. Do not write "it worked well" without specifics — state what was measured and what changed.
@@ -14,22 +14,22 @@ resolvedAt:
14
14
  correctedConcepts: []
15
15
  ---
16
16
 
17
- ## 原来的理解(错误)
17
+ ## False Belief
18
18
 
19
- 准确写下当时错误的理解,不要提前替它辩护或修正。
19
+ State the incorrect understanding exactly as it was held — without softening, defending, or pre-correcting it. A reader should be able to recognize this belief if they currently hold it.
20
20
 
21
- ## 为什么错了
21
+ ## Why It Is Wrong
22
22
 
23
- 说明哪条证据、哪个反例或哪个推理步骤暴露了原理解的问题。
23
+ Identify the specific evidence, counterexample, or reasoning flaw that disproves the false belief. Do not just assert it is wrong — show the proof.
24
24
 
25
- ## 正确理解
25
+ ## Correct Understanding
26
26
 
27
- 用清晰的语言写出现在确认正确的理解,并指出关键差异。
27
+ State the corrected understanding clearly and precisely. Highlight the key difference from the false belief — what specifically changes?
28
28
 
29
- ## 转折点
29
+ ## Turning Point
30
30
 
31
- 记录让你真正完成认知切换的瞬间、材料或实验结果。
31
+ Record the moment, material, experiment, or conversation that caused the actual cognitive shift. If no single turning point exists, this section may be omitted.
32
32
 
33
- ## 防止复发
33
+ ## Recurrence Prevention
34
34
 
35
- 写下未来再次遇到相似问题时,应该用什么检查点防止重复犯错。
35
+ Write the checks, questions, or heuristics to apply in the future to avoid falling back into this misconception. Each item should be a concrete test, not a vague reminder.