@itradingai/aiwiki 0.2.10 → 0.2.12

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/skill/SKILL.md CHANGED
@@ -1,21 +1,22 @@
1
1
  ---
2
2
  name: aiwiki
3
- description: Agent-first AIWiki workflow for turning one URL/body into local knowledge production files.
3
+ description: Agent-first AIWiki workflow for turning one URL/body into local Wiki knowledge files.
4
4
  ---
5
5
 
6
6
  # AIWiki Skill
7
7
 
8
- Use this skill when the user asks an Agent to process one URL, article body, or local text file with the `aiwiki` keyword.
8
+ 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
9
 
10
- The host Agent reads the webpage or user-provided body, then passes structured content to the `aiwiki` CLI. The base CLI writes files and does not own webpage fetching stability.
10
+ 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
11
 
12
- ## Agent 对接流程
12
+ ## Ingest Flow
13
13
 
14
14
  1. Read the URL, message, attachment, or user-provided body.
15
15
  2. Build an `aiwiki.agent_payload.v1` payload with `source` and `request`.
16
- 3. Do not include output paths in the payload. The CLI decides where files are written.
17
- 4. If webpage reading fails, still build a payload with `source.fetch_status` set to `failed` and include `source.fetch_notes`.
18
- 5. Prefer stdin so the user does not need to save a payload file:
16
+ 3. If you understand the source, also provide `analysis` and/or `wiki_entry`.
17
+ 4. Do not include output paths in the payload. The CLI decides where files are written.
18
+ 5. If webpage reading fails, still build a payload with `source.fetch_status` set to `failed` and include `source.fetch_notes`.
19
+ 6. Prefer stdin so the user does not need to save a payload file:
19
20
 
20
21
  ```bash
21
22
  aiwiki ingest-agent --stdin
@@ -33,43 +34,34 @@ For local files, call:
33
34
  aiwiki ingest-file --file <file>
34
35
  ```
35
36
 
36
- ## 用户回复
37
+ ## Wiki Entry Generation Rules
37
38
 
38
- After the CLI runs, read the command output and report these fields to the user:
39
-
40
- - `ingested`: whether readable content was written into the knowledge base.
41
- - `recorded`: whether AIWiki wrote a run record.
42
- - `fetch_status`: whether the host Agent supplied readable content.
43
- - `fit_score` and `fit_level`: lightweight fit feedback for review priority.
44
- - `summary`: short content summary or fetch-failure note.
45
- - `run_dir` and `processing_summary`: local result entry points.
46
- - `source_card`: Obsidian source-card entry when ingestion succeeded.
47
- - `dashboard` and `review_queue`: Obsidian review database entry points.
48
-
49
- Recommended reply shape:
39
+ AIWiki always creates a Wiki Entry for successful ingestion:
50
40
 
51
41
  ```text
52
- 已加入 Obsidian 审阅队列。
53
- 契合度:<fit_score> / <fit_level>
54
- 摘要:<summary>
55
- 资料卡:<source_card>
56
- 处理记录:<processing_summary>
57
- Obsidian 入口:<dashboard>
58
- 待审队列:<review_queue>
42
+ 05-wiki/source-knowledge/<slug>.md
59
43
  ```
60
44
 
61
- If `fetch_status` is `failed`, say that AIWiki recorded the failure reason but did not ingest readable content.
45
+ There are two modes:
62
46
 
63
- ## Obsidian + Dataview 边界
47
+ - `agent_enriched` / `enriched`: you provided `analysis` or `wiki_entry`; AIWiki writes those results into the Wiki Entry.
48
+ - `deterministic_fallback` / `scaffold`: you only provided source content; AIWiki writes title, source links, body preview, backlinks, and a "to be completed by Agent" section.
64
49
 
65
- - AIWiki 默认使用中文提示和中文审阅流程。
66
- - AIWiki 可直接配合 Obsidian 原生 Markdown、Properties、Backlinks、Search 和 Graph View 使用。
67
- - Dataview 是可选增强,只用于渲染生成的 dashboards。
68
- - 不要替用户安装 Dataview。
69
- - 不要编辑 `.obsidian`、`community-plugins.json` 或 Obsidian 插件配置。
70
- - 如果用户问 Dataview,说明可以在 Obsidian Community plugins 中手动安装并启用,然后打开 `dashboards/AIWiki Home.md`。
50
+ Because AIWiki CLI does not call an LLM, high-quality summary and knowledge extraction are the host Agent's responsibility. When possible, provide:
71
51
 
