bpmax-cli 0.2.1-beta.2 → 0.2.1-beta.20

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 (106) hide show
  1. package/README.md +28 -1
  2. package/dist/bin.js +2132 -101
  3. package/dist/bin.js.map +1 -1
  4. package/package.json +1 -1
  5. package/skills/bpmax-ai-taskbook/SKILL.md +4 -1
  6. package/skills/bpmax-api-platform-editor/SKILL.md +24 -31
  7. package/skills/bpmax-api-platform-editor/agents/openai.yaml +2 -2
  8. package/skills/bpmax-api-platform-editor/references/platform-api-map.md +2 -2
  9. package/skills/bpmax-api-platform-editor/references/runtime-workflow.md +3 -3
  10. package/skills/bpmax-blueprint-doc-workflow/SKILL.md +87 -0
  11. package/skills/bpmax-blueprint-doc-workflow/agents/openai.yaml +4 -0
  12. package/skills/bpmax-blueprint-doc-workflow/references/blueprint-structure.md +60 -0
  13. package/skills/bpmax-blueprint-doc-workflow/references/per-flow-required-structure.md +98 -0
  14. package/skills/bpmax-blueprint-doc-workflow/references/sample-forbidden-term.xml +12 -0
  15. package/skills/bpmax-blueprint-doc-workflow/references/sample-mermaid-codeblock.xml +12 -0
  16. package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-boundary.xml +10 -0
  17. package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-whiteboard.xml +10 -0
  18. package/skills/bpmax-blueprint-doc-workflow/references/sample-pass.xml +55 -0
  19. package/skills/bpmax-blueprint-doc-workflow/scripts/lint_blueprint_doc.py +257 -0
  20. package/skills/bpmax-builder-shared/template_script_hard_rules.py +3 -1
  21. package/skills/bpmax-builder-shared/tests/test_template_script_hard_rules.py +16 -0
  22. package/skills/bpmax-cli/SKILL.md +30 -0
  23. package/skills/bpmax-console-template-editor/SKILL.md +109 -523
  24. package/skills/bpmax-console-template-editor/agents/openai.yaml +2 -2
  25. package/skills/bpmax-console-template-editor/references/full-detail-guide.md +45 -0
  26. package/skills/bpmax-console-template-editor/references/local-temp-workflow.md +13 -12
  27. package/skills/bpmax-console-template-editor/scripts/console_template_editor_common.py +65 -78
  28. package/skills/bpmax-console-template-editor/tests/test_console_template_editor.py +86 -30
  29. package/skills/bpmax-dataset-field-template-editor/SKILL.md +124 -594
  30. package/skills/bpmax-dataset-field-template-editor/references/full-detail-guide.md +570 -0
  31. package/skills/bpmax-dataset-field-template-editor/references/runtime-verified-field-page-shape.md +1 -1
  32. package/skills/bpmax-dataset-field-template-editor/scripts/dataset_field_editor_common.py +11 -77
  33. package/skills/bpmax-dataset-field-template-editor/scripts/export_dataset_field.py +4 -57
  34. package/skills/bpmax-dataset-field-template-editor/scripts/init_create_dataset_field.py +2 -0
  35. package/skills/bpmax-dataset-field-template-editor/scripts/inspect_dataset_field_runtime.py +4 -78
  36. package/skills/bpmax-dataset-field-template-editor/scripts/submit_dataset_field.py +3 -89
  37. package/skills/bpmax-dataset-field-template-editor/tests/test_dataset_field_editor.py +14 -0
  38. package/skills/bpmax-dataset-field-template-editor/tests/test_init_create_dataset_field.py +2 -0
  39. package/skills/bpmax-dataset-template-editor/SKILL.md +112 -768
  40. package/skills/bpmax-dataset-template-editor/references/full-detail-guide.md +753 -0
  41. package/skills/bpmax-dataset-template-editor/references/ui-to-backend-field-map.md +1 -0
  42. package/skills/bpmax-dataset-template-editor/references/work-file-to-submit-mapping.md +2 -2
  43. package/skills/bpmax-dataset-template-editor/scripts/basic_table_audit.py +8 -1
  44. package/skills/bpmax-dataset-template-editor/scripts/dataset_editor_common.py +9 -90
  45. package/skills/bpmax-dataset-template-editor/scripts/export_dataset.py +8 -1
  46. package/skills/bpmax-dataset-template-editor/scripts/resolve_dataset.py +8 -1
  47. package/skills/bpmax-dataset-template-editor/scripts/submit_dataset.py +1 -2
  48. package/skills/bpmax-dataset-template-editor/scripts/verify_dataset_list.py +8 -1
  49. package/skills/bpmax-dataset-template-editor/scripts/verify_publish_health.py +8 -1
  50. package/skills/bpmax-dataset-template-editor/tests/test_dataset_editor.py +6 -40
  51. package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +18 -4
  52. package/skills/bpmax-e2e-flow-test-operator/SKILL.md +112 -533
  53. package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +43 -4
  54. package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +6 -5
  55. package/skills/bpmax-e2e-flow-test-operator/references/full-detail-guide.md +563 -0
  56. package/skills/bpmax-e2e-flow-test-operator/references/negative-sale-api-matrix.md +4 -4
  57. package/skills/bpmax-e2e-flow-test-operator/references/profile-schema.md +1 -1
  58. package/skills/bpmax-e2e-flow-test-operator/references/state-schema.md +3 -1
  59. package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_doc.py +7 -5
  60. package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_state.py +2 -2
  61. package/skills/bpmax-e2e-flow-test-operator/scripts/flow_runner.py +5 -1
  62. package/skills/bpmax-e2e-flow-test-operator/tests/test_negative_sale_api_tools.py +71 -0
  63. package/skills/bpmax-filter-template-editor/SKILL.md +110 -551
  64. package/skills/bpmax-filter-template-editor/references/experience-coverage-matrix.md +18 -18
  65. package/skills/bpmax-filter-template-editor/references/filter-request-shape.md +29 -26
  66. package/skills/bpmax-filter-template-editor/references/full-detail-guide.md +56 -0
  67. package/skills/bpmax-filter-template-editor/references/runtime-verified-filter-page-shape.md +10 -9
  68. package/skills/bpmax-filter-template-editor/scripts/filter_template_editor_common.py +7 -57
  69. package/skills/bpmax-filter-template-editor/tests/test_filter_template_editor.py +4 -48
  70. package/skills/bpmax-flow-template-editor/SKILL.md +109 -1084
  71. package/skills/bpmax-flow-template-editor/agents/openai.yaml +2 -2
  72. package/skills/bpmax-flow-template-editor/references/diff-strategy.md +3 -3
  73. package/skills/bpmax-flow-template-editor/references/editor-runtime-vs-draft.md +9 -9
  74. package/skills/bpmax-flow-template-editor/references/full-detail-guide.md +1155 -0
  75. package/skills/bpmax-flow-template-editor/references/local-temp-workflow.md +1 -1
  76. package/skills/bpmax-flow-template-editor/references/requirement-to-node-mapping.md +3 -3
  77. package/skills/bpmax-flow-template-editor/references/runtime-verified-flow-detail-shape.md +7 -7
  78. package/skills/bpmax-flow-template-editor/references/runtime-verified-meta-fields.md +2 -2
  79. package/skills/bpmax-flow-template-editor/references/runtime-verified-node-fields.md +2 -2
  80. package/skills/bpmax-flow-template-editor/references/save-draft-request-shape.md +7 -23
  81. package/skills/bpmax-flow-template-editor/references/work-file-to-submit-mapping.md +1 -1
  82. package/skills/bpmax-flow-template-editor/tests/test_flow_template_editor.py +19 -75
  83. package/skills/bpmax-form-template-editor/SKILL.md +111 -1104
  84. package/skills/bpmax-form-template-editor/agents/openai.yaml +2 -2
  85. package/skills/bpmax-form-template-editor/references/form-template-api-workflow.md +51 -51
  86. package/skills/bpmax-form-template-editor/references/full-detail-guide.md +1108 -0
  87. package/skills/bpmax-form-template-editor/references/local-temp-workflow.md +4 -4
  88. package/skills/bpmax-form-template-editor/references/payload-checklist.md +1 -1
  89. package/skills/bpmax-form-template-editor/scripts/form_template_editor_common.py +8 -0
  90. package/skills/bpmax-form-template-editor/tests/test_form_template_editor.py +42 -19
  91. package/skills/bpmax-list-template-editor/SKILL.md +110 -466
  92. package/skills/bpmax-list-template-editor/agents/openai.yaml +2 -2
  93. package/skills/bpmax-list-template-editor/references/full-detail-guide.md +454 -0
  94. package/skills/bpmax-list-template-editor/references/list-template-api-workflow.md +6 -9
  95. package/skills/bpmax-list-template-editor/references/local-temp-workflow.md +1 -1
  96. package/skills/bpmax-list-template-editor/scripts/list_template_editor_common.py +9 -78
  97. package/skills/bpmax-nav-config-editor/SKILL.md +13 -17
  98. package/skills/bpmax-nav-config-editor/agents/openai.yaml +2 -2
  99. package/skills/bpmax-nav-config-editor/references/api-workflow.md +2 -2
  100. package/skills/bpmax-nav-config-editor/references/runtime-probing.md +11 -12
  101. package/skills/bpmax-project/SKILL.md +1 -0
  102. package/skills/bpmax-project-detail-template-editor/SKILL.md +11 -33
  103. package/skills/bpmax-project-detail-template-editor/agents/openai.yaml +2 -2
  104. package/skills/bpmax-role-editor/SKILL.md +7 -30
  105. package/skills/bpmax-user-mock-operator/SKILL.md +1 -1
  106. package/skills/bpmax-user-mock-operator/agents/openai.yaml +2 -2
