@puyinkai/xiaobao-cli 0.1.0 → 0.1.8

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 (44) hide show
  1. package/dist/{api-Ccj5dLMo.mjs → api-CX99_4K7.mjs} +22 -5
  2. package/dist/{api-client-DwySN6x-.mjs → api-client-zDBFgk0y.mjs} +5 -3
  3. package/dist/{audio-VmDQMq59.mjs → audio-ShfvRomP.mjs} +2 -2
  4. package/dist/{auth-ChHvqjCS.mjs → auth-DpK81Vp5.mjs} +3 -3
  5. package/dist/cli.mjs +15 -11
  6. package/dist/{consultant-ABFTL_jx.mjs → consultant-CS9B42d3.mjs} +1 -1
  7. package/dist/current-CfDExInT.mjs +33 -0
  8. package/dist/{customer-DtSnQqy_.mjs → customer-B1cxRbJ9.mjs} +1 -1
  9. package/dist/{focus-BDYuP2vZ.mjs → focus-DfNPPhm5.mjs} +1 -1
  10. package/dist/{format-BZvv8lYc.mjs → format-yjmxrbNm.mjs} +15 -7
  11. package/dist/{list-Bkyi95YO.mjs → list-CD08BRLk.mjs} +6 -6
  12. package/dist/{list-CzB9_Jho.mjs → list-CKlx8YuL.mjs} +6 -6
  13. package/dist/{list-DW6KAAaC.mjs → list-CnlFIFiY.mjs} +6 -6
  14. package/dist/{list-iwd9cH1I.mjs → list-Cu6WzPpA.mjs} +5 -5
  15. package/dist/{list-CVKSGNu4.mjs → list-D56gEqiB.mjs} +6 -6
  16. package/dist/{list--o5Q_PI8.mjs → list-DCcCS6LM.mjs} +6 -6
  17. package/dist/{list-CGACp0y-.mjs → list-DI1OD95x.mjs} +3 -3
  18. package/dist/login-CUUcjWPd.mjs +156 -0
  19. package/dist/{logout-BJm9pjje.mjs → logout-DP7REhCd.mjs} +10 -7
  20. package/dist/{project-Ba05YzJ5.mjs → project-BuQQewOs.mjs} +3 -2
  21. package/dist/{project-store-Bz5kf-EI.mjs → project-store-CKVJa54T.mjs} +4 -3
  22. package/dist/{qa-D-B9FV9W.mjs → qa-CKsKiQIm.mjs} +5 -5
  23. package/dist/{resistance-Cf7zsdB3.mjs → resistance-DsE-Ha6Y.mjs} +1 -1
  24. package/dist/{text-BLH4R3xv.mjs → text-C3jhdPoe.mjs} +5 -5
  25. package/dist/{token-store-CHZ_rJQk.mjs → token-store-CXizLE2_.mjs} +46 -6
  26. package/dist/{use-DV9Ii3Tn.mjs → use-BZES4FZC.mjs} +2 -2
  27. package/dist/{visit-Ct3Vea8I.mjs → visit-CX0Mc1n6.mjs} +1 -1
  28. package/dist/{whoami-DwTHvI4B.mjs → whoami-CZVez-rm.mjs} +2 -2
  29. package/package.json +2 -2
  30. package/skills/wangxiaobao-audio-query/SKILL.md +51 -106
  31. package/skills/wangxiaobao-audio-wiki/SKILL.md +31 -77
  32. package/skills/wangxiaobao-audio-wiki/references/audio-wiki-schema.md +386 -0
  33. package/skills/wangxiaobao-audio-wiki/references/llm-wiki-ingest.md +450 -0
  34. package/skills/wangxiaobao-customer-focus-query/SKILL.md +37 -87
  35. package/skills/wangxiaobao-customer-query/SKILL.md +41 -90
  36. package/skills/wangxiaobao-customer-resistance-query/SKILL.md +32 -86
  37. package/skills/wangxiaobao-quick-qa/SKILL.md +41 -92
  38. package/skills/wangxiaobao-shared/SKILL.md +194 -0
  39. package/skills/wangxiaobao-switch-project/SKILL.md +51 -77
  40. package/skills/wangxiaobao-visit-query/SKILL.md +41 -88
  41. package/dist/login-BwkrByMm.mjs +0 -91
  42. package/dist/{device-flow-BgsZipYA.mjs → device-flow-D6JVcEap.mjs} +1 -1
  43. /package/dist/{headers-D79npewp.mjs → headers-DSnR4sjk.mjs} +0 -0
  44. /package/dist/{util-DgwkUfV9.mjs → util-CaPQBlNa.mjs} +0 -0
