bpmax-cli 0.2.1-beta.9 → 0.2.1-beta.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/README.md +30 -7
  2. package/dist/bin.js +45782 -12836
  3. package/dist/bin.js.map +1 -1
  4. package/package.json +12 -5
  5. package/scripts/install-skills.mjs +27 -60
  6. package/scripts/run-source-cli.mjs +145 -0
  7. package/skills/bpmax-ai-taskbook/SKILL.md +17 -1
  8. package/skills/bpmax-ai-taskbook/references/blueprint-taskbook-gates.md +141 -0
  9. package/skills/bpmax-ai-taskbook/references/taskbook-template.md +43 -3
  10. package/skills/bpmax-api-platform-editor/SKILL.md +24 -31
  11. package/skills/bpmax-api-platform-editor/agents/openai.yaml +2 -2
  12. package/skills/bpmax-api-platform-editor/references/platform-api-map.md +2 -2
  13. package/skills/bpmax-api-platform-editor/references/runtime-workflow.md +3 -3
  14. package/skills/bpmax-approval-matrix/SKILL.md +54 -2
  15. package/skills/bpmax-blueprint-doc-workflow/SKILL.md +38 -5
  16. package/skills/bpmax-blueprint-doc-workflow/references/blueprint-structure.md +24 -8
  17. package/skills/bpmax-blueprint-doc-workflow/references/business-language.md +74 -0
  18. package/skills/bpmax-blueprint-doc-workflow/references/per-flow-required-structure.md +13 -0
  19. package/skills/bpmax-blueprint-doc-workflow/references/review-and-confirmation-dialogue.md +70 -0
  20. package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-modeling-review.xml +23 -0
  21. package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-review-record.xml +72 -0
  22. package/skills/bpmax-blueprint-doc-workflow/references/sample-paragraph-flow-details.xml +27 -0
  23. package/skills/bpmax-blueprint-doc-workflow/references/sample-pass.xml +59 -35
  24. package/skills/bpmax-blueprint-doc-workflow/references/sample-system-identifier.xml +79 -0
  25. package/skills/bpmax-blueprint-doc-workflow/references/source-traceability-and-flow-modeling.md +115 -0
  26. package/skills/bpmax-blueprint-doc-workflow/scripts/lint_blueprint_doc.py +586 -5
  27. package/skills/bpmax-bug-reporting/SKILL.md +72 -0
  28. package/skills/bpmax-builder-shared/SKILL.md +1 -0
  29. package/skills/bpmax-builder-shared/configuration-impact-review.md +76 -0
  30. package/skills/bpmax-builder-shared/template_script_hard_rules.py +3 -1
  31. package/skills/bpmax-builder-shared/tests/test_template_script_hard_rules.py +16 -0
  32. package/skills/bpmax-business-skill/SKILL.md +3 -1
  33. package/skills/bpmax-cli/SKILL.md +46 -0
  34. package/skills/bpmax-config-latest/SKILL.md +4 -0
  35. package/skills/bpmax-console-template-editor/SKILL.md +113 -523
  36. package/skills/bpmax-console-template-editor/agents/openai.yaml +2 -2
  37. package/skills/bpmax-console-template-editor/references/full-detail-guide.md +45 -0
  38. package/skills/bpmax-console-template-editor/references/local-temp-workflow.md +13 -12
  39. package/skills/bpmax-console-template-editor/scripts/console_template_editor_common.py +299 -78
  40. package/skills/bpmax-console-template-editor/tests/test_console_template_editor.py +344 -30
  41. package/skills/bpmax-dataset-field-template-editor/SKILL.md +131 -594
  42. package/skills/bpmax-dataset-field-template-editor/references/full-detail-guide.md +570 -0
  43. package/skills/bpmax-dataset-field-template-editor/references/nested-field-patterns.md +8 -8
  44. package/skills/bpmax-dataset-field-template-editor/references/runtime-verified-field-page-shape.md +1 -1
  45. package/skills/bpmax-dataset-field-template-editor/scripts/dataset_field_editor_common.py +11 -77
  46. package/skills/bpmax-dataset-field-template-editor/scripts/export_dataset_field.py +4 -57
  47. package/skills/bpmax-dataset-field-template-editor/scripts/init_create_dataset_field.py +2 -0
  48. package/skills/bpmax-dataset-field-template-editor/scripts/inspect_dataset_field_runtime.py +4 -78
  49. package/skills/bpmax-dataset-field-template-editor/scripts/submit_dataset_field.py +3 -89
  50. package/skills/bpmax-dataset-field-template-editor/tests/test_dataset_field_editor.py +14 -0
  51. package/skills/bpmax-dataset-field-template-editor/tests/test_init_create_dataset_field.py +2 -0
  52. package/skills/bpmax-dataset-template-editor/SKILL.md +123 -778
  53. package/skills/bpmax-dataset-template-editor/references/dataset-script-runtime-matrix.md +11 -0
  54. package/skills/bpmax-dataset-template-editor/references/full-detail-guide.md +753 -0
  55. package/skills/bpmax-dataset-template-editor/references/runtime-gotchas.md +12 -0
  56. package/skills/bpmax-dataset-template-editor/references/ui-to-backend-field-map.md +1 -0
  57. package/skills/bpmax-dataset-template-editor/references/work-file-to-submit-mapping.md +2 -2
  58. package/skills/bpmax-dataset-template-editor/scripts/basic_table_audit.py +8 -1
  59. package/skills/bpmax-dataset-template-editor/scripts/dataset_editor_common.py +9 -90
  60. package/skills/bpmax-dataset-template-editor/scripts/export_dataset.py +8 -1
  61. package/skills/bpmax-dataset-template-editor/scripts/resolve_dataset.py +8 -1
  62. package/skills/bpmax-dataset-template-editor/scripts/submit_dataset.py +1 -2
  63. package/skills/bpmax-dataset-template-editor/scripts/verify_dataset_list.py +8 -1
  64. package/skills/bpmax-dataset-template-editor/scripts/verify_publish_health.py +8 -1
  65. package/skills/bpmax-dataset-template-editor/tests/test_dataset_editor.py +6 -40
  66. package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +18 -4
  67. package/skills/bpmax-e2e-flow-config-orchestrator/agents/openai.yaml +2 -2
  68. package/skills/bpmax-e2e-flow-config-orchestrator/references/orchestration-matrix.md +13 -9
  69. package/skills/bpmax-e2e-flow-test-operator/SKILL.md +174 -546
  70. package/skills/bpmax-e2e-flow-test-operator/agents/openai.yaml +2 -3
  71. package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +181 -15
  72. package/skills/bpmax-e2e-flow-test-operator/references/browser-action-dsl.md +169 -0
  73. package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +15 -7
  74. package/skills/bpmax-e2e-flow-test-operator/references/full-detail-guide.md +589 -0
  75. package/skills/bpmax-e2e-flow-test-operator/references/minimal-test-loop.md +12 -8
  76. package/skills/bpmax-e2e-flow-test-operator/references/negative-sale-api-matrix.md +4 -4
  77. package/skills/bpmax-e2e-flow-test-operator/references/profile-schema.md +1 -1
  78. package/skills/bpmax-e2e-flow-test-operator/references/state-schema.md +3 -1
  79. package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_doc.py +7 -5
  80. package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_state.py +2 -2
  81. package/skills/bpmax-e2e-flow-test-operator/scripts/flow_runner.py +5 -1
  82. package/skills/bpmax-e2e-flow-test-operator/tests/test_negative_sale_api_tools.py +71 -0
  83. package/skills/bpmax-e2e-flow-test-operator-v2/SKILL.md +64 -0
  84. package/skills/bpmax-e2e-flow-test-operator-v2/agents/openai.yaml +7 -0
  85. package/skills/bpmax-e2e-flow-test-operator-v2/references/automation-generation-pipeline.md +33 -0
  86. package/skills/bpmax-e2e-flow-test-operator-v2/references/autonomous-execution.md +40 -0
  87. package/skills/bpmax-e2e-flow-test-operator-v2/references/batch-generation-and-execution.md +17 -0
  88. package/skills/bpmax-e2e-flow-test-operator-v2/references/browser-action-runner.md +19 -0
  89. package/skills/bpmax-e2e-flow-test-operator-v2/references/browser-recording-and-replay.md +95 -0
  90. package/skills/bpmax-e2e-flow-test-operator-v2/references/form-script-generation.md +41 -0
  91. package/skills/bpmax-e2e-flow-test-operator-v2/references/identity-and-failure-routing.md +92 -0
  92. package/skills/bpmax-e2e-flow-test-operator-v2/references/multi-request-mutation.md +9 -0
  93. package/skills/bpmax-e2e-flow-test-operator-v2/references/scenario-coverage-generation.md +17 -0
  94. package/skills/bpmax-e2e-flow-test-operator-v2/references/scoped-execution.md +13 -0
  95. package/skills/bpmax-e2e-flow-test-operator-v2/references/step-restartability-and-state.md +23 -0
  96. package/skills/bpmax-e2e-flow-test-operator-v2/references/test-assets-and-evidence.md +9 -0
  97. package/skills/bpmax-e2e-flow-test-operator-v2/references/test-data-and-selector-contract.md +51 -0
  98. package/skills/bpmax-e2e-flow-test-operator-v2/references/test-preflight-and-confirmation.md +32 -0
  99. package/skills/bpmax-filter-template-editor/SKILL.md +114 -551
  100. package/skills/bpmax-filter-template-editor/references/experience-coverage-matrix.md +18 -18
  101. package/skills/bpmax-filter-template-editor/references/filter-content-schema.md +21 -0
  102. package/skills/bpmax-filter-template-editor/references/filter-request-shape.md +29 -26
  103. package/skills/bpmax-filter-template-editor/references/filter-runtime-patterns.md +19 -2
  104. package/skills/bpmax-filter-template-editor/references/full-detail-guide.md +56 -0
  105. package/skills/bpmax-filter-template-editor/references/runtime-verified-filter-page-shape.md +10 -9
  106. package/skills/bpmax-filter-template-editor/scripts/filter_template_editor_common.py +7 -57
  107. package/skills/bpmax-filter-template-editor/tests/test_filter_template_editor.py +4 -48
  108. package/skills/bpmax-flow/SKILL.md +2 -0
  109. package/skills/bpmax-flow-detail-template-editor/SKILL.md +53 -0
  110. package/skills/bpmax-flow-template-editor/SKILL.md +140 -1137
  111. package/skills/bpmax-flow-template-editor/agents/openai.yaml +2 -2
  112. package/skills/bpmax-flow-template-editor/references/diff-strategy.md +3 -3
  113. package/skills/bpmax-flow-template-editor/references/editor-runtime-vs-draft.md +9 -9
  114. package/skills/bpmax-flow-template-editor/references/flow-template-api-workflow.md +9 -1
  115. package/skills/bpmax-flow-template-editor/references/full-detail-guide.md +1162 -0
  116. package/skills/bpmax-flow-template-editor/references/local-temp-workflow.md +1 -1
  117. package/skills/bpmax-flow-template-editor/references/message-card-professional-standard.md +234 -0
  118. package/skills/bpmax-flow-template-editor/references/payload-checklist.md +2 -0
  119. package/skills/bpmax-flow-template-editor/references/project-create-runtime-gotchas.md +17 -0
  120. package/skills/bpmax-flow-template-editor/references/requirement-to-node-mapping.md +8 -3
  121. package/skills/bpmax-flow-template-editor/references/runtime-verified-flow-detail-shape.md +7 -7
  122. package/skills/bpmax-flow-template-editor/references/runtime-verified-meta-fields.md +2 -2
  123. package/skills/bpmax-flow-template-editor/references/runtime-verified-node-fields.md +12 -2
  124. package/skills/bpmax-flow-template-editor/references/save-draft-request-shape.md +7 -23
  125. package/skills/bpmax-flow-template-editor/references/script-review-hard-rules.md +17 -0
  126. package/skills/bpmax-flow-template-editor/references/work-file-to-submit-mapping.md +1 -1
  127. package/skills/bpmax-flow-template-editor/tests/test_flow_template_editor.py +19 -75
  128. package/skills/bpmax-form-template-editor/SKILL.md +138 -1151
  129. package/skills/bpmax-form-template-editor/agents/openai.yaml +2 -2
  130. package/skills/bpmax-form-template-editor/references/dynamic-field-state.md +167 -0
  131. package/skills/bpmax-form-template-editor/references/form-template-api-workflow.md +51 -51
  132. package/skills/bpmax-form-template-editor/references/full-detail-guide.md +1115 -0
  133. package/skills/bpmax-form-template-editor/references/local-temp-workflow.md +4 -4
  134. package/skills/bpmax-form-template-editor/references/payload-checklist.md +3 -1
  135. package/skills/bpmax-form-template-editor/references/sub-form-patterns.md +6 -0
  136. package/skills/bpmax-form-template-editor/scripts/form_template_editor_common.py +8 -0
  137. package/skills/bpmax-form-template-editor/tests/test_form_template_editor.py +42 -19
  138. package/skills/bpmax-functional-test-design/LICENSE.upstream +24 -0
  139. package/skills/bpmax-functional-test-design/SKILL.md +80 -0
  140. package/skills/bpmax-functional-test-design/agents/openai.yaml +4 -0
  141. package/skills/bpmax-functional-test-design/references/bpmax-test-suite-output.md +95 -0
  142. package/skills/bpmax-functional-test-design/references/decision-table-testing.md +50 -0
  143. package/skills/bpmax-functional-test-design/references/domain-testing.md +43 -0
  144. package/skills/bpmax-functional-test-design/references/state-transition-testing.md +47 -0
  145. package/skills/bpmax-functional-test-design/references/technique-selection.md +38 -0
  146. package/skills/bpmax-functional-test-design/references/use-case-testing.md +55 -0
  147. package/skills/bpmax-group-model-editor/SKILL.md +24 -0
  148. package/skills/bpmax-home-portal-editor/SKILL.md +81 -0
  149. package/skills/bpmax-icon-catalog/SKILL.md +18 -0
  150. package/skills/bpmax-icon-catalog/agents/openai.yaml +4 -0
  151. package/skills/bpmax-icon-catalog/assets/ri-icons.json +3140 -0
  152. package/skills/bpmax-icon-catalog/references/source-contract.md +3 -0
  153. package/skills/bpmax-list-template-editor/SKILL.md +133 -466
  154. package/skills/bpmax-list-template-editor/agents/openai.yaml +2 -2
  155. package/skills/bpmax-list-template-editor/references/content-config-shape.md +16 -4
  156. package/skills/bpmax-list-template-editor/references/full-detail-guide.md +461 -0
  157. package/skills/bpmax-list-template-editor/references/list-template-api-workflow.md +6 -9
  158. package/skills/bpmax-list-template-editor/references/local-temp-workflow.md +1 -1
  159. package/skills/bpmax-list-template-editor/references/runtime-verified-workflow.md +50 -2
  160. package/skills/bpmax-list-template-editor/references/special-formats.md +5 -2
  161. package/skills/bpmax-list-template-editor/scripts/list_template_editor_common.py +9 -78
  162. package/skills/bpmax-memory-protocol/SKILL.md +7 -6
  163. package/skills/bpmax-nav-config-editor/SKILL.md +14 -17
  164. package/skills/bpmax-nav-config-editor/agents/openai.yaml +2 -2
  165. package/skills/bpmax-nav-config-editor/references/api-workflow.md +2 -2
  166. package/skills/bpmax-nav-config-editor/references/runtime-probing.md +11 -12
  167. package/skills/bpmax-page-composition-template-editor/SKILL.md +398 -0
  168. package/skills/bpmax-page-composition-template-editor/examples/presets/catalog.json +41 -0
  169. package/skills/bpmax-page-composition-template-editor/examples/presets/full-capability-workbench.json +294 -0
  170. package/skills/bpmax-page-composition-template-editor/examples/presets/project-detail-step-panel.json +184 -0
  171. package/skills/bpmax-page-composition-template-editor/examples/presets/project-list-quick-process.json +177 -0
  172. package/skills/bpmax-page-composition-template-editor/examples/presets/project-operations-dashboard.json +400 -0
  173. package/skills/bpmax-page-composition-template-editor/examples/presets/project-operations-visual-light.json +214 -0
  174. package/skills/bpmax-page-composition-template-editor/examples/presets/step-related-projects.json +184 -0
  175. package/skills/bpmax-page-composition-template-editor/references/resource-api.md +9 -0
  176. package/skills/bpmax-plugin-config/SKILL.md +55 -5
  177. package/skills/bpmax-project/SKILL.md +37 -1
  178. package/skills/bpmax-project-detail-template-editor/SKILL.md +13 -39
  179. package/skills/bpmax-project-detail-template-editor/agents/openai.yaml +2 -2
  180. package/skills/bpmax-role-editor/SKILL.md +11 -30
  181. package/skills/bpmax-shared/SKILL.md +19 -9
  182. package/skills/bpmax-team-editor/SKILL.md +27 -0
  183. package/skills/bpmax-ui-ux-audit/LICENSE.upstream +23 -0
  184. package/skills/bpmax-ui-ux-audit/SKILL.md +42 -0
  185. package/skills/bpmax-ui-ux-audit/agents/openai.yaml +4 -0
  186. package/skills/bpmax-ui-ux-audit/references/audit-framework.md +39 -0
  187. package/skills/bpmax-ui-ux-audit/references/bpmax-ux-findings.md +56 -0
  188. package/skills/bpmax-user/SKILL.md +33 -1
  189. package/skills/bpmax-user-mock-operator/SKILL.md +58 -56
  190. package/skills/bpmax-user-mock-operator/agents/openai.yaml +2 -2
  191. package/skills/bpmax-user-mock-operator/scripts/chrome_identity_bridge.mjs +1766 -0
  192. package/skills/bpmax-user-model-editor/SKILL.md +24 -0
  193. package/skills/bpmax-workspace-editor/SKILL.md +1 -0
  194. package/skills/form-control-library/references/form-template-submit-schema.md +3 -1
  195. package/skills/bpmax-user-mock-operator/scripts/switch_user_identity.py +0 -37
  196. package/skills/bpmax-user-mock-operator/scripts/user_mock_operator_common.py +0 -136
  197. package/skills/bpmax-user-mock-operator/tests/test_user_mock_operator.py +0 -138
