@itradingai/aiwiki 0.2.15 → 0.2.18
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/README.md +34 -0
- package/dist/src/app.js +237 -11
- package/dist/src/context.js +173 -16
- package/dist/src/lint.js +163 -23
- package/docs/AGENT_HANDOFF.md +76 -0
- package/docs/POSITIONING_CONTEXT_COMPILER_PLAN.md +347 -0
- package/docs/README.md +1 -0
- package/docs/USAGE.md +67 -1
- package/docs/development-log.md +97 -0
- package/package.json +1 -1
- package/skill/LINT_PROTOCOL.md +12 -5
- package/skill/QUERY_PROTOCOL.md +21 -4
- package/skill/SKILL.md +54 -1
- package/skill/UPGRADE_NOTES.md +22 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
# AIWiki 定位调整与产品方案
|
|
2
|
+
|
|
3
|
+
本文基于 `20260607-aiwiki定位.md` 的判断,并结合当前 AIWiki 仓库现状整理。结论是:文档大方向可取,但不能把 AIWiki 改成重学习、重记忆、重人工复习的 Knowledge MEMO。AIWiki 更适合继续做 Agent-first 本地上下文编译器。
|
|
4
|
+
|
|
5
|
+
## 一句话定位
|
|
6
|
+
|
|
7
|
+
AIWiki 不是替代搜索,也不是替你读书,而是把你真正需要反复调用的资料、判断和输出,编译成 AI 能查询、能引用、能检查、能继续使用的本地知识资产。
|
|
8
|
+
|
|
9
|
+
更锋利的对外表达:
|
|
10
|
+
|
|
11
|
+
> 公开知识交给搜索。
|
|
12
|
+
> 私有判断、项目经验、输出风格、证据链,交给 AIWiki。
|
|
13
|
+
|
|
14
|
+
## 建议取舍判断
|
|
15
|
+
|
|
16
|
+
| 文档建议 | 判断 | 原因 | 落地优先级 |
|
|
17
|
+
| --- | --- | --- | --- |
|
|
18
|
+
| 不把 AIWiki 宣传成普通个人知识库或资料索引 | 可取 | 当前 README 已强调 Agent-first 和本地 LLM-wiki 后端,但还可以更明确地区分搜索、收藏夹和上下文编译器 | P0 |
|
|
19
|
+
| 保留 Markdown Wiki 形态 | 可取 | AIWiki 面向人和 Agent 协作,Markdown 的可读、可 diff、可回滚、可被 Agent 编辑是核心优势 | P0 |
|
|
20
|
+
| 强化个人判断层 | 强烈可取 | 当前 payload 已有 `source_role=processing`,但产品心智和目录/命令输出还没有把 personal insight 变成一等资产 | P0 |
|
|
21
|
+
| 强化输出资产层 | 强烈可取 | 当前已有 `source_role=output` 和 `represents_user_view=true` 边界,这是 AIWiki 最有差异化的一层 | P0 |
|
|
22
|
+
| `context` 从资料检索升级为任务上下文包 | 强烈可取 | 当前 `context` 已是 JSON 结构,适合加 `mode` 和按任务分组的结果,不需要推倒重做 | P0 |
|
|
23
|
+
| `query` 输出按资料类型分组 | 可取 | 这是低成本心智升级:从“搜索结果”变成“知识资产调度” | P1 |
|
|
24
|
+
| `lint` 从结构检查升级为知识质量检查 | 可取 | 当前 lint 已有元数据边界、fallback、grounding 检查,可继续加入 insight/output/evidence 使用关系检查 | P1 |
|
|
25
|
+
| `next` 从命令导航升级为加工建议 | 可取 | 适合帮助用户把资料推进到 insight、output、topic 或 review,而不是只提示下一条 CLI 命令 | P1 |
|
|
26
|
+
| 新增 Retain / Review | 部分可取 | 可以做轻量回看,但不应成为主流程,也不要第一阶段引入 FSRS 或 Anki 式学习系统 | P2 |
|
|
27
|
+
| 把 AIWiki 改成纯人脑内化工具 | 不建议 | 会偏离当前 Agent-first CLI 边界,也会让产品过重 | 不做 |
|
|
28
|
+
| 引入多知识库、自动采集、内置网页抓取 | 不建议 | 与当前仓库 AGENTS.md 和 README 边界冲突;这些属于 AIWiki Pro 或宿主 Agent/服务层,不属于基础 CLI | 不做 |
|
|
29
|
+
|
|
30
|
+
## 产品原则
|
|
31
|
+
|
|
32
|
+
1. AIWiki 只沉淀值得复用的上下文,不收藏所有公开知识。
|
|
33
|
+
2. 外部资料默认不代表用户观点。
|
|
34
|
+
3. 用户自己的输出和判断比外部输入更值钱。
|
|
35
|
+
4. AIWiki CLI 不调用 LLM;高质量分析由宿主 Agent 提供,AIWiki 负责规范、落盘、追踪、检查。
|
|
36
|
+
5. 保持单知识库、单命令 `aiwiki`、本地 Markdown 的基本边界。
|
|
37
|
+
6. Review / Retain 是增强闭环,不是默认主流程。
|
|
38
|
+
|
|
39
|
+
## 三类知识资产模型
|
|
40
|
+
|
|
41
|
+
### 1. Source Knowledge:来源证据
|
|
42
|
+
|
|
43
|
+
用于保存外部文章、网页、报告、视频转写、书籍摘录等。
|
|
44
|
+
|
|
45
|
+
建议字段:
|
|
46
|
+
|
|
47
|
+
```yaml
|
|
48
|
+
source_role: input
|
|
49
|
+
wiki_type: source_knowledge
|
|
50
|
+
represents_user_view: false
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
价值标准:
|
|
54
|
+
|
|
55
|
+
- 是否能作为证据引用。
|
|
56
|
+
- 是否能支撑观点或反驳观点。
|
|
57
|
+
- 是否能生成选题、方案、脚本或研究方向。
|
|
58
|
+
- 是否能和已有资料、判断、输出建立连接。
|
|
59
|
+
|
|
60
|
+
### 2. Personal Insight:个人判断
|
|
61
|
+
|
|
62
|
+
用于保存用户或宿主 Agent 帮用户整理出的判断、取舍、冲突、决策理由。
|
|
63
|
+
|
|
64
|
+
建议先复用现有 `source_role=processing`,并把 `wiki_type` 从宽泛的 `thought_note` 收窄为更明确的 `personal_insight` 或 `decision_note`。第一阶段可以兼容旧值。
|
|
65
|
+
|
|
66
|
+
建议字段:
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
type: insight_note
|
|
70
|
+
source_role: processing
|
|
71
|
+
wiki_type: personal_insight
|
|
72
|
+
represents_user_view: true
|
|
73
|
+
confidence: low | medium | high
|
|
74
|
+
based_on:
|
|
75
|
+
- 03-sources/article-cards/example.md
|
|
76
|
+
- 05-wiki/source-knowledge/example.md
|
|
77
|
+
used_for:
|
|
78
|
+
- article
|
|
79
|
+
- product_decision
|
|
80
|
+
- client_solution
|
|
81
|
+
- research
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
条目应回答:
|
|
85
|
+
|
|
86
|
+
- 我认同什么,为什么。
|
|
87
|
+
- 我反对什么,为什么。
|
|
88
|
+
- 对项目、文章、产品或客户方案有什么启发。
|
|
89
|
+
- 能否转成文章观点、产品决策或执行动作。
|
|
90
|
+
- 和我已有判断是否冲突。
|
|
91
|
+
|
|
92
|
+
### 3. Output Knowledge:可复用输出
|
|
93
|
+
|
|
94
|
+
用于保存用户已经发布或交付过的文章、方案、PRD、README、报价、视频脚本、群内回答等。
|
|
95
|
+
|
|
96
|
+
建议字段:
|
|
97
|
+
|
|
98
|
+
```yaml
|
|
99
|
+
source_role: output
|
|
100
|
+
wiki_type: personal_knowledge
|
|
101
|
+
represents_user_view: true
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
价值标准:
|
|
105
|
+
|
|
106
|
+
- 能反映用户真实观点。
|
|
107
|
+
- 能反映用户表达风格。
|
|
108
|
+
- 能被新文章、新方案、新脚本复用。
|
|
109
|
+
- 能回溯到支撑它的 source 和 insight。
|
|
110
|
+
|
|
111
|
+
## 命令方案
|
|
112
|
+
|
|
113
|
+
### `aiwiki context`
|
|
114
|
+
|
|
115
|
+
定位:从“相关资料包”升级为“任务上下文包”。
|
|
116
|
+
|
|
117
|
+
新增 `--mode`:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
aiwiki context "AI知识库是否还有必要" --mode write
|
|
121
|
+
aiwiki context "AIWiki产品定位" --mode decide
|
|
122
|
+
aiwiki context "Karpathy LLM Wiki" --mode research
|
|
123
|
+
aiwiki context "我的公众号文章风格" --mode style
|
|
124
|
+
aiwiki context "某个知识点" --mode learn
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
建议返回结构:
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"schema_version": "aiwiki.context.v2",
|
|
132
|
+
"query": "AIWiki产品定位",
|
|
133
|
+
"mode": "decide",
|
|
134
|
+
"external_sources": [],
|
|
135
|
+
"personal_insights": [],
|
|
136
|
+
"past_outputs": [],
|
|
137
|
+
"conflicts": [],
|
|
138
|
+
"usable_arguments": [],
|
|
139
|
+
"missing_context": [],
|
|
140
|
+
"recommended_next_action": ""
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
兼容策略:
|
|
145
|
+
|
|
146
|
+
- 保留 v1 `matches` 结构一段时间。
|
|
147
|
+
- v2 可以先在结果中新增字段,不立刻移除旧字段。
|
|
148
|
+
- `--mode` 缺省为 `general`。
|
|
149
|
+
|
|
150
|
+
### `aiwiki query`
|
|
151
|
+
|
|
152
|
+
定位:给人看的知识资产摘要,不是普通搜索结果。
|
|
153
|
+
|
|
154
|
+
建议输出分组:
|
|
155
|
+
|
|
156
|
+
```text
|
|
157
|
+
外部资料
|
|
158
|
+
- ...
|
|
159
|
+
|
|
160
|
+
个人判断
|
|
161
|
+
- ...
|
|
162
|
+
|
|
163
|
+
已发布输出
|
|
164
|
+
- ...
|
|
165
|
+
|
|
166
|
+
证据与冲突
|
|
167
|
+
- ...
|
|
168
|
+
|
|
169
|
+
建议下一步
|
|
170
|
+
- ...
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
优先级:
|
|
174
|
+
|
|
175
|
+
- 命中 output 和 insight 时,展示在 source 前面。
|
|
176
|
+
- source 只作为证据,不默认当成结论。
|
|
177
|
+
|
|
178
|
+
### `aiwiki lint`
|
|
179
|
+
|
|
180
|
+
定位:从文件结构健康检查升级为知识资产健康检查。
|
|
181
|
+
|
|
182
|
+
保留现有检查:
|
|
183
|
+
|
|
184
|
+
- 缺少系统文件。
|
|
185
|
+
- Source Card 没有 Wiki Entry。
|
|
186
|
+
- Wiki Entry 缺少 source_card / raw_file。
|
|
187
|
+
- fallback scaffold 过期。
|
|
188
|
+
- grounding needs review。
|
|
189
|
+
- `represents_user_view=true` 但不是 output。
|
|
190
|
+
- 重复 URL、重复标题、断链。
|
|
191
|
+
|
|
192
|
+
新增质量检查:
|
|
193
|
+
|
|
194
|
+
- 某主题只有 source,没有 insight。
|
|
195
|
+
- 某 insight 没有 `based_on`。
|
|
196
|
+
- 某 output 没有关联 source 或 insight。
|
|
197
|
+
- source 被错误标记为代表用户观点。
|
|
198
|
+
- claim 没有 source quote 或证据边界。
|
|
199
|
+
- 某主题存在冲突观点但没有决策结论。
|
|
200
|
+
- enriched entry 只有摘要,没有 reusable judgment / reusable knowledge。
|
|
201
|
+
|
|
202
|
+
### `aiwiki next`
|
|
203
|
+
|
|
204
|
+
定位:从命令导航升级为加工建议。
|
|
205
|
+
|
|
206
|
+
建议输出:
|
|
207
|
+
|
|
208
|
+
```text
|
|
209
|
+
当前最值得做:
|
|
210
|
+
- 这 3 篇 source 只有摘要,没有个人判断。
|
|
211
|
+
- 这个主题已有 5 条 source,可以生成主题页。
|
|
212
|
+
- 这条 output 没有证据链,建议补 linked sources。
|
|
213
|
+
- 这个观点和历史输出存在冲突,建议进入 review。
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### `aiwiki review` 或 `aiwiki retain`
|
|
217
|
+
|
|
218
|
+
定位:轻量回看,不做重学习系统。
|
|
219
|
+
|
|
220
|
+
第一版只做候选生成:
|
|
221
|
+
|
|
222
|
+
```text
|
|
223
|
+
今日建议回看:
|
|
224
|
+
- 3 条个人 insight
|
|
225
|
+
- 2 条高价值 source knowledge
|
|
226
|
+
- 1 条已输出文章中的核心观点
|
|
227
|
+
|
|
228
|
+
可生成卡片:
|
|
229
|
+
- 观点卡
|
|
230
|
+
- 证据卡
|
|
231
|
+
- 反驳卡
|
|
232
|
+
- 案例卡
|
|
233
|
+
- 输出卡
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
暂不做:
|
|
237
|
+
|
|
238
|
+
- FSRS。
|
|
239
|
+
- 每日强制复习。
|
|
240
|
+
- Anki 兼容。
|
|
241
|
+
- 学习进度系统。
|
|
242
|
+
|
|
243
|
+
## README 与对外话术
|
|
244
|
+
|
|
245
|
+
建议把开头改得更锋利:
|
|
246
|
+
|
|
247
|
+
```text
|
|
248
|
+
AIWiki 是一个 Agent-first 本地上下文编译器。
|
|
249
|
+
|
|
250
|
+
它不替代搜索,也不替你读书,而是把你真正需要反复调用的资料、判断和输出,编译成 AI 能查询、能引用、能检查、能继续使用的本地知识资产。
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
“它解决什么”建议改成:
|
|
254
|
+
|
|
255
|
+
- 公开资料搜索得到,但你的使用场景、判断和输出痕迹搜不到。
|
|
256
|
+
- 链接和资料散在聊天记录里,后续很难被 Agent 复用。
|
|
257
|
+
- AI 总结过一次内容,但没有沉淀成可追踪、可查询、可检查的上下文资产。
|
|
258
|
+
- 想把来源证据、个人判断、选题、大纲和已输出内容放进同一个本地知识系统。
|
|
259
|
+
- 想让宿主 Agent 负责理解内容,让 AIWiki 负责稳定落盘、连接和检查。
|
|
260
|
+
|
|
261
|
+
不建议继续主打:
|
|
262
|
+
|
|
263
|
+
```text
|
|
264
|
+
打造你的 AI 个人知识库
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
这个说法太泛,容易被理解成“AI 时代还要不要收藏夹”。
|
|
268
|
+
|
|
269
|
+
## 分阶段落地
|
|
270
|
+
|
|
271
|
+
### P0:定位与 schema 心智对齐
|
|
272
|
+
|
|
273
|
+
目标:不大改代码,先把产品定位和现有字段解释清楚。
|
|
274
|
+
|
|
275
|
+
任务:
|
|
276
|
+
|
|
277
|
+
1. 更新 README、FAQ、USAGE 的定位话术。
|
|
278
|
+
2. 在 docs 中新增“三类资产模型”说明。
|
|
279
|
+
3. 在 Agent handoff / skill 中要求宿主 Agent 区分 source、insight、output。
|
|
280
|
+
4. 明确 `source_role=input` 永远不默认代表用户观点。
|
|
281
|
+
5. 为 `processing` 角色补充 personal insight 示例 payload。
|
|
282
|
+
|
|
283
|
+
验收:
|
|
284
|
+
|
|
285
|
+
- 新用户能在 README 前 30 秒理解 AIWiki 不是搜索替代品。
|
|
286
|
+
- 文档能解释 source、insight、output 三层差异。
|
|
287
|
+
- 不引入新命令、不破坏旧 payload。
|
|
288
|
+
|
|
289
|
+
### P1:任务上下文与质量检查
|
|
290
|
+
|
|
291
|
+
目标:让 AIWiki 从“能查到资料”升级为“能为任务组织上下文”。
|
|
292
|
+
|
|
293
|
+
任务:
|
|
294
|
+
|
|
295
|
+
1. `context` 增加 `--mode`。
|
|
296
|
+
2. `context` 输出新增 `external_sources`、`personal_insights`、`past_outputs`、`conflicts`、`usable_arguments`、`missing_context`。
|
|
297
|
+
3. `query` 输出按资产类型分组。
|
|
298
|
+
4. `lint` 增加 insight/output/evidence 质量检查。
|
|
299
|
+
5. `next` 增加加工建议。
|
|
300
|
+
|
|
301
|
+
验收:
|
|
302
|
+
|
|
303
|
+
- 同一个 query 在 `write`、`decide`、`research`、`style` 下返回不同的建议结构。
|
|
304
|
+
- 有 insight/output 时优先暴露,不被 source 淹没。
|
|
305
|
+
- `lint` 能指出“只有资料、没有个人判断”和“输出没有证据链”。
|
|
306
|
+
|
|
307
|
+
### P2:轻量回看闭环
|
|
308
|
+
|
|
309
|
+
目标:吸收 Retain 思想,但不把 AIWiki 变成学习软件。
|
|
310
|
+
|
|
311
|
+
任务:
|
|
312
|
+
|
|
313
|
+
1. 新增 `review` 或 `retain` 的候选生成命令。
|
|
314
|
+
2. 支持观点卡、证据卡、反驳卡、案例卡、输出卡。
|
|
315
|
+
3. Review Queue 只作为入口,不成为默认强制流程。
|
|
316
|
+
|
|
317
|
+
验收:
|
|
318
|
+
|
|
319
|
+
- 命令能生成今日回看候选。
|
|
320
|
+
- 不需要用户维护复杂学习计划。
|
|
321
|
+
- 不引入 FSRS 或重型记忆系统。
|
|
322
|
+
|
|
323
|
+
## 不做清单
|
|
324
|
+
|
|
325
|
+
- 不做通用网页抓取。
|
|
326
|
+
- 不做多知识库。
|
|
327
|
+
- 不做 CLI 内置 LLM。
|
|
328
|
+
- 不做默认人工审核流程。
|
|
329
|
+
- 不把 Review Queue 变成强制主流程。
|
|
330
|
+
- 不把 AIWiki 改成 Anki 或 Knowledge MEMO。
|
|
331
|
+
- 不用 `aiwiki-pro` 作为用户命令。
|
|
332
|
+
|
|
333
|
+
## 推荐任务拆分
|
|
334
|
+
|
|
335
|
+
1. `AIWIKI-POS-001`:更新 README / FAQ / USAGE 定位话术。
|
|
336
|
+
2. `AIWIKI-POS-002`:补充三类资产模型文档和示例 payload。
|
|
337
|
+
3. `AIWIKI-CTX-001`:为 `context` 增加 `--mode` 和 v2 结果字段。
|
|
338
|
+
4. `AIWIKI-QRY-001`:让 `query` 按 source / insight / output 分组展示。
|
|
339
|
+
5. `AIWIKI-LINT-001`:增加知识质量 lint。
|
|
340
|
+
6. `AIWIKI-NEXT-001`:让 `next` 输出加工建议。
|
|
341
|
+
7. `AIWIKI-REV-001`:设计轻量 review / retain 候选生成。
|
|
342
|
+
|
|
343
|
+
## 最终判断
|
|
344
|
+
|
|
345
|
+
这份定位文档对 AIWiki 是利好。它指出了“普通个人知识库/资料索引”在 AI 时代价值下降,这个判断应该接受;但它没有否定 AIWiki 的 Agent-first 本地上下文后端方向。真正可取的调整,是把 AIWiki 从“存知识”进一步收窄成“存上下文、判断和使用痕迹”。
|
|
346
|
+
|
|
347
|
+
AIWiki 下一步最该做的不是扩功能,而是把已有地基讲清楚、排出优先级,然后补齐 personal insight、output knowledge、task context 和 quality lint 这四块。
|
package/docs/README.md
CHANGED
package/docs/USAGE.md
CHANGED
|
@@ -318,13 +318,23 @@ aiwiki query "AI Agent"
|
|
|
318
318
|
aiwiki lint
|
|
319
319
|
```
|
|
320
320
|
|
|
321
|
+
常用工作台模式:
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
aiwiki lint --severity warning
|
|
325
|
+
aiwiki lint --json
|
|
326
|
+
aiwiki lint --no-write
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
`lint` 会先输出 `lint_summary`、`top_issue` 和报告路径,再按 Errors / Warnings / Info 分组展示问题。每个问题会尽量给出建议动作,例如 `enrich`、`fix_link`、`reingest`、`archive` 或 `mark_reviewed`。`--severity` 只查看指定级别,`--json` 给宿主 Agent 使用,`--no-write` 只在终端检查而不更新 `dashboards/Lint Report.md`。
|
|
330
|
+
|
|
321
331
|
查看下一步建议:
|
|
322
332
|
|
|
323
333
|
```bash
|
|
324
334
|
aiwiki next
|
|
325
335
|
```
|
|
326
336
|
|
|
327
|
-
|
|
337
|
+
默认情况下,`lint` 输出报告并写入 `dashboards/Lint Report.md`。
|
|
328
338
|
|
|
329
339
|
## 8. 高级调试
|
|
330
340
|
|
|
@@ -424,3 +434,59 @@ aiwiki status
|
|
|
424
434
|
- `next_action`: the recommended next command.
|
|
425
435
|
|
|
426
436
|
`aiwiki next` uses the same repair order: fix workspace structure first, then lint errors, lint warnings, empty-workspace onboarding, and finally healthy-state query guidance.
|
|
437
|
+
|
|
438
|
+
## Query and Context Filters
|
|
439
|
+
|
|
440
|
+
`aiwiki context` and `aiwiki query` use local Markdown/frontmatter search. They do not use vector search, a database, external search, or RAG-over-wiki.
|
|
441
|
+
|
|
442
|
+
Useful filters:
|
|
443
|
+
|
|
444
|
+
```bash
|
|
445
|
+
aiwiki context "AI Agent" --type wiki_entries --source-role input --wiki-type source_knowledge --status active --limit 5
|
|
446
|
+
aiwiki query "AI Agent" --type source_cards --status to-review --limit 3
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
Supported filters:
|
|
450
|
+
|
|
451
|
+
- `--type`: one result group, such as `wiki_entries`, `source_cards`, `claims`, `topics`, `outlines`, or `raw_refs`.
|
|
452
|
+
- `--source-role`: frontmatter `source_role`, usually `input`, `processing`, or `output`.
|
|
453
|
+
- `--wiki-type`: frontmatter `wiki_type`, such as `source_knowledge` or `personal_knowledge`.
|
|
454
|
+
- `--status`: frontmatter status, such as `active`, `to-review`, `ready`, or `draft`.
|
|
455
|
+
- `--limit`: per-group result limit, clamped from 1 to 50.
|
|
456
|
+
|
|
457
|
+
The JSON result keeps the stable `schema_version: "aiwiki.context.v1"` and now also includes:
|
|
458
|
+
|
|
459
|
+
- `query_scope`: filters, limit, and searched groups.
|
|
460
|
+
- `result_quality`: total matches, best score, whether a Wiki Entry was found, and warnings.
|
|
461
|
+
- `recommended_next_action`: for example `use_matches_for_answer`, `review_grounding_or_enrich_entry`, or `broaden_query_or_ingest_source`.
|
|
462
|
+
- Per match: `match_reasons`, `quality_signals`, and `related_refs`.
|
|
463
|
+
|
|
464
|
+
Use `match_reasons` to explain why a result matched. Use `quality_signals` before answering confidently: scaffold or grounding-review entries should be treated as traceable leads, not final knowledge.
|
|
465
|
+
|
|
466
|
+
## Agent Skill Sync
|
|
467
|
+
|
|
468
|
+
AIWiki does not modify Agent configuration during `npm install`. After first install or upgrade, sync the packaged skill explicitly:
|
|
469
|
+
|
|
470
|
+
```bash
|
|
471
|
+
aiwiki agent sync --yes
|
|
472
|
+
aiwiki agent check
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
For one host Agent:
|
|
476
|
+
|
|
477
|
+
```bash
|
|
478
|
+
aiwiki agent sync --agent codex --yes
|
|
479
|
+
aiwiki agent sync --agent claude --yes
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
Useful Agent-facing options:
|
|
483
|
+
|
|
484
|
+
```bash
|
|
485
|
+
aiwiki agent sync --dry-run
|
|
486
|
+
aiwiki agent sync --json --yes
|
|
487
|
+
aiwiki agent check --json
|
|
488
|
+
aiwiki agent help
|
|
489
|
+
aiwiki context --help
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
`agent sync` is safe for first install and cross-version upgrades. It installs missing targets, leaves current targets unchanged, and backs up changed installed skill files before overwrite. If a backup is created, tell the user the backup path and that rollback means copying the backup file back to the target path.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# AIWiki Development Log
|
|
2
|
+
|
|
3
|
+
This log records queue-driven AIWiki development milestones that should remain visible to future maintainers, not only in automation chat history.
|
|
4
|
+
|
|
5
|
+
## 2026-06-05 - AIWIKI-004 lint workbench
|
|
6
|
+
|
|
7
|
+
Status: implemented, locally verified, pushed to GitHub, blocked on npm OTP before publication.
|
|
8
|
+
|
|
9
|
+
Version target: `@itradingai/aiwiki@0.2.16`
|
|
10
|
+
|
|
11
|
+
Commit: `932386c` (`Turn lint into an actionable maintenance workbench`)
|
|
12
|
+
|
|
13
|
+
### Goal
|
|
14
|
+
|
|
15
|
+
Turn `aiwiki lint` from a plain report writer into a practical structure-maintenance workbench for humans and host Agents.
|
|
16
|
+
|
|
17
|
+
The scoped acceptance criteria were:
|
|
18
|
+
|
|
19
|
+
- summarize lint output in the terminal with errors, warnings, info, top issue, and report path;
|
|
20
|
+
- group the markdown report by severity and provide a handling order;
|
|
21
|
+
- support `--severity error|warning|info`;
|
|
22
|
+
- support `--json` for machine-readable Agent use;
|
|
23
|
+
- support `--no-write` for temporary checks that do not update `dashboards/Lint Report.md`;
|
|
24
|
+
- add lightweight knowledge-gap signals where feasible;
|
|
25
|
+
- attach advisory review actions such as `enrich`, `fix_link`, `archive`, `reingest`, and `mark_reviewed`.
|
|
26
|
+
|
|
27
|
+
### Implemented
|
|
28
|
+
|
|
29
|
+
- `src/lint.ts`
|
|
30
|
+
- Added `LintSeverity` and advisory `LintAction`.
|
|
31
|
+
- Added issue `category` and `action` fields.
|
|
32
|
+
- Added system-file checks for `_system/purpose.md`, `_system/index.md`, and `_system/log.md`.
|
|
33
|
+
- Added signals for isolated Source Cards, stale deterministic fallback entries, grounding-review entries, metadata-boundary issues, duplicate URLs/titles, and broken wikilinks.
|
|
34
|
+
- Added severity filtering, terminal summary rendering, and severity-grouped report rendering.
|
|
35
|
+
|
|
36
|
+
- `src/app.ts`
|
|
37
|
+
- Added `aiwiki lint --severity error|warning|info`.
|
|
38
|
+
- Added `aiwiki lint --json`.
|
|
39
|
+
- Added `aiwiki lint --no-write`.
|
|
40
|
+
- Kept the default behavior of writing `dashboards/Lint Report.md`.
|
|
41
|
+
|
|
42
|
+
- `tests/cli.test.ts` and `tests/ingest.test.ts`
|
|
43
|
+
- Covered lint summary output, severity filtering, JSON output, no-write behavior, and updated lint issue text assertions.
|
|
44
|
+
|
|
45
|
+
- `docs/USAGE.md` and `docs/AGENT_HANDOFF.md`
|
|
46
|
+
- Documented human and Agent-facing lint modes.
|
|
47
|
+
|
|
48
|
+
### Verification
|
|
49
|
+
|
|
50
|
+
- `npm test`: passed, 53 tests.
|
|
51
|
+
- `npm run release:check`: passed, including 53 tests and release-check.
|
|
52
|
+
- `npm pack --dry-run`: passed for `@itradingai/aiwiki@0.2.16`.
|
|
53
|
+
- Clean export pack from `C:/tmp/aiwiki-004-publish`: passed, 31 files, shasum `945c70d3d4cf20c9550deaaf92036786b75e62cf`.
|
|
54
|
+
|
|
55
|
+
### Release State
|
|
56
|
+
|
|
57
|
+
GitHub push succeeded:
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
2e4b253..932386c main -> main
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
npm publication is blocked by a one-time password challenge:
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
npm error code EOTP
|
|
67
|
+
npm error This operation requires a one-time password from your authenticator.
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Current registry version remains `0.2.15`, so remote smoke tests for `0.2.16` have not run yet.
|
|
71
|
+
|
|
72
|
+
### Resume Steps
|
|
73
|
+
|
|
74
|
+
From the clean publish directory:
|
|
75
|
+
|
|
76
|
+
```powershell
|
|
77
|
+
cd C:\tmp\aiwiki-004-publish
|
|
78
|
+
npm publish --access public --otp=<code>
|
|
79
|
+
npm view @itradingai/aiwiki version
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
After `npm view` returns `0.2.16`, run remote smoke tests for:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
aiwiki lint --path <tmp-vault>
|
|
86
|
+
aiwiki lint --severity warning --path <tmp-vault>
|
|
87
|
+
aiwiki lint --json --path <tmp-vault>
|
|
88
|
+
aiwiki lint --no-write --path <tmp-vault>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Then update the queue through `published`, `remote_verified`, and `done`.
|
|
92
|
+
|
|
93
|
+
### Notes For Future Changes
|
|
94
|
+
|
|
95
|
+
- Lint actions are advisory only. Do not make `archive`, `reingest`, `mark_reviewed`, or related actions mutate files without a separate explicit task.
|
|
96
|
+
- Keep lint local-file-only. Do not add crawling, vector search, RAG-over-wiki, RBAC, RSS, scheduled collection, or browser plugins under this queue item.
|
|
97
|
+
- The original working tree had unrelated `skill/SKILL.md` changes. Publication must use a clean commit export until that WIP is resolved.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itradingai/aiwiki",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Agent-first AI knowledge base CLI for turning articles, links and notes into Obsidian-ready source cards, topics, outlines and reusable knowledge assets.",
|
|
6
6
|
"license": "MIT",
|
package/skill/LINT_PROTOCOL.md
CHANGED
|
@@ -15,15 +15,23 @@ Use this protocol when the user asks:
|
|
|
15
15
|
aiwiki lint
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
2.
|
|
19
|
-
|
|
18
|
+
2. When you need machine-readable triage, call:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
aiwiki lint --json
|
|
22
|
+
aiwiki next
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
3. Read the terminal report.
|
|
26
|
+
4. Mention the report path, usually:
|
|
20
27
|
|
|
21
28
|
```text
|
|
22
29
|
dashboards/Lint Report.md
|
|
23
30
|
```
|
|
24
31
|
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
5. Explain warnings and errors as structure-health feedback.
|
|
33
|
+
6. Do not frame lint as "the user must manually audit every note".
|
|
34
|
+
7. If `aiwiki next` recommends `aiwiki agent sync --yes`, treat Agent skill setup as the next operational step before asking the user to ingest or query more material.
|
|
27
35
|
|
|
28
36
|
## Issue Meaning
|
|
29
37
|
|
|
@@ -39,4 +47,3 @@ Prefer small, traceable fixes:
|
|
|
39
47
|
- Fix broken wikilinks.
|
|
40
48
|
- Add missing `source_card` or `raw_file` paths.
|
|
41
49
|
- Ask the host Agent to provide `analysis` for scaffold entries.
|
|
42
|
-
|
package/skill/QUERY_PROTOCOL.md
CHANGED
|
@@ -16,11 +16,29 @@ Use this protocol when the user asks:
|
|
|
16
16
|
aiwiki context "<topic>"
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
Add filters when the user intent is specific:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
aiwiki context "<topic>" --type wiki_entries --status active --limit 5
|
|
23
|
+
aiwiki context "<topic>" --source-role input --wiki-type source_knowledge --limit 5
|
|
24
|
+
aiwiki context "<topic>" --source-role output --limit 5
|
|
25
|
+
aiwiki context "<topic>" --type source_cards --status to-review --limit 5
|
|
26
|
+
```
|
|
27
|
+
|
|
19
28
|
3. Read the JSON result.
|
|
20
29
|
4. Prefer `matches.wiki_entries` before source cards, claims, topics, outlines, or raw refs.
|
|
21
|
-
5.
|
|
22
|
-
6.
|
|
23
|
-
7.
|
|
30
|
+
5. Read `query_scope` to understand what was searched.
|
|
31
|
+
6. Read `result_quality` before deciding how confident the answer can be.
|
|
32
|
+
7. Follow `recommended_next_action`:
|
|
33
|
+
- `use_matches_for_answer`: answer from the matches.
|
|
34
|
+
- `review_grounding_or_enrich_entry`: answer cautiously and suggest enrichment/review.
|
|
35
|
+
- `review_source_cards_then_create_wiki_entry`: explain that only source-level material exists.
|
|
36
|
+
- `broaden_query_or_ingest_source`: ask for a broader query or ingest more material.
|
|
37
|
+
8. Use `match_reasons` to explain why an item was selected.
|
|
38
|
+
9. Use `quality_signals` to decide whether the result is enriched, scaffold, needs grounding review, or only has weak source support.
|
|
39
|
+
10. Use `related_refs` to mention useful local follow-up files.
|
|
40
|
+
11. If the best Wiki Entry has `quality: "scaffold"` or `quality_signals` includes `grounding:needs_review`, tell the user that the entry is a traceable lead and may need Agent enrichment or evidence review.
|
|
41
|
+
12. Do not scan `02-raw` by default unless:
|
|
24
42
|
- Wiki Entries are insufficient.
|
|
25
43
|
- The user asks to verify the original source.
|
|
26
44
|
- There is a source conflict.
|
|
@@ -35,4 +53,3 @@ Include:
|
|
|
35
53
|
- Source basis.
|
|
36
54
|
- Known gaps or scaffold warnings.
|
|
37
55
|
- Suggested next step.
|
|
38
|
-
|
package/skill/SKILL.md
CHANGED
|
@@ -3,12 +3,46 @@ name: aiwiki
|
|
|
3
3
|
description: Agent-first AIWiki workflow for turning one URL/body into local Wiki knowledge files.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
<!-- aiwiki-skill-version: 0.2.18 -->
|
|
7
|
+
|
|
6
8
|
# AIWiki Skill
|
|
7
9
|
|
|
8
10
|
Use this skill when the user asks an Agent to process one URL, article body, or local text file with the `aiwiki` keyword, or says phrases like `入库 <url>` / `收录 <url>` / `从 AIWiki 里了解 <topic>`.
|
|
9
11
|
|
|
10
12
|
AIWiki CLI does not fetch webpages and does not call an LLM. The host Agent reads and understands the source; AIWiki validates, writes, links, tracks, queries, and lints local Markdown knowledge files.
|
|
11
13
|
|
|
14
|
+
## Agent-First Setup and Upgrade
|
|
15
|
+
|
|
16
|
+
When the user asks you to install, update, or repair AIWiki Agent integration, prefer the idempotent sync command:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
aiwiki agent sync --yes
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For a specific host:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
aiwiki agent sync --agent codex --yes
|
|
26
|
+
aiwiki agent sync --agent claude --yes
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Use `--dry-run` to preview without writing, and `--json` when you need machine-readable status:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
aiwiki agent sync --agent codex --dry-run
|
|
33
|
+
aiwiki agent sync --json --yes
|
|
34
|
+
aiwiki agent check --json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Sync behavior:
|
|
38
|
+
|
|
39
|
+
- missing installed skill: install the packaged AIWiki skill
|
|
40
|
+
- current installed skill: leave unchanged
|
|
41
|
+
- different installed skill: backup the old file, then overwrite with the packaged skill
|
|
42
|
+
- unsupported host: do not write; use `aiwiki prompt agent` as a manual fallback
|
|
43
|
+
|
|
44
|
+
After sync, tell the user the target path, any backup path, and that the target Agent may need to restart or reload before the new skill is active. Never edit Agent config during `npm install`; sync is the explicit safe step.
|
|
45
|
+
|
|
12
46
|
## Knowledge Base Purpose
|
|
13
47
|
|
|
14
48
|
Before ingesting, querying, linting, or reorganizing material, read `_system/purpose.md` in the target AIWiki workspace when it exists. Treat it as the local contract for:
|
|
@@ -143,7 +177,26 @@ When the user asks to understand a topic from AIWiki, call:
|
|
|
143
177
|
aiwiki context "<topic>"
|
|
144
178
|
```
|
|
145
179
|
|
|
146
|
-
Use
|
|
180
|
+
Use filters when the user's intent is clear:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
aiwiki context "<topic>" --type wiki_entries --status active --limit 5
|
|
184
|
+
aiwiki context "<topic>" --source-role output --limit 5
|
|
185
|
+
aiwiki context "<topic>" --type source_cards --status to-review --limit 5
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Use the returned JSON to answer. Prefer Wiki Entries first, but read these fields before responding:
|
|
189
|
+
|
|
190
|
+
- `query_scope`: filters, limit, and searched groups
|
|
191
|
+
- `result_quality`: total matches, best score, and whether a Wiki Entry was found
|
|
192
|
+
- `recommended_next_action`: whether to answer, broaden the query, enrich, or review grounding
|
|
193
|
+
- `match_reasons`: why each result matched
|
|
194
|
+
- `quality_signals`: scaffold, enriched, grounding, status, and relationship hints
|
|
195
|
+
- `related_refs`: local wikilinks and frontmatter relationships
|
|
196
|
+
|
|
197
|
+
Do not scan `02-raw` by default unless the Wiki result is insufficient, the user asks to verify the original text, or sources conflict.
|
|
198
|
+
|
|
199
|
+
If `quality_signals` contains `quality:scaffold` or `grounding:needs_review`, tell the user the result is a traceable lead that needs enrichment or review. Do not present it as final confirmed knowledge.
|
|
147
200
|
|
|
148
201
|
For direct human terminal output, use:
|
|
149
202
|
|