@@ -0,0 +1,450 @@
1
+ ---
2
+ name: llm-wiki
3
+ description: "Karpathy's LLM Wiki — build and maintain a persistent, interlinked markdown knowledge base. Ingest sources, query compiled knowledge, and lint for consistency."
4
+ version: 2.0.0
5
+ author: Hermes Agent
6
+ license: MIT
7
+ metadata:
8
+ hermes:
9
+ tags: [wiki, knowledge-base, research, notes, markdown, rag-alternative]
10
+ category: research
11
+ related_skills: [obsidian, arxiv, agentic-research-ideas]
12
+ ---
13
+
14
+ # Karpathy's LLM Wiki
15
+
16
+ Build and maintain a persistent, compounding knowledge base as interlinked markdown files.
17
+ Based on [Andrej Karpathy's LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f).
18
+
19
+ Unlike traditional RAG (which rediscovers knowledge from scratch per query), the wiki
20
+ compiles knowledge once and keeps it current. Cross-references are already there.
21
+ Contradictions have already been flagged. Synthesis reflects everything ingested.
22
+
23
+ **Division of labor:** The human curates sources and directs analysis. The agent
24
+ summarizes, cross-references, files, and maintains consistency.
25
+
26
+ ## When This Skill Activates
27
+
28
+ Use this skill when the user:
29
+ - Asks to create, build, or start a wiki or knowledge base
30
+ - Asks to ingest, add, or process a source into their wiki
31
+ - Asks a question and an existing wiki is present at the configured path
32
+ - Asks to lint, audit, or health-check their wiki
33
+ - References their wiki, knowledge base, or "notes" in a research context
34
+
35
+ ## Wiki Location
36
+
37
+ **Location:** Set via `WIKI_PATH` environment variable (e.g. in `~/.hermes/.env`).
38
+
39
+ If unset, defaults to `~/wiki`.
40
+
41
+ ```bash
42
+ WIKI="${WIKI_PATH:-$HOME/wiki}"
43
+ ```
44
+
45
+ The wiki is just a directory of markdown files — open it in Obsidian, VS Code, or
46
+ any editor. No database, no special tooling required.
47
+
48
+ ## Architecture: Three Layers
49
+
50
+ ```
51
+ wiki/
52
+ ├── SCHEMA.md # Conventions, structure rules, domain config
53
+ ├── index.md # Sectioned content catalog with one-line summaries
54
+ ├── log.md # Chronological action log (append-only, rotated yearly)
55
+ ├── raw/ # Layer 1: Immutable source material
56
+ │ ├── articles/ # Web articles, clippings
57
+ │ ├── papers/ # PDFs, arxiv papers
58
+ │ ├── transcripts/ # Meeting notes, interviews
59
+ │ └── assets/ # Images, diagrams referenced by sources
60
+ ├── entities/ # Layer 2: Entity pages (people, orgs, products, models)
61
+ ├── concepts/ # Layer 2: Concept/topic pages
62
+ ├── comparisons/ # Layer 2: Side-by-side analyses
63
+ └── queries/ # Layer 2: Filed query results worth keeping
64
+ ```
65
+
66
+ **Layer 1 — Raw Sources:** Immutable. The agent reads but never modifies these.
67
+ **Layer 2 — The Wiki:** Agent-owned markdown files. Created, updated, and
68
+ cross-referenced by the agent.
69
+ **Layer 3 — The Schema:** `SCHEMA.md` defines structure, conventions, and tag taxonomy.
70
+
71
+ ## Resuming an Existing Wiki (CRITICAL — do this every session)
72
+
73
+ When the user has an existing wiki, **always orient yourself before doing anything**:
74
+
75
+ ① **Read `SCHEMA.md`** — understand the domain, conventions, and tag taxonomy.
76
+ ② **Read `index.md`** — learn what pages exist and their summaries.
77
+ ③ **Scan recent `log.md`** — read the last 20-30 entries to understand recent activity.
78
+
79
+ ```bash
80
+ WIKI="${WIKI_PATH:-$HOME/wiki}"
81
+ # Orientation reads at session start
82
+ read_file "$WIKI/SCHEMA.md"
83
+ read_file "$WIKI/index.md"
84
+ read_file "$WIKI/log.md" offset=<last 30 lines>
85
+ ```
86
+
87
+ Only after orientation should you ingest, query, or lint. This prevents:
88
+ - Creating duplicate pages for entities that already exist
89
+ - Missing cross-references to existing content
90
+ - Contradicting the schema's conventions
91
+ - Repeating work already logged
92
+
93
+ For large wikis (100+ pages), also run a quick `search_files` for the topic
94
+ at hand before creating anything new.
95
+
96
+ ## Initializing a New Wiki
97
+
98
+ When the user asks to create or start a wiki:
99
+
100
+ 1. Determine the wiki path (from `$WIKI_PATH` env var, or ask the user; default `~/wiki`)
101
+ 2. Create the directory structure above
102
+ 3. Ask the user what domain the wiki covers — be specific
103
+ 4. Write `SCHEMA.md` customized to the domain (see template below)
104
+ 5. Write initial `index.md` with sectioned header
105
+ 6. Write initial `log.md` with creation entry
106
+ 7. Confirm the wiki is ready and suggest first sources to ingest
107
+
108
+ ### SCHEMA.md Template
109
+
110
+ Adapt to the user's domain. The schema constrains agent behavior and ensures consistency:
111
+
112
+ ```markdown
113
+ # Wiki Schema
114
+
115
+ ## Domain
116
+ [What this wiki covers — e.g., "AI/ML research", "personal health", "startup intelligence"]
117
+
118
+ ## Conventions
119
+ - File names: lowercase, hyphens, no spaces (e.g., `transformer-architecture.md`)
120
+ - Every wiki page starts with YAML frontmatter (see below)
121
+ - Use `[[wikilinks]]` to link between pages (minimum 2 outbound links per page)
122
+ - When updating a page, always bump the `updated` date
123
+ - Every new page must be added to `index.md` under the correct section
124
+ - Every action must be appended to `log.md`
125
+
126
+ ## Frontmatter
127
+ ```yaml
128
+ ---
129
+ title: Page Title
130
+ created: YYYY-MM-DD
131
+ updated: YYYY-MM-DD
132
+ type: entity | concept | comparison | query | summary
133
+ tags: [from taxonomy below]
134
+ sources: [raw/articles/source-name.md]
135
+ ---
136
+ ```
137
+
138
+ ## Tag Taxonomy
139
+ [Define 10-20 top-level tags for the domain. Add new tags here BEFORE using them.]
140
+
141
+ Example for AI/ML:
142
+ - Models: model, architecture, benchmark, training
143
+ - People/Orgs: person, company, lab, open-source
144
+ - Techniques: optimization, fine-tuning, inference, alignment, data
145
+ - Meta: comparison, timeline, controversy, prediction
146
+
147
+ Rule: every tag on a page must appear in this taxonomy. If a new tag is needed,
148
+ add it here first, then use it. This prevents tag sprawl.
149
+
150
+ ## Page Thresholds
151
+ - **Create a page** when an entity/concept appears in 2+ sources OR is central to one source
152
+ - **Add to existing page** when a source mentions something already covered
153
+ - **DON'T create a page** for passing mentions, minor details, or things outside the domain
154
+ - **Split a page** when it exceeds ~200 lines — break into sub-topics with cross-links
155
+ - **Archive a page** when its content is fully superseded — move to `_archive/`, remove from index
156
+
157
+ ## Entity Pages
158
+ One page per notable entity. Include:
159
+ - Overview / what it is
160
+ - Key facts and dates
161
+ - Relationships to other entities ([[wikilinks]])
162
+ - Source references
163
+
164
+ ## Concept Pages
165
+ One page per concept or topic. Include:
166
+ - Definition / explanation
167
+ - Current state of knowledge
168
+ - Open questions or debates
169
+ - Related concepts ([[wikilinks]])
170
+
171
+ ## Comparison Pages
172
+ Side-by-side analyses. Include:
173
+ - What is being compared and why
174
+ - Dimensions of comparison (table format preferred)
175
+ - Verdict or synthesis
176
+ - Sources
177
+
178
+ ## Update Policy
179
+ When new information conflicts with existing content:
180
+ 1. Check the dates — newer sources generally supersede older ones
181
+ 2. If genuinely contradictory, note both positions with dates and sources
182
+ 3. Mark the contradiction in frontmatter: `contradictions: [page-name]`
183
+ 4. Flag for user review in the lint report
184
+ ```
185
+
186
+ ### index.md Template
187
+
188
+ The index is sectioned by type. Each entry is one line: wikilink + summary.
189
+
190
+ ```markdown
191
+ # Wiki Index
192
+
193
+ > Content catalog. Every wiki page listed under its type with a one-line summary.
194
+ > Read this first to find relevant pages for any query.
195
+ > Last updated: YYYY-MM-DD | Total pages: N
196
+
197
+ ## Entities
198
+ <!-- Alphabetical within section -->
199
+
200
+ ## Concepts
201
+
202
+ ## Comparisons
203
+
204
+ ## Queries
205
+ ```
206
+
207
+ **Scaling rule:** When any section exceeds 50 entries, split it into sub-sections
208
+ by first letter or sub-domain. When the index exceeds 200 entries total, create
209
+ a `_meta/topic-map.md` that groups pages by theme for faster navigation.
210
+
211
+ ### log.md Template
212
+
213
+ ```markdown
214
+ # Wiki Log
215
+
216
+ > Chronological record of all wiki actions. Append-only.
217
+ > Format: `## [YYYY-MM-DD] action | subject`
218
+ > Actions: ingest, update, query, lint, create, archive, delete
219
+ > When this file exceeds 500 entries, rotate: rename to log-YYYY.md, start fresh.
220
+
221
+ ## [YYYY-MM-DD] create | Wiki initialized
222
+ - Domain: [domain]
223
+ - Structure created with SCHEMA.md, index.md, log.md
224
+ ```
225
+
226
+ ## Core Operations
227
+
228
+ ### 1. Ingest
229
+
230
+ When the user provides a source (URL, file, paste), integrate it into the wiki:
231
+
232
+ ① **Capture the raw source:**
233
+ - URL → use `web_extract` to get markdown, save to `raw/articles/`
234
+ - PDF → use `web_extract` (handles PDFs), save to `raw/papers/`
235
+ - Pasted text → save to appropriate `raw/` subdirectory
236
+ - Name the file descriptively: `raw/articles/karpathy-llm-wiki-2026.md`
237
+
238
+ ② **Discuss takeaways** with the user — what's interesting, what matters for
239
+ the domain. (Skip this in automated/cron contexts — proceed directly.)
240
+
241
+ ③ **Check what already exists** — search index.md and use `search_files` to find
242
+ existing pages for mentioned entities/concepts. This is the difference between
243
+ a growing wiki and a pile of duplicates.
244
+
245
+ ④ **Write or update wiki pages:**
246
+ - **New entities/concepts:** Create pages only if they meet the Page Thresholds
247
+ in SCHEMA.md (2+ source mentions, or central to one source)
248
+ - **Existing pages:** Add new information, update facts, bump `updated` date.
249
+ When new info contradicts existing content, follow the Update Policy.
250
+ - **Cross-reference:** Every new or updated page must link to at least 2 other
251
+ pages via `[[wikilinks]]`. Check that existing pages link back.
252
+ - **Tags:** Only use tags from the taxonomy in SCHEMA.md
253
+
254
+ ⑤ **Update navigation:**
255
+ - Add new pages to `index.md` under the correct section, alphabetically
256
+ - Update the "Total pages" count and "Last updated" date in index header
257
+ - Append to `log.md`: `## [YYYY-MM-DD] ingest | Source Title`
258
+ - List every file created or updated in the log entry
259
+
260
+ ⑥ **Report what changed** — list every file created or updated to the user.
261
+
262
+ A single source can trigger updates across 5-15 wiki pages. This is normal
263
+ and desired — it's the compounding effect.
264
+
265
+ ### 2. Query
266
+
267
+ When the user asks a question about the wiki's domain:
268
+
269
+ ① **Read `index.md`** to identify relevant pages.
270
+ ② **For wikis with 100+ pages**, also `search_files` across all `.md` files
271
+ for key terms — the index alone may miss relevant content.
272
+ ③ **Read the relevant pages** using `read_file`.
273
+ ④ **Synthesize an answer** from the compiled knowledge. Cite the wiki pages
274
+ you drew from: "Based on [[page-a]] and [[page-b]]..."
275
+ ⑤ **File valuable answers back** — if the answer is a substantial comparison,
276
+ deep dive, or novel synthesis, create a page in `queries/` or `comparisons/`.
277
+ Don't file trivial lookups — only answers that would be painful to re-derive.
278
+ ⑥ **Update log.md** with the query and whether it was filed.
279
+
280
+ ### 3. Lint
281
+
282
+ When the user asks to lint, health-check, or audit the wiki:
283
+
284
+ ① **Orphan pages:** Find pages with no inbound `[[wikilinks]]` from other pages.
285
+ ```python
286
+ # Use execute_code for this — programmatic scan across all wiki pages
287
+ import os, re
288
+ from collections import defaultdict
289
+ wiki = "<WIKI_PATH>"
290
+ # Scan all .md files in entities/, concepts/, comparisons/, queries/
291
+ # Extract all [[wikilinks]] — build inbound link map
292
+ # Pages with zero inbound links are orphans
293
+ ```
294
+
295
+ ② **Broken wikilinks:** Find `[[links]]` that point to pages that don't exist.
296
+
297
+ ③ **Index completeness:** Every wiki page should appear in `index.md`. Compare
298
+ the filesystem against index entries.
299
+
300
+ ④ **Frontmatter validation:** Every wiki page must have all required fields
301
+ (title, created, updated, type, tags, sources). Tags must be in the taxonomy.
302
+
303
+ ⑤ **Stale content:** Pages whose `updated` date is >90 days older than the most
304
+ recent source that mentions the same entities.
305
+
306
+ ⑥ **Contradictions:** Pages on the same topic with conflicting claims. Look for
307
+ pages that share tags/entities but state different facts.
308
+
309
+ ⑦ **Page size:** Flag pages over 200 lines — candidates for splitting.
310
+
311
+ ⑧ **Tag audit:** List all tags in use, flag any not in the SCHEMA.md taxonomy.
312
+
313
+ ⑨ **Log rotation:** If log.md exceeds 500 entries, rotate it.
314
+
315
+ ⑩ **Report findings** with specific file paths and suggested actions, grouped by
316
+ severity (broken links > orphans > stale content > style issues).
317
+
318
+ ⑪ **Append to log.md:** `## [YYYY-MM-DD] lint | N issues found`
319
+
320
+ ## Working with the Wiki
321
+
322
+ ### Searching
323
+
324
+ ```bash
325
+ # Find pages by content
326
+ search_files "transformer" path="$WIKI" file_glob="*.md"
327
+
328
+ # Find pages by filename
329
+ search_files "*.md" target="files" path="$WIKI"
330
+
331
+ # Find pages by tag
332
+ search_files "tags:.*alignment" path="$WIKI" file_glob="*.md"
333
+
334
+ # Recent activity
335
+ read_file "$WIKI/log.md" offset=<last 20 lines>
336
+ ```
337
+
338
+ ### Bulk Ingest
339
+
340
+ When ingesting multiple sources at once, batch the updates:
341
+ 1. Read all sources first
342
+ 2. Identify all entities and concepts across all sources
343
+ 3. Check existing pages for all of them (one search pass, not N)
344
+ 4. Create/update pages in one pass (avoids redundant updates)
345
+ 5. Update index.md once at the end
346
+ 6. Write a single log entry covering the batch
347
+
348
+ ### Archiving
349
+
350
+ When content is fully superseded or the domain scope changes:
351
+ 1. Create `_archive/` directory if it doesn't exist
352
+ 2. Move the page to `_archive/` with its original path (e.g., `_archive/entities/old-page.md`)
353
+ 3. Remove from `index.md`
354
+ 4. Update any pages that linked to it — replace wikilink with plain text + "(archived)"
355
+ 5. Log the archive action
356
+
357
+ ### Obsidian Integration
358
+
359
+ The wiki directory works as an Obsidian vault out of the box:
360
+ - `[[wikilinks]]` render as clickable links
361
+ - Graph View visualizes the knowledge network
362
+ - YAML frontmatter powers Dataview queries
363
+ - The `raw/assets/` folder holds images referenced via `![[image.png]]`
364
+
365
+ For best results:
366
+ - Set Obsidian's attachment folder to `raw/assets/`
367
+ - Enable "Wikilinks" in Obsidian settings (usually on by default)
368
+ - Install Dataview CLI for queries like `TABLE tags FROM "entities" WHERE contains(tags, "company")`
369
+
370
+ If using the Obsidian skill alongside this one, set `OBSIDIAN_VAULT_PATH` to the
371
+ same directory as the wiki path.
372
+
373
+ ### Obsidian Headless (servers and headless machines)
374
+
375
+ On machines without a display, use `obsidian-headless` instead of the desktop app.
376
+ It syncs vaults via Obsidian Sync without a GUI — perfect for agents running on
377
+ servers that write to the wiki while Obsidian desktop reads it on another device.
378
+
379
+ **Setup:**
380
+ ```bash
381
+ # Requires Node.js 22+
382
+ npm install -g obsidian-headless
383
+
384
+ # Login (requires Obsidian account with Sync subscription)
385
+ ob login --email <email> --password '<password>'
386
+
387
+ # Create a remote vault for the wiki
388
+ ob sync-create-remote --name "LLM Wiki"
389
+
390
+ # Connect the wiki directory to the vault
391
+ cd ~/wiki
392
+ ob sync-setup --vault "<vault-id>"
393
+
394
+ # Initial sync
395
+ ob sync
396
+
397
+ # Continuous sync (foreground — use systemd for background)
398
+ ob sync --continuous
399
+ ```
400
+
401
+ **Continuous background sync via systemd:**
402
+ ```ini
403
+ # ~/.config/systemd/user/obsidian-wiki-sync.service
404
+ [Unit]
405
+ Description=Obsidian LLM Wiki Sync
406
+ After=network-online.target
407
+ Wants=network-online.target
408
+
409
+ [Service]
410
+ ExecStart=/path/to/ob sync --continuous
411
+ WorkingDirectory=/home/user/wiki
412
+ Restart=on-failure
413
+ RestartSec=10
414
+
415
+ [Install]
416
+ WantedBy=default.target
417
+ ```
418
+
419
+ ```bash
420
+ systemctl --user daemon-reload
421
+ systemctl --user enable --now obsidian-wiki-sync
422
+ # Enable linger so sync survives logout:
423
+ sudo loginctl enable-linger $USER
424
+ ```
425
+
426
+ This lets the agent write to `~/wiki` on a server while you browse the same
427
+ vault in Obsidian on your laptop/phone — changes appear within seconds.
428
+
429
+ ## Pitfalls
430
+
431
+ - **Never modify files in `raw/`** — sources are immutable. Corrections go in wiki pages.
432
+ - **Always orient first** — read SCHEMA + index + recent log before any operation in a new session.
433
+ Skipping this causes duplicates and missed cross-references.
434
+ - **Always update index.md and log.md** — skipping this makes the wiki degrade. These are the
435
+ navigational backbone.
436
+ - **Don't create pages for passing mentions** — follow the Page Thresholds in SCHEMA.md. A name
437
+ appearing once in a footnote doesn't warrant an entity page.
438
+ - **Don't create pages without cross-references** — isolated pages are invisible. Every page must
439
+ link to at least 2 other pages.
440
+ - **Frontmatter is required** — it enables search, filtering, and staleness detection.
441
+ - **Tags must come from the taxonomy** — freeform tags decay into noise. Add new tags to SCHEMA.md
442
+ first, then use them.
443
+ - **Keep pages scannable** — a wiki page should be readable in 30 seconds. Split pages over
444
+ 200 lines. Move detailed analysis to dedicated deep-dive pages.
445
+ - **Ask before mass-updating** — if an ingest would touch 10+ existing pages, confirm
446
+ the scope with the user first.
447
+ - **Rotate the log** — when log.md exceeds 500 entries, rename it `log-YYYY.md` and start fresh.
448
+ The agent should check log size during lint.
449
+ - **Handle contradictions explicitly** — don't silently overwrite. Note both claims with dates,
450
+ mark in frontmatter, flag for user review.
@@ -1,86 +1,42 @@
1
1
  ---
2
2
  name: wangxiaobao-customer-focus-query
3
- description: |
4
- 旺小宝**客户关注点**分页查询 skill:按 visit/customer/audio ID 列表、一级/二级
5
- 分类模糊、来访时间窗组合查 AI 在客户对话里抽出的「关注点」标签
6
- (客户主动表达的关心:学区 / 户型 / 价格优惠 / 配套等)。**只读、不写文件、
7
- 无副作用**。对应 `xiaobao_list_customer_focus` tool。排序固定 visit_time DESC。
8
- 每条 tag customer / userInfo / audio + value_str(详细说明) + text_fragment(录音原文片段)。
9
-
10
- **当以下情况时使用此 Skill**:
11
- (1) 用户问"客户关注点"、"客户最在意什么"、"客户关心什么"、"客户问得最多"
12
- (2) 用户问某客户的关注点 —— 先调 `xiaobao_list_customers` 反查 customerId,
13
- 再调本 skill 带 customerIds 精确过滤
14
- (3) 用户问某次到访 / 某条录音里的关注点 —— 带 visitIds / audioIds
15
- (4) 用户按分类找 —— 户型 / 价格 / 学区 / 交通 / 商业配套 等 → category 模糊
16
- (5) 用户按二级分类找 —— "户型因素" / "位置因素" / "发展因素" → classification 模糊
17
- (6) 用户给时间窗 —— "5 月份的关注点" / "本周关注点" → fromDate / toDate
18
-
19
- **不要用本 skill 的场景**:
20
- - 用户问的是**抗性点 / 疑虑 / 反对意见** → 走 `wangxiaobao-customer-resistance-query`
21
- - 用户要的是客户**画像** / 标签 → 走 `wangxiaobao-customer-query`
22
- - 用户问"完整录音文本" → 走 `wangxiaobao-audio-query` + `xiaobao_get_audio_text`
3
+ version: 0.1.0
4
+ description: "旺小宝客户关注点(focus)分页查询 —— AI 在客户对话里抽出的客户主动表达的关心标签(学区 / 户型 / 价格优惠 / 配套等)。按 visit/customer/audio ID 列表(IN) + 一级分类(category LIKE) + 二级分类(classification LIKE) + 来访时间窗组合过滤,排序固定 visit_time DESC。每条 tag 已带 customer + userInfo + audio + value_str(详细说明) + text_fragment(录音原文片段)。只读、不写文件。高频命令: xiaobao-cli focus list [--visit-ids a,b] [--customer-ids a,b] [--audio-ids a,b] [--category <kw>] [--classification <kw>] [--from <date>] [--to <date>] [--page N] [--size N]。何时用:用户问客户关注点/客户最在意什么/客户关心什么/客户问得最多/某客户的关注点/某次到访或某条录音里的关注点/户型 价格 学区 交通 商业配套类关注点/5 月份的关注点。注:客户名→wang_id 先用 xiaobao-cli customer list 反查;问抗性/疑虑/反对走 resistance-query;问完整录音文本走 audio-query。"
5
+ metadata:
6
+ requires:
7
+ bins: ["xiaobao-cli"]
8
+ cliHelp: "xiaobao-cli focus --help"
23
9
  ---
24
10
 
25
- > **Host-agnostic CLI skill** — 本 skill 假设 `xiaobao-cli` 已装到 PATH
26
- > (`npm i -g @puyinkai/xiaobao-cli` 或 `npx -y @puyinkai/xiaobao-cli`)。
27
- > Agent 通过 shell 工具(Bash / Run / Shell)执行命令、读 **stdout JSON** 消费;
28
- > stderr 是进度/错误提示。退出码 0 = 成功,非 0 = 业务/网络错(错误对象同时打到 stdout 可解析)。
29
- >
30
- > CLI 14 个子命令跟 openclaw-xiaobao plugin 14 个 tool **1:1 等价**,返回 JSON
31
- > 结构完全一致(`{status, ok, data: {...}}`)。skill 里看到的 `resp.data.data.xxx`
32
- > 取数路径直接对 stdout JSON 用 `jq` / `JSON.parse` 即可。
33
- >
34
- > **plugin tool → CLI 命令翻译表(数组参数走逗号分隔)**:
35
- >
36
- > | plugin tool | CLI 命令 |
37
- > | --- | --- |
38
- > | `xiaobao_authorize { force? }` | `xiaobao-cli auth login [--force]` |
39
- > | `xiaobao_whoami` | `xiaobao-cli auth whoami` |
40
- > | `xiaobao_logout` | `xiaobao-cli auth logout` |
41
- > | `xiaobao_list_projects { keyword? }` | `xiaobao-cli project list [--keyword <kw>]` |
42
- > | `xiaobao_switch_project { tenantId, tenantName, projectId, projectName }` | `xiaobao-cli project use --tenant-id ... --tenant-name ... --project-id ... --project-name ...` |
43
- > | `xiaobao_list_consultants` | `xiaobao-cli consultant list` |
44
- > | `xiaobao_list_audio { fromDate, toDate, userId?, userIdList?, page, size }` | `xiaobao-cli audio list --from "..." --to "..." [--user-id ...] [--user-id-list a,b,c] [--page N] [--size N]` |
45
- > | `xiaobao_get_audio_text { audioId }` | `xiaobao-cli audio text <audioId>` |
46
- > | `xiaobao_list_customers { ... }` | `xiaobao-cli customer list [--user-id] [--user-name] [--customer-name] [--customer-phone] [--portrait] [--from] [--to] [--page] [--size]` |
47
- > | `xiaobao_list_visits { ... }` | `xiaobao-cli visit list [--customer-id] [--customer-name] [--from] [--to] [--page] [--size]` |
48
- > | `xiaobao_list_customer_focus { visitIds, customerIds, audioIds, category, classification, fromDate, toDate, ... }` | `xiaobao-cli focus list [--visit-ids a,b] [--customer-ids a,b] [--audio-ids a,b] [--category ...] [--classification ...] [--from ...] [--to ...]` |
49
- > | `xiaobao_list_customer_resistance { ... }` | `xiaobao-cli resistance list [同 focus]` |
50
- > | `xiaobao_quick_qa { prompt, threadId? }` | `xiaobao-cli qa "<prompt>" [--thread-id ...]` |
51
- > | `xiaobao_api { method, path, query, body, headers }` | `xiaobao-cli api <METHOD> <PATH> [--query k=v] [--body '<json>'] [--headers k=v]` |
52
- >
53
- > 用 `--format toon` 切到 TOON(uniform 数组省 30-50% token,LLM 上下文优化);
54
- > 用 `--format json`(默认)保持 JSON。state 路径:`~/.xiaobao/`(fallback 读 `~/.openclaw/state/wangxiaobao/`)。
55
-
56
-
57
11
  # 旺小宝客户关注点查询
58
12
 
59
- `xiaobao_list_customer_focus` tool AI 抽出的客户关注点标签。
13
+ > **CRITICAL** —— 跑命令前 MUST 先用 Read tool 读取 [`../wangxiaobao-shared/SKILL.md`](../wangxiaobao-shared/SKILL.md)(一份共享文档讲清安装 / 登录 / 选项目 / 错误码 / 输出协议等所有 xiaobao-cli 命令通用的前置约定)。
14
+
15
+ 跑 `xiaobao-cli focus list` 查 AI 抽出的客户关注点标签。
60
16
  跟抗性点 skill 镜像,差别就是底层走 `mv_open_customer_focus` 表。
61
17
 
62
18
  ## 执行前必读
63
19
 
64
- - 必须有有效 token:先调 `xiaobao_whoami`;未登录就 `xiaobao_authorize`
65
- - **必须有激活项目**:tool 内部自动读,缺失返回 `NO_ACTIVE_PROJECT`
20
+ - 必须有有效 token:先调 `xiaobao-cli auth whoami`;未登录就 `xiaobao-cli auth login`
21
+ - **必须有激活项目**:命令内部自动读,缺失返回 `NO_ACTIVE_PROJECT`
66
22
  - **数据权限隔离**:按当前用户授权可见顾问范围过滤(普通顾问看自己 /
67
23
  团队长看团队 / 项目管理员看全项目)
68
- - LocalDateTime 格式:`yyyy-MM-dd HH:mm:ss`(空格分隔),plugin 自动转
24
+ - LocalDateTime 格式:`yyyy-MM-dd HH:mm:ss`(空格分隔),CLI 自动转
69
25
  - **不要**写文件、出报告
70
26
 
71
27
  ---
72
28
 
73
29
  ## 快速索引:意图 → 工具
74
30
 
75
- | 用户意图 | plugin tool | 关键参数 |
31
+ | 用户意图 | 命令 | 关键参数 |
76
32
  | ------------------------------------ | --------------------------------- | ---------------------------------- |
77
- | 列时段内全部关注点 | `xiaobao_list_customer_focus` | `fromDate` / `toDate` |
78
- | 看某客户的关注点 | `xiaobao_list_customers` → `xiaobao_list_customer_focus` | `customerIds: [<wang_id>]` |
79
- | 看某次到访的关注点 | `xiaobao_list_customer_focus` | `visitIds: [<visit_id>]` |
80
- | 看某条录音的关注点 | `xiaobao_list_customer_focus` | `audioIds: [<audio_id>]` |
81
- | 按分类找(一级) | `xiaobao_list_customer_focus` | `category: "户型"` 等 |
82
- | 按分类找(二级) | `xiaobao_list_customer_focus` | `classification: "户型因素"` |
83
- | 估算总数 | `xiaobao_list_customer_focus` | `page: 1, size: 1`,只读 `total` |
33
+ | 列时段内全部关注点 | `xiaobao-cli focus list` | `--from` / `--to` |
34
+ | 看某客户的关注点 | `xiaobao-cli customer list` → `xiaobao-cli focus list` | `--customer-ids <wang_id>` |
35
+ | 看某次到访的关注点 | `xiaobao-cli focus list` | `--visit-ids <visit_id>` |
36
+ | 看某条录音的关注点 | `xiaobao-cli focus list` | `--audio-ids <audio_id>` |
37
+ | 按分类找(一级) | `xiaobao-cli focus list` | `--category 户型` 等 |
38
+ | 按分类找(二级) | `xiaobao-cli focus list` | `--classification 户型因素` |
39
+ | 估算总数 | `xiaobao-cli focus list` | `--page 1 --size 1`,只读 `total` |
84
40
 
85
41
  ---
86
42
 
@@ -88,8 +44,8 @@ description: |
88
44
 
89
45
  ### 1. 客户名 → wang_id 反查
90
46
 
91
- 用户说"屈哥的关注点"——先调 `xiaobao_list_customers { customerName: "屈哥" }`
92
- 拿到 `customerId`(= wang_id),再传给 `customerIds` 数组(即使只有一个也用数组)。
47
+ 用户说"屈哥的关注点"——先调 `xiaobao-cli customer list { customerName: "屈哥" }`
48
+ 拿到 `--customer-id`(= wang_id),再传给 `--customer-ids` 数组(即使只有一个也用数组)。
93
49
 
94
50
  ### 2. 分类模糊:一级 + 二级二选一或同时用
95
51
 
@@ -98,7 +54,7 @@ category 一级常见值:户型 / 价格 / 环境 / 教育 / 交通 / 商业
98
54
  classification 二级常见值:户型因素 / 价格因素 / 环境因素 / ... / 位置因素 / 发展因素
99
55
  ```
100
56
 
101
- 模糊关键词越短越宽:`category: "户型"` 同时命中 "户型因素" 和别的含 "户型" 的分类。
57
+ 模糊关键词越短越宽:`--category 户型` 同时命中 "户型因素" 和别的含 "户型" 的分类。
102
58
 
103
59
  ### 3. 时间窗:用户没明确说就推断
104
60
 
@@ -151,7 +107,7 @@ classification 二级常见值:户型因素 / 价格因素 / 环境因素 / ..
151
107
  }
152
108
  ```
153
109
 
154
- plugin tool 又外包一层 → 渲染用 `resp.data.data.content`。
110
+ CLI 又包一层 → 渲染用 `resp.data.data.content`。
155
111
 
156
112
  ### 5. 渲染给用户时只展示核心
157
113
 
@@ -165,38 +121,32 @@ plugin tool 又外包一层 → 渲染用 `resp.data.data.content`。
165
121
 
166
122
  ### 场景 1:本月客户最在意什么
167
123
 
168
- ```jsonc
169
- {
170
- "fromDate": "2026-05-01 00:00:00",
171
- "toDate": "2026-06-01 00:00:00",
172
- "page": 1, "size": 50
173
- }
124
+ ```bash
125
+ xiaobao-cli focus list --from "2026-05-01 00:00:00" --to "2026-06-01 00:00:00" --page 1 --size 50
174
126
  ```
175
127
 
176
- 后处理:按 `category` 聚合 → "5 月份 87 条关注点:户型因素 28 条 / 价格因素 19 条 / ..."。
128
+ 后处理:按 `--category` 聚合 → "5 月份 87 条关注点:户型因素 28 条 / 价格因素 19 条 / ..."。
177
129
 
178
130
  ### 场景 2:屈哥本次到访的关注点
179
131
 
180
- ```jsonc
181
- // step 1: 反查 wang_id(如果只知名字)
182
- // xiaobao_list_customers
183
- { "customerName": "屈哥" }
132
+ ```bash
133
+ # step 1: 反查 wang_id(如果只知名字)
134
+ xiaobao-cli customer list --customer-name 屈哥
184
135
 
185
- // step 2: 拿到 customerId = 507016570019512320
186
- // xiaobao_list_customer_focus
187
- { "customerIds": ["507016570019512320"], "page": 1, "size": 20 }
136
+ # step 2: 拿到 customerId = 507016570019512320,用 --customer-ids 过滤
137
+ xiaobao-cli focus list --customer-ids 507016570019512320 --page 1 --size 20
188
138
  ```
189
139
 
190
140
  ### 场景 3:户型相关关注点
191
141
 
192
- ```jsonc
193
- { "category": "户型", "page": 1, "size": 30 }
142
+ ```bash
143
+ xiaobao-cli focus list --category 户型 --page 1 --size 30
194
144
  ```
195
145
 
196
146
  ### 场景 4:特定录音里的关注点
197
147
 
198
- ```jsonc
199
- { "audioIds": ["507494047338729472"], "page": 1, "size": 50 }
148
+ ```bash
149
+ xiaobao-cli focus list --audio-ids 507494047338729472 --page 1 --size 50
200
150
  ```
201
151
 
202
152
  渲染:列出该录音里 AI 抽出的所有关注点,按 startOffset 升序展示原文 + 描述。
@@ -206,7 +156,7 @@ plugin tool 又外包一层 → 渲染用 `resp.data.data.content`。
206
156
  ## 常见错误与排查
207
157
 
208
158
  - **`error: 'NO_ACTIVE_PROJECT'`** — 跑 `wangxiaobao-switch-project` skill
209
- - **401 / token 过期** — 调 `xiaobao_authorize { force: true }` 重登
159
+ - **401 / token 过期** — 调 `xiaobao-cli auth login --force` 重登
210
160
  - **`total: 0`** — 过滤条件没匹配 / 该时段没数据 / 当前用户授权范围内没匹配的接待顾问
211
161
  - **传入的 ID 找不到对应数据** — 数据权限隔离把不属于授权顾问的 tag 过滤掉了;
212
162
  这是预期行为,不是 bug