@@ -1,478 +1,145 @@
1
1
  ---
2
2
  name: "bpmax-list-template-editor"
3
- description: "用于在 BPMAX 的项目列表模板页面中创建或编辑列表模板。只要用户提到“新建列表模板”“编辑项目列表模板”“按需求改 BPMAX 列表列”“从浏览器当前列表模板页确认配置”“让 Codex 根据需求构造列表模板配置”或等价表达,就应使用这个 skill。它要求用户先在浏览器打开一个空白列表模板或已有列表模板页面;随后 Codex 先通过真实线上接口确认数据格式,再把模板导出到本地临时文件,走 work 文件修改、第一次确认、submit 文件构建、强制 lint、第二次确认、typed CLI 提交、接口回读、浏览器刷新和高风险列表页验收的闭环。"
3
+ description: "用于通过 bpmax-cli typed config 创建或编辑 BPMAX 项目列表模板。只要用户提到“新建列表模板”“编辑项目列表模板”“按需求改 BPMAX 列表列”“确认列表模板配置”“让 Codex 根据需求构造列表模板配置”或等价表达,就应使用这个 skill。它要求 Codex 先通过 typed CLI 和真实线上接口确认数据格式,再把模板导出到本地临时文件,走 work 文件修改、第一次确认、submit 文件构建、强制 lint、第二次确认、typed CLI 提交和接口回读的配置闭环。"
4
4
  ---