@@ -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("&lt;", "<").replace("&gt;", ">").replace("&amp;", "&")
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())
@@ -49,7 +49,9 @@ INVENTORY_AGG_BLOCK_MESSAGE = (
49
49
  SQL_JOIN_PATTERN = re.compile(r"\bselect\b[\s\S]{0,800}\bjoin\b", re.IGNORECASE)
50
50
  ES_QUERY_PATTERN = re.compile(r"raw-es-search|ctx\.\$esQuery", re.IGNORECASE)
51
51
  PROJECT_LIST_PATTERN = re.compile(r"/bpmax/project/list|ESProjectList|esProjectList")
52
- USER_SCOPE_PROJECT_LIST_ALLOW_PATTERN = re.compile(r"bpmax-allow-user-scope-project-list\s*:")
52
+ USER_SCOPE_PROJECT_LIST_ALLOW_PATTERN = re.compile(
53
+ r"bpmax-allow-user-scope-project-list[ \t]*:[ \t]*[^\s\r\n][^\r\n]{2,}"
54
+ )
53
55
  ES_SIZE_PATTERN = re.compile(r"\bsize\s*:\s*(\d{3,})\b")
54
56
  SCRIPT_MATCH_PATTERN = re.compile(r"\.(?:find|filter|some)\s*\(|\.includes\s*\(")
55
57
  FRONTEND_COUNTING_PATTERN = re.compile(r"\b(?:inventoryQty|currentInventory|currentStock|total_count|count)\s*(?:\+\+|\+=\s*1)")
@@ -112,6 +112,22 @@ class TemplateScriptHardRulesTests(unittest.TestCase):
112
112
  self.assertTrue(report["ok"])
113
113
  self.assertEqual(report["findings"], [])
114
114
 
115
+ def test_rejects_empty_user_scope_project_list_waiver(self) -> None:
116
+ report = scan_named_script_surfaces(
117
+ [
118
+ {
119
+ "path": "fields.selector.lambda",
120
+ "script": (
121
+ "// bpmax-allow-user-scope-project-list:\n"
122
+ "return ctx.$axios.post('/bpmax/project/list?page=1', { flow_type: 'flow716' });"
123
+ ),
124
+ }
125
+ ]
126
+ )
127
+
128
+ self.assertFalse(report["ok"])
129
+ self.assertTrue(any(item["rule"] == "project_list_forbidden" for item in report["findings"]))
130
+
115
131
  def test_blocks_root_user_es_project_list_helper(self) -> None:
116
132
  report = scan_named_script_surfaces(
117
133
  [
@@ -33,6 +33,35 @@ bpmax-cli init --agent <agent> --channel feishu --url "<BPMAX_URL>" --name local
33
33
  - 找到匹配业务 skill 后,先复制 `next_commands.bbs_list` 里的 `--config-dir` 前缀运行 `bpmax-cli --config-dir <config_dir> bbs ensure <skill-key> --agent <agent> --profile <profile> --format json`,再按该业务 skill 的规则执行。
34
34
  - 只有没有匹配 BBS,或 BBS 不覆盖当前需求时,才回落到通用 `bpmax-flow`、`bpmax-project` 或 `bpmax-api` 路径。
35
35
 
36
+ ## Issue 提报
37
+
38
+ 用户要求“提 issue”、“创建 GitLab issue”、“报 bug 到 bpmax-cli”或需要把当前问题沉淀到 bpmax-cli 仓库时,使用 `bpmax-cli issue create` 或语义别名 `bpmax-cli issue report`。
39
+
40
+ 如果工作中发现 bpmax-cli 自身的稳定问题,也可以自动创建 issue,不需要等用户再次下达“提 issue”:
41
+
42
+ - 适用:可复现的 bpmax-cli 缺陷、回归、缺失 typed capability、错误/误导性诊断、lint 漏检、危险默认行为、skill 与 CLI 能力不一致。
43
+ - 不适用:客户业务配置缺陷、环境临时波动、权限未授权、证据不足的猜测、只在本地脏工作区出现的问题。这些先写入本轮报告或任务书,除非用户明确要求提到 bpmax-cli。
44
+ - 自动提报前必须先写一份精简 issue 描述文件,包含:现象、复现命令或最小步骤、期望行为、实际行为、影响范围、已验证的排除项、建议修复方向。
45
+ - 正式创建前必须先执行 `bpmax-cli issue create ... --dry-run --format json`,检查标题、正文、标签、项目、assignee 和保密标记;dry-run 中不得包含 token、API Key、cookie、手机号、完整 raw payload、客户敏感数据或大段日志。
46
+ - dry-run 检查通过且问题稳定可复现时,再去掉 `--dry-run` 创建;创建成功后最终回复必须给出 `issue.web_url`。
47
+ - 如果证据还不完整,先保留本地 notes/report,不要为了“自动提报”制造低质量 issue。
48
+
49
+ 推荐流程:
50
+
51
+ ```bash
52
+ bpmax-cli issue create --title "<标题>" --description-file <file.md> --label bug --dry-run --format json
53
+ bpmax-cli issue create --title "<标题>" --description-file <file.md> --label bug --format json
54
+ ```
55
+
56
+ 规则:
57
+
58
+ - 默认 GitLab 地址是 `https://gitlab.yitaiyitai.com`,默认项目是 `bpmax/bpmax-cli`;跨项目时显式加 `--project <group/project>`。
59
+ - 复杂描述先写到临时 markdown 文件,再用 `--description-file <file>`,不要把长日志或多行正文塞进命令行参数。
60
+ - 涉及 assignee 时用 `--assignee-id <id>`,可重复或传逗号分隔;涉及保密问题时加 `--confidential`。
61
+ - 默认先跑 `--dry-run --format json` 核对标题、正文、标签、项目和 assignee;确认后再去掉 `--dry-run` 实际提交。
62
+ - 需要指定凭据来源时用 `--token-env <ENV_NAME>`;不要在命令行、skill、memory、issue 正文或日志里写入 token 原文。
63
+ - 创建成功后,最终回复必须包含 CLI 返回的 issue URL;`pretty` 输出会直接打印 URL,`json` 输出读取 `issue.web_url`。
64
+
36
65
  ## 路由规则
37
66
 
38
67
  - 环境配置、全局参数、命令发现、原始 API 降级:先读 `../bpmax-shared/SKILL.md`
@@ -49,6 +78,7 @@ bpmax-cli init --agent <agent> --channel feishu --url "<BPMAX_URL>" --name local
49
78
  - BPMAX Business Skills 查询、同步、安装、更新、卸载:读 `../bpmax-business-skill/SKILL.md`
50
79
  - AI 任务方案、任务书、任务拆解、subagent 分工、实施任务表、进度 CSV:读 `../bpmax-ai-taskbook/SKILL.md`
51
80
  - 审批矩阵、角色矩阵、矩阵规则记录、`matrix_owner`、`cc_matrix`、规则 seed、审批人映射:读 `../bpmax-approval-matrix/SKILL.md`
81
+ - bpmax-cli 自身问题提报、GitLab issue 创建:留在本 skill 的 “Issue 提报” 小节,使用 `bpmax-cli issue create/report`
52
82
 
53
83
  ## 规则
54
84