72
- ## 最小 Payload
52
+ - `analysis.summary`
53
+ - `analysis.key_points`
54
+ - `analysis.reusable_knowledge`
55
+ - `analysis.related_concepts`
56
+ - `analysis.use_cases`
57
+ - `analysis.topic_candidates`
58
+ - `analysis.claims`
59
+ - `analysis.outline`
60
+ - `wiki_entry.title`
61
+ - `wiki_entry.sections`
62
+ - `wiki_entry.markdown`
63
+
64
+ ## Minimal Payload
73
65
 
74
66
  ```json
75
67
  {
@@ -82,12 +74,104 @@ If `fetch_status` is `failed`, say that AIWiki recorded the failure reason but d
82
74
  "content": "Article body read by the host Agent.",
83
75
  "fetcher": "host-agent",
84
76
  "fetch_status": "ok",
85
- "captured_at": "2026-05-07T10:00:00+08:00"
77
+ "captured_at": "2026-05-07T10:00:00+08:00",
78
+ "source_role": "input",
79
+ "represents_user_view": false
80
+ },
81
+ "analysis": {
82
+ "summary": "One-sentence summary.",
83
+ "key_points": ["Key point 1", "Key point 2"],
84
+ "related_concepts": ["Concept A"]
86
85
  },
87
86
  "request": {
88
87
  "mode": "ingest",
89
- "outputs": ["source_card", "creative_assets", "topics", "draft_outline", "processing_summary"],
88
+ "outputs": ["source_card", "wiki_entry", "creative_assets", "topics", "draft_outline", "processing_summary"],
90
89
  "language": "zh-CN"
91
90
  }
92
91
  }
93
92
  ```
93
+
94
+ ## User Reply
95
+
96
+ After the CLI runs, read the command output and report these fields:
97
+
98
+ - `ingested`
99
+ - `recorded`
100
+ - `fetch_status`
101
+ - `fit_score` and `fit_level`
102
+ - `summary`
103
+ - `wiki_entry`
104
+ - `wiki_entry_generation_mode`
105
+ - `wiki_entry_quality`
106
+ - `source_card`
107
+ - `processing_summary`
108
+ - `run_dir`
109
+
110
+ Recommended success reply:
111
+
112
+ ```text
113
+ AIWiki 已完成入库,并生成 Wiki 条目。
114
+ 质量模式:<wiki_entry_quality> / <wiki_entry_generation_mode>
115
+ 摘要:<summary>
116
+ Wiki 条目:<wiki_entry>
117
+ 资料卡:<source_card>
118
+ 处理记录:<processing_summary>
119
+ ```
120
+
121
+ If `wiki_entry_quality` is `scaffold`, say clearly that this Wiki Entry is a traceable fallback and still needs Agent enrichment for high-quality knowledge extraction.
122
+
123
+ If `fetch_status` is `failed`, say that AIWiki recorded the failure reason but did not ingest readable content.
124
+
125
+ ## Query Protocol
126
+
127
+ When the user asks to understand a topic from AIWiki, call:
128
+
129
+ ```bash
130
+ aiwiki context "<topic>"
131
+ ```
132
+
133
+ Use the returned JSON to answer. Prefer Wiki Entries first. Do not scan `02-raw` by default unless the Wiki result is insufficient, the user asks to verify the original text, or sources conflict.
134
+
135
+ For direct human terminal output, use:
136
+
137
+ ```bash
138
+ aiwiki query "<topic>"
139
+ ```
140
+
141
+ `query` renders the same retrieval basis as `context`; do not treat it as a separate search system.
142
+
143
+ ## Lint Protocol
144
+
145
+ When the user asks to整理 / 检查 / lint the knowledge base, call:
146
+
147
+ ```bash
148
+ aiwiki lint
149
+ ```
150
+
151
+ Explain warnings and errors as structure-health feedback. Do not frame lint as a requirement that the user manually review every item.
152
+
153
+ ## Source Role
154
+
155
+ Use the default source role for external material:
156
+
157
+ ```json
158
+ "source_role": "input",
159
+ "represents_user_view": false
160
+ ```
161
+
162
+ Only use `source_role: "output"` with `represents_user_view: true` when the user is importing their own published writing, talk transcript, newsletter, or similar authored output. Do not mark external material as the user's view.
163
+
164
+ ## Obsidian + Dataview Boundary
165
+
166
+ - AIWiki can be used with plain Markdown.
167
+ - Obsidian is a useful viewing surface, not a hard dependency.
168
+ - Dataview is optional and only enhances generated dashboards.
169
+ - Do not install Dataview for the user.
170
+ - Do not edit `.obsidian`, `community-plugins.json`, or Obsidian plugin configuration.
171
+
172
+ ## Prohibited
173
+
174
+ - Do not ask the user to save payload files.
175
+ - Do not ask the user to type `--path` every time.
176
+ - Do not claim AIWiki CLI fetches webpages.
177
+ - Do not claim AIWiki CLI automatically creates high-quality summaries without Agent-provided analysis.