@josephyan/qingflow-app-builder-mcp 1.1.26 → 1.1.28

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.
@@ -1,530 +1,138 @@
1
- # Build Single App(单应用完整搭建)
1
+ # Build Single App
2
2
 
3
- Use this when the user wants to set up one Qingflow app end-to-end: a rich field schema, grouped layout, approval flow, multiple view types, custom action buttons, in-app charts, associated reports on views, and sample data.
3
+ Use this when the user asks for one app/form, or gives one `app_key`.
4
+ If the request contains several related business objects, use [build-complete-system.md](./build-complete-system.md).
4
5
 
5
- **Signal phrases**: "创建一个应用"、"帮我搭一个XX管理"、"从零开始建一个XX表单"、"我需要一个管理XX的应用"
6
+ ## Main Chain
6
7
 
7
- For a multi-app system with cross-app relations and a portal dashboard, use [build-complete-system.md](./build-complete-system.md) instead.
8
-
9
- ---
10
-
11
- ## Execution order (never reorder)
12
-
13
- ```
14
- Phase 0 → Phase 1 → Phase 2 → Phase 3 → Phase 4 → Phase 5 → Phase 6 → Phase 7 → Phase 8 → Phase 9
15
- Package Schema Layout Flow Views Buttons Charts Assoc. Data Verify
16
- Res.
17
- ```
18
-
19
- - Phase 4 (views) must complete before Phase 7 (associated resources) — `view_key` values must be known first
20
- - Phase 6 (charts) must complete before Phase 7 (associated resources) — `chart_id`/`chart_key` values must be known first
21
- - Phase 8 (data) runs after all config phases — fields, flow, and views must be live
22
-
23
- ---
24
-
25
- ## Phase 0 — Scan workspace packages
26
-
27
- ```json
28
- {"tool_name": "package_list", "arguments": {"profile": "default"}}
29
- ```
30
-
31
- - **Package name exists in workspace** → tell the user, wait for explicit confirmation before adding the app into it
32
- - **Package name not in workspace** → create immediately, no confirmation needed:
33
-
34
- ```json
35
- {
36
- "tool_name": "package_apply",
37
- "arguments": {
38
- "profile": "default",
39
- "package_name": "合同管理",
40
- "create_if_missing": true
41
- }
42
- }
43
- ```
44
-
45
- Record the returned `package_id`. All subsequent phases use it.
46
-
47
- ---
48
-
49
- ## Phase 1 — Schema (15–20 fields)
50
-
51
- > **Read first**: [update-schema.md](./update-schema.md)
52
-
53
- ### Field type distribution
54
-
55
- | Type | Count | Examples |
56
- |------|-------|---------|
57
- | `text` | 2–3 | 名称、编号、联系人 |
58
- | `long_text` | 1–2 | 描述、摘要、备注 |
59
- | `single_select` | 2–3 | 状态、类型、优先级 |
60
- | `multi_select` | 1–2 | 标签、关联业务线 |
61
- | `date` / `datetime` | 2–3 | 签署日期、生效日期、到期日期 |
62
- | `amount` | 1–2 | 合同金额、已付金额 |
63
- | `number` | 1–2 | 期限(月)、完成率(%) |
64
- | `member` | 2 | 负责人、审核人 |
65
- | `department` | 0–1 | 所属部门 |
66
- | `phone` | 0–1 | 联系电话 |
67
- | `attachment` | 1 | 附件(`as_data_cover: true` for cover display) |
68
-
69
- ### Hard rules
70
-
71
- - Exactly one field must have `as_data_title: true`
72
- - `as_data_cover: true` requires `type: attachment`
73
- - No `relation` fields in a single-app build — use [build-complete-system.md](./build-complete-system.md) if cross-app links are needed
74
- - `single_select`/`multi_select` fields must include an `options` array
75
-
76
- ### Example — 合同管理
77
-
78
- ```json
79
- {
80
- "tool_name": "app_schema_apply",
81
- "arguments": {
82
- "profile": "default",
83
- "package_id": 1218950,
84
- "create_if_missing": true,
85
- "publish": true,
86
- "apps": [
87
- {
88
- "client_key": "contract",
89
- "app_name": "合同",
90
- "add_fields": [
91
- {"name": "合同名称", "type": "text", "required": true, "as_data_title": true},
92
- {"name": "合同编号", "type": "text"},
93
- {"name": "合同类型", "type": "single_select", "options": ["服务合同", "采购合同", "劳务合同", "保密协议", "其他"]},
94
- {"name": "合同状态", "type": "single_select", "options": ["草稿", "审批中", "已生效", "已到期", "已终止"]},
95
- {"name": "优先级", "type": "single_select", "options": ["高", "中", "低"]},
96
- {"name": "合同标签", "type": "multi_select", "options": ["重点客户", "续签", "新签", "框架协议"]},
97
- {"name": "签署日期", "type": "date"},
98
- {"name": "生效日期", "type": "date"},
99
- {"name": "到期日期", "type": "date"},
100
- {"name": "合同金额", "type": "amount"},
101
- {"name": "已付金额", "type": "amount"},
102
- {"name": "付款比例", "type": "number"},
103
- {"name": "合同期限(月)", "type": "number"},
104
- {"name": "负责人", "type": "member"},
105
- {"name": "法务审核人", "type": "member"},
106
- {"name": "所属部门", "type": "department"},
107
- {"name": "甲方联系人", "type": "text"},
108
- {"name": "甲方联系电话", "type": "phone"},
109
- {"name": "合同内容摘要", "type": "long_text"},
110
- {"name": "合同附件", "type": "attachment", "as_data_cover": true}
111
- ]
112
- }
113
- ]
114
- }
115
- }
8
+ ```text
9
+ app_resolve / app_get
10
+ -> app_schema_apply(fields + form.sections)
11
+ -> app_views_apply(views[])
12
+ -> workflow only when requested or required
13
+ -> readback/verify
116
14
  ```
117
15
 
118
- Record the returned `app_key`. All subsequent phases use it.
16
+ This is the only recommended chain for a new single app. Do not split layout into a routine second step.
119
17
 
120
- ---
18
+ ## Required Shape
121
19
 
122
- ## Phase 2 Layout
20
+ - Resolve the target package/app with `app_resolve`, `app_get`, or `package_get`.
21
+ - Create or update business fields with `app_schema_apply`.
22
+ - Put form layout directly in `form.sections` in the schema payload.
23
+ - Exactly one readable top-level field must have `as_data_title: true`.
24
+ - Do not create platform fields: `数据ID`, `编号`, `申请人`, `申请时间`, `创建人`, `创建时间`, `提交人`, `提交时间`, `更新时间`, `更新人`, `当前流程状态`, `当前处理人`, `当前处理节点`, `流程标题`.
25
+ - Create at least one business view when the user-facing list/table/card experience matters.
26
+ - If a view needs business actions, put the action configuration directly inside the view item with `action_buttons`.
123
27
 
124
- > **Read first**: [update-layout.md](./update-layout.md)
125
-
126
- Group fields into 3–4 logical sections with 2–3 fields per row.
28
+ ## Schema Payload Pattern
127
29
 
128
30
  ```json
