@qingflow-tech/qingflow-app-user-mcp 1.0.41 → 1.0.43
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/README.md +2 -4
- package/docs/local-agent-install.md +4 -4
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/skills/qingflow-app-user/SKILL.md +4 -4
- package/skills/qingflow-mcp-setup/SKILL.md +1 -1
- package/skills/qingflow-record-analysis/SKILL.md +1 -1
- package/skills/qingflow-record-delete/SKILL.md +1 -1
- package/skills/qingflow-record-import/SKILL.md +1 -1
- package/skills/qingflow-record-insert/SKILL.md +1 -1
- package/skills/qingflow-record-update/SKILL.md +1 -1
- package/skills/qingflow-task-ops/SKILL.md +1 -1
- package/src/qingflow_mcp/builder_facade/service.py +102 -2
- package/src/qingflow_mcp/cli/commands/builder.py +80 -6
- package/src/qingflow_mcp/response_trim.py +5 -4
- package/skills/qingflow-app-builder/SKILL.md +0 -290
- package/skills/qingflow-app-builder/agents/openai.yaml +0 -4
- package/skills/qingflow-app-builder/references/complete-system-development-guide.md +0 -59
- package/skills/qingflow-app-builder/references/create-app.md +0 -162
- package/skills/qingflow-app-builder/references/environments.md +0 -63
- package/skills/qingflow-app-builder/references/flow-actors-and-permissions.md +0 -123
- package/skills/qingflow-app-builder/references/gotchas.md +0 -113
- package/skills/qingflow-app-builder/references/match-rules.md +0 -129
- package/skills/qingflow-app-builder/references/public-surface-sync.md +0 -75
- package/skills/qingflow-app-builder/references/single-app-development-guide.md +0 -47
- package/skills/qingflow-app-builder/references/solution-playbooks.md +0 -62
- package/skills/qingflow-app-builder/references/tool-selection.md +0 -106
- package/skills/qingflow-app-builder/references/update-flow.md +0 -158
- package/skills/qingflow-app-builder/references/update-layout.md +0 -68
- package/skills/qingflow-app-builder/references/update-schema.md +0 -75
- package/skills/qingflow-app-builder/references/update-views.md +0 -286
- package/skills/qingflow-app-builder-code-integrations/SKILL.md +0 -139
- package/skills/qingflow-app-builder-code-integrations/agents/openai.yaml +0 -4
- package/skills/qingflow-app-builder-code-integrations/references/code-block.md +0 -66
- package/skills/qingflow-app-builder-code-integrations/references/q-linker.md +0 -77
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: qingflow-app-builder
|
|
3
|
-
description: Build, configure, and modify Qingflow apps and systems using the current Wingent Momo runtime MCP session. Use when the user wants to apply or repair an existing SolutionSpec, modify an existing package with app, view, workflow, portal, navigation, or reporting tools, verify builder-side results, or troubleshoot system-building behavior. Do not use this skill to install the MCP or to author a brand new SolutionSpec from scratch.
|
|
4
|
-
metadata:
|
|
5
|
-
short-description: Build and modify Qingflow apps and systems
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Qingflow App Builder
|
|
9
|
-
|
|
10
|
-
> **Skill 版本**:`qingflow-skills-2026.06.23.1`(入口文档版本;如需确认 CLI 包版本,使用 `qingflow --version` 或 `qingflow --json version`)。
|
|
11
|
-
|
|
12
|
-
## Overview
|
|
13
|
-
|
|
14
|
-
This skill is for the current **public builder surface**, not for legacy low-level builder writes.
|
|
15
|
-
In Wingent Momo runtime, trust the injected MCP session, credentials, workspace, and route context until a tool explicitly reports otherwise.
|
|
16
|
-
|
|
17
|
-
Before any write or verification flow, identify whether the task targets `test` or `prod` and read [references/environments.md](references/environments.md). If the user did not specify one, default to `prod`.
|
|
18
|
-
|
|
19
|
-
Before choosing a route, skim the shared maintenance baseline: [public-surface-sync.md](references/public-surface-sync.md).
|
|
20
|
-
Then pick the matching development guide: [single-app-development-guide.md](references/single-app-development-guide.md) for one app, or [complete-system-development-guide.md](references/complete-system-development-guide.md) for app packages/systems.
|
|
21
|
-
|
|
22
|
-
## Current Public Mental Model
|
|
23
|
-
|
|
24
|
-
Model builder requests in four layers and keep them separate:
|
|
25
|
-
|
|
26
|
-
- `package`: the app bundle or solution container
|
|
27
|
-
- `app`: one form/app inside that package
|
|
28
|
-
- `field`: one field inside one app
|
|
29
|
-
- `relation`: a field that links one app to another app
|
|
30
|
-
|
|
31
|
-
Default modeling rules:
|
|
32
|
-
|
|
33
|
-
- One business object -> one app
|
|
34
|
-
- Attributes of that object -> fields inside that app
|
|
35
|
-
- Another business object -> a separate app, not a text field
|
|
36
|
-
- Cross-object links -> relation fields, not text fields
|
|
37
|
-
|
|
38
|
-
## Route First
|
|
39
|
-
|
|
40
|
-
Before any builder write, classify the request:
|
|
41
|
-
|
|
42
|
-
- **Complete system / app package**: the user asks for a system, package, workspace module set, or several related forms/apps. Use `package_apply` for the package, then one `app_schema_apply(package_id=..., apps=[...])` for the app shells and fields. This is the main path for complete systems, not a bulk shortcut to abandon after the first slow response. Do not squeeze several business objects into one app.
|
|
43
|
-
- **Single app**: the user names one form/app or gives one `app_key`. Use `app_resolve`/`app_get`, then `app_schema_apply` and the app-scoped apply tools.
|
|
44
|
-
- **Record/user operation**: the user wants to add, edit, delete, approve, or analyze data. Route to the record/task skills instead of builder tools.
|
|
45
|
-
|
|
46
|
-
For complete systems, `apps[]` should use stable `client_key` values. Same-call relation fields should use `target_app_ref` for another `apps[].client_key`; use `target_app_key` only when the target app already exists or has been confirmed by readback. Create the related apps with one multi-app schema apply; do not create each app separately just to collect app keys and then patch relations afterward.
|
|
47
|
-
|
|
48
|
-
If a complete-system `app_schema_apply` times out, returns `partial_success`, returns `write_executed=true`, has `safe_to_retry=false`, or has incomplete readback, treat it as an uncertain write, not as a failed create. The next action is always `readback_before_retry`: read the package/app/fields first, compare intended `client_key`/`app_name`/relations against reality, and only then repair the missing slice. Do not retry the whole multi-app create, create `V2`/`测试`/random-suffix apps, or split the system into single-app rebuilds to bypass a duplicate/conflict.
|
|
49
|
-
|
|
50
|
-
Builder schema inputs should follow agent-intuitive semantics:
|
|
51
|
-
|
|
52
|
-
- primary icon syntax is `icon + color`, for example `icon: "table", color: "blue"`; `icon_name/icon_color`, `icon_config`, and `icon: {name, color}` are compatibility aliases only
|
|
53
|
-
- `single_select` / `multi_select` options may be strings or objects such as `{label, value}`; tools normalize to option labels
|
|
54
|
-
- relation fields need a target plus `display_field` and `visible_fields`
|
|
55
|
-
- do not create built-in system fields as form fields: `数据ID`, `编号`, `申请人`, `申请时间`, `创建人`, `创建时间`, `提交人`, `提交时间`, `更新时间`, `更新人`, `当前流程状态`, `当前处理人`, `当前处理节点`, `流程标题`. They are platform-generated; only reference supported system fields where a tool explicitly says so, such as button `source_field: "数据ID"`
|
|
56
|
-
|
|
57
|
-
## Public Tools You Should Think In
|
|
58
|
-
|
|
59
|
-
- Package: `package_get`, `package_apply`
|
|
60
|
-
- App reads: `app_resolve`, `app_get`, `app_get_fields`, `app_get_layout`, `app_get_views`, `app_get_flow`, `app_get_charts`
|
|
61
|
-
- Builder reads: `portal_list`, `portal_get`, `view_get`, `chart_get`, `builder_tool_contract`
|
|
62
|
-
- Directory: `member_search`, `role_search`, `role_create`
|
|
63
|
-
- Writes: `app_schema_apply`, `app_layout_apply`, `app_flow_apply`, `app_views_apply`, `app_custom_buttons_apply`, `app_associated_resources_apply`, `app_charts_apply`, `portal_apply`, `app_release_edit_lock_if_mine`
|
|
64
|
-
- Verification: `app_publish_verify`
|
|
65
|
-
- Cross-cutting escalation: `feedback_submit` after explicit user confirmation when the public builder surface still cannot satisfy the user's need
|
|
66
|
-
|
|
67
|
-
Treat these as the official surface. Do not default to `package_create`, `package_attach_app`, raw `portal_*` writes, or raw `qingbi_report_*` writes.
|
|
68
|
-
|
|
69
|
-
## Current Public Defaults
|
|
70
|
-
|
|
71
|
-
- Package work:
|
|
72
|
-
- use `package_get(package_id=...)` to read one known package
|
|
73
|
-
- use `package_apply(...)` for package creation, rename, icon, visibility, grouping, ordering, and app/portal layout
|
|
74
|
-
- Multi-app schema work:
|
|
75
|
-
- use one `app_schema_apply(package_id=..., apps=[...])` / CLI `builder schema apply --apps-file` when creating several apps in one package
|
|
76
|
-
- every `apps[]` item should carry its own `client_key`, `app_name`, `icon`, `color`, and `add_fields`
|
|
77
|
-
- same-call relation fields should use `target_app_ref` to point at another `apps[].client_key`; use `target_app` only when the app name is unique and stable, and use `target_app_key` only after the target app already exists or readback has confirmed it
|
|
78
|
-
- timeout / `partial_success` / `write_executed=true` / `safe_to_retry=false` means `readback_before_retry`; do not directly downgrade to single-app creation
|
|
79
|
-
- App base permissions:
|
|
80
|
-
- trust `app_get.editability.can_edit_app_base` for app base-info writes like app name, icon, and visibility
|
|
81
|
-
- `can_edit_form` only means schema/form-route capability; it no longer implies app base-info write capability
|
|
82
|
-
- Partial update rule:
|
|
83
|
-
- for existing views, custom buttons, associated resources, and charts, prefer `patch_views` / `patch_buttons` / `patch_resources` / `patch_charts`
|
|
84
|
-
- each patch item uses the object's real selector field (`view_key` / `button_id` / `associated_item_id` / `chart_id`, or unique name where supported) plus `set` and optional `unset`; do not send a literal `selector` key for these tools
|
|
85
|
-
- use `upsert_*` for creation or full target configuration; do not send a partial `upsert_*` and expect the backend to merge missing required fields
|
|
86
|
-
- Portal work:
|
|
87
|
-
- `portal_apply` is the public write path
|
|
88
|
-
- in edit mode, omitting `sections` means “preserve existing layout and update base info only”
|
|
89
|
-
- supplying `sections` means full replace semantics for sections
|
|
90
|
-
- Chart work:
|
|
91
|
-
- `app_charts_apply` is the public write path for app-source QingBI report bodies/configs; it creates/updates reports with `dataSourceType=qingflow`
|
|
92
|
-
- dataset BI reports are not created or edited by `app_charts_apply` yet; create them in QingBI first, then attach the existing report with `app_associated_resources_apply` and `report_source="dataset"`
|
|
93
|
-
- it does not attach the report to the Qingflow app associated-resource display; use `app_associated_resources_apply` for that
|
|
94
|
-
- supported `chart_type` values include legacy public aliases `target`, `table` and QingBI types such as `summary`, `columnar`, `area`, `stacked_area`, `funnel`, `waterfall`, `gauge`, `heatmap`, `histogram`, `treemap`, `radar`, `stacked_bar`, `stacked_column`, `scatter`, `ring`, `rose`, `dualaxes`, `map`, and `timeline`
|
|
95
|
-
- chart `filters` use the unified fixed-filter DSL: `field_name + operator + value/values`; the tool compiles them to QingBI string judge types
|
|
96
|
-
- use `patch_charts` for changing a chart name, visibility, filters, or one config fragment on an existing chart
|
|
97
|
-
- `visibility` is a public capability and should be treated as a base-only permission update
|
|
98
|
-
- do not model chart visibility changes as raw config rewrites
|
|
99
|
-
- Button work:
|
|
100
|
-
- `app_custom_buttons_apply` is the public write path for custom button bodies and view placement
|
|
101
|
-
- use `patch_buttons` for changing a single existing button parameter such as URL, text, icon, style, or add-data mapping
|
|
102
|
-
- for add-data buttons, use `trigger_add_data_config.target_app_key + field_mappings/default_values`; do not handwrite raw `que_relation`
|
|
103
|
-
- use `field_mappings` for dynamic current-record values, including system fields such as `数据ID` (`field_id=-17`) and `编号` (`field_id=0`)
|
|
104
|
-
- to prefill a target relation field with the current source record, map `{"source_field": "数据ID", "target_field": "目标引用字段"}`; use `default_values` only for static constants
|
|
105
|
-
- if field type compatibility is unclear, read [references/match-rules.md](references/match-rules.md)
|
|
106
|
-
- bind buttons to views through `view_configs[].buttons[]`; default to `placement`: `header` or `detail`
|
|
107
|
-
- builder `view_configs[].view_key` uses the raw key from `app_get.views[].view_key`, without a `custom:` prefix
|
|
108
|
-
- `buttons` is required in merge mode; do not send a view config with only `view_key`
|
|
109
|
-
- `view_configs[].mode` defaults to `merge`; use `mode: "replace"` or an explicit empty `buttons: []` to clear a view's custom button bindings
|
|
110
|
-
- `placement=list` configures row/list buttons and maps to the backend `INSIDE` button position
|
|
111
|
-
- advanced bindings may use `button_limit`, `button_formula`, `button_formula_type`, and `print_tpls` only when visibility or print-template behavior is required
|
|
112
|
-
- Associated resources:
|
|
113
|
-
- `app_associated_resources_apply` is the public write path for the Qingflow app-level associated report/view pool and per-view display config
|
|
114
|
-
- it attaches existing BI reports/views for in-app display; it does not create or edit QingBI report bodies/configs, including dataset reports
|
|
115
|
-
- use `patch_resources` for changing match rules or other existing associated-resource parameters; the tool preserves backend-required raw fields internally
|
|
116
|
-
- `associated_item_id` is the backend internal associated-resource id; for `view_configs`, `remove_associated_item_ids`, and `reorder_associated_item_ids`, you may pass `associated_item_id` or an existing resource's `chart_id`/`chart_key`/`view_key`, and the tool resolves it to the internal id
|
|
117
|
-
- before creating a resource, check `app_get.associated_resources` for the same `target_app_key + view_key/chart_key`; if it already exists, use `patch_resources` with that `associated_item_id`
|
|
118
|
-
- `client_key` is only a same-call reference for `view_configs[].associated_item_refs`; it is not saved and cannot deduplicate later calls
|
|
119
|
-
- do not pass backend raw `sourceType`; view resources infer the internal Qingflow view source, report/chart resources default to BI app reports, and existing dataset reports use `report_source="dataset"`
|
|
120
|
-
- use `match_mappings` for associated view/report filters; dynamic context matches use `source_field`, static filters use `value`; do not handwrite raw `matchRules`
|
|
121
|
-
- if field type compatibility is unclear, read [references/match-rules.md](references/match-rules.md)
|
|
122
|
-
- Views and flows:
|
|
123
|
-
- stay on `app_views_apply` / `app_flow_apply`
|
|
124
|
-
- use `patch_views` for existing-view parameter changes such as `query_conditions`, `filters`, `columns`, or visibility
|
|
125
|
-
- builder view writes use raw `view_key` values from `app_get.views`; `custom:<viewKey>` is a record-data `view_id` form, not a builder `view_key`
|
|
126
|
-
- do not create platform default/system views named `全部数据`, `我的数据`, `我发起的`, `待办`, `已办`, or `抄送`; they are built in. New views must use business-specific names. To change a built-in view, patch by its existing raw `view_key`
|
|
127
|
-
- use `builder_tool_contract` whenever the minimal legal shape is unclear
|
|
128
|
-
- keep view `filters` and `query_conditions` separate: `filters` use `field_name + operator + value/values` and are fixed saved filters; `query_conditions` configure the frontend query panel fields and only take effect after users enter query values
|
|
129
|
-
- new views default the associated report/view display area to visible with `limit_type="all"`; existing views preserve their current associated-resource display unless `associated_resources` is explicitly patched
|
|
130
|
-
- configure associated reports/views through `app_associated_resources_apply`, not through `app_views_apply`
|
|
131
|
-
|
|
132
|
-
## Standard Operating Order
|
|
133
|
-
|
|
134
|
-
1. Trust the current MCP/session when it is already injected by the runtime; only run auth/workspace recovery after a tool explicitly reports an auth, credential, or workspace error
|
|
135
|
-
2. Confirm whether the task is read-only or write-impacting
|
|
136
|
-
3. Classify the build scope:
|
|
137
|
-
- complete system/package -> `package_apply` or `package_get`, then one `app_schema_apply(package_id=..., apps=[...])`
|
|
138
|
-
- single app -> `app_resolve` / `app_get`, then app-scoped apply tools
|
|
139
|
-
- record/task/data request -> leave builder and use the matching record/task skill
|
|
140
|
-
4. Resolve the smallest stable target:
|
|
141
|
-
- app-scoped work -> `app_resolve`
|
|
142
|
-
- package-scoped work with known id -> `package_get`
|
|
143
|
-
- portal inventory -> `portal_list`
|
|
144
|
-
5. Read only the smallest config slice needed:
|
|
145
|
-
- app map -> `app_get` (default entry; includes compact views, charts, custom buttons, and associated resource pool)
|
|
146
|
-
- fields -> `app_get_fields`
|
|
147
|
-
- layout -> `app_get_layout`
|
|
148
|
-
- views -> `app_get_views` only when the app_get compact list is not enough
|
|
149
|
-
- flow -> `app_get_flow`
|
|
150
|
-
- charts -> `app_get_charts` only when the app_get compact list is not enough
|
|
151
|
-
- portal -> `portal_get`
|
|
152
|
-
6. If the public shape is unclear, call `builder_tool_contract`
|
|
153
|
-
7. Apply the smallest patch tool that fits:
|
|
154
|
-
- fields -> `app_schema_apply`
|
|
155
|
-
- layout -> `app_layout_apply`
|
|
156
|
-
- flow -> `app_flow_apply`
|
|
157
|
-
- existing views -> `app_views_apply.patch_views`; new/full views -> `app_views_apply.upsert_views`
|
|
158
|
-
- existing buttons -> `app_custom_buttons_apply.patch_buttons`; new/full buttons -> `app_custom_buttons_apply.upsert_buttons`
|
|
159
|
-
- existing associated resources -> `app_associated_resources_apply.patch_resources`; new/full resources -> `app_associated_resources_apply.upsert_resources`
|
|
160
|
-
- existing charts -> `app_charts_apply.patch_charts`; new/full charts -> `app_charts_apply.upsert_charts`
|
|
161
|
-
- portal -> `portal_apply`
|
|
162
|
-
- package metadata/layout -> `package_apply`
|
|
163
|
-
8. Use `app_publish_verify` only when the user explicitly wants final publish/live verification or you need a dedicated verification pass
|
|
164
|
-
|
|
165
|
-
## Safe Usage Rules
|
|
166
|
-
|
|
167
|
-
- Do not guess package identity from a loose name. Public package work assumes a known `package_id`, or an explicit create/update intent through `package_apply`.
|
|
168
|
-
- Do not perform routine auth probes before every builder action in runtime contexts with injected MCP credentials; recover auth only after an actual auth/workspace failure.
|
|
169
|
-
- If `package_id` is unknown, derive it from related app/portal readback when possible; otherwise ask the user instead of falling back to hidden package lookup tools.
|
|
170
|
-
- Do not bypass package/app-name conflicts by inventing `V2`, `测试`, timestamp, or random suffix apps in a real business package. Read back and decide whether to update the existing app, create only a truly missing app, or ask the user.
|
|
171
|
-
- After any uncertain schema write, do `readback_before_retry` with `package_get` / `app_resolve` / `app_get_fields`; retry only the verified missing or failed slice.
|
|
172
|
-
- Do not use `package_create` or `package_attach_app` as a public default path. If they still appear in low-level code, treat them as internal/legacy implementation details.
|
|
173
|
-
- Do not use raw `portal_*` writes or raw `qingbi_report_*` writes as the default builder strategy.
|
|
174
|
-
- `app_schema_apply`, `app_layout_apply`, `app_flow_apply`, and `app_views_apply` publish by default; `app_custom_buttons_apply` and `app_associated_resources_apply` publish after at least one write succeeds and do not accept a draft-only `publish` parameter; `app_charts_apply` is immediate-live without publish.
|
|
175
|
-
- When creating or updating fields, configure the app data title/cover directly in field JSON: `as_data_title: true` is required on exactly one readable top-level title field; `as_data_cover: true` is optional and only valid on one top-level `attachment` field.
|
|
176
|
-
- Do not add platform system fields to `add_fields`; if the user asks for record id, number, applicant, creation/update time, or workflow status, use the built-in data/list/readback fields instead of creating duplicate controls.
|
|
177
|
-
- If the same validation error repeats twice, stop guessing and re-read `builder_tool_contract`.
|
|
178
|
-
- For workflow assignees, prefer `role_search` over explicit members unless the user explicitly wants named members.
|
|
179
|
-
- Public flow building is still intentionally limited to stable linear workflows. If a requirement sounds like branches/conditions, explain the limitation instead of freehanding unsupported graph shapes.
|
|
180
|
-
- Respect collaborative edit locks. Only use `app_release_edit_lock_if_mine` when the lock owner is the current authenticated user.
|
|
181
|
-
- If the supported builder surface is still awkward or blocked after reasonable use, summarize the gap, ask whether to submit feedback, and call `feedback_submit` only after explicit user confirmation.
|
|
182
|
-
|
|
183
|
-
## Response Interpretation
|
|
184
|
-
|
|
185
|
-
- All builder apply/write tools return a standard UI envelope in addition to legacy fields:
|
|
186
|
-
`schema_version`, `operation`, `summary`, and `resources[]`.
|
|
187
|
-
- For UI cards or quick narration, read `resources[]` first. Each resource has `resource_type`, `operation`, `status`, `id`, `key`, `name`, typed `ids`, and `parent`.
|
|
188
|
-
- Use legacy fields such as `field_diff`, `views_diff`, `chart_results`, `created/updated/removed`, and `verification` only for compatibility and troubleshooting.
|
|
189
|
-
- Treat post-write readback as the source of truth, not just write status codes.
|
|
190
|
-
- `success` means write and verification completed; `partial_success` means the write landed or may have landed but verification is incomplete. If `write_executed=true`, `safe_to_retry=false`, or readback is unavailable, do `readback_before_retry` before any create retry.
|
|
191
|
-
- For portals, distinguish clearly between:
|
|
192
|
-
- base-info-only update with layout preserved
|
|
193
|
-
- full sections replace
|
|
194
|
-
- For object apply tools, distinguish clearly between:
|
|
195
|
-
- `patch_*`: public partial parameter replacement; the tool hydrates current config and full-saves internally
|
|
196
|
-
- `upsert_*`: create or full target configuration; omitted fields may mean default/clear depending on that object
|
|
197
|
-
- For charts, distinguish clearly between:
|
|
198
|
-
- base / visibility change
|
|
199
|
-
- real chart-config change
|
|
200
|
-
- For app permissions, report `can_edit_app_base` separately from `can_edit_form / can_edit_flow / can_edit_views / can_edit_charts`.
|
|
201
|
-
|
|
202
|
-
## Practical Patterns
|
|
203
|
-
|
|
204
|
-
- Read one package: `package_get`
|
|
205
|
-
- Create or update one package: `package_apply`
|
|
206
|
-
- Resolve one app: `app_resolve`
|
|
207
|
-
- Read one app map: `app_get`
|
|
208
|
-
- Read fields only: `app_get_fields`
|
|
209
|
-
- Read layout summary: `app_get_layout`
|
|
210
|
-
- Read views summary: `app_get_views`
|
|
211
|
-
- Read flow summary: `app_get_flow`
|
|
212
|
-
- Read chart summary: `app_get_charts`
|
|
213
|
-
- Read portal config: `portal_get`
|
|
214
|
-
- Search members or roles: `member_search`, `role_search`
|
|
215
|
-
- Create reusable role: `role_create`
|
|
216
|
-
- Add/update/remove fields: `app_schema_apply`
|
|
217
|
-
- Merge or replace layout: `app_layout_apply`
|
|
218
|
-
- Replace workflow: `app_flow_apply`
|
|
219
|
-
- Upsert/patch/remove views: `app_views_apply`
|
|
220
|
-
- Upsert/patch/remove custom buttons and bind them to header/detail view positions: `app_custom_buttons_apply`
|
|
221
|
-
- Upsert/patch/remove app associated reports/views and per-view display: `app_associated_resources_apply`
|
|
222
|
-
- Upsert/patch/remove/reorder charts: `app_charts_apply`
|
|
223
|
-
- Create or update portal pages: `portal_apply`
|
|
224
|
-
- Release your own stale edit lock: `app_release_edit_lock_if_mine`
|
|
225
|
-
- Final publish verification: `app_publish_verify`
|
|
226
|
-
|
|
227
|
-
## Button Pattern
|
|
228
|
-
|
|
229
|
-
Use `app_custom_buttons_apply` for the whole custom-button path: button body, add-data mapping, default values, and placement.
|
|
230
|
-
|
|
231
|
-
```json
|
|
232
|
-
{
|
|
233
|
-
"tool_name": "app_custom_buttons_apply",
|
|
234
|
-
"arguments": {
|
|
235
|
-
"app_key": "EMPLOYEE_APP",
|
|
236
|
-
"upsert_buttons": [
|
|
237
|
-
{
|
|
238
|
-
"client_key": "add_worklog",
|
|
239
|
-
"button_text": "快捷添加工时",
|
|
240
|
-
"style_preset": "primary_blue",
|
|
241
|
-
"button_icon": "ex-plus-circle",
|
|
242
|
-
"trigger_action": "addData",
|
|
243
|
-
"trigger_add_data_config": {
|
|
244
|
-
"target_app_key": "WORKLOG_APP",
|
|
245
|
-
"field_mappings": [
|
|
246
|
-
{"source_field": "数据ID", "target_field": "关联员工"},
|
|
247
|
-
{"source_field": "员工名称", "target_field": "员工姓名"},
|
|
248
|
-
{"source_field": "所属部门", "target_field": "部门名称"}
|
|
249
|
-
],
|
|
250
|
-
"default_values": {
|
|
251
|
-
"工时类型": "日常工作",
|
|
252
|
-
"状态": "待提交"
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
],
|
|
257
|
-
"remove_buttons": [],
|
|
258
|
-
"view_configs": [
|
|
259
|
-
{
|
|
260
|
-
"view_key": "EMPLOYEE_VIEW",
|
|
261
|
-
"mode": "merge",
|
|
262
|
-
"buttons": [
|
|
263
|
-
{"button_ref": "add_worklog", "placement": "detail", "primary": true}
|
|
264
|
-
]
|
|
265
|
-
}
|
|
266
|
-
]
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
`button_ref` may be a same-call `client_key` or an existing `button_id`. Supported placements are `header`, `detail`, and `list`; `list` maps to the backend `INSIDE` row/list button position.
|
|
272
|
-
|
|
273
|
-
For add-data buttons that create a child record linked back to the current record, map `source_field: "数据ID"` to the target relation field. Do not use raw `que_relation` unless maintaining an existing backend config.
|
|
274
|
-
|
|
275
|
-
## Resources
|
|
276
|
-
|
|
277
|
-
- Shared public-surface baseline: [public-surface-sync.md](references/public-surface-sync.md)
|
|
278
|
-
- Environment switching: [references/environments.md](references/environments.md)
|
|
279
|
-
- Tool choice and sequencing: [references/tool-selection.md](references/tool-selection.md)
|
|
280
|
-
- Field matching rules: [references/match-rules.md](references/match-rules.md)
|
|
281
|
-
- Result semantics and gotchas: [references/gotchas.md](references/gotchas.md)
|
|
282
|
-
- Single app development guide: [references/single-app-development-guide.md](references/single-app-development-guide.md)
|
|
283
|
-
- Complete system development guide: [references/complete-system-development-guide.md](references/complete-system-development-guide.md)
|
|
284
|
-
- Create one app in an existing package: [references/create-app.md](references/create-app.md)
|
|
285
|
-
- Update fields only: [references/update-schema.md](references/update-schema.md)
|
|
286
|
-
- Update layout only: [references/update-layout.md](references/update-layout.md)
|
|
287
|
-
- Update workflow only: [references/update-flow.md](references/update-flow.md)
|
|
288
|
-
- Workflow assignees and node permissions: [references/flow-actors-and-permissions.md](references/flow-actors-and-permissions.md)
|
|
289
|
-
- Update views only: [references/update-views.md](references/update-views.md)
|
|
290
|
-
- Standard end-to-end builder sequences: [references/solution-playbooks.md](references/solution-playbooks.md)
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Qingflow App Builder"
|
|
3
|
-
short_description: "Build and modify Qingflow apps and systems"
|
|
4
|
-
default_prompt: "Use $qingflow-app-builder to build or modify a Qingflow app or system safely, and verify environment routing and post-write readbacks when builder flows touch live data."
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# Complete System Development Guide
|
|
2
|
-
|
|
3
|
-
Use this when the user asks for a system, app package, workspace module set, or several related apps/forms.
|
|
4
|
-
Do not compress several business objects into one app.
|
|
5
|
-
|
|
6
|
-
## Recommended Completeness
|
|
7
|
-
|
|
8
|
-
Required:
|
|
9
|
-
|
|
10
|
-
- package exists or is created through `package_apply`
|
|
11
|
-
- core business objects are modeled as separate apps
|
|
12
|
-
- all new apps are created in one multi-app `app_schema_apply(package_id=..., apps=[...])`
|
|
13
|
-
- every app has stable `client_key`, `app_name`, `icon`, `color`, and one readable `as_data_title: true`
|
|
14
|
-
- same-call relations use `target_app_ref` to point to another `apps[].client_key`
|
|
15
|
-
- basic operating views exist for each core app
|
|
16
|
-
- package/apps/fields/relations are read back before repair or retry
|
|
17
|
-
|
|
18
|
-
Strongly recommended:
|
|
19
|
-
|
|
20
|
-
- cross-app relation fields for the main business links
|
|
21
|
-
- core metric charts and BI charts using semantic `metric`, `metrics`, `group_by`, and `where`
|
|
22
|
-
- a standard portal: business entry area, core metrics, BI charts, then concrete data views
|
|
23
|
-
- portal grid/business-entry sections contain real `config.items[]`, not empty containers
|
|
24
|
-
|
|
25
|
-
Optional:
|
|
26
|
-
|
|
27
|
-
- workflow, reminders, buttons, associated resources, sample data, roles, and permissions when the user asks for them or the business process clearly depends on them
|
|
28
|
-
|
|
29
|
-
## Standard Path
|
|
30
|
-
|
|
31
|
-
1. Resolve or create package: `package_get` / `package_apply`.
|
|
32
|
-
2. Draft all apps and relations with stable `client_key` values.
|
|
33
|
-
3. Run one multi-app `app_schema_apply` with `apps[]`.
|
|
34
|
-
4. If write result is uncertain, run readback before retrying.
|
|
35
|
-
5. For each app, apply layout and views.
|
|
36
|
-
6. Create charts before portals when the portal needs metrics or BI sections.
|
|
37
|
-
7. Create portal only after referenced apps, views, and charts are known.
|
|
38
|
-
8. Add workflows/buttons/associated resources when they are part of the requested business process.
|
|
39
|
-
|
|
40
|
-
## Recovery Rules
|
|
41
|
-
|
|
42
|
-
- Timeout, `partial_success`, `write_executed=true`, `safe_to_retry=false`, or incomplete readback means `write_may_have_succeeded`.
|
|
43
|
-
- Next action is always `readback_before_retry`: read package, resolve intended apps, then read fields/relations.
|
|
44
|
-
- Retry only verified missing apps, fields, or relations.
|
|
45
|
-
- Do not rebuild the system as separate single-app creates.
|
|
46
|
-
- Do not create `V2`, `测试`, timestamp, or random-suffix apps to bypass duplicate names.
|
|
47
|
-
|
|
48
|
-
## Portal Template
|
|
49
|
-
|
|
50
|
-
- Top area: one business entry grid plus one todo/common/frequent component when useful.
|
|
51
|
-
- Metrics: one row of 4-6 indicator/target cards with portal section `role: "metric"`; recommended height 5.
|
|
52
|
-
- BI charts: one row of 2-3 charts, 1-2 rows; recommended height 7.
|
|
53
|
-
- Data views: one row of 1-2 concrete views, 1-2 rows; recommended height 11.
|
|
54
|
-
|
|
55
|
-
## Stop Conditions
|
|
56
|
-
|
|
57
|
-
- If the user only asked for one app, switch to the single-app guide.
|
|
58
|
-
- If required package/app/field/relation readback contradicts the intended model, repair the specific missing slice before building dependent resources.
|
|
59
|
-
- If a public tool cannot express a needed business feature, state the gap and ask before using any fallback or submitting feedback.
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
# Create App
|
|
2
|
-
|
|
3
|
-
Use this when the user wants one new app inside an existing package.
|
|
4
|
-
This playbook follows the current public builder surface, not legacy package helper tools.
|
|
5
|
-
|
|
6
|
-
Do not use this playbook when the user is really asking for a system/package with multiple forms or modules. In that case:
|
|
7
|
-
|
|
8
|
-
1. read or create the package through `package_get` / `package_apply`
|
|
9
|
-
2. create the related apps in one `app_schema_apply(package_id=..., apps=[...])` call
|
|
10
|
-
3. keep package ownership on the public `package_id` path instead of a separate attach step
|
|
11
|
-
4. add same-call relation fields with `target_app_ref` when one new app references another new app; use `target_app_key` only after the target app already exists or readback confirms it
|
|
12
|
-
5. choose explicit non-template `icon + color` for each new package/app
|
|
13
|
-
|
|
14
|
-
Hierarchy reminder:
|
|
15
|
-
|
|
16
|
-
- package -> app -> field -> relation
|
|
17
|
-
- another business object is another app, not a text field
|
|
18
|
-
|
|
19
|
-
If creating a brand new package would help, ask the user to confirm package creation first. After confirmation, create it through `package_apply(create_if_missing=true, package_name=...)`.
|
|
20
|
-
|
|
21
|
-
## Minimal sequence
|
|
22
|
-
|
|
23
|
-
1. `package_get` if `package_id` is already known; otherwise derive the package from related readback or ask the user for the id
|
|
24
|
-
2. `app_resolve`
|
|
25
|
-
3. `app_schema_apply`
|
|
26
|
-
4. `app_publish_verify` only when the user asks for explicit final verification
|
|
27
|
-
|
|
28
|
-
## Multi-app systems are different
|
|
29
|
-
|
|
30
|
-
If the user says things like:
|
|
31
|
-
|
|
32
|
-
- “创建一个完整应用包”
|
|
33
|
-
- “包含项目、需求、任务、缺陷、团队这几个表单”
|
|
34
|
-
- “这些表单之间建立关联关系”
|
|
35
|
-
|
|
36
|
-
then do not treat that as one app.
|
|
37
|
-
|
|
38
|
-
Use this pattern instead:
|
|
39
|
-
|
|
40
|
-
1. `package_get` or `package_apply(create_if_missing=true, package_name=...)`
|
|
41
|
-
2. for a multi-app system, run one `app_schema_apply` with `package_id` and `apps[]`
|
|
42
|
-
3. use `apps[].client_key` plus relation field `target_app_ref` when one new app references another new app
|
|
43
|
-
|
|
44
|
-
If that multi-app call times out, returns `partial_success`, returns `write_executed=true`, has `safe_to_retry=false`, or has incomplete readback, do not decide that the create failed. Run `readback_before_retry`: read the package, resolve each intended app by package/name or returned app key, read fields, and retry only verified missing apps or fields. Do not rebuild the same complete system as separate single-app creates, and do not create `V2`, `测试`, timestamp, or random-suffix apps to bypass duplicate names.
|
|
45
|
-
|
|
46
|
-
## Example
|
|
47
|
-
|
|
48
|
-
When designing fields, do not add platform system fields such as `数据ID`, `编号`, `申请人`, `申请时间`, `创建人`, `创建时间`, `提交人`, `提交时间`, `更新时间`, `更新人`, `当前流程状态`, `当前处理人`, `当前处理节点`, or `流程标题`. Qingflow provides them automatically; create only business fields.
|
|
49
|
-
|
|
50
|
-
Create a new package only after the user confirms package creation:
|
|
51
|
-
|
|
52
|
-
```json
|
|
53
|
-
{
|
|
54
|
-
"tool_name": "package_apply",
|
|
55
|
-
"arguments": {
|
|
56
|
-
"profile": "default",
|
|
57
|
-
"package_name": "研发项目管理",
|
|
58
|
-
"create_if_missing": true,
|
|
59
|
-
"icon": "briefcase",
|
|
60
|
-
"color": "azure"
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Read the package when `package_id` is already known:
|
|
66
|
-
|
|
67
|
-
```json
|
|
68
|
-
{
|
|
69
|
-
"tool_name": "package_get",
|
|
70
|
-
"arguments": {
|
|
71
|
-
"profile": "default",
|
|
72
|
-
"package_id": 1218950
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Apply schema for a new app:
|
|
78
|
-
|
|
79
|
-
```json
|
|
80
|
-
{
|
|
81
|
-
"tool_name": "app_schema_apply",
|
|
82
|
-
"arguments": {
|
|
83
|
-
"profile": "default",
|
|
84
|
-
"app_name": "客户订单",
|
|
85
|
-
"package_id": 1218950,
|
|
86
|
-
"icon": "delivery-box-1",
|
|
87
|
-
"color": "emerald",
|
|
88
|
-
"create_if_missing": true,
|
|
89
|
-
"publish": true,
|
|
90
|
-
"add_fields": [
|
|
91
|
-
{"name": "订单编号", "type": "text", "required": true, "as_data_title": true},
|
|
92
|
-
{"name": "客户名称", "type": "text", "required": true},
|
|
93
|
-
{"name": "订单封面", "type": "attachment", "as_data_cover": true},
|
|
94
|
-
{"name": "订单金额", "type": "amount"},
|
|
95
|
-
{"name": "状态", "type": "single_select", "options": [{"label": "草稿"}, {"label": "进行中"}, {"label": "已完成"}], "required": true}
|
|
96
|
-
],
|
|
97
|
-
"update_fields": [],
|
|
98
|
-
"remove_fields": []
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Apply schema for multiple apps in one call:
|
|
104
|
-
|
|
105
|
-
```json
|
|
106
|
-
{
|
|
107
|
-
"tool_name": "app_schema_apply",
|
|
108
|
-
"arguments": {
|
|
109
|
-
"profile": "default",
|
|
110
|
-
"package_id": 1218950,
|
|
111
|
-
"create_if_missing": true,
|
|
112
|
-
"publish": true,
|
|
113
|
-
"apps": [
|
|
114
|
-
{
|
|
115
|
-
"client_key": "customer",
|
|
116
|
-
"app_name": "客户",
|
|
117
|
-
"icon": "business-personalcard",
|
|
118
|
-
"color": "emerald",
|
|
119
|
-
"add_fields": [
|
|
120
|
-
{"name": "客户名称", "type": "text", "required": true, "as_data_title": true}
|
|
121
|
-
]
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
"client_key": "order",
|
|
125
|
-
"app_name": "订单",
|
|
126
|
-
"icon": "delivery-box-1",
|
|
127
|
-
"color": "blue",
|
|
128
|
-
"add_fields": [
|
|
129
|
-
{"name": "订单编号", "type": "text", "required": true, "as_data_title": true},
|
|
130
|
-
{
|
|
131
|
-
"name": "关联客户",
|
|
132
|
-
"type": "relation",
|
|
133
|
-
"target_app_ref": "customer",
|
|
134
|
-
"display_field": {"name": "客户名称"},
|
|
135
|
-
"visible_fields": [{"name": "客户名称"}]
|
|
136
|
-
}
|
|
137
|
-
]
|
|
138
|
-
}
|
|
139
|
-
]
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
Data title is required: mark exactly one top-level field with `as_data_title: true`. Data cover is optional and only valid on a top-level `attachment` field.
|
|
145
|
-
|
|
146
|
-
## Common failures
|
|
147
|
-
|
|
148
|
-
### `APP_NOT_FOUND`
|
|
149
|
-
|
|
150
|
-
Expected on create. Continue with `create_if_missing=true`.
|
|
151
|
-
|
|
152
|
-
### `CREATE_APP_ROUTE_NOT_FOUND`
|
|
153
|
-
|
|
154
|
-
The create route did not resolve in the current backend route context. In Wingent Momo runtime, first retry the same `app_schema_apply` after confirming the injected session is still active. Only run `workspace_select` if a business tool explicitly reports a missing or wrong workspace.
|
|
155
|
-
|
|
156
|
-
### Hierarchy modeling mistake
|
|
157
|
-
|
|
158
|
-
If the user asked for several named forms/apps but the draft patch turns them into text fields inside one app, stop and remodel the task as:
|
|
159
|
-
|
|
160
|
-
- one package
|
|
161
|
-
- many apps
|
|
162
|
-
- relation fields between those apps
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# Environment Switching
|
|
2
|
-
|
|
3
|
-
Use this reference before any builder-side write, repair, or verification flow.
|
|
4
|
-
|
|
5
|
-
## Step 1: Resolve the active environment
|
|
6
|
-
|
|
7
|
-
Decide explicitly whether the task targets:
|
|
8
|
-
|
|
9
|
-
- `test`: build validation, mock data, trial package creation, safe iteration
|
|
10
|
-
- `prod`: formal business system changes in the live environment
|
|
11
|
-
|
|
12
|
-
If the user did not specify an environment, default to `prod`.
|
|
13
|
-
|
|
14
|
-
## Test Environment
|
|
15
|
-
|
|
16
|
-
Use test for:
|
|
17
|
-
|
|
18
|
-
- first application of a new `SolutionSpec`
|
|
19
|
-
- trying builder apply flows end-to-end with readback verification, or `solution_install` when the user is installing an existing packaged solution
|
|
20
|
-
- package initialization and schema evolution experiments
|
|
21
|
-
- mock data creation, with at least `5` records per relevant entity unless the user asks for fewer
|
|
22
|
-
|
|
23
|
-
Builder behavior in test:
|
|
24
|
-
|
|
25
|
-
- `preflight` or `plan` is still preferred, but fast `apply` is acceptable when the user explicitly wants an end-to-end smoke test
|
|
26
|
-
- package creation is acceptable
|
|
27
|
-
- verify should read back apps, views, portal, navigation, and sample records
|
|
28
|
-
|
|
29
|
-
Known current test backend:
|
|
30
|
-
|
|
31
|
-
- use an explicitly provided non-production backend
|
|
32
|
-
|
|
33
|
-
## Production Environment
|
|
34
|
-
|
|
35
|
-
Use production for:
|
|
36
|
-
|
|
37
|
-
- changes to real business systems
|
|
38
|
-
- additive modifications to live packages and apps
|
|
39
|
-
- controlled rollout of approved solution specs
|
|
40
|
-
|
|
41
|
-
Builder behavior in prod:
|
|
42
|
-
|
|
43
|
-
- always identify the target package or app set before changing anything
|
|
44
|
-
- default to `preflight` or `plan` before any `apply`
|
|
45
|
-
- additive requirements should modify the existing package with ordinary tools by default
|
|
46
|
-
- if creating a new package seems necessary in prod, ask the user to confirm package creation first
|
|
47
|
-
- do not seed mock data unless the user explicitly approves it for production
|
|
48
|
-
- verify is mandatory after writes
|
|
49
|
-
|
|
50
|
-
Production guardrails:
|
|
51
|
-
|
|
52
|
-
- restate the target workspace and target package before any write
|
|
53
|
-
- call out whether the action creates, mutates, or deletes builder-side configuration
|
|
54
|
-
- if a safer read-only inspection can answer the request, do that first
|
|
55
|
-
|
|
56
|
-
## Reporting Rule
|
|
57
|
-
|
|
58
|
-
For builder work, always report:
|
|
59
|
-
|
|
60
|
-
- active environment
|
|
61
|
-
- target workspace
|
|
62
|
-
- whether the operation is `plan`, `apply`, `repair`, or `verify`
|
|
63
|
-
- whether it touches an existing package or creates a new one
|