@itradingai/aiwiki 0.2.24 → 0.2.25

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/dist/src/app.js CHANGED
@@ -316,7 +316,7 @@ function printContextHelp(stream) {
316
316
  writeLine(stream, " --status active|to-review|ready|draft");
317
317
  writeLine(stream, " --limit <1-50>");
318
318
  writeLine(stream, "");
319
- writeLine(stream, "context JSON includes query_scope, result_quality, recommended_next_action, match_reasons, quality_signals, and related_refs.");
319
+ writeLine(stream, "context JSON includes query_scope, result_quality, recommended_next_action, match_reasons, quality_signals, related_refs, and reuse_guidance.");
320
320
  }
321
321
  function parseLintSeverity(value) {
322
322
  if (value === undefined) {
@@ -850,6 +850,7 @@ function contextOptions(args) {
850
850
  function renderQuery(context) {
851
851
  const lines = [`AIWiki 查询: ${context.query}`, ""];
852
852
  lines.push(`结果质量: matches=${context.result_quality.total_matches}, best_score=${context.result_quality.best_score}, has_wiki_entry=${context.result_quality.has_wiki_entry ? "yes" : "no"}`, `下一步建议: ${context.recommended_next_action}`, `查询范围: groups=${context.query_scope.searched_groups.join(",") || "none"}, limit=${context.query_scope.limit}, filters=${JSON.stringify(context.query_scope.filters)}`, "");
853
+ lines.push("Reuse workflows:", `- writing: ${context.reuse_guidance.writing}`, `- research: ${context.reuse_guidance.research}`, `- decision: ${context.reuse_guidance.decision}`, `- review: ${context.reuse_guidance.review}`, "");
853
854
  appendQueryGroup(lines, "Wiki 条目", context.matches.wiki_entries);
854
855
  appendQueryGroup(lines, "资料卡", context.matches.source_cards);
855
856
  appendQueryGroup(lines, "选题", context.matches.topics);
@@ -42,6 +42,7 @@ export async function buildContext(rootPath, query, options = {}, now = new Date
42
42
  raw_refs: []
43
43
  },
44
44
  suggested_answer_structure: ["topic overview", "core claims", "available evidence", "reuse judgment", "next action"],
45
+ reuse_guidance: reuseGuidance(),
45
46
  warnings: []
46
47
  };
47
48
  if (!tokens.length) {
@@ -265,6 +266,14 @@ function qualitySignals(item) {
265
266
  signals.push("relationships:present");
266
267
  return signals;
267
268
  }
269
+ function reuseGuidance() {
270
+ return {
271
+ writing: "Use matched Wiki Entries for angles, outlines, and source-backed points; check quality_signals before drafting.",
272
+ research: "Start from Wiki Entries, then inspect related_refs and Source Cards when evidence or source context matters.",
273
+ decision: "Use matches to recover constraints, prior judgments, and rejected alternatives before making or revising a choice.",
274
+ review: "Use result_quality, match_reasons, quality_signals, and warnings to decide whether the knowledge is ready or needs enrichment."
275
+ };
276
+ }
268
277
  function finalizeQuality(result) {
269
278
  const all = Object.values(result.matches).flat();
270
279
  result.result_quality = {
@@ -174,6 +174,8 @@ If `fetch_status` is `failed`, say that AIWiki recorded the failure reason but d
174
174
 
175
175
  ## Query Protocol
176
176
 
177
+ Call AIWiki context before writing, researching, deciding, or reviewing when the user asks you to reuse knowledge from this workspace. This includes drafting from prior notes, comparing evidence, recovering project constraints, checking rejected alternatives, or validating whether a match is strong enough to cite.
178
+
177
179
  When the user asks what AIWiki knows about a topic, call:
178
180
 
179
181
  ```bash
@@ -196,6 +198,7 @@ Read these fields before responding:
196
198
  - `match_reasons`
197
199
  - `quality_signals`
198
200
  - `related_refs`
201
+ - `reuse_guidance`
199
202
 
200
203
  Do not scan `02-raw` by default unless the Wiki result is insufficient, the user asks to verify the original text, or sources conflict.
201
204
 
package/docs/USAGE.md CHANGED
@@ -185,6 +185,13 @@ For human-readable terminal output:
185
185
  aiwiki query "<topic>"
186
186
  ```
187
187
 
188
+ Use query/context before the assistant writes, researches, decides, or reviews:
189
+
190
+ - Writing: retrieve prior angles, outlines, source-backed points, and quality warnings before drafting.
191
+ - Research: start from Wiki Entries, then follow `related_refs` and Source Cards when evidence matters.
192
+ - Decisions: recover constraints, prior judgments, and rejected alternatives before changing direction.
193
+ - Review: check `result_quality`, `match_reasons`, `quality_signals`, and warnings before treating a match as reusable knowledge.
194
+
188
195
  Useful filters:
189
196
 
190
197
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itradingai/aiwiki",
3
- "version": "0.2.24",
3
+ "version": "0.2.25",
4
4
  "type": "module",
5
5
  "description": "Local Markdown knowledge base for AI assistants. Save what your AI reads, ask it later, and keep everything local.",
6
6
  "license": "MIT",
package/skill/SKILL.md CHANGED
@@ -3,7 +3,7 @@ name: aiwiki
3
3
  description: Local Markdown knowledge base workflow for AI assistants.
4
4
  ---
5
5
 
6
- <!-- aiwiki-skill-version: 0.2.22 -->
6
+ <!-- aiwiki-skill-version: 0.2.25 -->
7
7
 
8
8
  # AIWiki Skill
9
9
 
@@ -202,6 +202,8 @@ If `fetch_status` is `failed`, say that AIWiki recorded the failure reason but d
202
202
 
203
203
  ## Query Protocol
204
204
 
205
+ Call AIWiki context before writing, researching, deciding, or reviewing when the user asks you to reuse knowledge from this workspace. This includes drafting from prior notes, comparing evidence, recovering project constraints, checking rejected alternatives, or validating whether a match is strong enough to cite.
206
+
205
207
  When the user asks to understand a topic from AIWiki, call:
206
208
 
207
209
  ```bash
@@ -224,6 +226,7 @@ Use the returned JSON to answer. Prefer Wiki Entries first, but read these field
224
226
  - `match_reasons`: why each result matched
225
227
  - `quality_signals`: scaffold, enriched, grounding, status, and relationship hints
226
228
  - `related_refs`: local wikilinks and frontmatter relationships
229
+ - `reuse_guidance`: how to apply the result to writing, research, decisions, and review
227
230
 
228
231
  Do not scan `02-raw` by default unless the Wiki result is insufficient, the user asks to verify the original text, or sources conflict.
229
232