5
5
 
6
6
  # BPMAX List Template Editor
7
7
 
8
8
  ## 写入路径硬约束
9
- - 执行前必须先运行 `bpmax-cli config adapters --format json` 核对 `list-template`;只有 `build_status` 和 `submit_status` 都是 `supported` 时才允许进入 build/submit。当前若显示 `blocked`,只能导出、编辑 work、lint 和形成变更建议,不得提交。
10
- - 在 bpmax-cli npm 分发包中,真实远端写操作只能走 `bpmax-cli config list-template submit`。
11
- - 旧来源脚本 `scripts/submit*.py` 只保留为结构参考,默认会硬失败;不得用它们直调 BPMAX API。
12
- - 不得用 `bpmax-cli api POST/PUT/DELETE /flow_page_template*` 或其它 raw API 绕过 typed config submit。
13
-
14
- ## 全局范围门禁
15
- - 范围 gate 对本 skill 是强要求。任何会修改 BPMAX 配置、线上状态、本地提交体或最终结果的动作,都必须先归类为 `requested`、`required-collateral` 或 `out-of-scope`。
16
- - 范围 gate 必须基于线上最新配置:分析或编辑配置前,先通过对应 workflow/API 拉取或读取远端最新状态;提交前再次确认本地 work/submit/payload 仍基于该最新远端基线,若线上配置已变化必须停止并重新对照。
17
- - 只有用户明确要求的 `requested`,或为闭合需求不可避免的 `required-collateral`,才允许进入 work / submit / 线上 payload / 状态变更。
9
+ - 执行前必须运行 `bpmax-cli config adapters --format json` 核对 `list-template`;只有 `build_status` 和 `submit_status` 都是 `supported` 时才允许 build/submit。
10
+ - 真实远端写入只能走 `bpmax-cli config list-template build/submit/create/delete/verify` typed adapter;不得用旧 `scripts/*.py`、raw API、页面 fetch、组件实例保存、终端 curl 或直接编辑 `think_*` 完成配置修改。
11
+ - `think_*` 本地镜像只允许做候选检索和结构参考;线上事实以 typed CLI export/readback/verify 和真实接口回读为准。
12
+ - 不读取或复用浏览器 Cookie、浏览器存储、手工请求头或旧脚本环境变量;不得打印、保存、提交、写入 issue/memory/log/artifact。
13
+ - `submit` 默认 dry-run 不算完成;真实提交必须使用精确 `--confirm "submit list-template <id>"`,并通过 base_hash/readback/verify。
14
+
15
+ ## 范围门禁
16
+ - 所有改动先归类为 `requested`、`required-collateral`、`out-of-scope`。
17
+ - 只有用户明确要求的 `requested`,或闭合需求不可避免的 `required-collateral`,才允许进入 work/submit/payload。
18
18
  - `required-collateral` 必须逐项解释“不改会坏/会失真/会不闭合”的原因并取得确认;`out-of-scope` 一律不得提交或顺手混入。
19
- - 不得以历史脏配置、顺手修复、统一风格、编辑器自动补字段、方便调试为理由修改需求外配置。
19
+ - 不得以历史脏配置、统一风格、编辑器自动补字段、方便调试为理由修改需求外配置。
20
20
 
21
21
  ## 何时使用
