@lark-apaas/coding-steering 0.1.34 → 0.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/steering/design-html/skills/charts/SKILL.md +4 -0
- package/steering/design-html/skills/preflight/scripts/probe.sh +0 -0
- package/steering/nestjs-react-fullstack/skills/plugin-guide/SKILL.md +4 -4
- package/steering/nestjs-react-fullstack/skills_local/plugin-guide/SKILL.md +4 -0
- package/steering/vite-react/skills/plugin-guide/SKILL.md +3 -1
- package/steering/vite-react/skills/react-three-fiber/SKILL.md +4 -0
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/coding-steering",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.35",
|
|
4
4
|
"description": "Stack-specific steering content for miaoda-coding templates",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"steering"
|
|
8
8
|
],
|
|
9
|
-
"scripts": {
|
|
10
|
-
"lint:md": "markdownlint 'steering/**/*.md' --ignore 'steering/**/skills/**' --ignore 'steering/**/skills_common/**' --ignore 'steering/**/skills_local/**'"
|
|
11
|
-
},
|
|
12
9
|
"devDependencies": {
|
|
13
10
|
"markdownlint-cli": "^0.47.0"
|
|
14
11
|
},
|
|
@@ -20,5 +17,8 @@
|
|
|
20
17
|
"miaoda",
|
|
21
18
|
"coding-steering"
|
|
22
19
|
],
|
|
23
|
-
"license": "MIT"
|
|
24
|
-
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"scripts": {
|
|
22
|
+
"lint:md": "markdownlint 'steering/**/*.md' --ignore 'steering/**/skills/**' --ignore 'steering/**/skills_common/**' --ignore 'steering/**/skills_local/**'"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -7,6 +7,8 @@ metadata:
|
|
|
7
7
|
en-US: Charts
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
{% raw %}
|
|
11
|
+
|
|
10
12
|
# 图表
|
|
11
13
|
|
|
12
14
|
你是用 ECharts 呈现信息的数据叙事设计者。你的图表会出现在创意 HTML 产物中,例如仪表盘、幻灯片、设计探索。ECharts 是你的媒介,不是目标;你的工作是让数据故事一眼可读,而不是堆配置项。一个图表只表达一个主要信息。
|
|
@@ -202,3 +204,5 @@ Object.assign(window, { EChart });
|
|
|
202
204
|
| Line 连接未按时间排序的点 | Bar 或 Scatter |
|
|
203
205
|
| markPoint 重复(统计极值 = 业务事件) | 仅保留业务注释 |
|
|
204
206
|
| 用 Stacked Bar 表示 Gantt | 使用带 `renderItem` 的 `custom` series |
|
|
207
|
+
|
|
208
|
+
{% endraw %}
|
|
File without changes
|
|
@@ -33,7 +33,7 @@ gate-tools:
|
|
|
33
33
|
## 核心概念(三层关系)
|
|
34
34
|
|
|
35
35
|
- **Plugin(插件)**:底层承载单元 = 插件元信息 + 表单定义(form.schema)。模型只感知插件与其表单字段,不感知内部实现(Action 实现、API 细节)。
|
|
36
|
-
- **PluginInstance(插件实例)**:对某个 Plugin 表单的业务封装,以单文件 JSON 存储于 `server/capabilities/<id>.json`(语义化 id)。通过 `paramsSchema` 暴露业务入参,通过 `formValue` 将入参映射到插件表单字段(常量或 `{{input.xxx}}` 引用)。
|
|
36
|
+
- **PluginInstance(插件实例)**:对某个 Plugin 表单的业务封装,以单文件 JSON 存储于 `server/capabilities/<id>.json`(语义化 id)。通过 `paramsSchema` 暴露业务入参,通过 `formValue` 将入参映射到插件表单字段(常量或 `{% raw %}{{input.xxx}}{% endraw %}` 引用)。
|
|
37
37
|
- **PluginInstanceAIJson(运行时投影 pluginInstance.ai.json)**:由 PluginInstance 派生的调用合同(Runtime Spec),经 `get_plugin_ai_json(id)` 获取。含实例元数据、`actions[]`(key / inputSchema / outputSchema / outputMode: unary|stream)、`readme`(特殊字段与限制,必须阅读并严格遵循)、`formSchema`(插件表单字段结构摘要,渐进式新增字段,部分环境未部署时缺失)、`type`(single_action / multi_action,后者需选择 actionKey)。**生成调用代码前必须读取它作为唯一权威依据,禁止猜测 action、入参/出参结构、输出模式。** 仅创建/修改配置(走 `plugin_instance` 工具)或只需实例列表概览(上下文已提供)时,无需调用 `get_plugin_ai_json`。
|
|
38
38
|
|
|
39
39
|
**paramsSchema 仅支持 4 种参数类型**:文本 `{ "type": "string" }`、字符串数组 `{ "type": "array", "items": { "type": "string" } }`、图片 `{ "type": "string", "format": "picture" }`、文件 `{ "type": "string", "format": "file" }`,均需带 `description`。
|
|
@@ -217,7 +217,7 @@ const structured = await capabilityClient
|
|
|
217
217
|
|
|
218
218
|
- **业务数据**(简历内容、职位描述等):从 DB 查询或前端传入,经 `input` 传递
|
|
219
219
|
- **固定的运行时配置**(固定接收人等):CREATE 时在 `formValue` 直接写死(如 `formValue.receiverUserList: ["1854102143505690"]`)
|
|
220
|
-
- **动态的运行时配置**(按角色/条件变化):从平台角色 API / 应用配置表 / 环境变量获取,经 `input` 传入(`formValue.receiverUserList: "{{input.receiverIds}}"`)
|
|
220
|
+
- **动态的运行时配置**(按角色/条件变化):从平台角色 API / 应用配置表 / 环境变量获取,经 `input` 传入(`{% raw %}formValue.receiverUserList: "{{input.receiverIds}}"{% endraw %}`)
|
|
221
221
|
|
|
222
222
|
**禁止**在业务代码中硬编码运行时配置值(如 `const userId = '185410...'`)。`formValue` 配置固定值 ≠ 代码硬编码:前者是声明式配置,修改不用改代码。
|
|
223
223
|
|
|
@@ -244,7 +244,7 @@ const structured = await capabilityClient
|
|
|
244
244
|
|
|
245
245
|
## 飞书深链 URL 规范
|
|
246
246
|
|
|
247
|
-
飞书通知/卡片插件中回链本应用页面的按钮深链,必须是**带 basePath 的绝对 URL**,Server 侧构造后作为 input 传给插件(capability 的 url 用 `{{input.xxx}}` 引用):
|
|
247
|
+
飞书通知/卡片插件中回链本应用页面的按钮深链,必须是**带 basePath 的绝对 URL**,Server 侧构造后作为 input 传给插件(capability 的 url 用 `{% raw %}{{input.xxx}}{% endraw %}` 引用):
|
|
248
248
|
|
|
249
249
|
```typescript
|
|
250
250
|
// req.hostname = 网关公网域名(trust proxy 已开),禁止用 req.headers.host
|
|
@@ -261,7 +261,7 @@ const url = `https://${req.hostname}${process.env.CLIENT_BASE_PATH}${routePath}`
|
|
|
261
261
|
| 不涉及持久化仍在 Server 侧写调用代码 / 为纯展示场景建后端 API 中转 | 即时展示、发消息等优先 Client 侧直接调 `capabilityClient`;涉及持久化才走 Server 侧 |
|
|
262
262
|
| `call()` 签名错误:`plugin.call(JSON.stringify({...}))` 或 `plugin.call({...})` | 第一个参数必须是 actionKey 字符串:`plugin.call('actionKey', {...})` |
|
|
263
263
|
| 流式 chunk 当字符串拼接(`text += chunk`) | chunk 是对象,按 outputSchema 解构:`text += chunk.content \|\| ''` |
|
|
264
|
-
| formValue 用 `["{{input.xxx}}"]` 包装已是 array 的 paramsSchema 参数 | paramsSchema 为 array 时 formValue 透传 `"{{input.xxx}}"`,不再包一层数组 |
|
|
264
|
+
| formValue 用 `{% raw %}["{{input.xxx}}"]{% endraw %}` 包装已是 array 的 paramsSchema 参数 | paramsSchema 为 array 时 formValue 透传 `{% raw %}"{{input.xxx}}"{% endraw %}`,不再包一层数组 |
|
|
265
265
|
| 前端调插件后不保存结果(页面刷新丢失),或为保存结果单独新建 API 端点 | 需持久化时 Server 侧调用直接落库(优先),或 Client 侧调用后立即经**已有** CRUD 接口保存 |
|
|
266
266
|
| 创建了 PluginInstance 但只建不调 | CREATE 后必须接 `get_plugin_ai_json` → 生成调用代码 → 集成业务逻辑 |
|
|
267
267
|
| 插件返回值 `as any` 直接取字段 | 按 outputSchema 生成 TypeScript interface |
|
|
@@ -8,6 +8,8 @@ steering-topic: plugin_guide
|
|
|
8
8
|
match-template-name: nestjs-react-fullstack
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
+
{% raw %}
|
|
12
|
+
|
|
11
13
|
# Plugin 集成指南(本地开发)
|
|
12
14
|
|
|
13
15
|
AI 插件集成规范,使用 lark-cli 命令管理插件包与实例,通过 capabilityClient / CapabilityService 生成调用代码。
|
|
@@ -578,3 +580,5 @@ npx @lark-apaas/miaoda-cli plugin list --id <instance_id>
|
|
|
578
580
|
5. **禁止用 `npm install` 安装插件包** — 插件包和 npm 包是两套独立机制。
|
|
579
581
|
6. **禁止 Mock** — 必须走真实插件实例调用链路。
|
|
580
582
|
7. **formValue 禁止 Handlebars 控制语法** — 仅允许 `{{input.xxx}}`。
|
|
583
|
+
|
|
584
|
+
{% endraw %}
|
|
@@ -180,7 +180,7 @@ const structured = await (jsonExtractor as any).call('textToJson', { text: rawRe
|
|
|
180
180
|
- **Plugin(插件)**:底层承载单元,包含插件元信息与表单定义(form.schema)。模型侧只感知插件及其表单字段,不感知插件内部实现细节。
|
|
181
181
|
- **PluginInstance(插件实例配置)**:基于某个 Plugin 的表单做"业务封装",以 **单文件 JSON** 的形式存储(每个插件实例一个文件,语义化 id)。
|
|
182
182
|
- 通过 `paramsSchema` 暴露业务入参
|
|
183
|
-
- 通过 `formValue` 将业务入参映射到插件表单字段(可常量或引用 `{{input.xxx}}`)
|
|
183
|
+
- 通过 `formValue` 将业务入参映射到插件表单字段(可常量或引用 `{% raw %}{{input.xxx}}{% endraw %}`)
|
|
184
184
|
- **PluginInstanceAIJson(pluginInstance.ai.json)**:工程转化层产物,是 pluginInstance 的**运行时投影 / 调用合同(Runtime Spec)**。
|
|
185
185
|
- 包含插件定位信息、actions 入口列表、input/output schema、outputMode、readme 等
|
|
186
186
|
- Code Agent 在生成**调用代码**前,必须读取它作为权威依据(使用 `capabilityClient` 调用)
|
|
@@ -224,6 +224,7 @@ Plugin 的具体内容以JSON格式给出,例如:
|
|
|
224
224
|
|
|
225
225
|
PluginInstance 的配置以 JSON 形式输出,例如:
|
|
226
226
|
|
|
227
|
+
{% raw %}
|
|
227
228
|
```json
|
|
228
229
|
{
|
|
229
230
|
"id": "create_feishu_group", // 全局唯一语义化 ID
|
|
@@ -245,6 +246,7 @@ PluginInstance 的配置以 JSON 形式输出,例如:
|
|
|
245
246
|
}
|
|
246
247
|
}
|
|
247
248
|
```
|
|
249
|
+
{% endraw %}
|
|
248
250
|
|
|
249
251
|
**注意**paramsSchema 支持以下 4 种参数类型,需要按下面规定的格式进行填充:
|
|
250
252
|
|
|
@@ -5,6 +5,8 @@ steering: true
|
|
|
5
5
|
steering-topic: react_three_fiber
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
{% raw %}
|
|
9
|
+
|
|
8
10
|
# React Three Fiber (R3F) 编码指南
|
|
9
11
|
|
|
10
12
|
实现 3D 场景 / 3D 游戏 / 3D 数据可视化时, MUST 用 **react-three-fiber + drei** 声明式栈, 严禁用 React + CSS / SVG / `transform: rotateX` 伪 3D.
|
|
@@ -220,3 +222,5 @@ npm install react-error-boundary # 必装! Canvas 外包 ErrorBoundary
|
|
|
220
222
|
|
|
221
223
|
- `client-coding-guide` - vite-react 通用编码规范
|
|
222
224
|
- `component-conventions` - React 组件命名 / 文件结构
|
|
225
|
+
|
|
226
|
+
{% endraw %}
|