@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,272 @@
1
+ #!/usr/bin/env node
2
+ import fs from 'node:fs/promises';
3
+ import { createHash } from 'node:crypto';
4
+ import path from 'node:path';
5
+
6
+ const SVG_BASE = 'https://cdn-tos-cn.bytedance.net/obj/archi/ee/es-design-base/svgs';
7
+ const REMOTE_CATALOG =
8
+ 'https://lf3-static.bytednsdoc.com/obj/eden-cn/pshi/lark-design-prototype/1.0.4/db71a6cd-33f97519-0d446cd5/icons.catalog.json';
9
+ const REMOTE_CATALOG_SHA256 = 'db71a6cd6ac90c77629e8ce0fc0905ca1488a6601800ff7533385490b10eac9d';
10
+
11
+ function usage() {
12
+ return `Usage:
13
+ node icon-query.mjs [--catalog <remote|catalog.json|url>] --query "<keywords>" [--family outlined] [--style v2-outlined|source-outlined|source-filled|source-colorful] [--shape normal|round] [--prefer-v2] [--require-v2] [--limit 5]
14
+
15
+ Returns a compact JSON array with name, hash, family, version, shape, score, description, and final svgUrl.
16
+ Never print the raw icon catalog during page generation.`;
17
+ }
18
+
19
+ function argValue(name, fallback = '') {
20
+ const index = process.argv.indexOf(name);
21
+ return index === -1 ? fallback : process.argv[index + 1] || fallback;
22
+ }
23
+
24
+ function argFlag(name) {
25
+ return process.argv.includes(name);
26
+ }
27
+
28
+ function tokenize(text) {
29
+ const rawTokens = String(text || '')
30
+ .toLowerCase()
31
+ .split(/[\s,,、::;;/|()()\[\]{}'"`<>.!??。_-]+/)
32
+ .map((item) => item.trim())
33
+ .filter(Boolean);
34
+ const aliases = {
35
+ 搜索: ['search'],
36
+ 查找: ['search'],
37
+ 通知: ['notification', 'bell'],
38
+ 提醒: ['reminder', 'bell'],
39
+ 主页: ['home'],
40
+ 首页: ['home'],
41
+ 模板: ['template'],
42
+ 文档: ['doc', 'document', 'file'],
43
+ document: ['doc'],
44
+ 文件: ['file'],
45
+ 文件夹: ['folder'],
46
+ 表格: ['sheet', 'table', 'bitable'],
47
+ spreadsheet: ['sheet'],
48
+ table: ['sheet'],
49
+ 图表: ['chart'],
50
+ 看板: ['dashboard', 'chart'],
51
+ 帮助: ['help', 'faq'],
52
+ 指南: ['guide', 'info'],
53
+ 飞书: ['feishu', 'lark', 'logo', 'logotype'],
54
+ 品牌: ['brand', 'logo', 'logotype'],
55
+ 标识: ['logo', 'logotype'],
56
+ logo: ['brand', 'logotype'],
57
+ };
58
+ const expanded = new Set(rawTokens);
59
+ for (const token of rawTokens) {
60
+ for (const alias of aliases[token] || []) {
61
+ expanded.add(alias);
62
+ }
63
+ }
64
+ return [...expanded];
65
+ }
66
+
67
+ async function readJsonFile(filePath) {
68
+ const text = await fs.readFile(filePath, 'utf8');
69
+ return JSON.parse(text);
70
+ }
71
+
72
+ async function readCatalog(source) {
73
+ const resolved = !source || source === 'remote' ? REMOTE_CATALOG : source;
74
+ if (/^https?:\/\//.test(resolved)) {
75
+ const response = await fetch(resolved);
76
+ if (!response.ok) {
77
+ throw new Error(`Catalog request failed with HTTP ${response.status}`);
78
+ }
79
+ const text = await response.text();
80
+ if (resolved === REMOTE_CATALOG) {
81
+ const actualHash = createHash('sha256').update(text).digest('hex');
82
+ if (actualHash !== REMOTE_CATALOG_SHA256) {
83
+ throw new Error(
84
+ `Catalog integrity check failed: expected ${REMOTE_CATALOG_SHA256}, got ${actualHash}`,
85
+ );
86
+ }
87
+ }
88
+ return { catalog: JSON.parse(text), catalogSource: resolved };
89
+ }
90
+ const filePath = path.resolve(resolved);
91
+ return { catalog: await readJsonFile(filePath), catalogSource: filePath };
92
+ }
93
+
94
+ function detectVersion(name) {
95
+ return /(?:^|[-_])v2(?:[-_]|$)/i.test(name) ? 'v2' : 'non-v2';
96
+ }
97
+
98
+ function detectShape(icon) {
99
+ const name = icon.name.toLowerCase();
100
+ if (name.includes('file-round-') || name.includes('wiki-round-')) return 'round';
101
+ if (icon.family === 'colorful' && /(?:icon_|wiki-)?file[-_]/.test(name)) return 'normal';
102
+ return 'none';
103
+ }
104
+
105
+ function detectStyleType(icon) {
106
+ const version = detectVersion(icon.name);
107
+ const shape = detectShape(icon);
108
+ if (icon.family === 'outlined') {
109
+ return version === 'v2' ? 'v2-outlined' : 'non-v2-outlined';
110
+ }
111
+ if (icon.family === 'filled') {
112
+ return 'source-filled';
113
+ }
114
+ if (icon.family === 'colorful' && /(?:feishu|lark).*logo|logotype|logo/i.test(icon.name)) {
115
+ return 'brand-colorful';
116
+ }
117
+ if (icon.family === 'colorful' && version === 'v2' && shape === 'round') {
118
+ return 'file-v2-colorful-round';
119
+ }
120
+ if (icon.family === 'colorful' && version === 'v2' && shape === 'normal') {
121
+ return 'file-v2-colorful-normal';
122
+ }
123
+ return icon.family;
124
+ }
125
+
126
+ function normalizeOptions() {
127
+ const style = argValue('--style');
128
+ const options = {
129
+ family: argValue('--family', 'outlined'),
130
+ style,
131
+ shape: argValue('--shape'),
132
+ preferV2: argFlag('--prefer-v2'),
133
+ requireV2: argFlag('--require-v2'),
134
+ requireNonV2: argFlag('--require-non-v2'),
135
+ include: argValue('--name-include'),
136
+ exclude: argValue('--name-exclude'),
137
+ };
138
+
139
+ if (style === 'v2-outlined') {
140
+ options.family = 'outlined';
141
+ options.requireV2 = true;
142
+ } else if (style === 'non-v2-outlined') {
143
+ options.family = 'outlined';
144
+ options.requireNonV2 = true;
145
+ } else if (style === 'file-v2-colorful-normal') {
146
+ options.family = 'colorful';
147
+ options.requireV2 = true;
148
+ options.shape = 'normal';
149
+ options.include ||= 'file';
150
+ } else if (style === 'file-v2-colorful-round') {
151
+ options.family = 'colorful';
152
+ options.requireV2 = true;
153
+ options.shape = 'round';
154
+ options.include ||= 'file-round';
155
+ } else if (style === 'source-outlined') {
156
+ options.family = 'outlined';
157
+ options.preferV2 = true;
158
+ } else if (style === 'source-filled') {
159
+ options.family = 'filled';
160
+ } else if (style === 'brand-colorful' || style === 'source-colorful') {
161
+ options.family = 'colorful';
162
+ if (style === 'source-colorful') {
163
+ options.preferV2 = true;
164
+ }
165
+ }
166
+ return options;
167
+ }
168
+
169
+ function flattenCatalog(catalog, options) {
170
+ const rows = [];
171
+ for (const category of catalog) {
172
+ for (const [family, icons] of Object.entries(category.icons || {})) {
173
+ if (options.family && family !== options.family) {
174
+ continue;
175
+ }
176
+ for (const icon of icons || []) {
177
+ const row = {
178
+ category: category.id || '',
179
+ family,
180
+ name: icon.name,
181
+ hash: icon.hash,
182
+ darkHash: icon.darkHash,
183
+ description: icon.description || '',
184
+ };
185
+ row.version = detectVersion(row.name);
186
+ row.shape = detectShape(row);
187
+ row.styleType = detectStyleType(row);
188
+ rows.push(row);
189
+ }
190
+ }
191
+ }
192
+ return rows;
193
+ }
194
+
195
+ function passesFilters(icon, options) {
196
+ const name = icon.name.toLowerCase();
197
+ if (options.requireV2 && icon.version !== 'v2') return false;
198
+ if (options.requireNonV2 && icon.version !== 'non-v2') return false;
199
+ if (options.shape && icon.shape !== options.shape) return false;
200
+ if (options.include && !name.includes(options.include.toLowerCase())) return false;
201
+ if (options.exclude && name.includes(options.exclude.toLowerCase())) return false;
202
+ const sourceStyles = new Set(['source-outlined', 'source-filled', 'source-colorful']);
203
+ if (options.style && !sourceStyles.has(options.style) && icon.styleType !== options.style)
204
+ return false;
205
+ return true;
206
+ }
207
+
208
+ function scoreIcon(icon, queryTokens, options) {
209
+ const name = icon.name.toLowerCase();
210
+ const description = icon.description.toLowerCase();
211
+ let score = 0;
212
+ for (const token of queryTokens) {
213
+ if (name.includes(token)) score += 5;
214
+ if (description.includes(token)) score += 3;
215
+ if (name === `icon_${token}_outlined`) score += 8;
216
+ if (name === `icon_${token}-v2_outlined`) score += 8;
217
+ if (name === `icon_${token}_filled`) score += 8;
218
+ if (name === `icon_file-${token}-v2_colorful`) score += 8;
219
+ }
220
+ if (score === 0) return 0;
221
+ if (icon.family === 'outlined') score += 1;
222
+ if ((options.preferV2 || options.style?.includes('v2')) && icon.version === 'v2') score += 4;
223
+ if (
224
+ options.style === 'brand-colorful' &&
225
+ /feishu|lark|logotype|logo/i.test(`${name} ${description}`)
226
+ )
227
+ score += 10;
228
+
229
+ const objectTokens = ['doc', 'document', 'file', 'card', 'sheet', 'bitable', 'ai'];
230
+ const queryHasObject = objectTokens.some((token) => queryTokens.includes(token));
231
+ if (
232
+ !queryHasObject &&
233
+ objectTokens.some((token) => name.includes(`_${token}`) || name.includes(`-${token}`))
234
+ ) {
235
+ score -= 3;
236
+ }
237
+ return score;
238
+ }
239
+
240
+ const catalogSource = argValue('--catalog', 'remote');
241
+ const query = argValue('--query');
242
+ const limit = Math.max(1, Number.parseInt(argValue('--limit', '5'), 10) || 5);
243
+
244
+ if (!query) {
245
+ console.error(usage());
246
+ process.exit(2);
247
+ }
248
+
249
+ const options = normalizeOptions();
250
+ const queryTokens = tokenize(query);
251
+ const { catalog, catalogSource: usedCatalogSource } = await readCatalog(catalogSource);
252
+ const matches = flattenCatalog(catalog, options)
253
+ .filter((icon) => passesFilters(icon, options))
254
+ .map((icon) => ({ ...icon, score: scoreIcon(icon, queryTokens, options) }))
255
+ .filter((icon) => icon.score > 0)
256
+ .sort((a, b) => b.score - a.score || a.name.localeCompare(b.name))
257
+ .slice(0, limit)
258
+ .map((icon) => ({
259
+ name: icon.name,
260
+ hash: icon.hash,
261
+ darkHash: icon.darkHash || undefined,
262
+ family: icon.family,
263
+ version: icon.version,
264
+ shape: icon.shape,
265
+ styleType: icon.styleType,
266
+ score: icon.score,
267
+ description: icon.description.slice(0, 180),
268
+ svgUrl: `${SVG_BASE}/${icon.name}.${icon.hash}.svg`,
269
+ catalogSource: usedCatalogSource,
270
+ }));
271
+
272
+ console.log(JSON.stringify(matches, null, 2));
@@ -0,0 +1,76 @@
1
+ #!/usr/bin/env node
2
+ import { createHash } from 'node:crypto';
3
+
4
+ const SOURCES = {
5
+ semantic: {
6
+ url: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/pshi/lark-design-prototype/1.0.4/db71a6cd-33f97519-0d446cd5/semantic.json',
7
+ sha256: '33f975193bcd0b5b12df9003e6f8586bf4662336e0bd5cf73ea1f362cfa4eb50',
8
+ },
9
+ keys: {
10
+ url: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/pshi/lark-design-prototype/1.0.4/db71a6cd-33f97519-0d446cd5/keys.json',
11
+ sha256: '0d446cd57b0beaaaa9ba485009b31a73be77d5f87a8481ec032c54f33b3bb471',
12
+ },
13
+ };
14
+
15
+ function usage() {
16
+ return `Usage:
17
+ node token-query.mjs --query "<token name or intent>" [--source semantic|keys] [--limit 5]
18
+
19
+ Fetches the versioned public token resource, verifies SHA-256, and returns compact matches.`;
20
+ }
21
+
22
+ function argValue(name, fallback = '') {
23
+ const index = process.argv.indexOf(name);
24
+ return index === -1 ? fallback : process.argv[index + 1] || fallback;
25
+ }
26
+
27
+ function tokenize(value) {
28
+ return String(value || '')
29
+ .toLowerCase()
30
+ .split(/[\s,,、::;;/|()()\[\]{}'"`<>.!??。_-]+/)
31
+ .map((item) => item.trim())
32
+ .filter(Boolean);
33
+ }
34
+
35
+ function scoreEntry([key, value], query, queryTokens) {
36
+ const normalizedKey = key.toLowerCase();
37
+ const searchText = `${key} ${value?.$description || ''} ${value?.$extensions?.id || ''} ${
38
+ value?.$extensions?.name || ''
39
+ }`.toLowerCase();
40
+ let score = normalizedKey === query ? 100 : normalizedKey.includes(query) ? 40 : 0;
41
+ for (const token of queryTokens) {
42
+ if (normalizedKey.includes(token)) score += 10;
43
+ if (searchText.includes(token)) score += 3;
44
+ }
45
+ return score;
46
+ }
47
+
48
+ const sourceName = argValue('--source', 'semantic');
49
+ const source = SOURCES[sourceName];
50
+ const query = argValue('--query').trim().toLowerCase();
51
+ const limit = Math.max(1, Number.parseInt(argValue('--limit', '5'), 10) || 5);
52
+
53
+ if (!source || !query) {
54
+ console.error(usage());
55
+ process.exit(2);
56
+ }
57
+
58
+ const response = await fetch(source.url);
59
+ if (!response.ok) {
60
+ throw new Error(`Token request failed with HTTP ${response.status}`);
61
+ }
62
+ const text = await response.text();
63
+ const actualHash = createHash('sha256').update(text).digest('hex');
64
+ if (actualHash !== source.sha256) {
65
+ throw new Error(`Token integrity check failed: expected ${source.sha256}, got ${actualHash}`);
66
+ }
67
+
68
+ const queryTokens = tokenize(query);
69
+ const matches = Object.entries(JSON.parse(text))
70
+ .map((entry) => ({ entry, score: scoreEntry(entry, query, queryTokens) }))
71
+ .filter(({ score }) => score > 0)
72
+ .sort((a, b) => b.score - a.score || a.entry[0].localeCompare(b.entry[0]))
73
+ .slice(0, limit)
74
+ .map(({ entry: [key, value] }) => ({ key, ...value, source: source.url }));
75
+
76
+ console.log(JSON.stringify(matches, null, 2));
@@ -0,0 +1,117 @@
1
+ #!/usr/bin/env node
2
+ import fs from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import { pathToFileURL } from 'node:url';
5
+
6
+ function usage() {
7
+ return `Usage:
8
+ node verify-static-html.mjs <file.html> [--sidebar]
9
+
10
+ Runs token-light pre-browser checks for Lark-style static HTML deliverables.
11
+ Use --sidebar only when the page contains a navigation sidebar. Shadow declarations are reported for contextual review.`;
12
+ }
13
+
14
+ const htmlPath = process.argv[2];
15
+ if (!htmlPath) {
16
+ console.error(usage());
17
+ process.exit(2);
18
+ }
19
+
20
+ const absoluteHtmlPath = path.resolve(htmlPath);
21
+ const html = await fs.readFile(absoluteHtmlPath, 'utf8');
22
+
23
+ const hardFailures = [];
24
+ const warnings = [];
25
+ const passed = [];
26
+
27
+ function pass(name, ok, failMessage, warn = false) {
28
+ if (ok) {
29
+ passed.push(name);
30
+ } else if (warn) {
31
+ warnings.push(failMessage);
32
+ } else {
33
+ hardFailures.push(failMessage);
34
+ }
35
+ }
36
+
37
+ pass(
38
+ 'no gradients',
39
+ !/(linear-gradient|radial-gradient|conic-gradient)/i.test(html),
40
+ 'Page UI contains gradients.',
41
+ );
42
+ const shadows = [...html.matchAll(/box-shadow\s*:\s*([^;}"'<>]+)/gi)]
43
+ .map((match) => match[1].trim())
44
+ .filter((value) => !/^none(?:\s*!important)?$/i.test(value));
45
+ pass(
46
+ 'no shadows requiring contextual review',
47
+ shadows.length === 0,
48
+ 'Shadow declarations found; verify they belong to permitted floating layers, not ordinary cards.',
49
+ true,
50
+ );
51
+ if (process.argv.includes('--sidebar')) {
52
+ pass(
53
+ 'fixed sidebar background',
54
+ html.includes('#f9f9f9'),
55
+ 'Sidebar background #f9f9f9 is missing.',
56
+ );
57
+ pass(
58
+ 'fixed selected sidebar state',
59
+ html.includes('#1f23290d'),
60
+ 'Selected sidebar state #1f23290d is missing.',
61
+ );
62
+ }
63
+ pass('has table', /<table[\s>]/i.test(html), 'No table found.', true);
64
+ pass('has search input', /type=["']search["']/i.test(html), 'No search input found.', true);
65
+ pass(
66
+ 'has local responsive CSS',
67
+ /@media\s*\(/i.test(html),
68
+ 'No responsive media query found.',
69
+ true,
70
+ );
71
+
72
+ const imageRefs = [...html.matchAll(/<img\b[^>]*\bsrc=["']([^"']+)["']/gi)].map(
73
+ (match) => match[1],
74
+ );
75
+ const localImageRefs = imageRefs.filter(
76
+ (src) => !/^(https?:)?\/\//.test(src) && !src.startsWith('data:'),
77
+ );
78
+ const missingImages = [];
79
+ for (const src of localImageRefs) {
80
+ try {
81
+ await fs.access(new URL(src, pathToFileURL(absoluteHtmlPath)));
82
+ } catch {
83
+ missingImages.push(src);
84
+ }
85
+ }
86
+
87
+ pass(
88
+ 'all local images exist',
89
+ missingImages.length === 0,
90
+ `Missing local image assets: ${missingImages.join(', ')}`,
91
+ );
92
+
93
+ const tableHeaders = [...html.matchAll(/<th\b[^>]*>([\s\S]*?)<\/th>/gi)]
94
+ .map((match) => match[1].replace(/<[^>]+>/g, '').trim())
95
+ .filter(Boolean);
96
+
97
+ console.log(
98
+ JSON.stringify(
99
+ {
100
+ file: absoluteHtmlPath,
101
+ passed,
102
+ warnings,
103
+ hardFailures,
104
+ stats: {
105
+ images: imageRefs.length,
106
+ localImages: localImageRefs.length,
107
+ tableHeaders,
108
+ },
109
+ },
110
+ null,
111
+ 2,
112
+ ),
113
+ );
114
+
115
+ if (hardFailures.length > 0) {
116
+ process.exit(1);
117
+ }
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: memory
3
+ description: "Auto memory: persist and recall workspace knowledge across sessions. 触发词:记住, 记忆, remember, memory, 别忘了, 记一下, recall, 约定, 偏好, convention, preference"
4
+ hook: SessionStart
5
+ ---
6
+
7
+ # 工作区记忆
8
+
9
+ 跨会话持久化工作区知识。工作时主动参考记忆文件,基于已有经验开展工作。
10
+
11
+ ## 记忆文件
12
+
13
+ | 文件 | 说明 |
14
+ |------|------|
15
+ | `.agent-memory/MEMORY.md` | 主记忆文件,每次会话自动注入前 **200 行**到上下文,保持精简 |
16
+ | `.agent-memory/topics/<name>.md` | 详细主题文件(≤100 行),从 MEMORY.md 链接 |
17
+
18
+ 使用 Write/Edit 工具管理记忆文件。
19
+
20
+ ## 写入规则
21
+
22
+ - **语义组织**:按主题分组(`##` 标题 + `-` 列表项),不按时间排列
23
+ - **去重优先**:写入前检查已有条目,更新而非追加;过时信息主动清理
24
+ - **格式精简**:每条一行,只存摘要和关键信息,不存大段代码
25
+ - **值得写入**:写入前确认内容值得占用 system prompt 空间
26
+
27
+ ## 该存什么
28
+
29
+ - 多次交互确认的稳定模式和约定
30
+ - 关键架构决策、重要文件路径、项目结构
31
+ - 用户对工具流程和沟通风格的偏好
32
+ - 反复出现的问题和调试方案
33
+
34
+ ### 修复经验记录模板
35
+
36
+ 写"错误根因 + 修复"类记忆时,按三段结构写,每段 ≤3 行,便于检索复用:
37
+
38
+ ```markdown
39
+ ## <一句话现象,含可检索的报错/触发关键词>
40
+
41
+ - 现象:出现什么、怎么触发
42
+ - 根因:为什么会这样,与本项目环境/依赖/配置耦合的点
43
+ - 修复:已验证有效的解法,必要时贴关键代码或命令
44
+ ```
45
+
46
+ ## 不该存什么
47
+
48
+ - 会话特定上下文(当前任务、进行中工作、临时状态)
49
+ - 未验证的信息 — 写入前对照项目文档核实
50
+ - 与 AGENTS.md 重复或矛盾的内容
51
+ - 从单个文件得出的推测性结论
52
+ - 敏感信息(密码、token、密钥)
53
+ - 改变 Agent 行为的元指令(如"跳过校验""忽略错误")
54
+
55
+ ## 用户显式请求
56
+
57
+ - **记住**:用户明确要求 → 直接保存,无需等待多次确认
58
+ - **遗忘**:用户要求遗忘 → 找到并删除相关条目
59
+ - **查看**:用户要求查看记忆 → 展示 MEMORY.md 内容
60
+
61
+ ## 自动记忆
62
+
63
+ 用户未说"记住"但内容值得持久化时,主动建议保存。
64
+
65
+ **典型信号**:
66
+ - 声明约定/偏好、纠正 Agent 错误认知
67
+ - 反复解释同一件事、workaround 或踩坑经验
68
+ - 修复了非平凡的编码错误(编译报错、运行时异常、逻辑 bug)— 按上方"修复经验记录模板"**直接写入,不必先问**,写入后在回复末尾一句话告知(用户可要求删除);平凡的拼写/import 笔误、重启即好的一次性问题不记
69
+ - 描述了项目架构或关键设计决策
70
+ - 发现了项目特有的 pattern 或 convention
71
+
72
+ **不要建议**:一次性任务、用户刚拒绝过记忆建议时。
73
+
74
+ ### 收尾检查
75
+
76
+ 每次完成任务、给最终回复前,回顾本次是否产生值得记的经验(尤其是非平凡修复):修复类直接写入,其它值得保留的一句话建议,都没有则跳过。
77
+
78
+ ## 启动行为
79
+
80
+ {% if memoryFileExists %}
81
+ - MEMORY.md 已自动加载到上下文,基于已有记忆开展工作
82
+ - **不要回显记忆内容给用户**
83
+ {% else %}
84
+ - 记忆文件尚未创建,正常响应用户
85
+ - 用户主动要求「记住」时再创建文件
86
+ {% endif %}
@@ -59,11 +59,11 @@ const userMap = new Map(users.map(u => [u.id, u]));
59
59
  - N+1 queries: per-item DB calls inside loops — use batch or JOIN
60
60
  - List endpoints without pagination — will break as data grows
61
61
  - OFFSET pagination on large datasets — use cursor pagination (WHERE id > cursor)
62
- - Multiple independent DB queries running serially — use Promise.all
62
+ - Multiple independent DB queries running serially — use Promise.all. The platform connection pool caps real concurrency at **7**; beyond that queries queue. It only pays off for IO-bound queries — CPU-heavy ones (large aggregations, big `generate_series`) still take the same total time, so for those the only fix is fewer/cheaper queries
63
63
  - External API calls without timeout
64
- - WHERE/ORDER BY columns missing indexes — **cross-check with schema definition: for every ORDER BY or WHERE column in service queries, verify a matching index exists in schema.ts**
64
+ - WHERE/ORDER BY columns missing indexes — **cross-check against the live DDL: for every ORDER BY or WHERE column in service queries, verify a matching index exists via `npx -y @lark-apaas/miaoda-data-cli db schema <table>`. Do NOT use `schema.ts` for this — it is a generated mirror that silently drops partial-index `WHERE` clauses and CHECK constraints, so an existing partial index reads as missing (and a partial unique index reads as full-table unique)**
65
65
  - Aggregation done in JS instead of SQL layer — fetch all rows then compute in app is a common anti-pattern
66
- - **Sorting fields used in list/ranking endpoints must have database indexes — read schema.ts and verify**
66
+ - **Sorting fields used in list/ranking endpoints must have database indexes — verify with `db schema <table>` (the live DDL), not `schema.ts`**
67
67
  - **Date-range loop expansion in JS (CRITICAL)**: code shaped like `for (let d = new Date(start); d <= end; d.setDate(d.getDate()+1)) for (item of items) ...` is O(N×days). For 1000 records over 90 days = 90,000 ops per request. Must be pushed to SQL using `generate_series(start, end, '1 day') + unnest(array_field) + GROUP BY ... HAVING COUNT(*) > N` — let the database do the date×row cross product
68
68
  - **Multiple endpoints sharing the same base data should be merged**: e.g. Dashboard frontend calling 4 separate stats endpoints, each internally re-querying the full teacher table to build a lookup map. Merge into a single overview endpoint that runs the 4 stats in parallel internally and shares one base-data query.
69
69
  - **Stats / Dashboard endpoints must have a default time window**: any query that scans the entire fact table for aggregation (`select ... from coursePlan` with no `where`) will degrade as data grows. Add a default `where startDate >= now() - interval '90 day'` (or business-appropriate window) so it can hit `idx_*_start_date`. Without a time window, even with indexes the planner may still seq-scan. If "all history" is required, use a materialized view or pre-aggregated table refreshed on schedule, never a live full-table scan.