22
- - 用户已经在浏览器打开了 BPMAX 列表模板新建页或编辑页。
23
- - 用户要按自然语言需求新增、删除、调整列表列。
24
- - 用户希望直接复用当前登录态,不手动找 API Key。
25
- - 用户要让 Codex 通过真实后端接口完成提交,再回到编辑页或列表页核对结果。
26
-
27
- ## 前置条件
28
- - 用户必须先在浏览器打开以下任一页面:
29
- - `.../w:<workspace>/project_detail_table/create`
30
- - `.../w:<workspace>/project_detail_table/<id>`
31
- - 编辑现有模板时,优先使用页面当前已经打开的完整编辑页 URL,不要擅自裁掉查询参数。
32
- - 当前验证过的编辑页完整地址规则是:
33
- - `/w:<workspace>/project_detail_table/<id>?flow_type=<flow_type>&flow_key=<flow_key>&_rad=1&flowKey=flow:<flow_type>:<flow_key>`
34
- - 当 `flow_key` 为空字符串时,`flowKey` 仍然保留尾部冒号,例如:`flow:flow876464415:`
35
- - 如果手动从项目列表页跳转到编辑页,必须按上面的完整规则进入,不要只拼裸路径 `/w:<workspace>/project_detail_table/<id>`,否则可能进入字段未完整回填的空壳编辑页。
36
- - 如果是编辑现有模板,开始前必须确认页面里已经真实显示当前列标题,而不是只凭接口猜测。
37
- - 用户需要在请求里明确说明这次要做什么改动。
38
-
39
- ## Mem0 协议
40
- - 开始前先调用 [$bpmax-memory-protocol](../bpmax-memory-protocol/SKILL.md),检索词至少包含:
41
- - `flow_type`
42
- - `flow_key`
43
- - 列表模板 `id` / 模板名
44
- - 关键列名 / 数据集字段 / 图标 / 标签 / 操作列关键词
45
- - 优先查这些历史信息:
46
- - 同流程已有列表模板和列对象骨架
47
- - 某个字段做成图标列、状态列、图片列的已验证写法
48
- - 编辑页保存链路或列表页渲染的已知坑点
49
- - 完成接口回读、编辑页刷新确认,以及高风险场景下的列表页验收后,再写回真正可复用的结论:
50
- - `decision`:列对象选型、lint 规则、验收口径
51
- - `task_learning`:某类 `$template`、图标、图片预览、badge 或操作列的稳定写法
52
- - `anti_pattern`:接口 success 但回读不一致、错误 URL 进入空壳编辑页、脚本列在列表页报错
53
- - 不要把普通列顺序调整、颜色微调、整段列 JSON 原样写进 Mem0。
54
- - 如果停在“submit 已构建但未二次确认”“lint 未通过”“接口回读未通过”“编辑页或列表页未验收”等状态,结束前写 `session_state`。
55
-
56
- ## 核心原则
57
- - 开发前必须先通过真实线上接口确认当前环境的列表模板详情结构,而不是只看本地镜像或旧请求样例。
58
- - 只要用户反馈“项目列表没数据 / 暂无项目”,第一优先级先确认目标流程是否已经配置默认列表模板,而不是先把根因归到数据集、数据集字段或 ES 数据为空:
59
- - 优先检查流程详情里的 `table_list_template`
60
- - 或直接查 `GET /api/flow_page_template?flow_type=<flow_type>&type=1`
61
- - 若默认列表模板未配置,页面可能直接显示空态,甚至不会自动发起 `POST /bpmax/project/list`;这是列表页运行时行为观察,不是脚本生成模板的默认方案
62
- - 列表模板验收必须核对“列表列 -> 表单字段 -> 数据集字段”的一致性:
63
- - 列表中展示的业务列必须能在当前流程发起表单、节点表单或数据集字段中找到稳定来源。
64
- - 当表单字段 key、控件类型或数据集字段发生变化时,要同步检查列表列的 `$template` 是否仍读取正确 key。
65
- - 列表模板的 `data_set_id` 必须指向当前流程实际发布并可刷新的数据集;不能只因为列表接口有模板回读就判定通过。
66
- - 测试列表页时至少验证:字段列能渲染出真实数据、操作列可进入详情、筛选条件不会引用已删除或改名字段。
67
- - 逐列检查是强要求:每一列都要记录列名、读取 key 或脚本来源、对应表单/数据集字段、是否符合业务语义;不能只抽查前几列或只看模板整体成功。
68
- - 最终落库必须通过 `bpmax-cli config list-template submit` 完成,不回退成 `vm.save()`、旧脚本或 raw API 主路径。
69
- - 编辑态若出现“脚本 PUT success 但 readback 不一致”或涉及 `data_set_id` 切换等已知 false positive 风险,必须追加页面运行时复核,不能直接宣告成功。
70
- - 查询改写硬门禁:`config[]`、`customQuery`、`beforeSearch`、`tabFilters` 等查询位点里,不得把 `data_set_id` 当 ES dataset 查询入口;lint 命中后直接阻断提交。
71
- - 查询改写默认口径:
72
- - 前端脚本默认优先 `raw-es-search`
73
- - 后端 helper 默认优先 `ctx.$esQuery(...)` 或已验证的 `rootUser` helper
74
- - 脚本中禁止使用 `/bpmax/project/list` / 用户态 `ESProjectList`;涉及项目 ES 数据时必须使用 `raw-es-search` + `data_set_key`、后端 `ctx.$esQuery(...)` 或不依赖 project/list 的 helper
75
- - 只有明确需要“当前登录人可见项目列表”语义时,才允许例外使用 `/bpmax/project/list` / 用户态 `ESProjectList`,且脚本里必须写 `bpmax-allow-user-scope-project-list: <reason>`;否则 lint 阻断
76
- - 禁止把 `/bpmax/project/list` 返回的 `count` / `total` 当真实总数;该接口可能被 10000 上限截断,真实总数必须用 `raw-es-search` + `track_total_hits=true`
77
- - 禁止把复杂 SQL join 作为数据集联动默认方案;能按数据集字段查询时,必须把条件下推到 `raw-es-search` / `ctx.$esQuery(...)`
78
- - 禁止先拉取大批 ES 数据再在脚本里 `find` / `filter` / `some` 匹配;必须直接查询需要的数据并控制 `size`
79
- - 禁止把 `raw-es-search`、`ctx.$esQuery(...)`、`/bpmax/project/list` 放进逐条 SN / 项目 / 团队循环里形成 N+1;必须批量 terms、aggregation 或预计算
80
- - 默认主流程不是“在对话里手改 payload”,而是:
81
- - 线上详情导出到本地临时文件
82
- - 修改 `work`
83
- - 第一次确认
84
- - 构建 `submit`
85
- - 强制 lint
86
- - 第二次确认
87
- - typed CLI submit
88
- - 接口回读
89
- - 浏览器刷新编辑页
90
- - 高风险改动自动进入真实列表页验收
91
- - 浏览器实时线上页面、真实接口返回、当前页已登录授权上下文优先级高于本地 `think_*` 镜像;本地配置只用于检索候选和参考样例,不能覆盖线上事实。
92
- - 新建与编辑要严格区分:
93
- - 新建:`POST /api/flow_page_template`
94
- - 编辑:`PUT /api/flow_page_template/:id`
95
- - 如果任务是“继续修正刚创建的新模板”,不要再次沿用旧 sample 走 create 流程。
96
- - create 成功后要把新模板 `id` 视为后续唯一目标,后续迭代优先切到该 `id` 的编辑模式。
97
- - 否则很容易再次 `POST` 出第二个新模板,导致引用方仍指向旧 `template_id`,形成模板 ID 漂移。
98
- - 列表模板不是表单模板:
99
- - 不使用 `rule/value`
100
- - 不使用 `publish`
101
- - 主体是 `content: JSON.stringify({ level, config })`
102
-
103
- ## 完成标准
104
- - 低风险改动:
105
- - `readbackAccepted`
106
- - `editorPageAccepted`
107
- - 高风险改动:
108
- - `readbackAccepted`
109
- - `editorPageAccepted`
110
- - `listPageAccepted`
111
- - 高风险场景自动触发条件:
112
- - 脚本列
113
- - badge / 状态标签 / `ColorBackgroundText`
114
- - icon / 头像 / 颜色 / 单行溢出 / 列宽调整
115
- - 操作列按钮
116
- - 图片预览列
117
- - `data_set_id` 切换
118
-
119
- ## 工作流
120
-
121
- ### 1. 识别当前模式
122
- - 读取当前页 URL。
123
- - 如果 URL 以 `/project_detail_table/create` 结尾,按“新建”流程处理。
124
- - 如果 URL 形如 `/project_detail_table/<id>`,按“编辑”流程处理。
125
- - 如果 URL 已带 `flow_type`、`flow_key`、`_rad`、`flowKey` 查询参数,默认保留整条 URL 继续工作;不要自行归一化成裸路径。
126
- - 进入列配置构造前,先按流程、模板和目标列语义检索一次 Mem0。
127
-
128
- ### 2. 获取授权上下文
129
- - 先在浏览器里确认当前页面登录态,再把终端脚本需要的鉴权信息取出来。
130
- - 优先提取:
131
- - `document.cookie`
132
- - 当前页面最近一次同域接口请求头
133
- - 必要时补看 `localStorage` / `sessionStorage`
134
- - 默认把 Cookie 组装成 `BPMAX_COOKIE_HEADER` 供脚本使用:
135
-
136
- ```bash
137
- export BPMAX_BASE_URL='https://<your-bpmax-host>'
138
- export BPMAX_COOKIE_HEADER='foo=bar; baz=qux'
139
- export BPMAX_WORKSPACE='store_mgr'
140
- ```
141
-
142
- - `BPMAX_BASE_URL` 固定取当前浏览器页面 origin,或最近一次同域接口请求的 origin;不要把某个测试环境 URL 当成 skill 默认值。
143
-
144
- - 当前已确认:
145
- - `GET /api/flow_page_template/:id` 可直接读取详情
146
- - `/bpmax/data-set` 是真实可用的数据集读取路径
147
- - `/api/bpmax/data-set` 在当前同域上下文里会返回 403,不能作为默认事实来源
148
-
149
- ### 3. 先用真实线上接口确认详情结构
150
- - 编辑已有模板时,第一事实来源固定为:
151
- - `GET /api/flow_page_template/:id`
152
- - 新建模板时,必须先找到一个可复用模板或已验证样例,再用:
153
- - `GET /api/flow_page_template/:sampleId`
154
- - 把它当作 create skeleton 的真实格式样本
155
- - 当前环境至少要确认这些顶层字段:
156
- - `name`
157
- - `desc`
158
- - `data_set_id`
159
- - `flow_type`
160
- - `flow_key`
161
- - `type`
162
- - `content`
163
- - `status`
164
- - `content` 展开后至少包含:
165
- - `level`
166
- - `config`
167
- - 只要线上接口返回与本地镜像冲突,一律以线上接口为准。
168
-
169
- ### 3.1 检索候选模板
170
- - 如果当前症状是“项目列表页显示暂无项目”,在新建或编辑模板前先确认该流程是否已有默认列表模板:
171
- - 流程镜像中看 `flow.data.meta.table_list_template`
172
- - 线上看 `GET /api/flow_page_template?flow_type=<flow_type>&type=1`
173
- - 没有默认列表模板时,先把它视为根因候选;不要跳过这一步直接排查数据集
174
- - 只要需求涉及“新建列表模板”“给流程配一套列表列”“参考已有列表模板改一个版本”,先在当前已激活配置仓库检索 `think_flow_page_template`。
175
- - 检索方式优先:
176
- - 模板名称
177
- - 流程 `flow_type`
178
- - 数据集相关关键词
179
- - 列标题关键词
180
- - 在没有得到用户确认前,不要直接新建一个语义重复的新列表模板。
181
-
182
- ### 3.2 导出到本地临时文件
183
- - 锁定目标模板后,默认先导出到 `.codex/tmp/list-template-editor/`,不要直接在对话里手拼 payload。
184
- - 编辑已有模板:
185
-
186
- ```bash
187
- export BPMAX_BASE_URL='https://<your-bpmax-host>'
188
- PYTHON_BIN=./venv/bin/python
189
- [[ -x "$PYTHON_BIN" ]] || PYTHON_BIN=./.venv/bin/python
190
- [[ -x "$PYTHON_BIN" ]] || PYTHON_BIN=python
191
-
192
- "$PYTHON_BIN" .codex/skills/bpmax-list-template-editor/scripts/export_list_template.py \
193
- --template-id 954573650 \
194
- --workspace store_mgr \
195
- --cookie-header "$BPMAX_COOKIE_HEADER"
196
- ```
197
-
198
- - 基于线上样例创建 skeleton:
199
-
200
- ```bash
201
- export BPMAX_BASE_URL='https://<your-bpmax-host>'
202
- "$PYTHON_BIN" .codex/skills/bpmax-list-template-editor/scripts/export_list_template.py \
203
- --create-skeleton \
204
- --sample-template-id 954573650 \
205
- --workspace store_mgr \
206
- --cookie-header "$BPMAX_COOKIE_HEADER"
207
- ```
208
-
209
- - 如果当前任务涉及数据集字段映射或切换数据集,还必须取实时数据集列表:
210
-
211
- ```bash
212
- export BPMAX_BASE_URL='https://<your-bpmax-host>'
213
- "$PYTHON_BIN" .codex/skills/bpmax-list-template-editor/scripts/fetch_data_set.py \
214
- --stem 954573650 \
215
- --flow-type flow441098230 \
216
- --flow-key '' \
217
- --workspace store_mgr \
218
- --cookie-header "$BPMAX_COOKIE_HEADER"
219
- ```
220
-
221
- ### 3.3 本地 work 文件结构
222
- - `work/<stem>.json` 是唯一允许人工修改的主文件,结构固定为:
223
- - `id`
224
- - `mode`
225
- - `sampleTemplateId`
226
- - `basic`
227
- - `content`
228
- - `meta`
229
- - `basic` 保存顶层业务字段:
230
- - `name`
231
- - `desc`
232
- - `data_set_id`
233
- - `flow_type`
234
- - `flow_key`
235
- - `type`
236
- - `status`
237
- - `content` 保存对象态的:
238
- - `level`
239
- - `config`
240
- - `meta` 至少保留:
241
- - `previousDataSetId`
242
- - `sourceTemplateId`
243
- - `riskHints`
244
- - 用户只改对象态结构,不直接手写字符串化 `content`。
245
-
246
- ### 3.4 第一次确认
247
- - 修改 `work/<stem>.json` 后,先向用户展示 `diffs/<stem>.work.diff.txt` 的关键差异。
248
- - 明确询问“work 文件是否正确”。
249
- - 用户确认后,记录 work 确认状态:
250
-
251
- ```bash
252
- "$PYTHON_BIN" .codex/skills/bpmax-list-template-editor/scripts/confirm_list_template.py \
253
- --stem 954573650 \
254
- --stage work \
255
- --actor codex
256
- ```
257
-
258
- - 没有明确确认前,不得构建 submit 文件。
259
-
260
- ### 4. 构造 submit 文件
261
- - `submit/<stem>.json` 只能通过脚本从 `work/<stem>.json` 构建,不能手写。
262
- - 默认命令:
263
-
264
- ```bash
265
- "$PYTHON_BIN" .codex/skills/bpmax-list-template-editor/scripts/build_submit_payload.py \
266
- --stem 954573650
267
- ```
268
-
269
- - 构建规则固定为:
270
- - 顶层只保留真实需要的提交字段:`name/desc/data_set_id/flow_type/flow_key/type/content`
271
- - `create` 模式额外补 `status`
272
- - `content` 必须由脚本统一转成 `JSON.stringify({ level, config })`
273
- - `content.config` 必须仍是数组
274
-
275
- ### 5. 强制 lint 门禁
276
- - 在第二次确认和正式提交前,必须先跑 lint:
277
-
278
- ```bash
279
- "$PYTHON_BIN" .codex/skills/bpmax-list-template-editor/scripts/lint_list_template_semantics.py \
280
- --stem 954573650 \
281
- --workspace store_mgr \
282
- --cookie-header "$BPMAX_COOKIE_HEADER"
283
- ```
284
-
285
- - lint 结果分两层,但都属于严格阻断:
286
- - `errors`
287
- - `style_errors`
288
- - 命中以下任一问题就禁止继续:
289
- - `content` 不是对象态,或 `config` 不是数组
290
- - 列对象存在未允许字段,或混入表单模板字段
291
- - `createElement.children.$template` / `eval` 结构非法
292
- - 操作列在列根配置了 `icon` / `iconColor`
293
- - 操作列任一按钮未配置按钮级 icon
294
- - 操作列缺少“详情/查看”或“删除/移除”动作
295
- - 删除/移除动作没有基于项目状态、当前环节或步骤状态的可用性 guard;默认只允许刚创建、未推进到第一个节点后的项目删除,过了第一个节点就不能删除
296
- - `icon` 不是完整 `ri ri_*`
297
- - 普通数据列带 `icon` 的列数少于 1 列或多于 3 列
298
- - `iconColor` 不符合规范
299
- - 涉及到人的列未渲染头像
300
- - 长文本列未配 `showOverflowTooltip`
301
- - 固定宽度只写了 `width` 或只写了 `minWidth`
302
- - 日期字段没有按 `YYYY-MM-DD` 规范处理
303
- - HTML 字符串 badge 未使用已验证组件/结构
304
- - `data_set_id` 不存在于实时数据集列表
305
- - 模板里引用了当前数据集不存在的字段 key
306
- - 切换 `data_set_id` 后保留了失效字段引用
307
- - 已知限制:
308
- - 这套 lint 目前按“当前 `data_set_id` 的字段集合”做静态校验。
309
- - “人的列必须有头像”当前按列标题关键词和渲染结构做启发式识别,例如:`负责人` / `申请人` / `发起人` / `创建人` / `审批人` / `处理人` / `人员`。
310
- - 如果列表模板实际运行在 `project/sub`、详情页子流程表格、或其他非纯 ES dataset 返回结构上,运行态可能还会额外提供 `metaForm`、`current_step` 等对象;这类引用在页面上可能可用,但 lint 仍可能报“字段不存在”。
311
- - 遇到这类报错时,不要先假设模板写法错了,先确认当前列表真实数据源到底是 ES 列表还是 `project/sub`。
312
-
313
- ### 6. 第二次确认
314
- - lint 通过后,向用户展示 `submit/<stem>.json` 摘要和 `diffs/<stem>.submit.diff.txt`,再次明确询问“submit 文件是否正确”。
315
- - 用户确认后,再记录 submit 确认状态:
316
-
317
- ```bash
318
- "$PYTHON_BIN" .codex/skills/bpmax-list-template-editor/scripts/confirm_list_template.py \
319
- --stem 954573650 \
320
- --stage submit \
321
- --actor codex
322
- ```
323
-
324
- - 没有 lint 通过或没有第二次明确确认前,不得执行提交脚本。
325
-
326
- ### 7. Typed CLI 提交与接口回读
327
- - 正式提交统一走:
328
-
329
- ```bash
330
- bpmax-cli config list-template submit \
331
- --id 954573650 \
332
- --payload .codex/tmp/list-template-editor/submit/list-template-954573650.json \
333
- --confirm "submit list-template 954573650"
334
- ```
335
-
336
- - 旧 `submit_list_template.py` 只保留为结构参考,默认会硬失败。
337
- - 不得直接调用 `POST/PUT /api/flow_page_template`。
338
- - 提交后脚本必须自动生成:
339
- - `result/<stem>.response.json`
340
- - `result/<stem>.readback.json`
341
- - `result/<stem>.readback.diff.txt`
342
- - `result/<stem>.verify.json`
343
- - `result/<stem>.acceptance.json`
344
- - 回读验收至少检查:
345
- - 顶层字段:`name/desc/data_set_id/flow_type/flow_key/type`
346
- - `content.level`
347
- - `content.config[]`
348
- - 列标题顺序
349
- - 若 `readback` 不一致,或涉及 `data_set_id` 切换、已知 false positive 场景,必须追加页面运行时复核,不能直接宣布完成。
350
- - 如果列表模板被别的模板通过 `template_id` 引用,提交后还要回到引用方页面确认引用 ID 是否已经切到这次实际生效的新模板 ID。
351
-
352
- ### 8. 刷新浏览器编辑页验收
353
- - 提交成功后,必须刷新对应编辑页,让用户做最终确认。
354
- - 编辑:
355
- - 刷新当前 `/w:<workspace>/project_detail_table/<id>`
356
- - 新建:
357
- - 用返回的新 `id` 打开 `/w:<workspace>/project_detail_table/<newId>`
358
- - 编辑页验收口径:
359
- - 新字段或新列标题已出现
360
- - 目标列顺序符合预期
361
- - 数据集绑定修改已回填到页面
362
- - 验收后记录:
363
-
364
- ```bash
365
- "$PYTHON_BIN" .codex/skills/bpmax-list-template-editor/scripts/record_acceptance.py \
366
- --stem 954573650 \
367
- --editor-page-accepted
368
- ```
369
-
370
- ### 9. 高风险自动列表页验收
371
- - 命中高风险条件时,必须继续打开真实列表页:
372
- - `/w:<workspace>/project?flow_type=<flow_type>&flow_key=<flow_key>`
373
- - 至少检查:
374
- - 目标列是否真实出现在列表页
375
- - 图标、头像、badge、单行溢出、列宽是否符合预期
376
- - 控制台是否出现模板引入的 `eval fn parsed failed`、`TypeError` 等错误
377
- - 数据集切换后列表是否仍正常渲染
378
- - 验收后记录:
379
-
380
- ```bash
381
- "$PYTHON_BIN" .codex/skills/bpmax-list-template-editor/scripts/record_acceptance.py \
382
- --stem 954573650 \
383
- --list-page-accepted
384
- ```
385
- - 高风险验收未通过时,skill 不允许宣告完成。
386
-
387
- ## 列对象与结构约束
388
- - 每个列对象至少可能包含:
389
- - `title`
390
- - `props`
391
- - `createElement`
392
- - `icon`
393
- - `iconColor`
394
- - `isSort`
395
- - `sortConf`
396
- - `preset`
397
- - 如果需求是“把某个数据集字段加成一列”,优先按前端 `FieldSelector` 的结构生成:
398
- - `title` 使用字段名
399
- - `createElement.children.$template` 使用 `ctx.<dataSetFieldKey>`
400
- - `createElement.children.eval = true`
401
- - 图标规则:
402
- - 操作列列根不要配置 `icon` / `iconColor`
403
- - 操作列的每个操作按钮前面都要带 icon
404
- - 操作列必须包含详情/查看动作和删除/移除动作
405
- - 删除/移除动作必须有条件 guard,依据项目状态、当前环节或步骤状态控制是否可用;默认语义是“刚创建/未推进可以删除,过了第一个节点不可删除”
406
- - 普通数据列至少 1 列带 icon,最多 3 列带 icon
407
- - 列表列 icon 和操作按钮 icon 都必须写完整 class:`ri ri_*`
408
- - 默认优先统一浅灰色:`#D6DCE5`
409
- - 人员列规则:
410
- - 涉及到人的列必须渲染头像,不允许只显示姓名文本
411
- - 默认优先使用 `el-avatar + span` 的“头像 + 名称”结构
412
- - 多人列也必须带头像,至少要有稳定的头像渲染节点,而不是纯 `name.join(',')`
413
- - 空值兜底:
414
- - 简单字段列推荐写法:`ctx.xxx || '--'`
415
- - 日期字段默认只显示 `YYYY-MM-DD`
416
- - 长文本列优先加 `showOverflowTooltip: true`
417
- - 列宽规则:
418
- - 用户明确要求固定宽度时,默认同时写 `props.width` 和 `props.minWidth`
419
- - 不要把表单模板概念混进列表模板:
420
- - 不使用 `rule`
421
- - 不使用 `value`
422
- - 不使用 `field_type`
423
- - 不使用 `publish`
22
+ - 用户需要通过 bpmax-cli typed config 创建、编辑、复制、删除或验证 BPMAX 列表模板。
23
+ - 用户要按自然语言需求新增、删除、排序或调整列表列、操作列、图标列、人员列、badge、图片预览列。
24
+ - 用户反馈“项目列表没数据 / 暂无项目 / 列不显示 / 操作列不可用”,需要确认默认列表模板、数据集字段映射和运行态列表页。
25
+ - 用户要让 Codex 完成配置提交,再用接口回读和真实用户身份的只读列表页核对结果。
26
+
27
+ ## 标准闭环
28
+ 1. 读取 [$bpmax-memory-protocol](../bpmax-memory-protocol/SKILL.md):检索 `flow_type`、`flow_key`、模板 id/名称、关键列名、数据集字段、图标、操作列关键词。
29
+ 2. 确认 CLI 上下文:`bpmax-cli config adapters --format json`、profile、capability、目标模板 id 或 create/copy/delete 模式。
30
+ 3. 导出线上最新:
31
+ ```bash
32
+ bpmax-cli config list-template export --id <id> --out .codex/tmp/list-template-editor --profile <profile> --format json
33
+ ```
34
+ 4. 若涉及字段映射或切换数据集,先导出当前数据集/字段并逐列对齐“列表列 -> 表单字段 -> 数据集字段”。
35
+ 5. 只修改 `work/<file>.json`;用户确认 work diff 前不得 build submit。
36
+ 6. 运行 typed CLI lint/impact/build:
37
+ ```bash
38
+ bpmax-cli config list-template lint --work .codex/tmp/list-template-editor/work/<file>.json --profile <profile> --format json
39
+ bpmax-cli config list-template impact --raw .codex/tmp/list-template-editor/raw/<file>.json --work .codex/tmp/list-template-editor/work/<file>.json --out .codex/tmp/list-template-editor/result/<file>.impact.json --profile <profile> --format json
40
+ bpmax-cli config list-template build --work .codex/tmp/list-template-editor/work/<file>.json --meta .codex/tmp/list-template-editor/meta/<file>.meta.json --out .codex/tmp/list-template-editor/submit/<file>.json --impact-report .codex/tmp/list-template-editor/result/<file>.impact.json --profile <profile> --format json
41
+ ```
42
+ 列字段、读取 key、`data_set_id`、格式化/操作脚本或模板绑定变化时,必须检查数据集、筛选器、导航和 E2E 引用;未确认的联动项不得 build。
43
+ 权限、角色、产品范围、组织范围、GTM 范围或操作按钮权限脚本发生变化时,还必须提供 `--boundary-manifest <file>`。manifest 使用 `schema_version=1`、`change_type=list-template-permission`,并列出 `allowed_paths`、`allowed_functions`、`forbidden_paths` 和具体 `rationale`;越界 diff 会阻断 build。
44
+ 7. 展示 work diff、submit diff、lint 摘要、字段映射摘要和高风险验收计划;用户二次确认 submit 后才能提交。
45
+ 8. typed CLI submit/create/delete:
46
+ ```bash
47
+ bpmax-cli config list-template submit --id <id> --payload .codex/tmp/list-template-editor/submit/<file>.json --profile <profile> --confirm "submit list-template <id>" --format json
48
+ bpmax-cli config list-template submit --id create:list-template --payload .codex/tmp/list-template-editor/submit/<create-file>.json --profile <profile> --confirm "submit list-template create:list-template" --format json
49
+ bpmax-cli config list-template delete --id <id> --profile <profile> --confirm "delete list-template <id>" --format json
50
+ ```
51
+ 当 build 产物标记 `list_template_safety.submit_gate.validation_required=true` 时,submit 还必须传 `--validation-report <file>`:`permission_matrix` 类型按权限/高风险矩阵校验。只有经过审计的紧急情形可用 `--override-reason "<具体原因>"` 绕过;覆盖原因会进入 dry-run 和执行回执,不能用空泛文案代替证据。
52
+ 当 build 产物标记 `list_template_safety.presentation_only=true`(只改了 `width`/`minWidth`/`align`/`headerAlign`/`showOverflowTooltip`/`fixed`/`sortable`/`className` 这类展示属性)时,不要求权限矩阵,改为要求 `column_width_runtime_check` 类型的 `--validation-report`:`schema_version=1`、`result="pass"`、绑定 `template_id`/`profile`/`submit_payload_hash`、声明 `template_data_columns`(该模板数据列总数)、`columns[]` 每列显式写 `truncated: true|false`,且测量列数必须≥`template_data_columns`。任一列仍截断即失败。
53
+ build 产物里的 `list_template_warnings`(列宽按语义偏窄、下钻链接未带行上下文、guard 硬编码环节名)是必须先看的告警:lint 会报,但只走 build→submit 时也会随 `list_template_safety.warnings` 输出。
54
+ 9. 提交后必须 `verify/readback`,确认顶层字段、`content.level`、`content.config[]`、列标题顺序、关键 `$template` 和数据集字段引用一致。
55
+ 10. 高风险改动必须以真实用户身份打开运行态列表页,只读验证目标列、操作按钮、图标/头像/badge/图片预览、筛选和 console/network 错误;不得把接口提交伪装成页面回归。
56
+
57
+ ## 核心配置门禁
58
+ - 任何 icon 选择或修改前,必须先读取 `../bpmax-icon-catalog/SKILL.md` 并运行 `bpmax-cli icon search/get/validate`;只使用 catalog 返回的完整 class。
59
+ - 列表模板是 `flow_page_template.type = 1`,主体是 `content: JSON.stringify({ level, config })`;不是表单模板,不使用 `rule/value/field_type/publish`。
60
+ - 当项目列表为空时,先查流程 `meta.table_list_template` 和 `GET /api/flow_page_template?flow_type=<flow_type>&type=1`,不要直接归因到 ES 数据为空。
61
+ - 列表模板 `data_set_id` 必须指向当前流程实际发布并可刷新的数据集;切换数据集后必须重新检查所有字段 key。
62
+ - 列表模板验收必须核对“列表列 -> 表单字段 -> 数据集字段”的一致性。
63
+ - 每一列都要记录:列名、读取 key 或脚本来源、对应表单/数据集字段、业务语义、是否需要运行态验收;不能只抽查。
64
+ - 每个关键业务列必须声明可审计的 field contract:`required_nonempty`、`allowed_empty_reason`、`source_dataset_field`、`detail_consistency`、`runtime_evidence`、`icon_token`。`icon_token` 同时记录已确认的 icon class 与颜色 token;不得把任意 hex 颜色当成已确认 token。
65
+ - 用 `bpmax-cli config list-template runtime-check --evidence <file> --profile <profile> --format json` 校验 field contract。关键列源值为空、映射缺失、索引陈旧、列表/详情不一致、运行态证据缺失或 icon token 不一致时必须保持 `partial` / `blocked`,不得用 lint、HTTP 200 或单张页面截图宣告完成。
66
+ - 逐列检查是强要求;新增、删除、移动、重命名或改脚本列时,都要说明该列为什么属于 `requested` 或 `required-collateral`。
67
+ - 查询脚本不得把 `data_set_id` 当 ES dataset 查询入口;使用 `raw-es-search` / `ctx.$esQuery(...)` 时必须用 `data_set_key` 或已验证 helper。
68
+ - 默认禁止 `/bpmax/project/list`、用户态 `ESProjectList`、大批 ES 数据前端 `find/filter/some`、逐条循环里查 ES 或 SQL join;确需用户可见项目列表时必须写明 `bpmax-allow-user-scope-project-list: <reason>`。
69
+
70
+ ## 本地文件与状态机
71
+ - 所有临时产物固定写到 `.codex/tmp/list-template-editor/`,包括 `raw/`、`work/`、`meta/`、`submit/`、`diffs/`、`result/`。
72
+ - `work/<file>.json` 是唯一允许人工修改的主文件;`submit/<file>.json` 只能由 typed CLI build 生成。
73
+ - `exported`:只允许分析和编辑 work,不允许 build。
74
+ - `work_confirmed`:用户已确认 work diff,允许 build。
75
+ - `submit_built`:submit 已生成,必须先 lint。
76
+ - `lint_passed`:允许展示 submit diff 并请求第二次确认。
77
+ - `submit_confirmed`:允许 typed CLI submit/create/delete。
78
+ - `submitted`:必须继续 verify/readback;命中高风险条件时继续真实列表页验收。
79
+ - 任意 work/submit 变化都会让旧确认、旧 lint、旧验收失效。
80
+
81
+ ## Lint 阻断项
82
+ - `content` 不是对象态,或 `content.config` 不是数组。
83
+ - 列对象混入表单模板字段,或 `createElement.children.$template` / `eval` 结构非法。
84
+ - 操作列缺详情/查看动作、缺删除/移除动作、删除动作无权限 guard、按钮缺 icon、列根误配 `icon/iconColor`。
85
+ - 删除 guard 使用 `current_flow_step_id/name` 为空作为前置条件,或 `disabled` 权限极性写反。
86
+ - `icon` 不是完整 `ri ri_*`,普通图标列数量少于 1 或多于 3。
87
+ - 人员列没有头像,长文本固定列没有溢出提示,或所有数据列都写死 `width`、没有至少一个自适应列。
88
+ - 日期字段没有按 `YYYY-MM-DD` 处理,HTML badge 未使用已验证组件/结构。
89
+ - `data_set_id` 不存在于实时数据集列表,或模板引用当前数据集不存在的字段 key。
90
+ - 切换 `data_set_id` 后仍保留旧字段引用。
91
+ - 查询脚本命中 `data_set_id` ES 入口、project/list、N+1、前端大批量过滤或 SQL join 反模式。
92
+
93
+ ## 验收分级
94
+ - 低风险改动至少需要 `readbackAccepted` 和 `editorPageAccepted`。
95
+ - 高风险改动至少需要 `readbackAccepted`、`editorPageAccepted`、`listPageAccepted`。
96
+ - 权限类高风险改动必须覆盖以下矩阵维度,并在一个 `schema_version=1`、`result=pass` 的验证报告中绑定 `template_id`、`profile`、`submit_payload_hash`、`checked_at`:
97
+ - 账号:`no_view`、`view_only`、`full_access`、`multi_role_union`;
98
+ - 范围:`all`、`specified`、`gtm_organization_intersection`,并记录组织范围;
99
+ - 行来源:`native`、`synthetic`;
100
+ - 页面路径:`first_entry`、`menu_return`、`refresh`、`filter`、`clear_filter`、`no_results`、`pagination`。
101
+ - 每个权限场景必须记录 `expected_count`、`actual_count`、关键 `buttons`、`column_samples` 和 `final_state.loading/table/empty`。运行 `bpmax-cli config list-template smoke --evidence <report> --format json`,只有行数一致、按钮可见性符合权限、列值未异常同值且三态互斥时才算通过。
102
+ - 高风险触发条件包括:脚本列、badge/状态标签、icon/头像/颜色/单行溢出/列宽、操作列按钮、图片预览列、`data_set_id` 切换。
103
+ - 编辑页只做只读回显确认:新字段或新列标题已出现、目标列顺序符合预期、数据集绑定已回填。
104
+ - 运行态列表页必须证明目标列真实渲染、操作列可进入详情;有 `project.delete` 权限的管理员或有 `project.delete.my` 且为创建人的用户可见并能真实删除,无权限用户不可删除;筛选条件不引用已删除字段。
105
+ - 运行态证据必须逐个关键字段绑定真实列表行、对应详情值和索引/数据集值,并回填 field contract;图标列还必须记录实际 icon class 与颜色 token。只证明“页面有行”不等于关键字段验收通过。
106
+ - 如果接口 readback 成功但页面不一致,按页面运行态缺陷继续排查,不能只看 200 或 hash 宣告完成。
107
+
108
+ ## 操作列与视觉 lint
109
+ - 操作列必须包含详情/查看动作和删除/移除动作。
110
+ - 删除/移除动作必须有权限 guard,首选 `if: { $template: "{return ctx.$CAN_DELETE}", eval: true }`;`$CAN_DELETE` 已封装 `project.delete`,以及 `project.delete.my + 当前用户是创建人` 的平台权限语义。
111
+ - 必须显式展开等价权限时,列表创建人字段只使用平台实际传入的 `ctx.__owner_id`,并与 `ctx.$USER_INFO.id` 比较;不得改用列表上下文不保证存在的 `project.owner.id` 或 `__project_owner.id`。
112
+ - 若使用 `disabled`,必须反向写成 `return !ctx.$CAN_DELETE`;不得把 `confirm`、`onClick` 或事件脚本当成权限 guard。
113
+ - 项目状态可以作为额外业务限制,但不能替代权限 guard;禁止要求 `current_flow_step_id/name` 为空,创建即进入首节点的流程会使该条件恒为 false。
114
+ - 操作列列根不得配置 `icon` / `iconColor`;每个操作按钮必须带按钮级 icon。
115
+ - icon 必须写完整且存在于 catalog 的 class:`ri ri_<name-with-hyphens>`,例如 `ri ri_bank-line`;普通数据列至少 1 列、最多 3 列带 icon。
116
+ - 人员列必须渲染头像,优先 `el-avatar + span`;只显示姓名文本不合格。
117
+ - 至少一个非操作数据列必须自适应:不写 `props.width`,可用 `props.minWidth` 保证最低可读宽度;操作/选择/序号列不计入自适应列。
118
+ - 固定数据列可只写 `width`;需要同时约束下限时再写 `minWidth`,并保证 `minWidth <= width`。标题必须能在列宽内完整展示,禁止 `auto`、百分比、非正数等不可验证宽度。
119
+ - 备注、描述、内容、原因、意见、地址、标题等长文本列使用固定宽度时必须提供完整内容提示;优先 `props.showOverflowTooltip: true`,也接受已验证的 `attribute.title` 或 tooltip/popover;日期默认显示 `YYYY-MM-DD`。
120
+ - HTML badge、复杂脚本列、图标/头像、操作列、图片预览、`data_set_id` 切换都属于高风险,默认进入真实列表页验收。
121
+
122
+ ## 必读 Reference 路由
123
+ - 主流程、临时文件状态机和旧经验归档:`references/local-temp-workflow.md`、`references/full-detail-guide.md`。
124
+ - 接口形态和历史请求骨架:`references/list-template-api-workflow.md`,只作契约说明,不是写入路径。
125
+ - `content.config[]` 列对象、操作列、icon/头像/badge 结构:`references/content-config-shape.md`、`references/special-formats.md`。
126
+ - 数据集字段映射和逐列对齐:`references/dataset-field-mapping.md`、`references/payload-checklist.md`。
127
+ - 编辑页/列表页只读验收、运行态诊断:`references/browser-page-contract.md`、`references/runtime-verified-workflow.md`。
128
+
129
+ ## 旧脚本边界
130
+ - `scripts/confirm_list_template.py`、`scripts/build_submit_payload.py`、`scripts/lint_list_template_semantics.py` 只作为历史结构/lint 参考。
131
+ - `scripts/submit_list_template.py` 默认硬失败;不得把它描述为可用提交路径。
132
+ - 如果 reference 中出现历史 `POST/PUT /api/flow_page_template`、`vm.$axios`、`fetch` 或页面实例保存写法,只能用于理解契约,不得作为 Agent 执行方案。
133
+ - 新能力和新 lint 必须沉淀到 TypeScript typed CLI 或 tests 中,不新增 Python 写入主路径。
424
134
 