129
31
  {
130
- "tool_name": "app_layout_apply",
131
- "arguments": {
132
- "profile": "default",
133
- "app_key": "APP_KEY",
134
- "mode": "merge",
135
- "publish": true,
136
- "sections": [
137
- {
138
- "title": "基础信息",
139
- "rows": [
140
- ["合同名称", "合同编号"],
141
- ["合同类型", "合同状态"],
142
- ["优先级", "合同标签"]
143
- ]
144
- },
145
- {
146
- "title": "时间与金额",
147
- "rows": [
148
- ["签署日期", "生效日期", "到期日期"],
149
- ["合同金额", "已付金额"],
150
- ["付款比例", "合同期限(月)"]
151
- ]
152
- },
153
- {
154
- "title": "责任人",
155
- "rows": [
156
- ["负责人", "法务审核人"],
157
- ["所属部门"]
158
- ]
159
- },
160
- {
161
- "title": "对方信息与附件",
162
- "rows": [
163
- ["甲方联系人", "甲方联系电话"],
164
- ["合同内容摘要"],
165
- ["合同附件"]
32
+ "package_id": 123,
33
+ "create_if_missing": true,
34
+ "apps": [
35
+ {
36
+ "client_key": "contract",
37
+ "app_name": "合同",
38
+ "icon": "document-text",
39
+ "color": "blue",
40
+ "add_fields": [
41
+ {"name": "合同名称", "type": "text", "required": true, "as_data_title": true},
42
+ {"name": "合同编号", "type": "text"},
43
+ {"name": "合同状态", "type": "select", "options": ["草稿", "审批中", "已生效", "已终止"]},
44
+ {"name": "合同金额", "type": "amount"},
45
+ {"name": "负责人", "type": "member"},
46
+ {"name": "签署日期", "type": "date"},
47
+ {"name": "合同说明", "type": "multiline"},
48
+ {"name": "合同附件", "type": "attachment"}
49
+ ],
50
+ "form": {
51
+ "sections": [
52
+ {"title": "基础信息", "rows": [["合同名称", "合同编号"], ["合同状态", "负责人"]]},
53
+ {"title": "金额与时间", "rows": [["合同金额", "签署日期"]]},
54
+ {"title": "补充信息", "rows": [["合同说明"], ["合同附件"]]}
166
55
  ]
167
56
  }
168
- ]
169
- }
170
- }
171
- ```
172
-
173
- ---
174
-
175
- ## Phase 3 — Flow
176
-
177
- > **Read first**: [update-flow.md](./update-flow.md) and [flow-actors-and-permissions.md](./flow-actors-and-permissions.md)
178
-
179
- Search for roles first; create only if none fits:
180
-
181
- ```json
182
- {"tool_name": "role_search", "arguments": {"profile": "default", "query": "法务"}}
183
- ```
184
-
185
- ```json
186
- {
187
- "tool_name": "app_flow_apply",
188
- "arguments": {
189
- "profile": "default",
190
- "app_key": "APP_KEY",
191
- "preset": "basic_approval",
192
- "publish": true,
193
- "nodes": [
194
- {
195
- "id": "approve_1",
196
- "type": "approve",
197
- "name": "法务审核",
198
- "assignees": {"role_names": ["法务"]},
199
- "permissions": {"editable_fields": ["合同状态", "合同内容摘要"]}
200
- },
201
- {
202
- "id": "approve_2",
203
- "type": "approve",
204
- "name": "负责人确认",
205
- "assignees": {"role_names": ["部门主管"]},
206
- "permissions": {"editable_fields": ["合同状态"]}
207
- }
208
- ]
209
- }
57
+ }
58
+ ]
210
59
  }
211
60
  ```
212
61
 
213
- ---
214
-
215
- ## Phase 4 — Views (multiple types)
62
+ Agent-friendly field type aliases are allowed: `multiline -> long_text`, `select -> single_select`, `amount -> amount`. Readback may show canonical types; do not treat that as a mismatch.
216
63
 
217
- > **Read first**: [update-views.md](./update-views.md)
64
+ ## View Payload Pattern
218
65
 
219
- Build all applicable view types in one call. All views require `query_conditions` with `enabled: true`.
220
-
221
- | Type | Build condition | Key config |
222
- |------|----------------|------------|
223
- | **table** | Always build first | `columns` covering title/status/date/amount/member |
224
- | **board** | App has a `single_select` status or stage field | `group_by` = that field name |
225
- | **gantt** | App has 2+ date fields | `start_field` + `end_field` |
226
- | **card** | App has `attachment` with `as_data_cover: true` | Visual browsing |
227
- | **calendar** | App has a key due/expiry date field | `date_field` = that field name |
66
+ - Use `app_views_apply(views=[...])`.
67
+ - Do not create platform default views named `全部数据`, `我的数据`, `我发起的`, `待办`, `已办`, or `抄送`.
68
+ - Use business-specific view names.
69
+ - `filters` are fixed saved filters.
70
+ - `query_conditions` are frontend query panel fields.
71
+ - Put button configuration in `action_buttons`.
228
72
 
229
73
  ```json
230
74
  {
231
- "tool_name": "app_views_apply",
232
- "arguments": {
233
- "profile": "default",
234
- "app_key": "APP_KEY",
235
- "publish": true,
236
- "upsert_views": [
237
- {
238
- "name": "全部合同",
239
- "type": "table",
240
- "columns": ["合同名称", "合同编号", "合同类型", "合同状态", "合同金额", "负责人", "签署日期", "到期日期"],
241
- "query_conditions": {
242
- "enabled": true,
243
- "exact": false,
244
- "hide_before_query": false,
245
- "rows": [["合同名称", "合同类型"], ["合同状态", "负责人"], ["签署日期", "到期日期"]]
246
- }
75
+ "views": [
76
+ {
77
+ "operation": "upsert",
78
+ "app_key": "APP_KEY",
79
+ "name": "合同执行视图",
80
+ "type": "table",
81
+ "columns": ["合同名称", "合同状态", "合同金额", "负责人", "签署日期"],
82
+ "filters": [
83
+ {"field_name": "合同状态", "operator": "neq", "value": "已终止"}
84
+ ],
85
+ "query_conditions": {
86
+ "enabled": true,
87
+ "rows": [["合同名称", "合同状态"], ["负责人", "签署日期"]]
247
88
  },
248
- {
249
- "name": "合同看板",
250
- "type": "board",
251
- "columns": ["合同名称", "合同类型", "合同金额", "负责人", "到期日期"],
252
- "group_by": "合同状态",
253
- "query_conditions": {
254
- "enabled": true,
255
- "exact": false,
256
- "hide_before_query": false,
257
- "rows": [["合同名称", "负责人"]]
258
- }
259
- },
260
- {
261
- "name": "合同甘特图",
262
- "type": "gantt",
263
- "columns": ["合同名称", "合同状态", "负责人", "合同金额"],
264
- "start_field": "生效日期",
265
- "end_field": "到期日期",
266
- "query_conditions": {
267
- "enabled": true,
268
- "exact": false,
269
- "hide_before_query": false,
270
- "rows": [["合同名称", "合同状态"]]
271
- }
272
- },
273
- {
274
- "name": "合同卡片",
275
- "type": "card",
276
- "columns": ["合同名称", "合同类型", "合同状态", "合同金额", "到期日期"],
277
- "query_conditions": {
278
- "enabled": true,
279
- "exact": false,
280
- "hide_before_query": false,
281
- "rows": [["合同名称", "合同状态"]]
282
- }
283
- },
284
- {
285
- "name": "到期日历",
286
- "type": "calendar",
287
- "columns": ["合同名称", "合同类型", "合同金额", "负责人"],
288
- "date_field": "到期日期",
289
- "query_conditions": {
290
- "enabled": true,
291
- "exact": false,
292
- "hide_before_query": false,
293
- "rows": [["合同名称", "合同状态"]]
89
+ "action_buttons": [
90
+ {
91
+ "text": "查看合同模板",
92
+ "action": "link",
93
+ "url": "https://example.com/contract-template",
94
+ "placement": "detail"
294
95
  }
96
+ ]
97
+ },
98
+ {
99
+ "operation": "upsert",
100
+ "app_key": "APP_KEY",
101
+ "name": "合同状态看板",
102
+ "type": "board",
103
+ "group_by": "合同状态",
104
+ "columns": ["合同名称", "合同金额", "负责人", "签署日期"],
105
+ "query_conditions": {
106
+ "enabled": true,
107
+ "rows": [["合同名称", "负责人"]]
295
108
  }
296
- ]
297
- }
109
+ }
110
+ ]
298
111
  }
299
112
  ```
300
113
 
301
- Record all `view_key` values before Phase 7.
302
-
303
- ---
304
-
305
- ## Phase 5 — Custom Buttons
114
+ ## Workflow
306
115
 
307
- > Call `builder_tool_contract(tool="app_custom_buttons_apply")` if the exact button schema is unclear.
308
- > `app_custom_buttons_apply` publishes automatically — do **not** pass `publish`.
116
+ Only add workflow when the user asks for approval, fill, copy, reminders, process routing, or task handling.
309
117
 
310
- Build 2–3 buttons. Common patterns for a single app:
118
+ - Create an explicit business status `select` field first, such as `状态`, `处理状态`, `审批状态`, or `流程阶段`.
119
+ - Do not create platform workflow system fields such as `当前流程状态`, `当前处理人`, `当前处理节点`, or `流程标题`.
120
+ - If no workflow is requested, report it as not requested/not configured.
311
121
 
312
- | Button | Trigger type | Placement | When to use |
313
- |--------|-------------|-----------|-------------|
314
- | 快捷创建子记录 | `add_data` | header, detail | When a related app exists in the same package |
315
- | 外部跳转 | `link` | header, list | Always applicable — jump to external URL or doc |
316
- | 列表行操作 | `add_data` / `link` | list | Row-level quick action in table view |
122
+ ## Readback And Verification
317
123
 
318
- **Example — link button (always applicable) + add-data button (requires a related app):**
319
-
320
- ```json
321
- {
322
- "tool_name": "app_custom_buttons_apply",
323
- "arguments": {
324
- "profile": "default",
325
- "app_key": "APP_KEY",
326
- "upsert_buttons": [
327
- {
328
- "name": "查看合同模板",
329
- "trigger_type": "link",
330
- "style": "default",
331
- "placements": ["header", "detail"],
332
- "trigger_link_config": {
333
- "url": "https://your-template-url"
334
- }
335
- },
336
- {
337
- "name": "发起变更申请",
338
- "trigger_type": "add_data",
339
- "style": "primary",
340
- "placements": ["header", "detail", "list"],
341
- "trigger_add_data_config": {
342
- "target_app_key": "CHANGE_REQUEST_APP_KEY",
343
- "field_mappings": [
344
- {"source_field": "数据ID", "target_field": "关联合同"},
345
- {"source_field": "合同名称", "target_field": "合同标题"},
346
- {"source_field": "负责人", "target_field": "申请人"}
347
- ]
348
- }
349
- }
350
- ],
351
- "view_configs": [
352
- {
353
- "view_key": "TABLE_VIEW_KEY",
354
- "mode": "merge",
355
- "buttons": ["发起变更申请", "查看合同模板"]
356
- }
357
- ]
358
- }
359
- }
360
- ```
361
-
362
- **Notes:**
363
- - `placements: ["list"]` maps to the backend row-level `INSIDE` position
364
- - `view_configs[].buttons` is required in merge mode — do not send a view config with only `view_key`
365
- - `source_field: "数据ID"` passes the current record's ID to the target relation field
366
- - If this app has no related app, skip the add-data button and use the link button only
367
- - Use raw `view_key` from `app_get.views[].view_key`; do not prefix with `custom:`
368
-
369
- ---
370
-
371
- ## Phase 6 — Charts
372
-
373
- > `app_charts_apply` is immediate-live — no publish step. Record all returned `chart_id`/`chart_key` values before Phase 7.
374
-
375
- Build 2–4 charts: 2 indicator cards + 1 distribution chart + 1 trend chart.
376
-
377
- ```json
378
- {
379
- "tool_name": "app_charts_apply",
380
- "arguments": {
381
- "profile": "default",
382
- "app_key": "APP_KEY",
383
- "upsert_charts": [
384
- {
385
- "name": "合同总金额",
386
- "chart_type": "target",
387
- "config": {
388
- "measure_field": "合同金额",
389
- "aggregate": "SUM"
390
- }
391
- },
392
- {
393
- "name": "有效合同数",
394
- "chart_type": "target",
395
- "config": {
396
- "filter": {"合同状态": ["已生效"]},
397
- "aggregate": "COUNT"
398
- }
399
- },
400
- {
401
- "name": "合同状态分布",
402
- "chart_type": "columnar",
403
- "config": {
404
- "dimension_field": "合同状态",
405
- "measure_field": "合同金额",
406
- "aggregate": "SUM"
407
- }
408
- },
409
- {
410
- "name": "月度签约趋势",
411
- "chart_type": "area",
412
- "config": {
413
- "dimension_field": "签署日期",
414
- "time_granularity": "month",
415
- "measure_field": "合同金额",
416
- "aggregate": "SUM"
417
- }
418
- }
419
- ]
420
- }
421
- }
422
- ```
423
-
424
- ---
425
-
426
- ## Phase 7 — Associated Resources
427
-
428
- Attach charts to the app's view area so users can see them inline without leaving the app.
429
-
430
- Before running `upsert_resources`, check existing resources with the dedicated read tool:
431
-
432
- ```json
433
- {"tool_name": "app_get_associated_resources", "arguments": {"profile": "default", "app_key": "APP_KEY"}}
434
- ```
435
-
436
- If the result already contains the target chart, use `patch_resources` with its `associated_item_id` instead of re-upserting.
437
-
438
- ```json
439
- {
440
- "tool_name": "app_associated_resources_apply",
441
- "arguments": {
442
- "profile": "default",
443
- "app_key": "APP_KEY",
444
- "upsert_resources": [
445
- {
446
- "client_key": "res_status_chart",
447
- "resource_type": "chart",
448
- "chart_key": "CHART_KEY_FOR_STATUS_DISTRIBUTION",
449
- "display_name": "合同状态分布"
450
- },
451
- {
452
- "client_key": "res_trend_chart",
453
- "resource_type": "chart",
454
- "chart_key": "CHART_KEY_FOR_TREND",
455
- "display_name": "月度签约趋势"
456
- }
457
- ],
458
- "view_configs": [
459
- {
460
- "view_key": "TABLE_VIEW_KEY",
461
- "associated_item_refs": ["res_status_chart", "res_trend_chart"]
462
- }
463
- ]
464
- }
465
- }
466
- ```
467
-
468
- **Notes:**
469
- - `app_associated_resources_apply` publishes automatically — do **not** pass `publish`
470
- - `client_key` is a same-call alias only; repeated `upsert_resources` without `associated_item_id` creates duplicates
471
- - On subsequent edits, use `patch_resources` with `associated_item_id` instead
472
-
473
- ---
474
-
475
- ## Phase 8 — Sample Data
476
-
477
- > **Hand off to `qingflow-record-insert` skill**. Read the record-insert skill docs before inserting.
478
-
479
- Insert **5–8 records** covering all status values and realistic amounts. Call `record_insert_schema_get` first.
480
-
481
- ```json
482
- {"tool_name": "record_insert_schema_get", "arguments": {"profile": "default", "app_key": "APP_KEY"}}
483
- ```
484
-
485
- ```json
486
- {
487
- "tool_name": "record_insert",
488
- "arguments": {
489
- "profile": "default",
490
- "app_key": "APP_KEY",
491
- "items": [
492
- {"合同名称": "上海科技服务协议", "合同编号": "HT-2024-001", "合同类型": "服务合同", "合同状态": "已生效", "合同金额": 580000, "已付金额": 290000, "负责人": "张三", "签署日期": "2024-01-15", "生效日期": "2024-02-01", "到期日期": "2025-01-31", "优先级": "高", "合同期限(月)": 12},
493
- {"合同名称": "北京采购框架合同", "合同编号": "HT-2024-002", "合同类型": "采购合同", "合同状态": "审批中", "合同金额": 1200000, "已付金额": 0, "负责人": "李四", "签署日期": "2024-03-10", "生效日期": "2024-04-01", "到期日期": "2025-03-31", "优先级": "高", "合同期限(月)": 12},
494
- {"合同名称": "广州运维服务合同", "合同编号": "HT-2024-003", "合同类型": "服务合同", "合同状态": "已生效", "合同金额": 240000, "已付金额": 120000, "负责人": "王五", "签署日期": "2024-02-20", "生效日期": "2024-03-01", "到期日期": "2024-12-31", "优先级": "中", "合同期限(月)": 10},
495
- {"合同名称": "深圳保密协议", "合同编号": "HT-2024-004", "合同类型": "保密协议", "合同状态": "已生效", "合同金额": 0, "已付金额": 0, "负责人": "张三", "签署日期": "2024-04-05", "生效日期": "2024-04-05", "到期日期": "2027-04-04", "优先级": "中", "合同期限(月)": 36},
496
- {"合同名称": "杭州合作开发合同", "合同编号": "HT-2024-005", "合同类型": "服务合同", "合同状态": "草稿", "合同金额": 850000, "已付金额": 0, "负责人": "李四", "签署日期": "2024-05-01", "生效日期": "2024-06-01", "到期日期": "2025-05-31", "优先级": "高", "合同期限(月)": 12},
497
- {"合同名称": "成都劳务外包合同", "合同编号": "HT-2023-006", "合同类型": "劳务合同", "合同状态": "已到期", "合同金额": 360000, "已付金额": 360000, "负责人": "王五", "签署日期": "2023-01-01", "生效日期": "2023-01-01", "到期日期": "2023-12-31", "优先级": "低", "合同期限(月)": 12}
498
- ]
499
- }
500
- }
501
- ```
502
-
503
- Member and department fields accept natural language values — do not look up IDs manually.
504
-
505
- ---
506
-
507
- ## Phase 9 — Publish Verify
508
-
509
- ```json
510
- {"tool_name": "app_publish_verify", "arguments": {"profile": "default", "app_key": "APP_KEY"}}
511
- ```
124
+ After writing:
512
125
 
513
- Confirm `publish_status` is live and `unplaced_fields` is empty. If `unplaced_fields` is non-empty, run `app_layout_apply` to place them before reporting completion.
126
+ - read fields and confirm `as_data_title`
127
+ - read layout and confirm important fields are placed
128
+ - read views and confirm business view keys exist
129
+ - verify publish/live status only when required by the user or task
514
130
 
515
- ---
131
+ If a write returns `partial_success`, `write_executed=true`, or `safe_to_retry=false`, read back before retrying. Retry only verified missing or incorrect slices.
516
132
 
517
- ## Common failures
133
+ ## Stop Conditions
518
134
 
519
- | Error | Phase | Fix |
520
- |-------|-------|-----|
521
- | `VALIDATION_ERROR` on select field | 1 | `single_select`/`multi_select` must include `options` array |
522
- | `UNKNOWN_LAYOUT_FIELD` | 2 | Re-read with `app_get_fields`; field name in `rows` must match exactly |
523
- | `FLOW_ASSIGNEE_REQUIRED` | 3 | Run `role_search` first; every approve/fill node must have at least one assignee |
524
- | View `partial_success` | 4 | Check `verification.view_query_conditions_verified`; read `views_diff.failed` |
525
- | `calendar` view rejected | 4 | Build calendar only when a date field exists; verify field type |
526
- | Button `view_configs` blocked | 5 | `buttons` array is required in merge mode; do not send a view config with only `view_key` |
527
- | Button add-data fails — no related app | 5 | Skip add-data button; use link button only |
528
- | Chart config rejected | 6 | Call `builder_tool_contract(tool="app_charts_apply")` for exact field/aggregate schema |
529
- | Associated resource duplicate | 7 | Check `app_get.associated_resources` first; use `patch_resources` with `associated_item_id` if already exists |
530
- | `unplaced_fields` non-empty on verify | 9 | Run `app_layout_apply` to place the missing fields, then re-verify |
135
+ - If the task actually needs multiple business objects, switch to the complete-system guide.
136
+ - If a same/similar app already exists and the user did not explicitly say update, extend, or create new, stop and ask which target to use.
137
+ - Do not create `V2`, `测试`, timestamp, or random-suffix apps to bypass duplicate names in a real business package.
138
+ - If the same validation error repeats twice, re-read `builder_tool_contract` instead of guessing.