@lark-apaas/coding-miaoda-sandbox-skills 0.1.0-dev.ec88bb5 → 0.1.0-dev.f3f0e48

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 (207) hide show
  1. package/miaoda/ai-data-processing/SKILL.md +4 -1
  2. package/miaoda/animation-skill/SKILL.md +348 -0
  3. package/miaoda/authz-cli/SKILL.md +1 -0
  4. package/miaoda/charts-skill/SKILL.md +264 -0
  5. package/miaoda/creative-to-fullstack/SKILL.md +64 -0
  6. package/miaoda/data-analysis/SKILL.md +151 -0
  7. package/miaoda/data-analysis/references/json-output-specification.md +277 -0
  8. package/miaoda/data-analysis/references/post-analysis-guide.md +77 -0
  9. package/miaoda/data-analysis/references/python-analysis-reference.md +272 -0
  10. package/miaoda/data-analysis/references/tmp-file-management-guide.md +100 -0
  11. package/miaoda/debug-investigation/SKILL.md +35 -23
  12. package/miaoda/extract-json-schema/SKILL.md +147 -0
  13. package/miaoda/feishu/SKILL.md +4 -4
  14. package/miaoda/forms-skill/SKILL.md +46 -4
  15. package/miaoda/lark-apps/SKILL.md +37 -0
  16. package/miaoda/lark-apps/references/openapi-key.md +80 -0
  17. package/miaoda/lark-apps-authz/SKILL.md +292 -0
  18. package/miaoda/lark-apps-authz/references/permission-points.md +39 -0
  19. package/miaoda/lark-apps-authz/references/role.md +122 -0
  20. package/miaoda/lark-apps-db/SKILL.md +227 -0
  21. package/miaoda/lark-apps-db/references/full-reference.md +424 -0
  22. package/miaoda/lark-apps-file/SKILL.md +216 -0
  23. package/miaoda/lark-apps-ops/SKILL.md +67 -0
  24. package/miaoda/lark-apps-ops/references/lark-apps-access-scope-get.md +30 -0
  25. package/miaoda/lark-apps-ops/references/lark-apps-access-scope-set.md +40 -0
  26. package/miaoda/lark-apps-ops/references/lark-apps-cache.md +62 -0
  27. package/miaoda/lark-apps-ops/references/lark-apps-env.md +46 -0
  28. package/miaoda/lark-apps-ops/references/lark-apps-export.md +46 -0
  29. package/miaoda/lark-apps-ops/references/lark-apps-local-dev.md +26 -0
  30. package/miaoda/lark-apps-ops/references/lark-apps-mcp.md +25 -0
  31. package/miaoda/lark-apps-ops/references/lark-apps-member.md +93 -0
  32. package/miaoda/lark-apps-ops/references/lark-apps-observability.md +46 -0
  33. package/miaoda/lark-apps-ops/references/lark-apps-plugin-install.md +36 -0
  34. package/miaoda/lark-apps-ops/references/lark-apps-plugin-list.md +23 -0
  35. package/miaoda/lark-apps-ops/references/lark-apps-plugin-uninstall.md +25 -0
  36. package/miaoda/lark-apps-ops/references/lark-apps-release-create.md +37 -0
  37. package/miaoda/lark-apps-ops/references/lark-apps-release-get.md +59 -0
  38. package/miaoda/lark-apps-ops/references/lark-apps-release-list.md +31 -0
  39. package/miaoda/lark-apps-ops/references/lark-apps-update.md +30 -0
  40. package/miaoda/lark-apps-ops/references/lark-apps-user-id-convert.md +63 -0
  41. package/miaoda/lark-apps-ops/references/openapi-key.md +80 -0
  42. package/miaoda/lark-design-prototype/DESIGN.md +603 -0
  43. package/miaoda/lark-design-prototype/SKILL.md +85 -0
  44. package/miaoda/lark-design-prototype/references/assets/card-illustration-library.md +113 -0
  45. package/miaoda/lark-design-prototype/references/case-matching.md +53 -0
  46. package/miaoda/lark-design-prototype/references/cases/conversational-ai-home.md +27 -0
  47. package/miaoda/lark-design-prototype/references/cases/data-table.md +30 -0
  48. package/miaoda/lark-design-prototype/references/cases/official-home.md +26 -0
  49. package/miaoda/lark-design-prototype/references/cases/workspace-home.md +34 -0
  50. package/miaoda/lark-design-prototype/references/color-roles.md +163 -0
  51. package/miaoda/lark-design-prototype/references/component-selection.md +134 -0
  52. package/miaoda/lark-design-prototype/references/design-quality-checklist.md +156 -0
  53. package/miaoda/lark-design-prototype/references/form-shell-patterns.md +77 -0
  54. package/miaoda/lark-design-prototype/references/icon-semantics.md +237 -0
  55. package/miaoda/lark-design-prototype/references/layout-interaction.md +164 -0
  56. package/miaoda/lark-design-prototype/references/page-contract.md +281 -0
  57. package/miaoda/lark-design-prototype/references/product-patterns.md +93 -0
  58. package/miaoda/lark-design-prototype/references/prompt-expansion.md +107 -0
  59. package/miaoda/lark-design-prototype/references/restoration-traps.md +113 -0
  60. package/miaoda/lark-design-prototype/references/token-semantics.md +112 -0
  61. package/miaoda/lark-design-prototype/references/visual-brief.md +125 -0
  62. package/miaoda/lark-design-prototype/references/visual-style-prompts.md +61 -0
  63. package/miaoda/lark-design-prototype/scripts/icon-query.mjs +272 -0
  64. package/miaoda/lark-design-prototype/scripts/token-query.mjs +76 -0
  65. package/miaoda/lark-design-prototype/scripts/verify-static-html.mjs +117 -0
  66. package/miaoda/miaoda-file/SKILL.md +1 -0
  67. package/miaoda/miaoda-sql/SKILL.md +21 -2
  68. package/miaoda/performance-review/SKILL.md +144 -0
  69. package/miaoda/performance-review/references/business-analyzer.md +139 -0
  70. package/miaoda/performance-review/references/examples.md +107 -0
  71. package/miaoda/semantic-search/SKILL.md +6 -4
  72. package/miaoda/table-skill/SKILL.md +2 -0
  73. package/{shared → miaoda}/testing-guide/SKILL.md +119 -13
  74. package/miaoda-design/lark-apps-comment/SKILL.md +119 -0
  75. package/miaoda-design/lark-apps-ops/SKILL.md +47 -0
  76. package/miaoda-design/lark-apps-ops/references/lark-apps-release-create.md +52 -0
  77. package/miaoda-design/lark-apps-ops/references/lark-apps-release-get.md +59 -0
  78. package/miaoda-design/lark-apps-ops/references/lark-apps-release-list.md +31 -0
  79. package/miaoda-design/lark-apps-ops/references/lark-apps-update.md +33 -0
  80. package/{shared → miaoda-modern}/charts-skill/SKILL.md +1 -1
  81. package/miaoda-modern/debug-investigation/SKILL.md +1 -1
  82. package/miaoda-modern/forms-skill/SKILL.md +70 -7
  83. package/{shared → miaoda-modern}/lark-apps/SKILL.md +5 -5
  84. package/miaoda-modern/lark-apps/references/openapi-key.md +80 -0
  85. package/miaoda-modern/lark-apps-ops/SKILL.md +67 -0
  86. package/miaoda-modern/lark-apps-ops/references/lark-apps-access-scope-get.md +30 -0
  87. package/miaoda-modern/lark-apps-ops/references/lark-apps-access-scope-set.md +40 -0
  88. package/miaoda-modern/lark-apps-ops/references/lark-apps-cache.md +62 -0
  89. package/miaoda-modern/lark-apps-ops/references/lark-apps-env.md +46 -0
  90. package/miaoda-modern/lark-apps-ops/references/lark-apps-export.md +46 -0
  91. package/miaoda-modern/lark-apps-ops/references/lark-apps-local-dev.md +26 -0
  92. package/miaoda-modern/lark-apps-ops/references/lark-apps-mcp.md +25 -0
  93. package/miaoda-modern/lark-apps-ops/references/lark-apps-member.md +93 -0
  94. package/miaoda-modern/lark-apps-ops/references/lark-apps-observability.md +46 -0
  95. package/miaoda-modern/lark-apps-ops/references/lark-apps-plugin-install.md +36 -0
  96. package/miaoda-modern/lark-apps-ops/references/lark-apps-plugin-list.md +23 -0
  97. package/miaoda-modern/lark-apps-ops/references/lark-apps-plugin-uninstall.md +25 -0
  98. package/miaoda-modern/lark-apps-ops/references/lark-apps-release-create.md +37 -0
  99. package/miaoda-modern/lark-apps-ops/references/lark-apps-release-get.md +59 -0
  100. package/miaoda-modern/lark-apps-ops/references/lark-apps-release-list.md +31 -0
  101. package/miaoda-modern/lark-apps-ops/references/lark-apps-update.md +30 -0
  102. package/miaoda-modern/lark-apps-ops/references/lark-apps-user-id-convert.md +63 -0
  103. package/{shared/lark-apps → miaoda-modern/lark-apps-ops}/references/openapi-key.md +3 -3
  104. package/miaoda-modern/lark-design-prototype/DESIGN.md +603 -0
  105. package/miaoda-modern/lark-design-prototype/SKILL.md +85 -0
  106. package/miaoda-modern/lark-design-prototype/references/assets/card-illustration-library.md +113 -0
  107. package/miaoda-modern/lark-design-prototype/references/case-matching.md +53 -0
  108. package/miaoda-modern/lark-design-prototype/references/cases/conversational-ai-home.md +27 -0
  109. package/miaoda-modern/lark-design-prototype/references/cases/data-table.md +30 -0
  110. package/miaoda-modern/lark-design-prototype/references/cases/official-home.md +26 -0
  111. package/miaoda-modern/lark-design-prototype/references/cases/workspace-home.md +34 -0
  112. package/miaoda-modern/lark-design-prototype/references/color-roles.md +163 -0
  113. package/miaoda-modern/lark-design-prototype/references/component-selection.md +134 -0
  114. package/miaoda-modern/lark-design-prototype/references/design-quality-checklist.md +156 -0
  115. package/miaoda-modern/lark-design-prototype/references/form-shell-patterns.md +77 -0
  116. package/miaoda-modern/lark-design-prototype/references/icon-semantics.md +237 -0
  117. package/miaoda-modern/lark-design-prototype/references/layout-interaction.md +164 -0
  118. package/miaoda-modern/lark-design-prototype/references/page-contract.md +281 -0
  119. package/miaoda-modern/lark-design-prototype/references/product-patterns.md +93 -0
  120. package/miaoda-modern/lark-design-prototype/references/prompt-expansion.md +107 -0
  121. package/miaoda-modern/lark-design-prototype/references/restoration-traps.md +113 -0
  122. package/miaoda-modern/lark-design-prototype/references/token-semantics.md +112 -0
  123. package/miaoda-modern/lark-design-prototype/references/visual-brief.md +125 -0
  124. package/miaoda-modern/lark-design-prototype/references/visual-style-prompts.md +61 -0
  125. package/miaoda-modern/lark-design-prototype/scripts/icon-query.mjs +272 -0
  126. package/miaoda-modern/lark-design-prototype/scripts/token-query.mjs +76 -0
  127. package/miaoda-modern/lark-design-prototype/scripts/verify-static-html.mjs +117 -0
  128. package/miaoda-modern/memory/SKILL.md +86 -0
  129. package/{shared → miaoda-modern}/performance-review/SKILL.md +3 -3
  130. package/miaoda-modern/reviewer-usage/SKILL.md +113 -0
  131. package/package.json +1 -1
  132. package/shared/attachment/SKILL.md +5 -1
  133. package/shared/lark-cli/SKILL.md +221 -0
  134. package/shared/lark-cli/lark-base/README.md +61 -0
  135. package/shared/lark-cli/lark-base/references/lark-base-commands.md +123 -0
  136. package/shared/lark-cli/lark-calendar/README.md +158 -0
  137. package/shared/lark-cli/lark-calendar/references/lark-calendar-meeting.md +30 -0
  138. package/shared/lark-cli/lark-calendar/references/lark-calendar-room-find.md +108 -0
  139. package/shared/lark-cli/lark-calendar/references/lark-calendar-suggestion.md +120 -0
  140. package/shared/lark-cli/lark-contact/README.md +35 -0
  141. package/shared/lark-cli/lark-contact/references/lark-contact-get-user.md +13 -0
  142. package/shared/lark-cli/lark-contact/references/lark-contact-search-user.md +121 -0
  143. package/shared/lark-cli/lark-doc/README.md +68 -0
  144. package/shared/lark-cli/lark-doc/references/lark-doc-fetch.md +138 -0
  145. package/shared/lark-cli/lark-doc/references/lark-doc-history.md +61 -0
  146. package/shared/lark-cli/lark-drive/README.md +158 -0
  147. package/shared/lark-cli/lark-drive/references/lark-drive-batch-query-comments.md +44 -0
  148. package/shared/lark-cli/lark-drive/references/lark-drive-files-list.md +183 -0
  149. package/shared/lark-cli/lark-drive/references/lark-drive-list-replies.md +49 -0
  150. package/shared/lark-cli/lark-im/README.md +70 -0
  151. package/shared/lark-cli/lark-im/references/lark-im-chat-list.md +140 -0
  152. package/shared/lark-cli/lark-im/references/lark-im-chat-members-list.md +84 -0
  153. package/shared/lark-cli/lark-im/references/lark-im-chat-search.md +135 -0
  154. package/shared/lark-cli/lark-im/references/lark-im-reactions.md +232 -0
  155. package/shared/lark-cli/lark-minutes/README.md +51 -0
  156. package/shared/lark-cli/lark-minutes/references/lark-minutes-download.md +130 -0
  157. package/shared/lark-cli/lark-sheets/README.md +174 -0
  158. package/shared/lark-cli/lark-sheets/references/lark-sheets-changeset.md +105 -0
  159. package/shared/lark-cli/lark-sheets/references/lark-sheets-chart.md +46 -0
  160. package/shared/lark-cli/lark-sheets/references/lark-sheets-conditional-format.md +42 -0
  161. package/shared/lark-cli/lark-sheets/references/lark-sheets-filter-view.md +51 -0
  162. package/shared/lark-cli/lark-sheets/references/lark-sheets-filter.md +42 -0
  163. package/shared/lark-cli/lark-sheets/references/lark-sheets-float-image.md +43 -0
  164. package/shared/lark-cli/lark-sheets/references/lark-sheets-formula-verify.md +64 -0
  165. package/shared/lark-cli/lark-sheets/references/lark-sheets-history.md +70 -0
  166. package/shared/lark-cli/lark-sheets/references/lark-sheets-pivot-table.md +44 -0
  167. package/shared/lark-cli/lark-sheets/references/lark-sheets-read-data.md +287 -0
  168. package/shared/lark-cli/lark-sheets/references/lark-sheets-search-replace.md +67 -0
  169. package/shared/lark-cli/lark-sheets/references/lark-sheets-sheet-structure.md +52 -0
  170. package/shared/lark-cli/lark-sheets/references/lark-sheets-sparkline.md +47 -0
  171. package/shared/lark-cli/lark-sheets/references/lark-sheets-workbook.md +69 -0
  172. package/shared/lark-cli/lark-sheets/scripts/lark_detect_subtables.py +596 -0
  173. package/shared/lark-cli/lark-sheets/scripts/lark_inspect_workbook.py +193 -0
  174. package/shared/lark-cli/lark-sheets/scripts/lark_profile_table.py +616 -0
  175. package/shared/lark-cli/lark-sheets/scripts/lark_sheet_range.py +176 -0
  176. package/shared/lark-cli/lark-sheets/scripts/lark_sheet_read_cli.py +221 -0
  177. package/shared/lark-cli/lark-sheets/scripts/sheets_df.py +50 -0
  178. package/shared/lark-cli/lark-slides/README.md +87 -0
  179. package/shared/lark-cli/lark-slides/references/lark-slides-history.md +117 -0
  180. package/shared/lark-cli/lark-slides/references/lark-slides-xml-presentation-slide-get.md +108 -0
  181. package/shared/lark-cli/lark-slides/references/lark-slides-xml-presentations-get.md +77 -0
  182. package/shared/lark-cli/lark-task/README.md +93 -0
  183. package/shared/lark-cli/lark-task/references/lark-task-get-my-tasks.md +57 -0
  184. package/shared/lark-cli/lark-task/references/lark-task-get-related-tasks.md +49 -0
  185. package/shared/lark-cli/lark-task/references/lark-task-search.md +36 -0
  186. package/shared/lark-cli/lark-task/references/lark-task-tasklist-search.md +35 -0
  187. package/shared/lark-cli/lark-vc/README.md +40 -0
  188. package/shared/lark-cli/lark-vc/references/lark-vc-recording.md +31 -0
  189. package/shared/lark-cli/lark-whiteboard/README.md +34 -0
  190. package/shared/lark-cli/lark-whiteboard/references/lark-whiteboard-export.md +59 -0
  191. package/shared/lark-cli/lark-wiki/README.md +50 -0
  192. package/shared/lark-cli/lark-wiki/references/lark-wiki-node-get.md +70 -0
  193. package/shared/lark-cli/lark-wiki/references/lark-wiki-node-list.md +95 -0
  194. package/shared/lark-cli/lark-wiki/references/lark-wiki-space-list.md +68 -0
  195. package/miaoda-design/attachment/SKILL.md +0 -58
  196. package/shared/dev-channel-probe/SKILL.md +0 -40
  197. /package/{shared → miaoda}/memory/SKILL.md +0 -0
  198. /package/{shared → miaoda}/reviewer-usage/SKILL.md +0 -0
  199. /package/{shared → miaoda-modern}/animation-skill/SKILL.md +0 -0
  200. /package/{shared → miaoda-modern}/data-analysis/SKILL.md +0 -0
  201. /package/{shared → miaoda-modern}/data-analysis/references/json-output-specification.md +0 -0
  202. /package/{shared → miaoda-modern}/data-analysis/references/post-analysis-guide.md +0 -0
  203. /package/{shared → miaoda-modern}/data-analysis/references/python-analysis-reference.md +0 -0
  204. /package/{shared → miaoda-modern}/data-analysis/references/tmp-file-management-guide.md +0 -0
  205. /package/{shared → miaoda-modern}/extract-json-schema/SKILL.md +0 -0
  206. /package/{shared → miaoda-modern}/performance-review/references/business-analyzer.md +0 -0
  207. /package/{shared → miaoda-modern}/performance-review/references/examples.md +0 -0
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: reviewer-usage
3
+ description: "Reviewer SubAgent dispatch & post-return protocol — required reading BEFORE invoking Reviewer. Covers when you MUST escalate to Reviewer after repeated self-fix failures, how many Reviewers to dispatch, how to split scopes, what the prompt must contain, and how to act on the per-issue policy tags Reviewer returns. 触发词:派 Reviewer、code review、审查、排查、review and fix、反复失败、修不好、repeated-fix"
4
+ available-agents:
5
+ - Code
6
+ - DesignModern
7
+ ---
8
+
9
+ # Reviewer Usage Guide
10
+
11
+ This skill is the operational manual for dispatching the Reviewer SubAgent and handling its returned report. Reviewer's own `description` only states what Reviewer is for; everything about *how* to use it lives here. **Load this skill before every Reviewer dispatch.**
12
+
13
+ ## When NOT to dispatch Reviewer
14
+
15
+ - Pure code-location questions ("where is X implemented", "which file handles Y") → use Explore.
16
+ - Missing-feature requests ("help me implement X", "X is not implemented yet", 帮我实现 / 还没实现) → handle as regular implementation.
17
+
18
+ ## When you MUST escalate (repeated-fix)
19
+
20
+ Inline self-fixing has a hard ceiling. The moment ANY of the following is true, **STOP self-fixing and dispatch a Reviewer via `task` instead** — do not attempt a 3rd inline patch of the same problem:
21
+
22
+ - **同一问题失败 ≥2 轮**: you have already attempted to fix the *same* symptom twice (edit → check → still broken → edit again → still broken) and it persists. The 3rd attempt MUST be a Reviewer dispatch, not another inline guess. Two failed self-fixes is direct evidence your hypothesis is wrong — an independent Reviewer with no anchoring bias is more likely to find the true root cause than a 3rd same-direction patch.
23
+ - **用户二次否定**: the user has rejected your fix twice ("还是不对" / "没生效" / "还是这个问题" on the same issue). The second rejection is a mandatory escalation trigger — do not keep iterating inline.
24
+
25
+ Why this is a hard rule, not a suggestion: thrash (repeatedly editing the same code in the same wrong direction) burns tokens and time while convergence probability stays near zero. Escalating to a Reviewer breaks the loop with fresh, unbiased root-cause analysis. When you escalate, follow the normal dispatch protocol below (still pass `<user-original-message>` verbatim; still pass only `scope` + `dimensions`).
26
+
27
+ ## Review dimensions
28
+
29
+ Performance, correctness, security, maintainability. Default to **performance + correctness**; include security only if explicitly requested or clearly relevant. User-specified dimensions override the default.
30
+
31
+ ## Dispatch count — trade-offs
32
+
33
+ More is NOT always better:
34
+
35
+ - **Single Reviewer overloaded** → on a large project the attention budget gets diluted and critical bugs are missed.
36
+ - **Too many Reviewers** → cross-scope gaps (issues spanning multiple Reviewers' scopes go unreported), and the same files get re-read by multiple Reviewers (token + latency doubled).
37
+
38
+ ### Heuristics (not hard rules — judge by the actual situation)
39
+
40
+ - Use `glob` to roughly estimate file count before dispatching.
41
+ - Small / single-module change (< 50 files): **1 Reviewer**.
42
+ - Mid-size full project (50–150 files): **2 Reviewers**, split by scope.
43
+ - Large full project (> 150 files): **3–4 Reviewers**, split by scope.
44
+ - User explicitly limits the scope or asks for a single dimension on a small change: **1 Reviewer** suffices.
45
+
46
+ ## Hard constraints when splitting
47
+
48
+ - **Mutually exclusive scopes**: a typical project splits into `server/` (incl. `server/database/`), `client/`, and `shared/`; each scope is owned by exactly ONE Reviewer. Two Reviewers MUST NOT review the same directory (duplicated Read is the most common form of waste).
49
+ - **Each Reviewer covers all requested dimensions within its own scope** (default: performance + correctness). Do NOT make a single Reviewer the sole owner of "shared / cross-boundary consistency" — that locks its attention onto type contracts and lets performance bugs inside its scope slip through. Cross-boundary consistency is a shared check between two adjacent Reviewers (e.g. the server Reviewer audits "do shared types match what the server actually returns", the client Reviewer audits "do shared interfaces match what the frontend actually calls").
50
+ - **Change-type reviews (not full-project audits)**: a Reviewer MUST read every scope the change actually touches. If a commit modifies `server/`, you MUST dispatch a Reviewer for `server/` — you cannot get away with only a `client/` Reviewer.
51
+ - **Multiple Reviewers MUST be dispatched in parallel** (multiple tool calls in a single message). Never serially.
52
+ - **Each Reviewer's prompt** must spell out `scope = <specific directories or file list>` and `dimensions = <performance/correctness/...>`, and explicitly say "do not read code outside this scope". Do not broadcast the full task to every Reviewer.
53
+
54
+ ## Other rules for the dispatch
55
+
56
+ - **Wait synchronously** for all Reviewer reports before fixing. No background dispatch.
57
+ - **Do not pre-read code**; pass scope only (git range, directory paths, or file list). Each Reviewer discovers and reads within its scope.
58
+ - **REQUIRED — Reviewer prompt MUST start with** `<user-original-message>{用户原话}</user-original-message>`. Reviewer uses this verbatim text to classify fix-intent vs review-only mode for its mandatory ACTION block; without it Reviewer guesses wrong and the recommended AskUser option is wrong. ❌ FORBIDDEN: paraphrase, summarize, translate, or omit the user's message — pass it character-for-character.
59
+
60
+ ## Caller anti-pattern checklist (read before dispatching Reviewer)
61
+
62
+ ### ❌ Anti-pattern 1: scope is narrower than where the true root cause may live
63
+
64
+ The caller does not know where the true root cause is — a "suspicious directory" guessed from surface clues (a filename in the stack trace, a module the user named) often excludes the directory the true root cause actually lives in. Phase 1 Discovery is designed for Reviewer to narrow down via glob/grep on its own; when the caller does that work prematurely, it loses the true root cause.
65
+
66
+ **Hard rule**: for bug-investigation tasks, `scope` MUST stay at a directory-tree top-level boundary (`client/` / `server/` / `shared/`). **Drilling down into a subdirectory or a single file is forbidden.**
67
+
68
+ The only exception is a small refactor PR static review where the commit touches a single subdirectory only AND the total file count exceeds 150 requiring 3–4 Reviewers running in parallel (per the Heuristics earlier in this skill).
69
+
70
+ ### ❌ Anti-pattern 2: adding "key observations / focus on / suspected files" sections outside `<user-original-message>`
71
+
72
+ If the caller forms its own shallow hypothesis before dispatching Reviewer and injects that as a "clue" into Reviewer's prompt, it violates the core principle of reviewer-usage: Reviewer is an independent sub-agent whose value comes from judging without caller bias. Injecting observations anchors Reviewer to the caller's (usually wrong) direction → the true root cause is never found.
73
+
74
+ **Hard rule**: outside the `<user-original-message>` block, **only `scope = ...` and `dimensions = ...` are allowed**. Any "focus on / key files / suspected paths / investigation direction / key observations" sections must be removed.
75
+
76
+ Exception: if the user's own message already contains these phrasings (e.g. the user said "please focus on X"), keep them inside `<user-original-message>` verbatim — that is the user's real intent, not caller pollution.
77
+
78
+
79
+ ## Protocol after Reviewer returns
80
+
81
+ Reviewer pre-tags each issue with a `policy` field (`auto-fix` or `AskUser`) and prints an ACTION header. Code agent acts on the tags directly — it does NOT re-classify.
82
+
83
+ ### Step 1 — Read the ACTION header
84
+
85
+ It tells you: (a) how many issues are tagged `auto-fix`, (b) how many are tagged `AskUser`, (c) the exact `options` and `recommended` label for the `ask_user_question` call.
86
+
87
+ ### Step 2 — Fix every `policy: auto-fix` issue immediately
88
+
89
+ No AskUser, no confirmation, no asking the user.
90
+
91
+ ### Step 3 — Handle `policy: AskUser` issues (only if at least one exists)
92
+
93
+ - **STEP 3a (echo)**: emit a short user-facing summary listing the `policy: AskUser` issues, grouped by 🔴 Critical / 🟠 Bug / 🟡 Suggestion, with file:line. ≤25 lines (collapse the rest as `... (其余 N 项见下方表单)`). The user cannot see Reviewer's report directly — without this echo they cannot decide.
94
+ - **STEP 3b (call ask_user_question)**: in the same turn, immediately call `ask_user_question` — `header`: `Review 确认`; `description`: paste the same list as STEP 3a; ONE Radio `question`: "Reviewer 另发现以下超出本次任务范围的问题,是否一并处理?"; use the exact `options` and `recommended` label that the ACTION header specified.
95
+ - No FINAL reply between 3a and 3b.
96
+ - **STEP 3b applies only if `ask_user_question` is in your tool list.** Some chains deliberately omit it (no confirmation step by design). If you do not have that tool: do STEP 3a only and stop there — this bucket degrades to report-only, and Step 4 does not apply. Do NOT seek confirmation by any other means (no free-text question, no other tool), and do NOT promote these issues to auto-fix. State plainly which issues were reported but not acted on; never present "not confirmed" as "no problem".
97
+
98
+ ### Step 4 — Act on the user's choice
99
+
100
+ Strip any trailing `(推荐)` from the returned label before matching:
101
+
102
+ - `修复严重问题` → fix the 🔴+🟠 subset of `policy: AskUser` issues, then report.
103
+ - `修复所有问题` → fix every `policy: AskUser` issue, then report.
104
+ - `修复建议项` → fix every `policy: AskUser` 🟡 issue, then report.
105
+ - `不修复` → report with: `policy: auto-fix` fixes done + `policy: AskUser` issues left untouched (preserve original Reviewer `file:line — desc` entries verbatim).
106
+
107
+ ## Recursion and edge cases
108
+
109
+ - If fixes trigger a new Reviewer dispatch, recurse through the same protocol, but cap AskUser follow-ups **per original Reviewer batch** at 2. On the 3rd would-be AskUser, fold remaining `policy: AskUser` items into the final report instead. A brand-new Reviewer dispatch resets the counter.
110
+ - `policy: auto-fix` fix failure does NOT skip AskUser — mark failed items as `未处理` inside the AskUser description so the user sees the real state.
111
+ - `Verdict: Looks good` (zero issues) → no AskUser; report directly.
112
+ - Reviewer report missing `policy` tags or unparseable into 🔴/🟠/🟡 → treat all parseable issues as `policy: AskUser` and route through Step 3 so the user decides.
113
+ - Multiple Reviewers dispatched in parallel: each report runs this protocol independently (no cross-report aggregation); the recursion cap applies per batch.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/coding-miaoda-sandbox-skills",
3
- "version": "0.1.0-dev.ec88bb5",
3
+ "version": "0.1.0-dev.f3f0e48",
4
4
  "description": "Miaoda 合并沙箱 skills 包(包含原 miaoda-skills 的 miaoda / miaoda-modern / miaoda-design / shared 四条业务线);发布公网 npm,随沙箱运行时经 update-skills 同步到 .agent/skills/",
5
5
  "type": "module",
6
6
  "files": [
@@ -1,6 +1,10 @@
1
1
  ---
2
2
  name: attachment
3
- description: "Use when user mentions attachments, uploaded files, or shared files. Handles preprocessing: listing, extracting archives, and reading files in .agent/{conversation_id}/attachments directory."
3
+ description: "附件预处理 / Attachment Preprocessing. Use when user mentions attachments, uploaded files, or shared files. 当用户提到附件、上传文件或共享文件时使用;仅负责列出、解压和读取 .agent/{conversation_id}/attachments 下的文件,后续处理由文件内容和用户意图决定。"
4
+ metadata:
5
+ display-names:
6
+ zh-CN: 附件预处理
7
+ en-US: Attachment Preprocessing
4
8
  ---
5
9
 
6
10
  # Attachment Preprocessing
@@ -0,0 +1,221 @@
1
+ ---
2
+ name: lark-cli
3
+ description: "在妙搭沙箱里用 lark-cli 对飞书/Lark 非 apps 域做白名单内只读或受限操作:日历日程/忙闲/会议室推荐(calendar)、通讯录按姓名邮箱搜人(contact)、云文档读取与按关键词搜文档与历史版本(docs)、云盘文件列表与按关键词搜云空间文件/评论/访问记录(drive)、IM 群聊列表/成员/搜索(im)、妙记音视频下载(minutes)、电子表格读取(sheets)、幻灯片读取与历史(slides)、任务与清单查询(task)、画板导出(whiteboard)、知识库空间与节点(wiki)、多维表格读取——数据表/字段/视图配置/记录与按关键词搜记录(base)、会议录制信息——回看链接/时长/关联妙记(vc)。当用户要查看/读取/搜索/下载/导出这些飞书资源的内容时使用;命令通道一律是 lark-cli 的非 apps 域。用户消息里出现飞书资源链接就属于本 skill 的场景——链接域名同时存在 feishu.cn / feishu-boe.cn / larkoffice.com / doubao.com 多种环境,路由只看路径与 token 形态、不看域名;这类链接无法用 web_fetch 或浏览器读取,必须走本 skill。触发词:飞书文档, 云文档, 飞书链接, 文档链接, 电子表格, 表格链接, 多维表格, Base, bitable, 维表, 知识库, wiki 空间, 节点, 妙记, 会议纪要, 逐字稿, 日程, 忙闲, 排期, 通讯录, 找人, 群聊, 群消息, 置顶消息, 表情回复, 任务清单, 待办, 画板, 白板, 幻灯片, 云空间, 我的云盘, 文件夹, 会议录制, /docx/, /sheets/, /base/, /wiki/, /slides/, /minutes/, /drive/folder/, feishu.cn, feishu-boe.cn, larkoffice.com。NOT for 妙搭应用操作(走 lark-apps 系列 skill)、未列出的域、以及各域未开放的写/管理命令(本沙箱屏蔽的能力不要拼);也 NOT for 用插件(plugin / capabilityClient / CapabilityService)读取飞书资源——插件只用于生成出来的应用在运行时访问飞书,Agent 在生成期读取内容一律用 bash 调 lark-cli。"
4
+ metadata:
5
+ requires:
6
+ bins: ["lark-cli"]
7
+ cliHelp: "lark-cli --help; lark-cli <domain> --help"
8
+ require-knowledge-sources:
9
+ - lark_cli
10
+ control-by-feature-ab: true
11
+ ---
12
+
13
+ # lark-cli(非 apps 域)· 沙箱版
14
+
15
+ 在妙搭沙箱里通过 `lark-cli` 对飞书/Lark 资源做**白名单内只读或受限操作**的入口 skill,按域拆分为 13 个子文档,本文件只做沙箱约定与意图路由。
16
+
17
+ ## 沙箱约定(先读)
18
+
19
+ > 本约定块只出现在本根 SKILL.md 一份,13 个域共用;
20
+ > 子域 `lark-<域>/README.md` 不重复本块。
21
+
22
+ - **命令名**:一律 `lark-cli <域> +<cmd>`(快捷命令)或 `lark-cli <域> <resource> <method>`(各域白名单内的原生 API);命令 / flag 细节以 `--help` 为准。
23
+ - **不要鉴权自举**:沙箱运行环境负责准备并随请求带上这次会话所需的鉴权材料(token 经
24
+ `x-aily-token` 注入);**不要**自行执行登录或初始化配置命令,遇到身份或权限不足的报错
25
+ 也不需要自行引导补登录或补配置——本沙箱不涉及这些步骤。
26
+ - **失败处理**:命令失败时把 `error.hint` 转述给用户,不要原样甩 envelope JSON。
27
+ - **身份**:多数域默认以当前登录用户身份运行(`--as user`);wiki 域默认 `auto`、需显式带 `--as user`,以各域 README 的「身份」节为准。能否读到目标资源取决于该用户的可见范围。
28
+ - **原生 API 先查 schema**:调用 `lark-cli <域> <resource> <method>` 前,先 `lark-cli schema <域>.<resource>.<method>` 确认参数结构,不要凭直觉拼 `--params`。
29
+
30
+ ## 高风险写操作审批(exit-10)
31
+
32
+ `risk: high-risk-write` 的命令不带 `--yes` 会 **exit 10** 并返回 `confirmation_required`。处理:
33
+
34
+ 1. 识别 exit code=10 且 `error.type=="confirmation_required"`;
35
+ 2. 把 `error.risk.action` + 关键参数转述给用户,明确"高风险",等显式同意;
36
+ 3. 同意 → 原始 argv 末尾加 `--yes` 重试;拒绝 → 终止;
37
+ 4. 想先看请求 → `--dry-run`(不触发门禁、不需 `--yes`)。
38
+
39
+ **绝不**看到 exit 10 就默认补 `--yes` 静默重试。
40
+
41
+ ## 意图路由
42
+
43
+ **执行某域操作前 MUST 先读对应域的 README.md,再按其指引读 references/**;不要只看本文件就拼命令。
44
+
45
+ | 用户意图 | 读取 |
46
+ |---|---|
47
+ | 查日程、搜日程、看忙闲、找会议室、推荐时间块、取日程关联的会议信息 | [lark-calendar/README.md](lark-calendar/README.md) |
48
+ | 按姓名/邮箱搜人拿 open_id、查他人或自己的资料 | [lark-contact/README.md](lark-contact/README.md) |
49
+ | 读云文档内容(整篇或锚点局部)、列文档历史版本 | [lark-doc/README.md](lark-doc/README.md) |
50
+ | 列云盘文件夹子项、查文档评论列表、查文档访问记录 | [lark-drive/README.md](lark-drive/README.md) |
51
+ | 列群聊、搜群、看群成员、查置顶/表情回复等群状态 | [lark-im/README.md](lark-im/README.md) |
52
+ | 下载妙记音视频、查妙记基础信息 | [lark-minutes/README.md](lark-minutes/README.md) |
53
+ | 读电子表格数据/公式/样式/对象配置、看历史版本与变更 | [lark-sheets/README.md](lark-sheets/README.md) |
54
+ | 读演示文稿整份或单页 XML、看历史版本与回滚任务状态 | [lark-slides/README.md](lark-slides/README.md) |
55
+ | 搜索或列取任务/任务清单(分配给我、我创建、我关注等) | [lark-task/README.md](lark-task/README.md) |
56
+ | 导出画板为预览图/SVG/代码/原始节点结构 | [lark-whiteboard/README.md](lark-whiteboard/README.md) |
57
+ | 列知识库空间、列/查 wiki 节点、看空间成员 | [lark-wiki/README.md](lark-wiki/README.md) |
58
+ | 读多维表格:列表/字段/视图配置/记录、按关键词搜记录 | [lark-base/README.md](lark-base/README.md) |
59
+ | 查会议录制:回看链接、时长、关联妙记 | [lark-vc/README.md](lark-vc/README.md) |
60
+
61
+ ### calendar —— 日程与会议安排
62
+
63
+ - 触发词:日程、日历、会议安排、今天/本周有什么会、忙闲、空闲时段、会议室、约个时间。
64
+ - 能力:日程查询(`+agenda` / `+get` / `+search-event`)、忙闲(`+freebusy`)、会议室查找(`+room-find`)、时间块推荐(`+suggestion`)、日程关联视频会议信息(`+meeting`)。
65
+ - 入口:[lark-calendar/README.md](lark-calendar/README.md)
66
+
67
+ ```bash
68
+ lark-cli calendar +agenda --start 2026-03-10 --end 2026-03-17
69
+ lark-cli calendar +search-event --query "周会" --start 2026-04-20 --end 2026-04-27
70
+ ```
71
+
72
+ ### contact —— 通讯录搜人
73
+
74
+ - 触发词:找人、搜员工、某人的 open_id、查某人的部门/邮箱、我的资料。
75
+ - 能力:按姓名/邮箱搜人拿 open_id(`+search-user`)、按 open_id 取资料、查看自己(`+get-user`)。
76
+ - 拿到 open_id 后想发消息 / 新建日程的限制见下方「能力边界」的跨域协作条目。
77
+ - 入口:[lark-contact/README.md](lark-contact/README.md)
78
+
79
+ ```bash
80
+ lark-cli contact +search-user --query "张三" --has-chatted
81
+ lark-cli contact +get-user
82
+ ```
83
+
84
+ ### doc —— 云文档读取
85
+
86
+ - 触发词:读文档、看飞书文档、docx/wiki 链接内容、文档历史版本。
87
+ - 能力:`docs +fetch`(整篇或 `#share-...` / `#block_id` 锚点局部读取)、`docs +history-list`(历史版本列表)、`docs +search`(按关键词搜云文档)。本沙箱仅这三个只读入口。
88
+ - 入口:[lark-doc/README.md](lark-doc/README.md)
89
+
90
+ ```bash
91
+ lark-cli docs +fetch --doc "文档URL或token"
92
+ lark-cli docs +history-list --doc "文档URL或token" --page-size 20
93
+ lark-cli docs +search --query "<关键词>"
94
+ ```
95
+
96
+ ### drive —— 云盘盘点与评论/访问记录
97
+
98
+ - 触发词:云盘里有什么、列文件夹、文档评论、谁看过这个文档。
99
+ - 能力:`drive +search`(按关键词搜云空间文件,支持类型/归属/时间窗过滤)、`drive +batch-query-comments`(按 comment_id 批量取评论详情)、`drive +list-replies`(取某条评论的回复列表)、`drive files list`(列子项、可递归盘点)、`drive file.comments list`(评论分页遍历)、`drive file.view_records list`(访问记录)。3 个只读快捷命令 + 3 个只读原生 API。
100
+ - 入口:[lark-drive/README.md](lark-drive/README.md)
101
+
102
+ ```bash
103
+ lark-cli schema drive.files.list # 调用原生 API 前先看参数结构
104
+ lark-cli drive files list --params '{"folder_token":"<folder_token>","page_size":200}'
105
+ lark-cli drive +search --query "<关键词>" --doc-types file --mine
106
+ ```
107
+
108
+ ### im —— 群聊与成员查询
109
+
110
+ - 触发词:我有哪些群、搜群名、群里都有谁、群里的机器人、置顶消息、表情回复。
111
+ - 能力:`+chat-list` / `+chat-search` / `+chat-members-list` 三个只读快捷命令,及 pins、reactions 等白名单只读 API。
112
+ - 入口:[lark-im/README.md](lark-im/README.md)
113
+
114
+ ```bash
115
+ lark-cli im +chat-list --sort active_time
116
+ lark-cli im +chat-search --query "项目群"
117
+ ```
118
+
119
+ ### minutes —— 妙记
120
+
121
+ - 触发词:妙记、会议录制、minutes 链接、下载音视频、妙记信息。
122
+ - 能力:`+download`(下载妙记音视频媒体)、`minutes minutes get`(标题/时长/所有者等基础信息)。
123
+ - 入口:[lark-minutes/README.md](lark-minutes/README.md)
124
+
125
+ ```bash
126
+ lark-cli minutes +download --minute-tokens obcnxxxxxxxxxxxxxxxxxxxx --output ./meeting.mp4
127
+ ```
128
+
129
+ ### sheets —— 电子表格读取
130
+
131
+ - 触发词:读表格、看电子表格、汇总某列、公式对不对、图表/透视表配置、表格历史版本。
132
+ - 能力:读数据(`+csv-get` / `+table-get` / `+cells-get`)、结构与对象配置(工作表/图表/透视表/条件格式/筛选器/迷你图/浮动图片)、历史与变更(`+history-list` / `+changeset-get`)、公式自检(`+formula-verify`)。
133
+ - 入口:[lark-sheets/README.md](lark-sheets/README.md)
134
+
135
+ ```bash
136
+ lark-cli sheets +csv-get --url "https://.../sheets/shtXXX" --sheet-name "<真实表名>" --range "A1:F30"
137
+ ```
138
+
139
+ ### slides —— 幻灯片读取
140
+
141
+ - 触发词:看演示文稿、读 slides、某页幻灯片内容、幻灯片历史版本。
142
+ - 能力:整份 XML(`slides xml_presentations get`)、单页 XML(可指定历史版本)、历史版本列表(`slides +history-list`)与回滚任务状态查询(`slides +history-revert-status`)。
143
+ - 入口:[lark-slides/README.md](lark-slides/README.md)
144
+
145
+ ```bash
146
+ lark-cli slides +history-list --presentation "<url_or_id>" --page-size 20
147
+ lark-cli slides +history-revert-status --presentation "<url_or_id>" --task-id "<task_id>"
148
+ ```
149
+
150
+ ### task —— 任务与清单查询
151
+
152
+ - 触发词:我的任务、分配给我的待办、我创建/关注的任务、任务清单、截止日期。
153
+ - 能力:任务搜索(`+search`)、我的任务(`+get-my-tasks`)、与我相关(`+get-related-tasks`)、清单搜索(`+tasklist-search`)。
154
+ - 「待办」一词有归属歧义(飞书任务 vs 妙记待办),先按 lark-task README 的归属判断节确认。
155
+ - 入口:[lark-task/README.md](lark-task/README.md)
156
+
157
+ ```bash
158
+ lark-cli task +get-my-tasks
159
+ lark-cli task +search --query "上线"
160
+ ```
161
+
162
+ ### whiteboard —— 画板导出
163
+
164
+ - 触发词:看画板、导出画板图片、画板 SVG、画板是不是代码画的、画板节点结构。
165
+ - 能力:`+export` 导出预览图 / SVG / Mermaid·PlantUML 源码 / 原始节点结构(raw)。
166
+ - 入口:[lark-whiteboard/README.md](lark-whiteboard/README.md)
167
+
168
+ ```bash
169
+ lark-cli whiteboard +export --whiteboard-token "wbcnxxxxxxxx" --output-type preview --output ./preview
170
+ ```
171
+
172
+ ### wiki —— 知识库查询
173
+
174
+ - 触发词:知识库、wiki 空间、wiki 节点、知识库目录、空间成员。
175
+ - 能力:列空间(`+space-list`)、列节点(`+node-list`)、查节点详情/解析 wiki URL(`+node-get`)、列空间成员(`wiki members list`)。
176
+ - 入口:[lark-wiki/README.md](lark-wiki/README.md)
177
+
178
+ ```bash
179
+ lark-cli wiki +space-list --as user
180
+ lark-cli wiki +node-get --node-token "<wiki URL 或 token>" --as user
181
+ ```
182
+
183
+ ### base —— 多维表格读取
184
+
185
+ - 触发词:多维表格、Base、bitable、表里的记录、视图筛选、字段类型。
186
+ - 能力:定位(`+url-resolve`)、元信息(`+base-get`)、结构(`+table-list` / `+field-list` / `+view-list`)、视图配置(7 个 `+view-get*`)、记录(`+record-list` / `+record-search`)。仅这 8 类只读入口。
187
+ - 入口:[lark-base/README.md](lark-base/README.md)
188
+
189
+ ```bash
190
+ lark-cli base +url-resolve --url "<Base URL>"
191
+ lark-cli base +record-list --base-token <t> --table-id <tbl> --view-id "<视图名>"
192
+ ```
193
+
194
+ ### vc —— 会议录制
195
+
196
+ - 触发词:会议录制、回看链接、录了多久、meeting_id。
197
+ - 能力:`vc +recording`(按 `--meeting-ids` 或 `--calendar-event-ids` 查录制的 `recording_url` / `duration` / `minute_token`)。仅这一个只读入口。
198
+ - 输入:`meeting_id` 或日程实例 ID 二者之一,**必须由用户直接提供**;只拿到会议链接或会议号时向用户索取 ID。
199
+ - 入口:[lark-vc/README.md](lark-vc/README.md)
200
+
201
+ ```bash
202
+ lark-cli vc +recording --meeting-ids <meeting_id>
203
+ ```
204
+
205
+ ### 跨域串联提示
206
+
207
+ 一次请求常跨多个域,按链路顺序读各域 README:
208
+
209
+ - **找人 → 发消息/排日程**:先 contact 搜人拿 `open_id`;发消息、新建日程 / 邀请会议在当前沙箱不可用(im 域仅开放群相关的只读查询、calendar 域无写能力),拿到 open_id 后告知用户该限制,不要用其它域命令替代;查日程 / 忙闲走 calendar 只读查询。
210
+ - **找文件 → 读内容**:只知道文件名不知道 URL 时,先在 drive / wiki 定位资源拿 token,再回 doc / sheets / slides 读内容。
211
+ - **wiki 链接 → 具体文档**:`/wiki/<token>` 链接先走 wiki `+node-get` 解析出 `obj_token` 与 `obj_type`,再按类型转 doc / sheets / slides 域读取。
212
+ - **约会议**:时间不明确时先在 calendar 用 `+suggestion` 推荐时间块,确认时间块后再用 `+room-find` 找会议室;无明确时间块禁止直接调 `+room-find`。
213
+ - **「待办」归属**:上下文含妙记/会议纪要时不走 task 域,归属判断细则见 lark-task README。
214
+
215
+ ## 能力边界
216
+
217
+ - **只开放各域 README 列出的白名单命令**:各域 README 未列出的命令与 flag 在本沙箱被屏蔽,不要凭上游文档或直觉拼;原生 API 仅各域 README「API Resources」白名单内的可用。
218
+ - **未列出的域不可用**:本 skill 只覆盖上述 13 个非 apps 域;未列出的域未开放,不要尝试。
219
+ - **写/管理操作默认不开放**:创建、编辑、删除、上传、权限管理等能力大多被屏蔽;个别高风险写入口命中 exit 10 门禁时,按上文「高风险写操作审批(exit-10)」协议处理,绝不静默补 `--yes`。
220
+ - **妙搭应用操作不在这里**:对当前妙搭应用的操作(部署发布、改应用名、环境变量、线上日志与监控、插件、开放 API Key、可见范围等)走 [`lark-apps-ops`](../lark-apps-ops/SKILL.md) 系列 skill。
221
+ - **不要用插件代替本 skill 读资源**:你现在要读的飞书资源,一律用 bash 跑 `lark-cli` 读。插件(plugin / `capabilityClient` / `CapabilityService`)是写进应用代码、由**生成出来的应用在运行时**调用的,不是你的读取工具;多维表格尤其容易混——用户给了 Base 链接要你先读懂再建应用,走 base 域,不要去装插件或生成插件调用代码。反过来,应用本身需要在运行时读写飞书(页面上展示多维表格数据、发飞书通知)才用插件,那部分看 `plugin-guide`。
@@ -0,0 +1,61 @@
1
+ # base (v3)
2
+
3
+ > [!IMPORTANT]
4
+ > - 运行 `lark-cli --version`,确认可用,无需询问用户。
5
+
6
+ ## 身份
7
+
8
+ base 域命令默认使用 `--as user`。
9
+
10
+ ## Shortcuts
11
+
12
+ | Shortcut | 说明 |
13
+ |----------|------|
14
+ | [`+url-resolve`](references/lark-base-commands.md) | 把 Base / Wiki / 记录分享 URL 解析成 `base_token` + 所选块的 `block_type` 与对应 ID |
15
+ | [`+base-get`](references/lark-base-commands.md) | 读 Base 本体元信息 |
16
+ | [`+table-list`](references/lark-base-commands.md) | 列数据表 |
17
+ | [`+field-list`](references/lark-base-commands.md) | 列字段(含类型与选项) |
18
+ | [`+view-list`](references/lark-base-commands.md) | 列视图,按视图名取 `view_id` |
19
+ | [`+view-get`](references/lark-base-commands.md) 及 `+view-get-card` / `+view-get-filter` / `+view-get-group` / `+view-get-sort` / `+view-get-timebar` / `+view-get-visible-fields` | 读视图配置(共 7 个) |
20
+ | [`+record-list`](references/lark-base-commands.md) | 读记录,可按视图 / filter-json / sort-json 取 |
21
+ | [`+record-search`](references/lark-base-commands.md) | 按关键词搜记录(`--keyword`) |
22
+
23
+ - 使用 Shortcut 前,必须先读 [references/lark-base-commands.md](references/lark-base-commands.md)。
24
+
25
+ ## 先拿 base_token —— 定位规则
26
+
27
+ **不要把 Base / Wiki URL、wiki token 或孤立 raw token 直接当 `--base-token`。**
28
+
29
+ | 用户给了什么 | 怎么做 |
30
+ |---|---|
31
+ | Base / Wiki / 记录分享 URL | `lark-cli base +url-resolve --url "<URL>" --as user`,取 `base_token`;**`table_id` 只在返回的 `block_type` 为 `table` 时才可用**(URL 里的 `table=` 是顶层块,可能是仪表盘/workflow/文档,不是数据表 ID)。不是 `table` 就走 `+table-list` 按表名定位。详见 [commands](references/lark-base-commands.md) |
32
+ | 文档里的 `<bitable token="..." table-id="...">` 标签 | 直接把 `token` 当 `base_token`、`table-id` 当 `--table-id`,不用再 `+url-resolve` |
33
+ | 只有 Base 名称或关键词 | 本域没有按名称搜 Base 的能力;改用 [lark-drive](../lark-drive/README.md) 的 `+search --doc-types bitable` 先定位到 URL,再 `+url-resolve` |
34
+
35
+ `--table-id` / `--view-id` 既接 ID(`tbl...` / `vew...`)也接名称。
36
+
37
+ ## 意图路由
38
+
39
+ | 用户需求 | 命令 |
40
+ |---|---|
41
+ | 这个 Base 里有哪些表 | `+table-list --base-token <t>` |
42
+ | 这张表有哪些字段、字段类型/选项是什么 | `+field-list --base-token <t> --table-id <tbl>` |
43
+ | 读表里的记录 | `+record-list --base-token <t> --table-id <tbl>` |
44
+ | 只读某个视图筛选后的记录 | `+record-list ... --view-id "<视图名或 vew...>"` |
45
+ | 按关键词搜记录 | `+record-search ... --keyword "<关键词>"` |
46
+ | 只要某几个字段 | 追加 `--field-id <字段名>`(可重复) |
47
+ | 这个视图的筛选/排序/分组/可见字段怎么配的 | `+view-get-filter` / `+view-get-sort` / `+view-get-group` / `+view-get-visible-fields` |
48
+ | Base 叫什么、归谁 | `+base-get --base-token <t>` |
49
+
50
+ ## 分页
51
+
52
+ `+table-list` 的 `--limit` 范围 1-100(默认 50);`+field-list` / `+view-list` 的 `--limit`
53
+ 范围 1-200(默认 100)。都配 `--offset` 翻页。
54
+
55
+ `+record-list` / `+record-search` 默认 `--format ndjson`:记录写入本地 `.ndjson` 文件(用
56
+ `--output <path>.ndjson` 指定),stdout 摘要中的 `records_count` / `has_more` 用于分页判断;
57
+ `--limit` 默认且最大 10000。`has_more=true` 时用返回的 `next_offset` 作为 `--offset` 继续,直到
58
+ `has_more=false`。细节见 [commands](references/lark-base-commands.md)。
59
+
60
+ 结果被 `--limit` 截断时,不要拿这一页的内容回答「一共有多少」「最大的是哪个」这类全局问题,
61
+ 先翻完或收窄条件。
@@ -0,0 +1,123 @@
1
+ # base 域命令参考
2
+
3
+ 命令事实以 `lark-cli base +<cmd> --help` 为准。本文只补 `--help` 没说清的部分。
4
+
5
+ ## 通用
6
+
7
+ - 所有命令默认 `--as user`。
8
+ - 除 `+url-resolve` 外,其余命令都必须传 `--base-token`。
9
+ - `--table-id` / `--view-id` 接 ID 或名称;ID 形态是 `tbl...` / `vew...`。
10
+
11
+ ## `+url-resolve`
12
+
13
+ ```bash
14
+ lark-cli base +url-resolve --url "<Base/Wiki/记录分享 URL>" --as user
15
+ ```
16
+
17
+ 返回 `base_token`,以及所选块的类型 `block_type` 与对应 ID。这是所有后续调用的入口。
18
+
19
+ **URL 里的 `table=` 不是 `table_id`。** 它表示当前选中的 Base **顶层块**,可能是数据表、仪表盘、workflow、文件夹或文档。判读返回值:
20
+
21
+ - `base_token` → 直接用。
22
+ - **仅当 `block_type` 为 `table` 时**,才把返回的 `table_id` 当数据表 ID 用。
23
+ - `block_type` 是其他类型(或返回的是 `dashboard_id` / `workflow_id`、只有中性 `block_id`)时,说明用户当前选中的**不是数据表**:改用 `+table-list --base-token <t>` 列出真实数据表,再按用户点名的表名选定 `--table-id`。
24
+ - `selection_source=url_query` 只说明「URL 当前选中了该块」,**不代表**它覆盖用户明确点名的目标。用户点名的目标与返回的 `block_name` 不一致时,以用户为准,走 `+table-list` 重新定位。
25
+
26
+ 绝不要从 URL 字符串里自行截取 `table=` 的值当 `--table-id`。
27
+
28
+ ## `+base-get` / `+table-list`
29
+
30
+ ```bash
31
+ lark-cli base +base-get --base-token <t> --as user
32
+ lark-cli base +table-list --base-token <t> --limit 50 --as user
33
+ ```
34
+
35
+ `+table-list` 的 `--limit` 范围 1-100,默认 50。
36
+
37
+ ## `+field-list` / `+view-list`
38
+
39
+ ```bash
40
+ lark-cli base +field-list --base-token <t> --table-id <tbl> --as user
41
+ lark-cli base +view-list --base-token <t> --table-id <tbl> --as user
42
+ ```
43
+
44
+ `--limit` 范围 1-200,默认 100。写记录级查询前先用 `+field-list` 确认字段名与类型,
45
+ 不要凭用户口述猜字段名。
46
+
47
+ ## 7 个 `+view-get*`
48
+
49
+ ```bash
50
+ lark-cli base +view-get --base-token <t> --table-id <tbl> --view-id <v> --as user
51
+ lark-cli base +view-get-filter --base-token <t> --table-id <tbl> --view-id <v> --as user
52
+ lark-cli base +view-get-sort --base-token <t> --table-id <tbl> --view-id <v> --as user
53
+ lark-cli base +view-get-group --base-token <t> --table-id <tbl> --view-id <v> --as user
54
+ lark-cli base +view-get-card --base-token <t> --table-id <tbl> --view-id <v> --as user
55
+ lark-cli base +view-get-timebar --base-token <t> --table-id <tbl> --view-id <v> --as user
56
+ lark-cli base +view-get-visible-fields --base-token <t> --table-id <tbl> --view-id <v> --as user
57
+ ```
58
+
59
+ 共 7 个,按需取对应配置;`+view-get` 是视图本体元信息。
60
+
61
+ ## `+record-list`
62
+
63
+ ```bash
64
+ lark-cli base +record-list --base-token <t> --table-id <tbl> --as user
65
+ lark-cli base +record-list --base-token <t> --table-id <tbl> --view-id "<视图名>" --as user
66
+ lark-cli base +record-list --base-token <t> --table-id <tbl> --field-id "标题" --field-id "状态" \
67
+ --format ndjson --output ./records.ndjson --as user
68
+ ```
69
+
70
+ - 省略 `--view-id` 读全表;传 `--view-id` 读该视图筛选后的记录
71
+ - `--filter-json` 是筛选 JSON 对象(结构见下方「filter 条件结构」,与 `+view-get-filter` 读到的同一套),**会覆盖 `--view-id` 的筛选**
72
+ - `--sort-json` 是排序数组,如 `[{"field":"Updated","desc":true}]`
73
+ - `--field-id` 可重复,用于只投影需要的字段,减少返回体
74
+ - 输出格式 `--format` 取 `ndjson`(默认)或 `json`(行内原始矩阵)。Record 读取统一使用
75
+ `--format ndjson --output <path>.ndjson`:记录写入本地 NDJSON 文件(每行一条 Record JSON),stdout
76
+ 摘要中的 `records_count` / `has_more` 用于分页判断;用 jq / Python 处理该文件,不要把长数据拉进上下文
77
+ - `--limit`:ndjson 默认且最大 10000(范围 1-10000);json 默认 100(范围 1-200)。只在探查 / 预览 /
78
+ 明确限定条数时才调小
79
+ - 翻页:完整读取从 `--offset 0` 开始,`has_more=true` 时用返回的 `next_offset` 作为下一次 `--offset`
80
+ (不要自行推算),直到 `has_more=false`;每页保存到不同文件;翻页保持同一表、视图、筛选、排序和字段投影
81
+ - 返回的单元格:单选也返回数组;标量空值通常为 `null`(空值不等于零),多值空值为 `[]`;人员读取带
82
+ `id` / `name`(按 ID 去重,名称不代表唯一身份);日期为 RFC3339;Formula / Lookup 读取为文本
83
+
84
+ ## `+record-search`
85
+
86
+ ```bash
87
+ lark-cli base +record-search --base-token <t> --table-id <tbl> \
88
+ --keyword "<关键词>" --search-field <字段名> \
89
+ --format ndjson --output ./search.ndjson --as user
90
+ ```
91
+
92
+ `--keyword` 必填(除非用 `--json` 直传请求体)。
93
+ `--limit`:ndjson 默认且最大 10000;json 默认 10,范围 1-200。
94
+ `--view-id` / `--filter-json` / `--sort-json` / `--field-id` / `--format` / `--output` / 翻页规则同 `+record-list`。
95
+
96
+ ## filter 条件结构
97
+
98
+ `+view-get-filter` 返回的视图筛选、以及 `+record-list` / `+record-search` 的 `--filter-json`,共用同一套 tuple 结构:
99
+
100
+ ```json
101
+ {
102
+ "logic": "and",
103
+ "conditions": [
104
+ ["状态", "intersects", ["Doing"]],
105
+ ["负责人", "intersects", [{ "id": "ou_xxx" }]],
106
+ ["截止时间", "empty"]
107
+ ]
108
+ }
109
+ ```
110
+
111
+ - 顶层是 `{logic?, conditions?}`;`logic` 取 `and`(默认)或 `or`;`conditions` 默认空数组。
112
+ - 每条条件是 tuple `[field, operator, value?]`;`empty` / `non_empty` 写 2 项即可(`["截止时间","empty"]`)。
113
+ - 清空筛选写 `{"conditions": []}`。
114
+ - `+record-list` / `+record-search` 的 `--filter-json` 额外支持**嵌套条件组**:`conditions` 里可放
115
+ `{"logic":"or","conditions":[...]}` 子组(如「优先级是 P0 或负责人非空」)。其他使用筛选条件的场景(如视图筛选)
116
+ 只支持单层 `conditions`。
117
+ - value 写法随字段类型而变:文本用字符串数组,单/多选用选项名数组,人员类(`user`/`created_by`/`updated_by`)用 `[{"id":"ou_xxx"}]`,checkbox 用布尔,日期类有专门的相对/绝对写法。构造前先用 `+field-list` 确认字段类型与选项名。
118
+
119
+ > 这套 tuple 结构**不适用于聚合查询**。本沙箱未开放 `+data-query`,遇到"分组统计/聚合"类需求时不要臆造它的 `filters` 对象 DSL。
120
+
121
+ ## 选路
122
+
123
+ 按条件取原始记录用 `+record-list`;只有「模糊找含某关键词的记录」才用 `+record-search`。