425
135
  ## 输出要求
426
- - 明确告诉用户这次是“新建”还是“编辑”。
427
- - 如果做过现有模板检索,要先汇报候选模板并说明是否已得到用户确认。
428
- - 明确告诉用户本次用到的核心 typed CLI 命令:
429
- - `bpmax-cli config list-template export`
430
- - `bpmax-cli config list-template lint`
431
- - `bpmax-cli config list-template build`
432
- - `bpmax-cli config list-template submit`
433
- - `bpmax-cli config list-template verify`
434
- - 如果引用了旧来源脚本,只能说明它们用于结构参考或本地 lint,不得把旧 `submit_list_template.py` 描述为提交路径。
435
- - 必须说明:
436
- - `work` 是否已确认
437
- - lint 是否已通过
438
- - `submit` 是否已确认
439
- - 接口回读是否通过
440
- - 浏览器编辑页是否已刷新确认
441
- - 若命中高风险条件,真实列表页是否已验收
442
-
443
- ## 参考资料
444
- - 创建/编辑接口与内容结构: [references/list-template-api-workflow.md](./references/list-template-api-workflow.md)
445
- - `content.config[]` 形态与列对象模型: [references/content-config-shape.md](./references/content-config-shape.md)
446
- - 提交前的 payload 检查清单: [references/payload-checklist.md](./references/payload-checklist.md)
447
- - 当前页面与前端实现对应关系: [references/browser-page-contract.md](./references/browser-page-contract.md)
448
- - 数据集字段映射列的生成规则: [references/dataset-field-mapping.md](./references/dataset-field-mapping.md)
449
- - 运行时验证过的页面操作方式: [references/runtime-verified-workflow.md](./references/runtime-verified-workflow.md)
450
- - 当前已确认可用的特殊格式清单: [references/special-formats.md](./references/special-formats.md)
451
- - 本地临时文件闭环: [references/local-temp-workflow.md](./references/local-temp-workflow.md)
452
-
453
- ## 关键经验
454
- - 编辑态最终仍要 typed CLI 提交,但对“接口 success、回读不一致”的场景必须提高警惕,不能只看 200。
455
- - 数据集读取必须走 `/bpmax/data-set`;新增字段列和切换数据集时,实时数据集列表是唯一事实来源。
456
- - 图标 class 必须完整,不能写成 `ri_file-text-line` 这种半截格式。
457
- - 操作列列根配置 `icon` / `iconColor` 或任一按钮缺少 icon 都视为 lint 阻断项;普通列按“至少 1 列、最多 3 列”控制 icon 覆盖数量。
458
- - 涉及到人的列必须带头像,优先复用 `el-avatar + span`;只写姓名文本视为 lint 阻断项。
459
- - 固定宽度必须同时写 `width` 和 `minWidth`。
460
- - HTML 字符串 badge、复杂脚本列、图标和操作列都属于高风险改动,默认必须进真实列表页验收。
461
-
462
-
463
- ## bpmax-cli 统一执行入口
464
-
465
- 本 npm 分发版必须优先使用 typed CLI 命令,不要让 Agent 直接拼 raw API 或直接运行旧来源脚本提交配置:
466
-
467
- ```bash
468
- bpmax-cli config list-template export --id <id> --out .codex/tmp/list-template-editor
469
- bpmax-cli config list-template lint --work .codex/tmp/list-template-editor/work/<file>.json
470
- bpmax-cli config list-template build --work .codex/tmp/list-template-editor/work/<file>.json --meta .codex/tmp/list-template-editor/meta/<file>.meta.json --out .codex/tmp/list-template-editor/submit/<file>.json
471
- bpmax-cli config list-template submit --id <id> --payload .codex/tmp/list-template-editor/submit/<file>.json
472
- bpmax-cli config list-template submit --id <id> --payload .codex/tmp/list-template-editor/submit/<file>.json --confirm "submit list-template <id>"
473
- bpmax-cli config list-template verify --id <id> --expect .codex/tmp/list-template-editor/work/<file>.json
474
- ```
475
-
476
- 授权前置:当前 profile 必须通过校对码授权,并在授权页开启“配置能力”。如果 CLI 返回 capability 缺失,停止并让用户使用有管理权限的账号重新授权。
477
-
478
- 旧来源中的 `scripts/` 和 `references/` 只作为字段结构、lint 规则和验收规则参考;真实远端写操作必须走 `bpmax-cli config list-template submit`,保留 dry-run、二次确认、审计和回读验证。
136
+ - 明确本次是 `edit` / `create` / `copy` / `delete` / `preview-only`。
137
+ - 列出 `requested`、`required-collateral`、`out-of-scope` 和目标模板、`data_set_id`、`flow_type`、`flow_key`。
138
+ - 汇报本次用到的 typed CLI 命令:export、lint、impact、build、submit、verify。
139
+ - 汇报 impact 报告中的已检查引用、`required-collateral`、未验证面和下一步建议;统一规则见 `../bpmax-builder-shared/configuration-impact-review.md`。
140
+ - 汇报逐列映射表:列名、模板读取、表单/数据集来源、业务语义、风险级别。
141
+ - 明确 `work` 是否确认、lint 是否通过、`submit` 是否确认、接口回读是否通过、真实列表页是否验收。
142
+ - 如发现 bpmax-cli 自身 lint/submit/readback 行为异常,可按 [$bpmax-cli](../bpmax-cli/SKILL.md) 的 issue 规则记录 CLI 缺陷;不要把客户配置缺陷误报为 CLI issue。
143
+ - 若未提交,只能输出待确认 work/submit 与下一步命令;不得暗示线上配置已经生效。
144
+ - 若用户明确要求重新验收,必须重新打开当前运行态列表页取新证据,不得复用旧截图或旧报告。
145
+ - 若没有完成真实提交或真实页面验收,必须说明当前停在哪个 gate,不能宣告配置完成。