bpmax-cli 0.1.44 → 0.2.1-beta.10
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 +79 -5
- package/dist/bin.js +14430 -2672
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
- package/scripts/install-skills.mjs +98 -0
- package/skills/bpmax-ai-taskbook/SKILL.md +230 -0
- package/skills/bpmax-ai-taskbook/agents/openai.yaml +3 -0
- package/skills/bpmax-ai-taskbook/references/taskbook-template.md +68 -0
- package/skills/bpmax-api-platform-editor/SKILL.md +321 -0
- package/skills/bpmax-api-platform-editor/agents/openai.yaml +4 -0
- package/skills/bpmax-api-platform-editor/references/api-doc-debug-workflow.md +34 -0
- package/skills/bpmax-api-platform-editor/references/api-proxy-shape.md +41 -0
- package/skills/bpmax-api-platform-editor/references/instance-config-shape.md +41 -0
- package/skills/bpmax-api-platform-editor/references/platform-api-map.md +52 -0
- package/skills/bpmax-api-platform-editor/references/runtime-workflow.md +32 -0
- package/skills/bpmax-api-platform-editor/scripts/api_platform_editor_common.py +1276 -0
- package/skills/bpmax-api-platform-editor/scripts/build_submit_payload.py +64 -0
- package/skills/bpmax-api-platform-editor/scripts/capture_write_contract.py +40 -0
- package/skills/bpmax-api-platform-editor/scripts/export_layer_bundle.py +212 -0
- package/skills/bpmax-api-platform-editor/scripts/record_doc_debug_acceptance.py +62 -0
- package/skills/bpmax-api-platform-editor/scripts/submit_and_verify_layer.py +75 -0
- package/skills/bpmax-api-platform-editor/tests/test_api_platform_editor.py +287 -0
- package/skills/bpmax-approval-matrix/SKILL.md +90 -0
- package/skills/bpmax-auth/SKILL.md +6 -17
- package/skills/bpmax-blueprint-doc-workflow/SKILL.md +87 -0
- package/skills/bpmax-blueprint-doc-workflow/agents/openai.yaml +4 -0
- package/skills/bpmax-blueprint-doc-workflow/references/blueprint-structure.md +60 -0
- package/skills/bpmax-blueprint-doc-workflow/references/per-flow-required-structure.md +98 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-forbidden-term.xml +12 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-mermaid-codeblock.xml +12 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-boundary.xml +10 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-whiteboard.xml +10 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-pass.xml +55 -0
- package/skills/bpmax-blueprint-doc-workflow/scripts/lint_blueprint_doc.py +257 -0
- package/skills/bpmax-builder-shared/SKILL.md +44 -0
- package/skills/bpmax-builder-shared/base_url.py +81 -0
- package/skills/bpmax-builder-shared/runtime-script-site-matrix.json +71 -0
- package/skills/bpmax-builder-shared/runtime-script-site-matrix.md +34 -0
- package/skills/bpmax-builder-shared/runtime-script-template-catalog.md +123 -0
- package/skills/bpmax-builder-shared/runtime_script_rules.py +272 -0
- package/skills/bpmax-builder-shared/skill_audit.py +374 -0
- package/skills/bpmax-builder-shared/template_script_hard_rules.py +280 -0
- package/skills/bpmax-builder-shared/tests/test_base_url.py +80 -0
- package/skills/bpmax-builder-shared/tests/test_runtime_script_rules.py +115 -0
- package/skills/bpmax-builder-shared/tests/test_skill_audit.py +231 -0
- package/skills/bpmax-builder-shared/tests/test_template_script_hard_rules.py +281 -0
- package/skills/bpmax-cli/SKILL.md +5 -0
- package/skills/bpmax-config-latest/SKILL.md +71 -0
- package/skills/bpmax-console-template-editor/SKILL.md +536 -0
- package/skills/bpmax-console-template-editor/agents/openai.yaml +4 -0
- package/skills/bpmax-console-template-editor/references/filter-integration.md +60 -0
- package/skills/bpmax-console-template-editor/references/lessons-from-resume-dashboard.md +114 -0
- package/skills/bpmax-console-template-editor/references/local-temp-workflow.md +69 -0
- package/skills/bpmax-console-template-editor/references/module-catalog.md +100 -0
- package/skills/bpmax-console-template-editor/references/runtime-page-shape.md +91 -0
- package/skills/bpmax-console-template-editor/references/template-shape.md +149 -0
- package/skills/bpmax-console-template-editor/scripts/build_submit_payload.py +38 -0
- package/skills/bpmax-console-template-editor/scripts/confirm_console_template.py +33 -0
- package/skills/bpmax-console-template-editor/scripts/console_template_editor_common.py +964 -0
- package/skills/bpmax-console-template-editor/scripts/export_console_template.py +99 -0
- package/skills/bpmax-console-template-editor/scripts/lint_console_template.py +46 -0
- package/skills/bpmax-console-template-editor/scripts/submit_console_template.py +99 -0
- package/skills/bpmax-console-template-editor/tests/test_console_template_editor.py +383 -0
- package/skills/bpmax-dataset-field-template-editor/SKILL.md +606 -0
- package/skills/bpmax-dataset-field-template-editor/references/create-request-gotchas.md +25 -0
- package/skills/bpmax-dataset-field-template-editor/references/field-classify-mapping.md +35 -0
- package/skills/bpmax-dataset-field-template-editor/references/nested-field-patterns.md +24 -0
- package/skills/bpmax-dataset-field-template-editor/references/runtime-verified-field-page-shape.md +61 -0
- package/skills/bpmax-dataset-field-template-editor/references/virtual-field-patterns.md +27 -0
- package/skills/bpmax-dataset-field-template-editor/references/work-file-to-submit-mapping.md +127 -0
- package/skills/bpmax-dataset-field-template-editor/scripts/build_submit_payload.py +67 -0
- package/skills/bpmax-dataset-field-template-editor/scripts/confirm_dataset_field.py +37 -0
- package/skills/bpmax-dataset-field-template-editor/scripts/dataset_field_editor_common.py +784 -0
- package/skills/bpmax-dataset-field-template-editor/scripts/export_dataset_field.py +62 -0
- package/skills/bpmax-dataset-field-template-editor/scripts/init_create_dataset_field.py +104 -0
- package/skills/bpmax-dataset-field-template-editor/scripts/inspect_dataset_field_runtime.py +83 -0
- package/skills/bpmax-dataset-field-template-editor/scripts/lint_dataset_field_semantics.py +35 -0
- package/skills/bpmax-dataset-field-template-editor/scripts/submit_dataset_field.py +95 -0
- package/skills/bpmax-dataset-field-template-editor/tests/test_dataset_field_editor.py +709 -0
- package/skills/bpmax-dataset-field-template-editor/tests/test_init_create_dataset_field.py +59 -0
- package/skills/bpmax-dataset-template-editor/SKILL.md +789 -0
- package/skills/bpmax-dataset-template-editor/references/custom-key-usage-patterns.md +18 -0
- package/skills/bpmax-dataset-template-editor/references/dataset-script-runtime-matrix.md +73 -0
- package/skills/bpmax-dataset-template-editor/references/pre-process-script-authoring-guide.md +186 -0
- package/skills/bpmax-dataset-template-editor/references/pre-process-script-example-catalog.md +106 -0
- package/skills/bpmax-dataset-template-editor/references/runtime-gotchas.md +28 -0
- package/skills/bpmax-dataset-template-editor/references/runtime-verified-dataset-page-shape.md +47 -0
- package/skills/bpmax-dataset-template-editor/references/ui-to-backend-field-map.md +23 -0
- package/skills/bpmax-dataset-template-editor/references/work-file-to-submit-mapping.md +97 -0
- package/skills/bpmax-dataset-template-editor/scripts/basic_table_audit.py +65 -0
- package/skills/bpmax-dataset-template-editor/scripts/build_submit_payload.py +38 -0
- package/skills/bpmax-dataset-template-editor/scripts/dataset_editor_common.py +650 -0
- package/skills/bpmax-dataset-template-editor/scripts/export_dataset.py +155 -0
- package/skills/bpmax-dataset-template-editor/scripts/lint_dataset_template.py +42 -0
- package/skills/bpmax-dataset-template-editor/scripts/resolve_dataset.py +43 -0
- package/skills/bpmax-dataset-template-editor/scripts/scan_custom_key_references.py +27 -0
- package/skills/bpmax-dataset-template-editor/scripts/submit_dataset.py +115 -0
- package/skills/bpmax-dataset-template-editor/scripts/verify_dataset_list.py +52 -0
- package/skills/bpmax-dataset-template-editor/scripts/verify_publish_health.py +39 -0
- package/skills/bpmax-dataset-template-editor/tests/test_dataset_editor.py +373 -0
- package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +227 -0
- package/skills/bpmax-e2e-flow-config-orchestrator/agents/openai.yaml +4 -0
- package/skills/bpmax-e2e-flow-config-orchestrator/references/orchestration-matrix.md +63 -0
- package/skills/bpmax-e2e-flow-test-operator/SKILL.md +564 -0
- package/skills/bpmax-e2e-flow-test-operator/agents/openai.yaml +5 -0
- package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale.json +97 -0
- package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale_final_v2.json +105 -0
- package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale_main.json +36 -0
- package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale_region.json +40 -0
- package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +355 -0
- package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +41 -0
- package/skills/bpmax-e2e-flow-test-operator/references/failure-update-loop.md +17 -0
- package/skills/bpmax-e2e-flow-test-operator/references/filter-field-discovery.md +40 -0
- package/skills/bpmax-e2e-flow-test-operator/references/minimal-test-loop.md +24 -0
- package/skills/bpmax-e2e-flow-test-operator/references/negative-sale-api-matrix.md +75 -0
- package/skills/bpmax-e2e-flow-test-operator/references/profile-schema.md +109 -0
- package/skills/bpmax-e2e-flow-test-operator/references/skill-experience-coverage-matrix.md +29 -0
- package/skills/bpmax-e2e-flow-test-operator/references/stale-runtime-and-clean-sample-rules.md +54 -0
- package/skills/bpmax-e2e-flow-test-operator/references/state-schema.md +83 -0
- package/skills/bpmax-e2e-flow-test-operator/scripts/bpmax_session.py +287 -0
- package/skills/bpmax-e2e-flow-test-operator/scripts/dealer_sample_on_shelf_plan.json +59 -0
- package/skills/bpmax-e2e-flow-test-operator/scripts/dealer_sample_on_shelf_runner.py +687 -0
- package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_doc.py +121 -0
- package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_state.py +288 -0
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_api_matrix.py +161 -0
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_filter_fields.py +138 -0
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_form_runtime.py +396 -0
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_runner.py +341 -0
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_test_profile.py +185 -0
- package/skills/bpmax-e2e-flow-test-operator/tests/test_negative_sale_api_tools.py +138 -0
- package/skills/bpmax-feishu-chat-flow-plugin-editor/SKILL.md +69 -0
- package/skills/bpmax-feishu-chat-flow-plugin-editor/agents/openai.yaml +4 -0
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/config-checklist.md +42 -0
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/config-recipes.md +38 -0
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/config-shape.md +86 -0
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/gate-lint.md +68 -0
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/hoocoo-patterns.md +39 -0
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/runtime-behavior.md +41 -0
- package/skills/bpmax-feishu-chat-flow-plugin-editor/references/script-authoring.md +110 -0
- package/skills/bpmax-feishu-chat-flow-plugin-editor/scripts/lint_feishu_chat_plugin.py +278 -0
- package/skills/bpmax-feishu-chat-flow-plugin-editor/tests/test_lint_feishu_chat_plugin.py +203 -0
- package/skills/bpmax-filter-template-editor/SKILL.md +564 -0
- package/skills/bpmax-filter-template-editor/references/experience-coverage-matrix.md +38 -0
- package/skills/bpmax-filter-template-editor/references/filter-and-flow-binding.md +57 -0
- package/skills/bpmax-filter-template-editor/references/filter-content-schema.md +141 -0
- package/skills/bpmax-filter-template-editor/references/filter-request-shape.md +287 -0
- package/skills/bpmax-filter-template-editor/references/filter-runtime-patterns.md +115 -0
- package/skills/bpmax-filter-template-editor/references/runtime-verified-filter-page-shape.md +94 -0
- package/skills/bpmax-filter-template-editor/scripts/build_submit_payload.py +25 -0
- package/skills/bpmax-filter-template-editor/scripts/confirm_filter_template.py +22 -0
- package/skills/bpmax-filter-template-editor/scripts/export_filter_template.py +57 -0
- package/skills/bpmax-filter-template-editor/scripts/filter_template_editor_common.py +348 -0
- package/skills/bpmax-filter-template-editor/scripts/init_create_filter_template.py +8 -0
- package/skills/bpmax-filter-template-editor/scripts/lint_filter_template_semantics.py +26 -0
- package/skills/bpmax-filter-template-editor/scripts/submit_filter_template.py +62 -0
- package/skills/bpmax-filter-template-editor/tests/test_filter_template_editor.py +231 -0
- package/skills/bpmax-flow-template-editor/SKILL.md +1148 -0
- package/skills/bpmax-flow-template-editor/agents/openai.yaml +4 -0
- package/skills/bpmax-flow-template-editor/references/before-next-step-script-runtime-gotchas.md +62 -0
- package/skills/bpmax-flow-template-editor/references/config-surfaces-and-placeholders.md +270 -0
- package/skills/bpmax-flow-template-editor/references/diff-strategy.md +67 -0
- package/skills/bpmax-flow-template-editor/references/editor-runtime-vs-draft.md +25 -0
- package/skills/bpmax-flow-template-editor/references/flow-template-api-workflow.md +174 -0
- package/skills/bpmax-flow-template-editor/references/intent-model.md +117 -0
- package/skills/bpmax-flow-template-editor/references/lessons-from-price-plan-flow.md +147 -0
- package/skills/bpmax-flow-template-editor/references/local-temp-workflow.md +97 -0
- package/skills/bpmax-flow-template-editor/references/matrix-flow-form-nav-collaboration.md +168 -0
- package/skills/bpmax-flow-template-editor/references/payload-checklist.md +133 -0
- package/skills/bpmax-flow-template-editor/references/project-create-runtime-gotchas.md +106 -0
- package/skills/bpmax-flow-template-editor/references/requirement-to-node-mapping.md +149 -0
- package/skills/bpmax-flow-template-editor/references/runtime-verified-flow-detail-shape.md +41 -0
- package/skills/bpmax-flow-template-editor/references/runtime-verified-meta-fields.md +155 -0
- package/skills/bpmax-flow-template-editor/references/runtime-verified-node-fields.md +179 -0
- package/skills/bpmax-flow-template-editor/references/save-draft-request-shape.md +91 -0
- package/skills/bpmax-flow-template-editor/references/script-review-hard-rules.md +96 -0
- package/skills/bpmax-flow-template-editor/references/work-file-to-submit-mapping.md +57 -0
- package/skills/bpmax-flow-template-editor/scripts/build_submit_payload.py +69 -0
- package/skills/bpmax-flow-template-editor/scripts/confirm_flow_template.py +52 -0
- package/skills/bpmax-flow-template-editor/scripts/export_flow_template.py +114 -0
- package/skills/bpmax-flow-template-editor/scripts/flow_template_editor_common.py +1084 -0
- package/skills/bpmax-flow-template-editor/scripts/submit_flow_template.py +159 -0
- package/skills/bpmax-flow-template-editor/tests/test_flow_template_editor.py +636 -0
- package/skills/bpmax-form-template-editor/SKILL.md +1160 -0
- package/skills/bpmax-form-template-editor/agents/openai.yaml +4 -0
- package/skills/bpmax-form-template-editor/references/form-template-api-workflow.md +203 -0
- package/skills/bpmax-form-template-editor/references/local-temp-workflow.md +125 -0
- package/skills/bpmax-form-template-editor/references/payload-checklist.md +77 -0
- package/skills/bpmax-form-template-editor/references/sub-form-patterns.md +49 -0
- package/skills/bpmax-form-template-editor/scripts/build_submit_payload.py +37 -0
- package/skills/bpmax-form-template-editor/scripts/check_form_template_consistency.py +145 -0
- package/skills/bpmax-form-template-editor/scripts/confirm_form_template.py +67 -0
- package/skills/bpmax-form-template-editor/scripts/export_form_template.py +91 -0
- package/skills/bpmax-form-template-editor/scripts/form_template_editor_common.py +1762 -0
- package/skills/bpmax-form-template-editor/scripts/lint_form_template_semantics.py +30 -0
- package/skills/bpmax-form-template-editor/scripts/record_runtime_acceptance.py +67 -0
- package/skills/bpmax-form-template-editor/scripts/submit_form_template.py +163 -0
- package/skills/bpmax-form-template-editor/tests/test_form_template_editor.py +1292 -0
- package/skills/bpmax-list-template-editor/SKILL.md +478 -0
- package/skills/bpmax-list-template-editor/agents/openai.yaml +4 -0
- package/skills/bpmax-list-template-editor/references/browser-page-contract.md +81 -0
- package/skills/bpmax-list-template-editor/references/content-config-shape.md +165 -0
- package/skills/bpmax-list-template-editor/references/dataset-field-mapping.md +60 -0
- package/skills/bpmax-list-template-editor/references/list-template-api-workflow.md +108 -0
- package/skills/bpmax-list-template-editor/references/local-temp-workflow.md +102 -0
- package/skills/bpmax-list-template-editor/references/payload-checklist.md +47 -0
- package/skills/bpmax-list-template-editor/references/runtime-verified-workflow.md +147 -0
- package/skills/bpmax-list-template-editor/references/special-formats.md +411 -0
- package/skills/bpmax-list-template-editor/scripts/build_submit_payload.py +37 -0
- package/skills/bpmax-list-template-editor/scripts/confirm_list_template.py +33 -0
- package/skills/bpmax-list-template-editor/scripts/export_list_template.py +89 -0
- package/skills/bpmax-list-template-editor/scripts/fetch_data_set.py +34 -0
- package/skills/bpmax-list-template-editor/scripts/lint_list_template_semantics.py +54 -0
- package/skills/bpmax-list-template-editor/scripts/list_template_editor_common.py +955 -0
- package/skills/bpmax-list-template-editor/scripts/record_acceptance.py +55 -0
- package/skills/bpmax-list-template-editor/scripts/submit_list_template.py +117 -0
- package/skills/bpmax-list-template-editor/tests/test_list_template_editor_common.py +441 -0
- package/skills/bpmax-memory-protocol/SKILL.md +72 -0
- package/skills/bpmax-nav-config-editor/SKILL.md +350 -0
- package/skills/bpmax-nav-config-editor/agents/openai.yaml +4 -0
- package/skills/bpmax-nav-config-editor/references/api-workflow.md +70 -0
- package/skills/bpmax-nav-config-editor/references/config-shape.md +78 -0
- package/skills/bpmax-nav-config-editor/references/icon-selection.md +83 -0
- package/skills/bpmax-nav-config-editor/references/path-mapping-rules.md +51 -0
- package/skills/bpmax-nav-config-editor/references/payload-checklist.md +41 -0
- package/skills/bpmax-nav-config-editor/references/runtime-probing.md +47 -0
- package/skills/bpmax-nav-config-editor/scripts/build_submit_payload.py +34 -0
- package/skills/bpmax-nav-config-editor/scripts/confirm_nav_config.py +32 -0
- package/skills/bpmax-nav-config-editor/scripts/export_nav_config.py +56 -0
- package/skills/bpmax-nav-config-editor/scripts/lint_nav_config_semantics.py +33 -0
- package/skills/bpmax-nav-config-editor/scripts/nav_config_editor_common.py +812 -0
- package/skills/bpmax-nav-config-editor/scripts/submit_nav_config.py +44 -0
- package/skills/bpmax-nav-config-editor/scripts/verify_nav_config.py +33 -0
- package/skills/bpmax-nav-config-editor/tests/test_nav_config_editor.py +358 -0
- package/skills/bpmax-nav-config-editor/tests/test_nav_config_editor_common.py +138 -0
- package/skills/bpmax-nav-config-editor/tests/test_nav_config_lint.py +58 -0
- package/skills/bpmax-nav-config-editor/tests/test_nav_config_submit_verify.py +51 -0
- package/skills/bpmax-plugin-config/SKILL.md +42 -0
- package/skills/bpmax-project/SKILL.md +17 -3
- package/skills/bpmax-project-detail-template-editor/SKILL.md +355 -0
- package/skills/bpmax-project-detail-template-editor/agents/openai.yaml +4 -0
- package/skills/bpmax-project-detail-template-editor/references/local-temp-workflow.md +59 -0
- package/skills/bpmax-project-detail-template-editor/references/module-catalog-and-config-notes.md +120 -0
- package/skills/bpmax-project-detail-template-editor/references/payload-checklist.md +33 -0
- package/skills/bpmax-project-detail-template-editor/references/project-detail-template-api-workflow.md +44 -0
- package/skills/bpmax-project-detail-template-editor/scripts/build_submit_payload.py +30 -0
- package/skills/bpmax-project-detail-template-editor/scripts/confirm_project_detail_template.py +33 -0
- package/skills/bpmax-project-detail-template-editor/scripts/export_project_detail_template.py +87 -0
- package/skills/bpmax-project-detail-template-editor/scripts/lint_project_detail_template_semantics.py +37 -0
- package/skills/bpmax-project-detail-template-editor/scripts/project_detail_template_editor_common.py +507 -0
- package/skills/bpmax-project-detail-template-editor/scripts/submit_project_detail_template.py +120 -0
- package/skills/bpmax-project-detail-template-editor/tests/test_project_detail_template_editor.py +369 -0
- package/skills/bpmax-role-editor/SKILL.md +251 -0
- package/skills/bpmax-role-editor/references/api-workflow.md +30 -0
- package/skills/bpmax-role-editor/references/runtime-page-shape.md +18 -0
- package/skills/bpmax-role-editor/references/work-file-mapping.md +32 -0
- package/skills/bpmax-role-editor/scripts/build_submit_payload.py +38 -0
- package/skills/bpmax-role-editor/scripts/confirm_role.py +33 -0
- package/skills/bpmax-role-editor/scripts/export_role.py +163 -0
- package/skills/bpmax-role-editor/scripts/lint_role_semantics.py +38 -0
- package/skills/bpmax-role-editor/scripts/role_editor_common.py +1231 -0
- package/skills/bpmax-role-editor/scripts/submit_role.py +144 -0
- package/skills/bpmax-role-editor/tests/test_role_editor.py +343 -0
- package/skills/bpmax-shared/SKILL.md +1 -1
- package/skills/bpmax-user-mock-operator/SKILL.md +106 -0
- package/skills/bpmax-user-mock-operator/agents/openai.yaml +4 -0
- package/skills/bpmax-user-mock-operator/scripts/switch_user_identity.py +37 -0
- package/skills/bpmax-user-mock-operator/scripts/user_mock_operator_common.py +136 -0
- package/skills/bpmax-user-mock-operator/tests/test_user_mock_operator.py +138 -0
- package/skills/bpmax-workspace-editor/SKILL.md +78 -0
- package/skills/bpmax-workspace-editor/agents/openai.yaml +4 -0
- package/skills/form-control-library/SKILL.md +82 -0
- package/skills/form-control-library/agents/openai.yaml +4 -0
- package/skills/form-control-library/references/form-controls.md +199 -0
- package/skills/form-control-library/references/form-template-submit-schema.md +180 -0
- package/skills/form-control-library/references/group-select-runtime.md +191 -0
- package/skills/form-control-library/scripts/rebuild_form_control_library.py +55 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Per-Flow Required Structure
|
|
2
|
+
|
|
3
|
+
Every BPMAX blueprint flow chapter must be independently complete. A reader should be able to configure that flow without hunting through other flow chapters for required fields, forms, writeback, or AI rules.
|
|
4
|
+
|
|
5
|
+
## Required Sections
|
|
6
|
+
|
|
7
|
+
1. **业务目标与适用场景**
|
|
8
|
+
- Business problem solved.
|
|
9
|
+
- Entry scenarios.
|
|
10
|
+
- Primary roles.
|
|
11
|
+
- Owning BPMAX flow.
|
|
12
|
+
|
|
13
|
+
2. **流程模板**
|
|
14
|
+
- Process diagram in a Feishu whiteboard.
|
|
15
|
+
- Start node and creation action/form.
|
|
16
|
+
- Main business states and action nodes only.
|
|
17
|
+
- Each node must be a business-meaningful action/state change handled by a human or AI Agent.
|
|
18
|
+
- Apply Occam's razor: keep the workflow minimal and avoid duplicate or low-value intermediate nodes.
|
|
19
|
+
- Do not model pure system automation as separate nodes; place notifications, child-flow creation, data sync, field copy, and background scripts in automation/writeback notes on the related business node.
|
|
20
|
+
- In a main/end-to-end flow, do not expand the internal steps of child flows. Put each child flow in the relevant main-flow node and use a special visual style to show it is a child flow.
|
|
21
|
+
- Branches and returns in natural business language.
|
|
22
|
+
- Related/external flow links when needed.
|
|
23
|
+
|
|
24
|
+
3. **开始节点与创建表单**
|
|
25
|
+
- Start node name.
|
|
26
|
+
- Creation form name.
|
|
27
|
+
- Creator role.
|
|
28
|
+
- Initial required fields.
|
|
29
|
+
- Draft and submit behavior.
|
|
30
|
+
|
|
31
|
+
4. **环节配置说明**
|
|
32
|
+
- Use a table with step/state, responsible role, node form, editable fields, transition, automation, completion/writeback.
|
|
33
|
+
- Current-flow nodes must be business states or business actions, not configuration object names.
|
|
34
|
+
- The responsible role must be a human role or AI Agent for every node; system-only work belongs in the automation column.
|
|
35
|
+
|
|
36
|
+
5. **表单模板**
|
|
37
|
+
- Use a field table with: field, type, required, source, editable role, validation rule.
|
|
38
|
+
- Include attachments, confirmations, signatures, and conditional visibility where relevant.
|
|
39
|
+
- Only include fields that are meaningful for the form user or AI Agent to view, fill, confirm, or edit.
|
|
40
|
+
- Do not include system-only fields in form templates. Examples that belong in data set/writeback notes instead of forms: `当前阶段` with source `系统写入`, `关联选题子流程` project references created automatically, `关联筹备子流程` project references created automatically, read-only child-flow links, internal relationship IDs, and other fields whose editable role is only `系统`.
|
|
41
|
+
|
|
42
|
+
6. **流程数据集**
|
|
43
|
+
- Data set purpose.
|
|
44
|
+
- Key fields.
|
|
45
|
+
- Status fields.
|
|
46
|
+
- Relationship fields.
|
|
47
|
+
- Writeback targets.
|
|
48
|
+
- Read-only vs editable rules.
|
|
49
|
+
- System-written state fields, child-flow references, parent-flow references, internal relationship IDs, and other read-only linkage fields should be described here, not in the form template section.
|
|
50
|
+
|
|
51
|
+
7. **列表/筛选/详情/看板入口**
|
|
52
|
+
- Target users.
|
|
53
|
+
- List columns or cards.
|
|
54
|
+
- Filters.
|
|
55
|
+
- Detail page sections.
|
|
56
|
+
- Dashboard or operational view if applicable.
|
|
57
|
+
- Action buttons.
|
|
58
|
+
|
|
59
|
+
8. **自动化与 AI/agent**
|
|
60
|
+
- Trigger point.
|
|
61
|
+
- Input data.
|
|
62
|
+
- Output draft/suggestion/card/writeback.
|
|
63
|
+
- Human confirmation role.
|
|
64
|
+
- Exception fallback.
|
|
65
|
+
- Audit log requirements.
|
|
66
|
+
|
|
67
|
+
9. **办结口径与下游联动**
|
|
68
|
+
- Completion criteria.
|
|
69
|
+
- Final status.
|
|
70
|
+
- Written history/status fields.
|
|
71
|
+
- Downstream flows or views affected.
|
|
72
|
+
|
|
73
|
+
10. **BPMAX 实现边界**
|
|
74
|
+
- Use exactly these labels:
|
|
75
|
+
- `BPMAX 配置可实现`
|
|
76
|
+
- `配置 + 脚本/API/现有插件`
|
|
77
|
+
- `需定制插件/外部服务`
|
|
78
|
+
|
|
79
|
+
## Diagram Requirements
|
|
80
|
+
|
|
81
|
+
- The final diagram must be a Feishu whiteboard block.
|
|
82
|
+
- Mermaid code block syntax such as `<pre lang="mermaid">` is not allowed in final docs.
|
|
83
|
+
- Prefer `flowchart TD`.
|
|
84
|
+
- Use quoted labels when labels contain punctuation.
|
|
85
|
+
- Avoid Mermaid decision diamonds for business flow blueprints; represent branches with normal state nodes and edge labels.
|
|
86
|
+
- Every flow diagram must include a start node naming the creation action or creation form.
|
|
87
|
+
- Do not draw standalone nodes for pure automation, such as "send notification", "copy field", "sync data set", "create child flow", "write log", or "call API"; attach them as edge labels or automation notes to the nearest human/AI business node.
|
|
88
|
+
- In main-flow diagrams, draw child flows with a special style instead of their internal nodes. Prefer Mermaid subroutine syntax like `B[["改善筹备子流程"]]` or a distinct class such as `class B childFlow`, then define `classDef childFlow fill:#eef6ff,stroke:#2f6fed,stroke-width:2px,stroke-dasharray: 6 3;`.
|
|
89
|
+
|
|
90
|
+
## Anti-Patterns
|
|
91
|
+
|
|
92
|
+
- “字段同主流程” without restating the fields needed by this flow.
|
|
93
|
+
- “数据集见公共配置” when the data is flow-owned.
|
|
94
|
+
- “AI 自动确认/自动通过/自动结案/自动认证/自动对账” for key business decisions.
|
|
95
|
+
- A workflow section without whiteboard.
|
|
96
|
+
- A diagram that uses configuration objects as main business states.
|
|
97
|
+
- A diagram that turns background automation into separate business nodes.
|
|
98
|
+
- A workflow with redundant confirmation, transfer, or waiting nodes that do not change business state or require human/AI Agent handling.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<title>禁止词示例</title>
|
|
2
|
+
<h1>蓝图定位与目标</h1>
|
|
3
|
+
<h1>BPMAX 实施总规则</h1>
|
|
4
|
+
<h1>总体业务架构</h1>
|
|
5
|
+
<h1>公共支撑配置</h1>
|
|
6
|
+
<h1>流程一:主流程</h1>
|
|
7
|
+
<whiteboard type="mermaid">flowchart TD
|
|
8
|
+
A[开始节点:创建申请表单] --> B[处理]</whiteboard>
|
|
9
|
+
<p>业务目标与适用场景。流程模板。开始节点。创建表单。环节配置。表单模板。流程数据集。列表、筛选、详情、看板、入口。自动化 AI 触发 输入 输出 人工确认 异常兜底。办结口径与下游联动。BPMAX 配置可实现;配置 + 脚本/API/现有插件;需定制插件/外部服务。TODO</p>
|
|
10
|
+
<h1>实现边界</h1>
|
|
11
|
+
<p>BPMAX 配置可实现;配置 + 脚本/API/现有插件;需定制插件/外部服务。</p>
|
|
12
|
+
<h1>验收、风险、待确认事项</h1>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<title>代码块流程图示例</title>
|
|
2
|
+
<h1>蓝图定位与目标</h1>
|
|
3
|
+
<h1>BPMAX 实施总规则</h1>
|
|
4
|
+
<h1>总体业务架构</h1>
|
|
5
|
+
<h1>公共支撑配置</h1>
|
|
6
|
+
<h1>流程一:主流程</h1>
|
|
7
|
+
<pre lang="mermaid"><code>flowchart TD
|
|
8
|
+
A --> B</code></pre>
|
|
9
|
+
<p>业务目标与适用场景。流程模板。开始节点。创建表单。环节配置。表单模板。流程数据集。列表、筛选、详情、看板、入口。自动化 AI 触发 输入 输出 人工确认 异常兜底。办结口径与下游联动。BPMAX 配置可实现;配置 + 脚本/API/现有插件;需定制插件/外部服务。</p>
|
|
10
|
+
<h1>实现边界</h1>
|
|
11
|
+
<p>BPMAX 配置可实现;配置 + 脚本/API/现有插件;需定制插件/外部服务。</p>
|
|
12
|
+
<h1>验收、风险、待确认事项</h1>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<title>缺实现边界示例</title>
|
|
2
|
+
<h1>蓝图定位与目标</h1>
|
|
3
|
+
<h1>BPMAX 实施总规则</h1>
|
|
4
|
+
<h1>总体业务架构</h1>
|
|
5
|
+
<h1>公共支撑配置</h1>
|
|
6
|
+
<h1>流程一:主流程</h1>
|
|
7
|
+
<whiteboard type="mermaid">flowchart TD
|
|
8
|
+
A[开始节点:创建申请表单] --> B[处理]</whiteboard>
|
|
9
|
+
<p>业务目标与适用场景。流程模板。开始节点。创建表单。环节配置。表单模板。流程数据集。列表、筛选、详情、看板、入口。自动化 AI 触发 输入 输出 人工确认 异常兜底。办结口径与下游联动。</p>
|
|
10
|
+
<h1>验收、风险、待确认事项</h1>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<title>缺流程图示例</title>
|
|
2
|
+
<h1>蓝图定位与目标</h1>
|
|
3
|
+
<h1>BPMAX 实施总规则</h1>
|
|
4
|
+
<h1>总体业务架构</h1>
|
|
5
|
+
<h1>公共支撑配置</h1>
|
|
6
|
+
<h1>流程一:主流程</h1>
|
|
7
|
+
<p>业务目标与适用场景。流程模板。开始节点。创建表单。环节配置。表单模板。流程数据集。列表、筛选、详情、看板、入口。自动化 AI 触发 输入 输出 人工确认 异常兜底。办结口径与下游联动。BPMAX 配置可实现;配置 + 脚本/API/现有插件;需定制插件/外部服务。</p>
|
|
8
|
+
<h1>实现边界</h1>
|
|
9
|
+
<p>BPMAX 配置可实现;配置 + 脚本/API/现有插件;需定制插件/外部服务。</p>
|
|
10
|
+
<h1>验收、风险、待确认事项</h1>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<title>示例 BPMAX 蓝图方案</title>
|
|
2
|
+
<h1>1. 蓝图定位与目标</h1>
|
|
3
|
+
<p>示例目标。</p>
|
|
4
|
+
<h1>2. BPMAX 实施总规则</h1>
|
|
5
|
+
<p>流程优先,流程图使用飞书画板。</p>
|
|
6
|
+
<h1>3. 总体业务架构</h1>
|
|
7
|
+
<p>主流程与联动流程。</p>
|
|
8
|
+
<h1>4. 公共支撑配置</h1>
|
|
9
|
+
<p>共享组织、用户模型和自动化日志。</p>
|
|
10
|
+
<h1>5. 流程一:主流程</h1>
|
|
11
|
+
<h2>5.1 业务目标与适用场景</h2>
|
|
12
|
+
<p>业务目标与适用场景。</p>
|
|
13
|
+
<h2>5.2 流程模板</h2>
|
|
14
|
+
<whiteboard type="mermaid">flowchart TD
|
|
15
|
+
A[开始节点:创建申请表单] --> B[处理]</whiteboard>
|
|
16
|
+
<p>开始节点:创建申请表单。创建表单由申请人填写。</p>
|
|
17
|
+
<h2>5.3 环节配置说明</h2>
|
|
18
|
+
<table><tr><th>环节</th><th>角色</th></tr><tr><td>处理</td><td>负责人</td></tr></table>
|
|
19
|
+
<h2>5.4 表单模板</h2>
|
|
20
|
+
<table><tr><th>字段</th><th>类型</th></tr><tr><td>名称</td><td>文本</td></tr></table>
|
|
21
|
+
<h2>5.5 流程数据集</h2>
|
|
22
|
+
<p>流程数据集包含状态、关联字段和写回规则。</p>
|
|
23
|
+
<h2>5.6 列表/筛选/详情/看板入口</h2>
|
|
24
|
+
<p>列表、筛选、详情、看板、入口。</p>
|
|
25
|
+
<h2>5.7 自动化与 AI/agent</h2>
|
|
26
|
+
<p>AI 触发、输入、输出、人工确认、异常兜底。</p>
|
|
27
|
+
<h2>5.8 办结口径与下游联动</h2>
|
|
28
|
+
<p>办结后归档并下游联动。</p>
|
|
29
|
+
<h2>5.9 BPMAX 实现边界</h2>
|
|
30
|
+
<p>BPMAX 配置可实现;配置 + 脚本/API/现有插件;需定制插件/外部服务。</p>
|
|
31
|
+
<h1>6. 流程二:辅助流程</h1>
|
|
32
|
+
<h2>6.1 业务目标与适用场景</h2>
|
|
33
|
+
<p>业务目标与适用场景。</p>
|
|
34
|
+
<h2>6.2 流程模板</h2>
|
|
35
|
+
<whiteboard type="mermaid">flowchart TD
|
|
36
|
+
A[开始节点:创建辅助表单] --> B[办结]</whiteboard>
|
|
37
|
+
<p>开始节点:创建辅助表单。创建表单由管理员填写。</p>
|
|
38
|
+
<h2>6.3 环节配置说明</h2>
|
|
39
|
+
<table><tr><th>环节</th><th>角色</th></tr><tr><td>办结</td><td>管理员</td></tr></table>
|
|
40
|
+
<h2>6.4 表单模板</h2>
|
|
41
|
+
<table><tr><th>字段</th><th>类型</th></tr><tr><td>名称</td><td>文本</td></tr></table>
|
|
42
|
+
<h2>6.5 流程数据集</h2>
|
|
43
|
+
<p>流程数据集包含状态和写回规则。</p>
|
|
44
|
+
<h2>6.6 列表/筛选/详情/看板入口</h2>
|
|
45
|
+
<p>列表、筛选、详情、看板、入口。</p>
|
|
46
|
+
<h2>6.7 自动化与 AI/agent</h2>
|
|
47
|
+
<p>AI 触发、输入、输出、人工确认、异常兜底。</p>
|
|
48
|
+
<h2>6.8 办结口径与下游联动</h2>
|
|
49
|
+
<p>办结口径和下游联动。</p>
|
|
50
|
+
<h2>6.9 BPMAX 实现边界</h2>
|
|
51
|
+
<p>BPMAX 配置可实现;配置 + 脚本/API/现有插件;需定制插件/外部服务。</p>
|
|
52
|
+
<h1>7. BPMAX 可配置能力与需定制能力边界</h1>
|
|
53
|
+
<p>BPMAX 配置可实现;配置 + 脚本/API/现有插件;需定制插件/外部服务。</p>
|
|
54
|
+
<h1>8. 一期验收路径、风险与待确认事项</h1>
|
|
55
|
+
<p>验收、风险、待确认。</p>
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Lint BPMAX blueprint Feishu Docx fetch output or XML.
|
|
3
|
+
|
|
4
|
+
The checker is intentionally structural. It does not try to prove business
|
|
5
|
+
correctness; it blocks the recurring blueprint failures that make a document
|
|
6
|
+
unusable for BPMAX implementation.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import argparse
|
|
12
|
+
import json
|
|
13
|
+
import re
|
|
14
|
+
import sys
|
|
15
|
+
from dataclasses import dataclass, field
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
from typing import Iterable
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
DEFAULT_FORBID_TERMS = ["TODO", "待补充", "略", "后续完善", "代码块流程图"]
|
|
21
|
+
DEFAULT_REQUIRED_TERMS = [
|
|
22
|
+
"BPMAX 配置可实现",
|
|
23
|
+
"配置 + 脚本/API/现有插件",
|
|
24
|
+
"需定制插件/外部服务",
|
|
25
|
+
]
|
|
26
|
+
CORE_CHAPTER_TERMS = [
|
|
27
|
+
"蓝图定位与目标",
|
|
28
|
+
"BPMAX 实施总规则",
|
|
29
|
+
"总体业务架构",
|
|
30
|
+
"公共支撑配置",
|
|
31
|
+
"实现边界",
|
|
32
|
+
]
|
|
33
|
+
ACCEPTANCE_TERMS = ["验收", "风险", "待确认"]
|
|
34
|
+
FLOW_REQUIRED_TERMS = {
|
|
35
|
+
"业务目标与适用场景": ["业务目标与适用场景"],
|
|
36
|
+
"流程模板": ["流程模板"],
|
|
37
|
+
"开始节点": ["开始节点", "开始:", "创建"],
|
|
38
|
+
"创建表单": ["创建表单", "创建环节", "创建申请", "创建或导入", "初始表单"],
|
|
39
|
+
"环节配置": ["环节配置", "环节", "节点配置"],
|
|
40
|
+
"表单模板": ["表单模板", "字段"],
|
|
41
|
+
"流程数据集": ["流程数据集", "数据集", "写回"],
|
|
42
|
+
"视图入口": ["列表", "筛选", "详情", "看板", "入口", "视图"],
|
|
43
|
+
"自动化与 AI/agent": ["自动化", "AI", "agent", "Agent"],
|
|
44
|
+
"办结口径与下游联动": ["办结", "下游联动", "归档", "完成条件"],
|
|
45
|
+
"BPMAX 实现边界": DEFAULT_REQUIRED_TERMS,
|
|
46
|
+
}
|
|
47
|
+
AI_REQUIRED_TERMS = ["触发", "输入", "输出", "人工确认", "异常兜底"]
|
|
48
|
+
AI_FORBIDDEN_PATTERNS = [
|
|
49
|
+
r"AI[^。;\n]{0,30}自动(?:最终)?确认",
|
|
50
|
+
r"AI[^。;\n]{0,30}自动通过",
|
|
51
|
+
r"AI[^。;\n]{0,30}自动结案",
|
|
52
|
+
r"AI[^。;\n]{0,30}自动认证",
|
|
53
|
+
r"AI[^。;\n]{0,30}自动对账",
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
@dataclass
|
|
58
|
+
class Finding:
|
|
59
|
+
level: str
|
|
60
|
+
code: str
|
|
61
|
+
message: str
|
|
62
|
+
flow: str | None = None
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
@dataclass
|
|
66
|
+
class FlowSection:
|
|
67
|
+
title: str
|
|
68
|
+
content: str
|
|
69
|
+
whiteboards: int = 0
|
|
70
|
+
mermaid_code_blocks: int = 0
|
|
71
|
+
missing: list[str] = field(default_factory=list)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def read_content(path: Path) -> str:
|
|
75
|
+
raw = path.read_text(encoding="utf-8")
|
|
76
|
+
stripped = raw.lstrip()
|
|
77
|
+
if stripped.startswith("{"):
|
|
78
|
+
data = json.loads(raw)
|
|
79
|
+
try:
|
|
80
|
+
return data["data"]["document"]["content"]
|
|
81
|
+
except KeyError as exc:
|
|
82
|
+
raise SystemExit(f"JSON input does not look like lark-cli docs +fetch output: missing {exc}") from exc
|
|
83
|
+
return raw
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def plain_text(xml: str) -> str:
|
|
87
|
+
text = re.sub(r"<[^>]+>", " ", xml)
|
|
88
|
+
text = text.replace("<", "<").replace(">", ">").replace("&", "&")
|
|
89
|
+
return re.sub(r"\s+", " ", text)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def has_any(text: str, terms: Iterable[str]) -> bool:
|
|
93
|
+
return any(term in text for term in terms)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def contains_forbidden_term(text: str, term: str) -> bool:
|
|
97
|
+
if term == "略":
|
|
98
|
+
return bool(re.search(r"(?<![\u4e00-\u9fffA-Za-z0-9])略(?![\u4e00-\u9fffA-Za-z0-9])", text))
|
|
99
|
+
return term in text
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def has_ai_final_decision_violation(text: str, pattern: str) -> bool:
|
|
103
|
+
for match in re.finditer(pattern, text):
|
|
104
|
+
snippet = match.group(0)
|
|
105
|
+
if any(negation in snippet for negation in ["不自动", "不能", "不得", "不会", "不可", "不直接"]):
|
|
106
|
+
continue
|
|
107
|
+
return True
|
|
108
|
+
return False
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def extract_title(xml: str) -> str:
|
|
112
|
+
match = re.search(r"<title(?:\s[^>]*)?>(.*?)</title>", xml, re.S)
|
|
113
|
+
return plain_text(match.group(1)).strip() if match else ""
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def extract_flows(xml: str) -> list[FlowSection]:
|
|
117
|
+
heading_re = re.compile(r"<h([1-3])[^>]*>(.*?)</h\1>", re.S)
|
|
118
|
+
matches = list(heading_re.finditer(xml))
|
|
119
|
+
flow_matches = []
|
|
120
|
+
for match in matches:
|
|
121
|
+
title = plain_text(match.group(2)).strip()
|
|
122
|
+
if re.search(r"流程[一二三四五六七八九十\d]+[::]", title):
|
|
123
|
+
flow_matches.append((match, title))
|
|
124
|
+
|
|
125
|
+
flows = []
|
|
126
|
+
for index, (match, title) in enumerate(flow_matches):
|
|
127
|
+
start = match.start()
|
|
128
|
+
end = flow_matches[index + 1][0].start() if index + 1 < len(flow_matches) else len(xml)
|
|
129
|
+
content = xml[start:end]
|
|
130
|
+
flows.append(
|
|
131
|
+
FlowSection(
|
|
132
|
+
title=title,
|
|
133
|
+
content=content,
|
|
134
|
+
whiteboards=len(re.findall(r"<whiteboard\b", content)),
|
|
135
|
+
mermaid_code_blocks=len(re.findall(r"<pre[^>]*lang=[\"']mermaid[\"']", content, re.I)),
|
|
136
|
+
)
|
|
137
|
+
)
|
|
138
|
+
return flows
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def add_error(findings: list[Finding], code: str, message: str, flow: str | None = None) -> None:
|
|
142
|
+
findings.append(Finding("error", code, message, flow))
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def lint(xml: str, require_terms: list[str], forbid_terms: list[str]) -> tuple[list[Finding], list[FlowSection]]:
|
|
146
|
+
findings: list[Finding] = []
|
|
147
|
+
text = plain_text(xml)
|
|
148
|
+
|
|
149
|
+
if not extract_title(xml):
|
|
150
|
+
add_error(findings, "DOC_TITLE_MISSING", "Document must contain a <title> block.")
|
|
151
|
+
|
|
152
|
+
for term in CORE_CHAPTER_TERMS:
|
|
153
|
+
if term not in text:
|
|
154
|
+
add_error(findings, "DOC_CORE_CHAPTER_MISSING", f"Missing core blueprint chapter term: {term}")
|
|
155
|
+
if not any(term in text for term in ACCEPTANCE_TERMS):
|
|
156
|
+
add_error(findings, "DOC_ACCEPTANCE_MISSING", "Missing acceptance/risk/confirmation chapter wording.")
|
|
157
|
+
|
|
158
|
+
for term in require_terms:
|
|
159
|
+
if term not in text:
|
|
160
|
+
add_error(findings, "REQUIRED_TERM_MISSING", f"Required term not found: {term}")
|
|
161
|
+
|
|
162
|
+
for term in forbid_terms:
|
|
163
|
+
if contains_forbidden_term(text, term):
|
|
164
|
+
add_error(findings, "FORBIDDEN_TERM_PRESENT", f"Forbidden term found: {term}")
|
|
165
|
+
|
|
166
|
+
for pattern in AI_FORBIDDEN_PATTERNS:
|
|
167
|
+
if has_ai_final_decision_violation(text, pattern):
|
|
168
|
+
add_error(findings, "AI_AUTO_FINAL_DECISION", f"AI final-decision wording matched pattern: {pattern}")
|
|
169
|
+
|
|
170
|
+
if re.search(r"<pre[^>]*lang=[\"']mermaid[\"']", xml, re.I):
|
|
171
|
+
add_error(findings, "MERMAID_CODE_BLOCK", "Final blueprint must use whiteboard blocks, not Mermaid code blocks.")
|
|
172
|
+
|
|
173
|
+
flows = extract_flows(xml)
|
|
174
|
+
if not flows:
|
|
175
|
+
add_error(findings, "FLOW_SECTION_MISSING", "No flow sections matching 流程X: were found.")
|
|
176
|
+
|
|
177
|
+
for flow in flows:
|
|
178
|
+
flow_text = plain_text(flow.content)
|
|
179
|
+
if flow.whiteboards < 1:
|
|
180
|
+
add_error(findings, "FLOW_WHITEBOARD_MISSING", "Flow section has no <whiteboard> diagram.", flow.title)
|
|
181
|
+
flow.missing.append("whiteboard")
|
|
182
|
+
if flow.mermaid_code_blocks:
|
|
183
|
+
add_error(findings, "FLOW_MERMAID_CODE_BLOCK", "Flow section contains Mermaid code block.", flow.title)
|
|
184
|
+
flow.missing.append("no mermaid code block")
|
|
185
|
+
|
|
186
|
+
for label, terms in FLOW_REQUIRED_TERMS.items():
|
|
187
|
+
if not has_any(flow_text, terms):
|
|
188
|
+
add_error(findings, "FLOW_REQUIRED_CONTENT_MISSING", f"Missing per-flow content: {label}", flow.title)
|
|
189
|
+
flow.missing.append(label)
|
|
190
|
+
|
|
191
|
+
if "AI" in flow_text or "agent" in flow_text or "Agent" in flow_text:
|
|
192
|
+
for term in AI_REQUIRED_TERMS:
|
|
193
|
+
if term not in flow_text:
|
|
194
|
+
add_error(findings, "FLOW_AI_DETAIL_MISSING", f"AI/agent section missing term: {term}", flow.title)
|
|
195
|
+
flow.missing.append(f"AI {term}")
|
|
196
|
+
|
|
197
|
+
return findings, flows
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def build_report(findings: list[Finding], flows: list[FlowSection], source: Path) -> dict:
|
|
201
|
+
errors = [f for f in findings if f.level == "error"]
|
|
202
|
+
return {
|
|
203
|
+
"ok": not errors,
|
|
204
|
+
"source": str(source),
|
|
205
|
+
"error_count": len(errors),
|
|
206
|
+
"flow_count": len(flows),
|
|
207
|
+
"flows": [
|
|
208
|
+
{
|
|
209
|
+
"title": flow.title,
|
|
210
|
+
"whiteboards": flow.whiteboards,
|
|
211
|
+
"mermaid_code_blocks": flow.mermaid_code_blocks,
|
|
212
|
+
"missing": flow.missing,
|
|
213
|
+
}
|
|
214
|
+
for flow in flows
|
|
215
|
+
],
|
|
216
|
+
"findings": [finding.__dict__ for finding in findings],
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
def main() -> int:
|
|
221
|
+
parser = argparse.ArgumentParser(description="Lint BPMAX blueprint Feishu Docx content.")
|
|
222
|
+
parser.add_argument("--source", required=True, help="Path to lark-cli fetch JSON output or XML content.")
|
|
223
|
+
parser.add_argument("--json-report", help="Optional path to write a JSON lint report.")
|
|
224
|
+
parser.add_argument("--require-term", action="append", default=[], help="Additional required term. Repeatable.")
|
|
225
|
+
parser.add_argument("--forbid-term", action="append", default=[], help="Additional forbidden term. Repeatable.")
|
|
226
|
+
args = parser.parse_args()
|
|
227
|
+
|
|
228
|
+
source = Path(args.source)
|
|
229
|
+
xml = read_content(source)
|
|
230
|
+
require_terms = DEFAULT_REQUIRED_TERMS + args.require_term
|
|
231
|
+
forbid_terms = DEFAULT_FORBID_TERMS + args.forbid_term
|
|
232
|
+
findings, flows = lint(xml, require_terms, forbid_terms)
|
|
233
|
+
report = build_report(findings, flows, source)
|
|
234
|
+
|
|
235
|
+
if args.json_report:
|
|
236
|
+
Path(args.json_report).write_text(json.dumps(report, ensure_ascii=False, indent=2), encoding="utf-8")
|
|
237
|
+
|
|
238
|
+
status = "PASS" if report["ok"] else "FAIL"
|
|
239
|
+
print(f"BPMAX blueprint lint: {status}")
|
|
240
|
+
print(f"Source: {source}")
|
|
241
|
+
print(f"Flows: {report['flow_count']}")
|
|
242
|
+
for flow in report["flows"]:
|
|
243
|
+
missing = ", ".join(flow["missing"]) if flow["missing"] else "none"
|
|
244
|
+
print(f"- {flow['title']}: whiteboards={flow['whiteboards']}, missing={missing}")
|
|
245
|
+
if report["findings"]:
|
|
246
|
+
print("Findings:")
|
|
247
|
+
for finding in report["findings"]:
|
|
248
|
+
prefix = f"[{finding['level']}] {finding['code']}"
|
|
249
|
+
if finding.get("flow"):
|
|
250
|
+
prefix += f" ({finding['flow']})"
|
|
251
|
+
print(f"- {prefix}: {finding['message']}")
|
|
252
|
+
|
|
253
|
+
return 0 if report["ok"] else 1
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
if __name__ == "__main__":
|
|
257
|
+
sys.exit(main())
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "bpmax-builder-shared"
|
|
3
|
+
description: "BPMAX 配置类 skill 的共享规则和脚本库。用于复用配置编辑器的范围门禁、运行时脚本规则、模板脚本硬规则、base URL 处理和 skill 审计工具;不作为直接修改 BPMAX 远端配置的入口。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# BPMAX Builder Shared
|
|
7
|
+
|
|
8
|
+
## 定位
|
|
9
|
+
|
|
10
|
+
这是 BPMAX 配置类 skill 的共享辅助库,不直接执行远端配置写入。
|
|
11
|
+
|
|
12
|
+
适用场景:
|
|
13
|
+
- 配置类 skill 需要复用 `base_url.py`、`runtime_script_rules.py`、`template_script_hard_rules.py` 或 `skill_audit.py`。
|
|
14
|
+
- 检查配置编辑器 skill 是否满足范围门禁、脚本硬规则、运行时脚本站点矩阵。
|
|
15
|
+
- 为 `bpmax-form-template-editor`、`bpmax-flow-template-editor`、`bpmax-list-template-editor`、`bpmax-filter-template-editor`、`bpmax-project-detail-template-editor`、`bpmax-console-template-editor`、`bpmax-dataset-template-editor`、`bpmax-dataset-field-template-editor`、`bpmax-api-platform-editor`、`bpmax-role-editor`、`bpmax-nav-config-editor` 提供共享参考。
|
|
16
|
+
|
|
17
|
+
## 写入路径硬约束
|
|
18
|
+
|
|
19
|
+
- 不要从本目录脚本直接调用 BPMAX 远端写接口。
|
|
20
|
+
- 所有真实配置提交必须走 `bpmax-cli config <domain> build` 和 `bpmax-cli config <domain> submit`。
|
|
21
|
+
- 不得用 `bpmax-cli api POST/PUT/PATCH/DELETE` 绕过 typed config submit。
|
|
22
|
+
- `submit` 默认 dry-run;真实提交必须带精确 `--confirm "submit <domain> <id>"`。
|
|
23
|
+
|
|
24
|
+
## 使用方式
|
|
25
|
+
|
|
26
|
+
优先在具体配置 skill 中引用本目录的脚本或规则文件,不要把本 skill 当作用户任务入口。
|
|
27
|
+
|
|
28
|
+
常用文件:
|
|
29
|
+
- `base_url.py`:统一处理 BPMAX/sysconfigdiff URL。
|
|
30
|
+
- `runtime_script_rules.py`:运行时脚本规则。
|
|
31
|
+
- `template_script_hard_rules.py`:模板脚本硬规则。
|
|
32
|
+
- `skill_audit.py`:配置类 skill 静态审计。
|
|
33
|
+
- `runtime-script-site-matrix.md`:运行时脚本站点矩阵说明。
|
|
34
|
+
- `runtime-script-template-catalog.md`:模板脚本分类参考。
|
|
35
|
+
|
|
36
|
+
## 验证
|
|
37
|
+
|
|
38
|
+
修改共享脚本后至少运行对应本地测试:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
python -m pytest skills/bpmax-builder-shared/tests
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
如果调用方 skill 也改了,再运行对应 skill 的 quick validate。
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import os
|
|
5
|
+
import re
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Mapping
|
|
8
|
+
from urllib.parse import urlparse
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
BASE_URL_ENV_VAR = "BPMAX_BASE_URL"
|
|
12
|
+
DEFAULT_BASE_URL = ""
|
|
13
|
+
REPO_ROOT = Path(__file__).resolve().parents[3]
|
|
14
|
+
DEFAULT_AGENTS_PATH = REPO_ROOT / "AGENTS.md"
|
|
15
|
+
AGENTS_CONTRACT_MARKER = "BPMAX_DEFAULT_ORIGIN_CONTRACT"
|
|
16
|
+
AGENTS_CONTRACT_PATTERN = re.compile(
|
|
17
|
+
rf"<!--\s*{AGENTS_CONTRACT_MARKER}\s*(\{{.*?\}})\s*-->",
|
|
18
|
+
re.DOTALL,
|
|
19
|
+
)
|
|
20
|
+
AGENTS_SIMPLE_PATTERN = re.compile(r"^\s*BPMAX_DEFAULT_ORIGIN:\s*(\S+)\s*$", re.MULTILINE)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _normalize_base_url(value: str) -> str:
|
|
24
|
+
text = str(value or "").strip()
|
|
25
|
+
if not text:
|
|
26
|
+
return ""
|
|
27
|
+
text = text.rstrip("/")
|
|
28
|
+
if text.endswith("/api"):
|
|
29
|
+
text = text[:-4]
|
|
30
|
+
parsed = urlparse(text)
|
|
31
|
+
if parsed.scheme not in ("http", "https") or not parsed.netloc:
|
|
32
|
+
raise SystemExit(
|
|
33
|
+
f"invalid base url: {text!r}. Use an http(s) origin such as https://bpmax.example.com"
|
|
34
|
+
)
|
|
35
|
+
if parsed.path not in ("", "/"):
|
|
36
|
+
raise SystemExit(f"invalid base url: {text!r}. Use the app origin only, not a nested path.")
|
|
37
|
+
return f"{parsed.scheme}://{parsed.netloc}"
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def load_agents_default_origin(*, agents_path: str | Path | None = None) -> str:
|
|
41
|
+
path = DEFAULT_AGENTS_PATH if agents_path is None else Path(agents_path)
|
|
42
|
+
if not path.exists():
|
|
43
|
+
return ""
|
|
44
|
+
text = path.read_text(encoding="utf-8")
|
|
45
|
+
match = AGENTS_CONTRACT_PATTERN.search(text)
|
|
46
|
+
if match is not None:
|
|
47
|
+
try:
|
|
48
|
+
payload = json.loads(match.group(1))
|
|
49
|
+
except json.JSONDecodeError as exc:
|
|
50
|
+
raise SystemExit(f"invalid {AGENTS_CONTRACT_MARKER} JSON in {path}") from exc
|
|
51
|
+
if not isinstance(payload, dict):
|
|
52
|
+
raise SystemExit(f"invalid {AGENTS_CONTRACT_MARKER} payload in {path}")
|
|
53
|
+
resolved = _normalize_base_url(str(payload.get("default_origin") or ""))
|
|
54
|
+
if resolved:
|
|
55
|
+
return resolved
|
|
56
|
+
simple_match = AGENTS_SIMPLE_PATTERN.search(text)
|
|
57
|
+
if simple_match is not None:
|
|
58
|
+
return _normalize_base_url(simple_match.group(1))
|
|
59
|
+
return ""
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def resolve_base_url(
|
|
63
|
+
value: str | None,
|
|
64
|
+
*,
|
|
65
|
+
browser_origin: str | None = None,
|
|
66
|
+
env: Mapping[str, str] | None = None,
|
|
67
|
+
agents_path: str | Path | None = None,
|
|
68
|
+
) -> str:
|
|
69
|
+
env_map = os.environ if env is None else env
|
|
70
|
+
resolved = value if value not in (None, "") else env_map.get(BASE_URL_ENV_VAR, "")
|
|
71
|
+
if resolved in (None, ""):
|
|
72
|
+
resolved = browser_origin
|
|
73
|
+
if resolved in (None, ""):
|
|
74
|
+
resolved = load_agents_default_origin(agents_path=agents_path)
|
|
75
|
+
normalized = _normalize_base_url(resolved)
|
|
76
|
+
if normalized:
|
|
77
|
+
return normalized
|
|
78
|
+
raise SystemExit(
|
|
79
|
+
"missing BPMAX base url: pass --base-url, set BPMAX_BASE_URL, provide the current browser page origin, "
|
|
80
|
+
"or define a repo fallback in AGENTS.md"
|
|
81
|
+
)
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"sites": [
|
|
4
|
+
{
|
|
5
|
+
"site_name": "lambda",
|
|
6
|
+
"runtime_kind": "frontend_expression",
|
|
7
|
+
"supports_await": true,
|
|
8
|
+
"requires_return_wrapper": true,
|
|
9
|
+
"recommended_max_lines": 40,
|
|
10
|
+
"allowed_side_effects": ["setValue", "mergeRule", "reload"],
|
|
11
|
+
"preferred_pattern": "return (async () => { guard; normalize; fetch; apply; })();",
|
|
12
|
+
"forbidden_pattern": "flat multi-branch promise chain with top-level await or nested then",
|
|
13
|
+
"allows_promise_then": false
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"site_name": "customeValidate",
|
|
17
|
+
"runtime_kind": "frontend_validator",
|
|
18
|
+
"supports_await": true,
|
|
19
|
+
"requires_return_wrapper": true,
|
|
20
|
+
"recommended_max_lines": 40,
|
|
21
|
+
"allowed_side_effects": ["return_validation_result"],
|
|
22
|
+
"preferred_pattern": "return (async () => { guard; fetch; return message_or_empty; })();",
|
|
23
|
+
"forbidden_pattern": "field writeback, notification, or nested promise chain",
|
|
24
|
+
"allows_promise_then": false
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"site_name": "es_project_selector_search",
|
|
28
|
+
"runtime_kind": "frontend_async_callback",
|
|
29
|
+
"supports_await": true,
|
|
30
|
+
"requires_return_wrapper": true,
|
|
31
|
+
"recommended_max_lines": 60,
|
|
32
|
+
"allowed_side_effects": ["return_search_list"],
|
|
33
|
+
"preferred_pattern": "return (async () => { guard; query; return { list }; })();",
|
|
34
|
+
"forbidden_pattern": "inline mapping tables mixed with UI writeback",
|
|
35
|
+
"allows_promise_then": false
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"site_name": "pre_process_script",
|
|
39
|
+
"runtime_kind": "backend_hook",
|
|
40
|
+
"supports_await": true,
|
|
41
|
+
"requires_return_wrapper": false,
|
|
42
|
+
"recommended_max_lines": 80,
|
|
43
|
+
"allowed_side_effects": ["rewrite_query", "append_filters", "default_sort", "import_server_script"],
|
|
44
|
+
"preferred_pattern": "guard; normalize; optional helper call; rewrite ctx.body; return",
|
|
45
|
+
"forbidden_pattern": "mixed UI concerns, writeback, notifications, or nested then chains",
|
|
46
|
+
"allows_promise_then": false
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"site_name": "beforeNextStepScript",
|
|
50
|
+
"runtime_kind": "backend_flow_hook",
|
|
51
|
+
"supports_await": true,
|
|
52
|
+
"requires_return_wrapper": false,
|
|
53
|
+
"recommended_max_lines": 120,
|
|
54
|
+
"allowed_side_effects": ["step_guard", "query", "state_patch", "external_sync", "import_server_script"],
|
|
55
|
+
"preferred_pattern": "guard; normalize; fetch; decide; apply; return",
|
|
56
|
+
"forbidden_pattern": "mixed validation, notification, and persistence branches in one flat function",
|
|
57
|
+
"allows_promise_then": false
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"site_name": "project_create_validator",
|
|
61
|
+
"runtime_kind": "backend_create_hook",
|
|
62
|
+
"supports_await": true,
|
|
63
|
+
"requires_return_wrapper": true,
|
|
64
|
+
"recommended_max_lines": 120,
|
|
65
|
+
"allowed_side_effects": ["query", "return_validation_result", "import_server_script"],
|
|
66
|
+
"preferred_pattern": "return (async () => { guard; fetch; validate; return message_or_empty; })();",
|
|
67
|
+
"forbidden_pattern": "nested then chains, writeback, or mixed callback side effects",
|
|
68
|
+
"allows_promise_then": false
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|