@qingflow-tech/qingflow-app-user-mcp 1.0.40 → 1.0.41
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 -2
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/skills/qingflow-app-builder/SKILL.md +14 -4
- package/skills/qingflow-app-builder/references/complete-system-development-guide.md +59 -0
- package/skills/qingflow-app-builder/references/create-app.md +3 -1
- package/skills/qingflow-app-builder/references/gotchas.md +6 -0
- package/skills/qingflow-app-builder/references/single-app-development-guide.md +47 -0
- package/skills/qingflow-app-builder/references/solution-playbooks.md +10 -0
- package/skills/qingflow-app-builder-code-integrations/SKILL.md +2 -0
- package/skills/qingflow-app-user/SKILL.md +2 -0
- package/skills/qingflow-mcp-setup/SKILL.md +2 -0
- package/skills/qingflow-record-analysis/SKILL.md +3 -1
- package/skills/qingflow-record-delete/SKILL.md +2 -0
- package/skills/qingflow-record-import/SKILL.md +29 -0
- package/skills/qingflow-record-insert/SKILL.md +24 -1
- package/skills/qingflow-record-update/SKILL.md +3 -0
- package/skills/qingflow-task-ops/SKILL.md +2 -0
- package/src/qingflow_mcp/builder_facade/models.py +183 -0
- package/src/qingflow_mcp/builder_facade/service.py +722 -74
- package/src/qingflow_mcp/cli/formatters.py +1 -0
- package/src/qingflow_mcp/cli/main.py +2 -0
- package/src/qingflow_mcp/response_trim.py +1 -0
- package/src/qingflow_mcp/tools/ai_builder_tools.py +388 -17
- package/src/qingflow_mcp/tools/record_tools.py +28 -2
package/README.md
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Install:
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npm install @qingflow-tech/qingflow-app-user-mcp@1.0.
|
|
6
|
+
npm install @qingflow-tech/qingflow-app-user-mcp@1.0.41
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
Run:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npx -y -p @qingflow-tech/qingflow-app-user-mcp@1.0.
|
|
12
|
+
npx -y -p @qingflow-tech/qingflow-app-user-mcp@1.0.41 qingflow-app-user-mcp
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
Environment:
|
package/package.json
CHANGED
package/pyproject.toml
CHANGED
|
@@ -7,6 +7,8 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Qingflow App Builder
|
|
9
9
|
|
|
10
|
+
> **Skill 版本**:`qingflow-skills-2026.06.23.1`(入口文档版本;如需确认 CLI 包版本,使用 `qingflow --version` 或 `qingflow --json version`)。
|
|
11
|
+
|
|
10
12
|
## Overview
|
|
11
13
|
|
|
12
14
|
This skill is for the current **public builder surface**, not for legacy low-level builder writes.
|
|
@@ -15,6 +17,7 @@ In Wingent Momo runtime, trust the injected MCP session, credentials, workspace,
|
|
|
15
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`.
|
|
16
18
|
|
|
17
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.
|
|
18
21
|
|
|
19
22
|
## Current Public Mental Model
|
|
20
23
|
|
|
@@ -36,11 +39,13 @@ Default modeling rules:
|
|
|
36
39
|
|
|
37
40
|
Before any builder write, classify the request:
|
|
38
41
|
|
|
39
|
-
- **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. Do not squeeze several business objects into one app.
|
|
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.
|
|
40
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.
|
|
41
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.
|
|
42
45
|
|
|
43
|
-
For complete systems, `apps[]` should use stable `client_key` values. Same-call relation fields
|
|
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.
|
|
44
49
|
|
|
45
50
|
Builder schema inputs should follow agent-intuitive semantics:
|
|
46
51
|
|
|
@@ -69,7 +74,8 @@ Treat these as the official surface. Do not default to `package_create`, `packag
|
|
|
69
74
|
- Multi-app schema work:
|
|
70
75
|
- use one `app_schema_apply(package_id=..., apps=[...])` / CLI `builder schema apply --apps-file` when creating several apps in one package
|
|
71
76
|
- every `apps[]` item should carry its own `client_key`, `app_name`, `icon`, `color`, and `add_fields`
|
|
72
|
-
- same-call relation 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
|
|
73
79
|
- App base permissions:
|
|
74
80
|
- trust `app_get.editability.can_edit_app_base` for app base-info writes like app name, icon, and visibility
|
|
75
81
|
- `can_edit_form` only means schema/form-route capability; it no longer implies app base-info write capability
|
|
@@ -161,6 +167,8 @@ Treat these as the official surface. Do not default to `package_create`, `packag
|
|
|
161
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`.
|
|
162
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.
|
|
163
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.
|
|
164
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.
|
|
165
173
|
- Do not use raw `portal_*` writes or raw `qingbi_report_*` writes as the default builder strategy.
|
|
166
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.
|
|
@@ -179,7 +187,7 @@ Treat these as the official surface. Do not default to `package_create`, `packag
|
|
|
179
187
|
- For UI cards or quick narration, read `resources[]` first. Each resource has `resource_type`, `operation`, `status`, `id`, `key`, `name`, typed `ids`, and `parent`.
|
|
180
188
|
- Use legacy fields such as `field_diff`, `views_diff`, `chart_results`, `created/updated/removed`, and `verification` only for compatibility and troubleshooting.
|
|
181
189
|
- Treat post-write readback as the source of truth, not just write status codes.
|
|
182
|
-
- `success` means write and verification completed; `partial_success` means the write landed but verification is incomplete.
|
|
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.
|
|
183
191
|
- For portals, distinguish clearly between:
|
|
184
192
|
- base-info-only update with layout preserved
|
|
185
193
|
- full sections replace
|
|
@@ -271,6 +279,8 @@ For add-data buttons that create a child record linked back to the current recor
|
|
|
271
279
|
- Tool choice and sequencing: [references/tool-selection.md](references/tool-selection.md)
|
|
272
280
|
- Field matching rules: [references/match-rules.md](references/match-rules.md)
|
|
273
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)
|
|
274
284
|
- Create one app in an existing package: [references/create-app.md](references/create-app.md)
|
|
275
285
|
- Update fields only: [references/update-schema.md](references/update-schema.md)
|
|
276
286
|
- Update layout only: [references/update-layout.md](references/update-layout.md)
|
|
@@ -0,0 +1,59 @@
|
|
|
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.
|
|
@@ -8,7 +8,7 @@ Do not use this playbook when the user is really asking for a system/package wit
|
|
|
8
8
|
1. read or create the package through `package_get` / `package_apply`
|
|
9
9
|
2. create the related apps in one `app_schema_apply(package_id=..., apps=[...])` call
|
|
10
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
|
|
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
12
|
5. choose explicit non-template `icon + color` for each new package/app
|
|
13
13
|
|
|
14
14
|
Hierarchy reminder:
|
|
@@ -41,6 +41,8 @@ Use this pattern instead:
|
|
|
41
41
|
2. for a multi-app system, run one `app_schema_apply` with `package_id` and `apps[]`
|
|
42
42
|
3. use `apps[].client_key` plus relation field `target_app_ref` when one new app references another new app
|
|
43
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
|
+
|
|
44
46
|
## Example
|
|
45
47
|
|
|
46
48
|
When designing fields, do not add platform system fields such as `数据ID`, `编号`, `申请人`, `申请时间`, `创建人`, `创建时间`, `提交人`, `提交时间`, `更新时间`, `更新人`, `当前流程状态`, `当前处理人`, `当前处理节点`, or `流程标题`. Qingflow provides them automatically; create only business fields.
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
- Another app is not a field
|
|
18
18
|
- If the user names multiple forms/modules that relate to each other, create multiple apps and connect them with relation fields
|
|
19
19
|
- Do not use child app names like “项目/需求/任务/缺陷/团队” as plain text fields inside one app
|
|
20
|
+
- For a complete system, the main creation path is one multi-app `app_schema_apply(package_id=..., apps=[...])` with stable `apps[].client_key` values and same-call relation fields using `target_app_ref`
|
|
21
|
+
- Use `target_app_key` only for an app that already exists or has been confirmed by readback
|
|
20
22
|
|
|
21
23
|
## Auto publish
|
|
22
24
|
|
|
@@ -88,7 +90,11 @@
|
|
|
88
90
|
## Retry discipline
|
|
89
91
|
|
|
90
92
|
- If a write returns `partial_success`, read back before retrying
|
|
93
|
+
- If multi-app schema apply times out, returns `write_executed=true`, returns `safe_to_retry=false`, or has incomplete readback, treat it as `write_may_have_succeeded`; the next action is `readback_before_retry`
|
|
94
|
+
- `readback_before_retry` means read package/app/fields first, classify which intended apps and relation fields actually exist, and retry only the verified missing slice
|
|
91
95
|
- Do not repeat create steps after `app_key` already exists
|
|
96
|
+
- Do not split a complete-system schema create into single-app rebuilds until readback proves exactly what is missing
|
|
97
|
+
- Do not bypass duplicate/conflict states by inventing `V2`, `测试`, timestamp, or random-suffix app names in a real business package
|
|
92
98
|
- For backend rejects, keep the retry narrow: retry only the failed tool, not the whole chain
|
|
93
99
|
- For `VALIDATION_ERROR`, do not keep guessing. Reuse `suggested_next_call`, `canonical_arguments`, `allowed_keys`, and `allowed_values` first.
|
|
94
100
|
- For layout `VALIDATION_ERROR`, also inspect `section_allowed_keys`, `section_aliases`, and `minimal_section_example`. If the same layout-shape error repeats twice, stop free-form retries and re-read `builder_tool_contract(app_layout_apply)`.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Single App Development Guide
|
|
2
|
+
|
|
3
|
+
Use this when the user asks for one app/form, or gives one `app_key`.
|
|
4
|
+
If the user asks for a package, system, or several related modules, use `complete-system-development-guide.md` instead.
|
|
5
|
+
|
|
6
|
+
## Recommended Completeness
|
|
7
|
+
|
|
8
|
+
Required:
|
|
9
|
+
|
|
10
|
+
- target package/app resolved by `package_get`, `app_resolve`, or `app_get`
|
|
11
|
+
- business fields created or updated through `app_schema_apply`
|
|
12
|
+
- exactly one readable top-level `as_data_title: true`
|
|
13
|
+
- no platform system fields in `add_fields`
|
|
14
|
+
- layout places the important fields
|
|
15
|
+
- at least one business view beyond platform default views when the task includes user-facing list work
|
|
16
|
+
|
|
17
|
+
Strongly recommended:
|
|
18
|
+
|
|
19
|
+
- saved filters and query panel fields for the main operating views
|
|
20
|
+
- simple charts when the app has status, amount, date, or owner fields worth tracking
|
|
21
|
+
- associated resources or buttons only when they support a concrete workflow
|
|
22
|
+
|
|
23
|
+
Optional:
|
|
24
|
+
|
|
25
|
+
- workflow, portal entry, sample data, roles, or visibility changes when requested by the user or clearly needed by the app's job
|
|
26
|
+
|
|
27
|
+
## Standard Path
|
|
28
|
+
|
|
29
|
+
1. Read current target: `app_resolve` or `app_get`.
|
|
30
|
+
2. Read current fields: `app_get_fields`.
|
|
31
|
+
3. Apply fields with `app_schema_apply`.
|
|
32
|
+
4. Apply layout with `app_layout_apply`.
|
|
33
|
+
5. Apply views with `app_views_apply` when list/table/card/gantt behavior is part of the request.
|
|
34
|
+
6. Apply charts/buttons/associated resources only if they are part of the app's actual workflow.
|
|
35
|
+
7. Use `app_publish_verify` only when explicit live verification is required.
|
|
36
|
+
|
|
37
|
+
## Field Rules
|
|
38
|
+
|
|
39
|
+
- Use agent-friendly field types where possible: `text`, `multiline`, `select`, `multi_select`, `number`, `amount`, `date`, `datetime`, `member`, `department`, `attachment`, `relation`.
|
|
40
|
+
- Do not create `数据ID`, `编号`, `申请人`, `申请时间`, `创建人`, `创建时间`, `提交人`, `提交时间`, `更新时间`, `更新人`, `当前流程状态`, `当前处理人`, `当前处理节点`, or `流程标题`.
|
|
41
|
+
- Do not create built-in default views such as `全部数据` or `我的数据`; Qingflow provides system views.
|
|
42
|
+
|
|
43
|
+
## Stop Conditions
|
|
44
|
+
|
|
45
|
+
- If the task actually needs multiple business objects, stop and switch to the complete-system guide.
|
|
46
|
+
- If a write returns `partial_success`, `write_executed=true`, or `safe_to_retry=false`, read back before retrying.
|
|
47
|
+
- If the same validation error repeats twice, re-read `builder_tool_contract` instead of guessing.
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Use these when you need a quick reminder of the standard v2 builder sequences.
|
|
4
4
|
|
|
5
|
+
## Create a complete system / app package
|
|
6
|
+
|
|
7
|
+
1. `package_get` or `package_apply`
|
|
8
|
+
2. one multi-app `app_schema_apply(package_id=..., apps=[...])`
|
|
9
|
+
3. use stable `apps[].client_key` values and relation `target_app_ref` for same-call app references
|
|
10
|
+
4. use returned/readback `app_key` values for layout, views, workflow, charts, buttons, associated resources, and portal work
|
|
11
|
+
5. `app_publish_verify` only when the user asks for explicit live verification or a final verification pass is required
|
|
12
|
+
|
|
13
|
+
If the multi-app schema write times out or returns `partial_success`, `write_executed=true`, `safe_to_retry=false`, or incomplete readback, the next action is `readback_before_retry`: read package/app/fields first, then retry only verified missing pieces. Do not repeat the whole apps payload, split into single-app rebuilds, or create `V2` / `测试` / random-suffix apps to dodge duplicate names.
|
|
14
|
+
|
|
5
15
|
## Create a new app in an existing package
|
|
6
16
|
|
|
7
17
|
1. `package_get`
|
|
@@ -7,6 +7,8 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Qingflow App Builder Code Integrations
|
|
9
9
|
|
|
10
|
+
> **Skill 版本**:`qingflow-skills-2026.06.23.1`(入口文档版本;如需确认 CLI 包版本,使用 `qingflow --version` 或 `qingflow --json version`)。
|
|
11
|
+
|
|
10
12
|
Use this skill when the user wants to build or repair:
|
|
11
13
|
- `code_block` fields
|
|
12
14
|
- `q_linker` fields
|
|
@@ -7,6 +7,8 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Qingflow MCP Setup
|
|
9
9
|
|
|
10
|
+
> **Skill 版本**:`qingflow-skills-2026.06.23.1`(入口文档版本;如需确认 CLI 包版本,使用 `qingflow --version` 或 `qingflow --json version`)。
|
|
11
|
+
|
|
10
12
|
## Overview
|
|
11
13
|
|
|
12
14
|
This skill sets up the local Qingflow MCP server, connects it to a local AI client, and verifies authentication and workspace selection. Use it for installation, client configuration, token login, and connection troubleshooting.
|
|
@@ -7,6 +7,8 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Qingflow Record Analysis
|
|
9
9
|
|
|
10
|
+
> **Skill 版本**:`qingflow-skills-2026.06.23.1`(入口文档版本;如需确认 CLI 包版本,使用 `qingflow --version` 或 `qingflow --json version`)。
|
|
11
|
+
|
|
10
12
|
Use this skill only for final statistical conclusions: counts, distributions, ratios, averages, rankings, trends, comparisons, and analysis reports.
|
|
11
13
|
|
|
12
14
|
Default path, every time:
|
|
@@ -37,7 +39,7 @@ The CLI command is under the `record` command group, so the discovery path is: f
|
|
|
37
39
|
- Before final analysis, run a field-quality profile in pandas: row count, null rate, distinct count, and period coverage for candidate grouping fields.
|
|
38
40
|
- Do not use a high-missing field as the main conclusion dimension. If a candidate dimension is sparse, downgrade it to an `已填写样本观察` and choose a cleaner semantic fallback when available.
|
|
39
41
|
- Full final conclusions require `record_access.complete=true` and `record_access.safe_for_final_conclusion=true`.
|
|
40
|
-
- `record_list` is only for sample inspection after the aggregate result is understood.
|
|
42
|
+
- `record_list` is only for sample inspection after the aggregate result is understood; its `data.items[]` rows are flat field-title keyed objects, not nested `fields[]`.
|
|
41
43
|
- `record_get` is only for single-record detail verification, logs, references, images, or readable attachments. Read images from `media_assets.items[].local_path`; read documents/tables from `file_assets.items[].local_path` and `extraction.text_path`.
|
|
42
44
|
- `record_export_direct` is only for explicit export/download/Excel requests.
|
|
43
45
|
- `chart_get` / QingBI is only for user-provided report URLs or chart ids. If it reports `CHART_BASE_INFO_UNAVAILABLE` but `chart_data_loaded=true`, treat the chart data as readable and only the metadata/base info as degraded.
|
|
@@ -7,6 +7,8 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Qingflow Record Import
|
|
9
9
|
|
|
10
|
+
> **Skill 版本**:`qingflow-skills-2026.06.23.1`(入口文档版本;如需确认 CLI 包版本,使用 `qingflow --version` 或 `qingflow --json version`)。
|
|
11
|
+
|
|
10
12
|
## Default Path
|
|
11
13
|
|
|
12
14
|
`app_get -> record_import_schema_get -> record_import_template_get -> record_import_verify -> (optional authorized repair) -> record_import_start -> record_import_status_get`
|
|
@@ -21,6 +23,33 @@ metadata:
|
|
|
21
23
|
- `record_import_start`
|
|
22
24
|
- `record_import_status_get`
|
|
23
25
|
|
|
26
|
+
## File Shape And Field Mapping
|
|
27
|
+
|
|
28
|
+
- Official template headers are the target contract. Do not rename them in the import file.
|
|
29
|
+
- CSV can be used as a source format for planning or local transformation, but the current verify/start path expects the official Excel template (`.xlsx` / `.xls`).
|
|
30
|
+
- When the user gives CSV-like data, map each source column to the official template header first, then write the mapped rows into a copy of the template after explicit user authorization.
|
|
31
|
+
- Relation fields: prefer stable target `record_id` or another unique searchable value already accepted by the import schema. Do not rely on duplicated display names.
|
|
32
|
+
- Member / department fields: use values inside the schema/candidate scope; do not invent departments or names that are not resolvable.
|
|
33
|
+
- Select fields: use option labels from the schema/template; option ids are acceptable only when the import schema or prior readback proves they are supported.
|
|
34
|
+
|
|
35
|
+
Example source CSV for planning only:
|
|
36
|
+
|
|
37
|
+
```csv
|
|
38
|
+
客户名称,关联客户,状态,负责人
|
|
39
|
+
上海示例客户,CUST_RECORD_ID_001,有效,张三
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Mapped template row concept:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"客户名称": "上海示例客户",
|
|
47
|
+
"关联客户": "CUST_RECORD_ID_001",
|
|
48
|
+
"状态": "有效",
|
|
49
|
+
"负责人": "张三"
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
24
53
|
## Working Rules
|
|
25
54
|
|
|
26
55
|
1. Inspect `app_get.data.import_capability` first
|
|
@@ -8,6 +8,8 @@ metadata:
|
|
|
8
8
|
|
|
9
9
|
# Qingflow Record Insert
|
|
10
10
|
|
|
11
|
+
> **Skill 版本**:`qingflow-skills-2026.06.23.1`(入口文档版本;如需确认 CLI 包版本,使用 `qingflow --version` 或 `qingflow --json version`)。
|
|
12
|
+
|
|
11
13
|
## Default Path
|
|
12
14
|
|
|
13
15
|
`record_insert_schema_get -> record_insert(items) -> optional record_get/readback`
|
|
@@ -22,6 +24,26 @@ Default to batch-shaped insert. A single new record is `items` with one row.
|
|
|
22
24
|
- `record_department_candidates`
|
|
23
25
|
- `file_upload_local`
|
|
24
26
|
|
|
27
|
+
## Special Field Write Cheatsheet
|
|
28
|
+
|
|
29
|
+
Always read the insert schema first, then use field titles as `items[].fields` keys. For special fields:
|
|
30
|
+
|
|
31
|
+
- `member`: write a unique name, email, or resolved member id. If candidates are duplicated or the tool returns `needs_confirmation`, stop and surface candidates.
|
|
32
|
+
- `department`: do not invent department names. Use a value inside the schema/candidate scope: unique department name, returned id/key, or returned object shape such as `{"key":"DEPT_ID","label":"部门名"}` / `{"id":"DEPT_ID","value":"部门名"}`.
|
|
33
|
+
- `relation`: known target record id is most stable for batch inserts. Natural display text is allowed only when it uniquely resolves through the field's `searchable_fields`; duplicates require confirmation.
|
|
34
|
+
- `single_select` / `multi_select`: option label and option id are both acceptable when present in schema/options. Prefer labels for readability; let the tool compile to the path-specific value.
|
|
35
|
+
- `attachment`: upload the local file first with `file_upload_local`, then write the returned file value. Do not write only a filename or arbitrary URL.
|
|
36
|
+
- System fields are read-only: `数据ID`, `编号`, `申请人`, `申请时间`, `创建人`, `创建时间`, `提交人`, `提交时间`, `更新时间`, `更新人`, `当前流程状态`, `当前处理人`, `当前处理节点`, `流程标题`.
|
|
37
|
+
|
|
38
|
+
## Failure Repair Contract
|
|
39
|
+
|
|
40
|
+
When insert returns `blocked`, `partial_success`, or `needs_confirmation`, do not retry the whole batch blindly.
|
|
41
|
+
|
|
42
|
+
- Read `items[].failed_fields[]` first.
|
|
43
|
+
- Each failed field exposes `error_code`, `expected_format`, `example_value`, and `next_action`.
|
|
44
|
+
- For `member`, `department`, `relation`, `attachment`, and `select` fields, `next_action` is field-type specific: candidate lookup, upload first, use record/apply id, or use schema option label/id.
|
|
45
|
+
- Retry only the failed `row_number` with corrected values. If any row has `write_executed=true` or `created_record_ids` is non-empty, never replay the original batch.
|
|
46
|
+
|
|
25
47
|
## Candidate Lookup
|
|
26
48
|
|
|
27
49
|
Do not pre-query member or department ids by default. Use candidate commands only when:
|
|
@@ -72,7 +94,7 @@ Without `record_id` / `workflow_node_id` / `fields-file`, the result is a static
|
|
|
72
94
|
9. For `linkage.kind=formula_fill`, treat the field as formula/default-auto-fill driven unless the user explicitly asks to override it and the field is still writable
|
|
73
95
|
10. If insert succeeds and single-record detail/readback matters, prefer `record_get`; for batch verification, rely on returned `created_record_ids` first, then use `record_get` for selected rows or `record_access -> Python` when a row-shaped bulk check is truly needed
|
|
74
96
|
11. Keep subtable payloads under the parent field as a row array
|
|
75
|
-
12.
|
|
97
|
+
12. Follow the Special Field Write Cheatsheet for member, department, relation, select, and attachment values; do not pre-query ids by default when a natural value is unique enough
|
|
76
98
|
13. If the write returns `status="needs_confirmation"`, stop and surface the candidates
|
|
77
99
|
14. Retry failed rows only with explicit ids / objects after the user confirms
|
|
78
100
|
15. Keep `verify_write=true` for production inserts
|
|
@@ -123,6 +145,7 @@ qingflow --json record insert --app-key APP_KEY --items-file records.json
|
|
|
123
145
|
- Do not invent missing required fields
|
|
124
146
|
- Do not fill platform system fields such as `数据ID`, `编号`, `申请人`, `创建时间`, or `更新时间`
|
|
125
147
|
- Do not flatten subtable leaf fields to the top level
|
|
148
|
+
- Do not invent member / department / relation candidates outside schema or candidate scope
|
|
126
149
|
- Do not pre-query or silently guess member / department / relation ids when a natural string is enough
|
|
127
150
|
- Do not retry a whole batch after `created_record_ids` is non-empty
|
|
128
151
|
- Do not bind logic to a transient nested schema serialization detail when the field title and parent table already identify the legal payload shape
|
|
@@ -7,6 +7,8 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Qingflow Record Update
|
|
9
9
|
|
|
10
|
+
> **Skill 版本**:`qingflow-skills-2026.06.23.1`(入口文档版本;如需确认 CLI 包版本,使用 `qingflow --version` 或 `qingflow --json version`)。
|
|
11
|
+
|
|
10
12
|
## Default Path
|
|
11
13
|
|
|
12
14
|
`record_get -> record_update`
|
|
@@ -33,6 +35,7 @@ metadata:
|
|
|
33
35
|
11. If single-record readback matters, prefer `record_get` after the write and read top-level `fields[]`, `media_assets.items[].local_path`, `file_assets.items[].local_path`, `file_assets.items[].extraction.text_path`, and `semantic_context`; `record_get` follows the frontend storage cookie redirect path for Qingflow attachments, so prefer local paths over remote URLs; use `record_list(..., output_profile="normalized")` only for batch row-shaped normalized readback
|
|
34
36
|
12. For batch updates, read top-level `mode`, `dry_run`, `total`, `succeeded`, `failed`, `needs_confirmation`, `updated_record_ids`, `write_executed`, `safe_to_retry`, `verification_status`, and `items[].row_number/status/record_id`
|
|
35
37
|
13. If `write_executed=true`, do not blindly retry the whole batch; use `items[]` and `updated_record_ids` to decide whether only failed rows need repair
|
|
38
|
+
14. If you use `record_list` to locate candidates, parse `data.items[]` as flat row objects such as `row["客户名称"]` + `row["record_id"]`; do not expect a nested `fields[]` array in list rows
|
|
36
39
|
|
|
37
40
|
## Special Field Values
|
|
38
41
|
|