speccrew 0.6.68 → 0.7.0

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 (134) hide show
  1. package/.speccrew/agents/speccrew-task-worker.md +1 -1
  2. package/.speccrew/agents/speccrew-team-leader.md +336 -189
  3. package/.speccrew/skills/speccrew-agentflow-manager/SKILL.md +161 -0
  4. package/.speccrew/skills/speccrew-agentflow-manager/workflow.agentflow.xml +347 -0
  5. package/.speccrew/skills/speccrew-deploy-build/SKILL.md +3 -56
  6. package/.speccrew/skills/speccrew-deploy-build/workflow.agentflow.xml +125 -0
  7. package/.speccrew/skills/speccrew-deploy-migrate/SKILL.md +3 -64
  8. package/.speccrew/skills/speccrew-deploy-migrate/workflow.agentflow.xml +135 -0
  9. package/.speccrew/skills/speccrew-deploy-smoke-test/SKILL.md +4 -156
  10. package/.speccrew/skills/speccrew-deploy-smoke-test/workflow.agentflow.xml +178 -0
  11. package/.speccrew/skills/speccrew-deploy-startup/SKILL.md +3 -135
  12. package/.speccrew/skills/speccrew-deploy-startup/workflow.agentflow.xml +223 -0
  13. package/.speccrew/skills/speccrew-dev-backend/SKILL.md +10 -2
  14. package/.speccrew/skills/speccrew-dev-backend/workflow.agentflow.xml +254 -0
  15. package/.speccrew/skills/speccrew-dev-desktop-electron/SKILL.md +10 -2
  16. package/.speccrew/skills/speccrew-dev-desktop-electron/workflow.agentflow.xml +259 -0
  17. package/.speccrew/skills/speccrew-dev-desktop-tauri/SKILL.md +10 -2
  18. package/.speccrew/skills/speccrew-dev-desktop-tauri/workflow.agentflow.xml +245 -0
  19. package/.speccrew/skills/speccrew-dev-frontend/SKILL.md +10 -2
  20. package/.speccrew/skills/speccrew-dev-frontend/workflow.agentflow.xml +262 -0
  21. package/.speccrew/skills/speccrew-dev-mobile/SKILL.md +10 -2
  22. package/.speccrew/skills/speccrew-dev-mobile/workflow.agentflow.xml +244 -0
  23. package/.speccrew/skills/speccrew-dev-review-backend/SKILL.md +10 -2
  24. package/.speccrew/skills/speccrew-dev-review-backend/workflow.agentflow.xml +251 -0
  25. package/.speccrew/skills/speccrew-dev-review-desktop/SKILL.md +10 -2
  26. package/.speccrew/skills/speccrew-dev-review-desktop/workflow.agentflow.xml +214 -0
  27. package/.speccrew/skills/speccrew-dev-review-frontend/SKILL.md +10 -2
  28. package/.speccrew/skills/speccrew-dev-review-frontend/workflow.agentflow.xml +213 -0
  29. package/.speccrew/skills/speccrew-dev-review-mobile/SKILL.md +10 -2
  30. package/.speccrew/skills/speccrew-dev-review-mobile/workflow.agentflow.xml +214 -0
  31. package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +7 -1
  32. package/.speccrew/skills/speccrew-fd-api-contract/workflow.agentflow.xml +222 -0
  33. package/.speccrew/skills/speccrew-fd-feature-analyze/SKILL.md +7 -1
  34. package/.speccrew/skills/speccrew-fd-feature-analyze/workflow.agentflow.xml +223 -0
  35. package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +7 -1
  36. package/.speccrew/skills/speccrew-fd-feature-design/workflow.agentflow.xml +322 -0
  37. package/.speccrew/skills/speccrew-get-timestamp/SKILL.md +3 -39
  38. package/.speccrew/skills/speccrew-get-timestamp/workflow.agentflow.xml +43 -0
  39. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +57 -508
  40. package/.speccrew/skills/{speccrew-knowledge-bizs-api-analyze-xml/SKILL.md → speccrew-knowledge-bizs-api-analyze/workflow.agentflow.xml} +1 -154
  41. package/.speccrew/skills/speccrew-knowledge-bizs-api-graph/SKILL.md +73 -283
  42. package/.speccrew/skills/{speccrew-knowledge-bizs-api-graph-xml/SKILL.md → speccrew-knowledge-bizs-api-graph/workflow.agentflow.xml} +0 -298
  43. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +931 -801
  44. package/.speccrew/skills/{speccrew-knowledge-bizs-dispatch-xml/SKILL.md → speccrew-knowledge-bizs-dispatch/workflow.agentflow.xml} +42 -272
  45. package/.speccrew/skills/speccrew-knowledge-bizs-identify-entries/SKILL.md +263 -71
  46. package/.speccrew/skills/{speccrew-knowledge-bizs-identify-entries-xml/SKILL.md → speccrew-knowledge-bizs-identify-entries/workflow.agentflow.xml} +8 -184
  47. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/SKILL.md +200 -181
  48. package/.speccrew/skills/{speccrew-knowledge-bizs-init-features-xml/SKILL.md → speccrew-knowledge-bizs-init-features/workflow.agentflow.xml} +7 -134
  49. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/SKILL.md +5 -89
  50. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/workflow.agentflow.xml +129 -0
  51. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +454 -326
  52. package/.speccrew/skills/{speccrew-knowledge-bizs-ui-analyze-xml/SKILL.md → speccrew-knowledge-bizs-ui-analyze/workflow.agentflow.xml} +8 -128
  53. package/.speccrew/skills/speccrew-knowledge-bizs-ui-graph/SKILL.md +302 -247
  54. package/.speccrew/skills/{speccrew-knowledge-bizs-ui-graph-xml/SKILL.md → speccrew-knowledge-bizs-ui-graph/workflow.agentflow.xml} +7 -199
  55. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/SKILL.md +267 -156
  56. package/.speccrew/skills/{speccrew-knowledge-bizs-ui-style-extract-xml/SKILL.md → speccrew-knowledge-bizs-ui-style-extract/workflow.agentflow.xml} +7 -151
  57. package/.speccrew/skills/speccrew-knowledge-graph-query/SKILL.md +3 -122
  58. package/.speccrew/skills/speccrew-knowledge-graph-query/workflow.agentflow.xml +106 -0
  59. package/.speccrew/skills/speccrew-knowledge-graph-write/SKILL.md +3 -80
  60. package/.speccrew/skills/speccrew-knowledge-graph-write/workflow.agentflow.xml +152 -0
  61. package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +371 -265
  62. package/.speccrew/skills/{speccrew-knowledge-module-summarize-xml/SKILL.md → speccrew-knowledge-module-summarize/workflow.agentflow.xml} +7 -197
  63. package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +45 -333
  64. package/.speccrew/skills/{speccrew-knowledge-system-summarize-xml/SKILL.md → speccrew-knowledge-system-summarize/workflow.agentflow.xml} +0 -177
  65. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +174 -727
  66. package/.speccrew/skills/{speccrew-knowledge-techs-dispatch-xml/SKILL.md → speccrew-knowledge-techs-dispatch/workflow.agentflow.xml} +10 -351
  67. package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +20 -150
  68. package/.speccrew/skills/{speccrew-knowledge-techs-generate-xml/SKILL.md → speccrew-knowledge-techs-generate/workflow.agentflow.xml} +0 -169
  69. package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +75 -587
  70. package/.speccrew/skills/{speccrew-knowledge-techs-generate-conventions-xml/SKILL.md → speccrew-knowledge-techs-generate-conventions/workflow.agentflow.xml} +0 -153
  71. package/.speccrew/skills/speccrew-knowledge-techs-generate-quality/SKILL.md +463 -297
  72. package/.speccrew/skills/{speccrew-knowledge-techs-generate-quality-xml/SKILL.md → speccrew-knowledge-techs-generate-quality/workflow.agentflow.xml} +0 -164
  73. package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +57 -292
  74. package/.speccrew/skills/{speccrew-knowledge-techs-generate-ui-style-xml/SKILL.md → speccrew-knowledge-techs-generate-ui-style/workflow.agentflow.xml} +2 -193
  75. package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +49 -335
  76. package/.speccrew/skills/{speccrew-knowledge-techs-index-xml/SKILL.md → speccrew-knowledge-techs-index/workflow.agentflow.xml} +0 -167
  77. package/.speccrew/skills/speccrew-knowledge-techs-init/SKILL.md +28 -109
  78. package/.speccrew/skills/{speccrew-knowledge-techs-init-xml/SKILL.md → speccrew-knowledge-techs-init/workflow.agentflow.xml} +0 -189
  79. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +3 -487
  80. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/workflow.agentflow.xml +278 -0
  81. package/.speccrew/skills/speccrew-pm-knowledge-detector/SKILL.md +3 -71
  82. package/.speccrew/skills/speccrew-pm-knowledge-detector/workflow.agentflow.xml +108 -0
  83. package/.speccrew/skills/speccrew-pm-module-initializer/SKILL.md +3 -107
  84. package/.speccrew/skills/speccrew-pm-module-initializer/workflow.agentflow.xml +139 -0
  85. package/.speccrew/skills/speccrew-pm-module-matcher/SKILL.md +3 -115
  86. package/.speccrew/skills/speccrew-pm-module-matcher/workflow.agentflow.xml +146 -0
  87. package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +3 -343
  88. package/.speccrew/skills/speccrew-pm-requirement-analysis/workflow.agentflow.xml +174 -0
  89. package/.speccrew/skills/speccrew-pm-requirement-assess/SKILL.md +3 -91
  90. package/.speccrew/skills/speccrew-pm-requirement-assess/workflow.agentflow.xml +173 -0
  91. package/.speccrew/skills/speccrew-pm-requirement-clarify/SKILL.md +3 -224
  92. package/.speccrew/skills/speccrew-pm-requirement-clarify/workflow.agentflow.xml +159 -0
  93. package/.speccrew/skills/speccrew-pm-requirement-model/SKILL.md +3 -275
  94. package/.speccrew/skills/speccrew-pm-requirement-model/workflow.agentflow.xml +210 -0
  95. package/.speccrew/skills/speccrew-pm-requirement-simple/SKILL.md +3 -76
  96. package/.speccrew/skills/speccrew-pm-requirement-simple/workflow.agentflow.xml +120 -0
  97. package/.speccrew/skills/speccrew-pm-sub-prd-generate/SKILL.md +7 -1
  98. package/.speccrew/skills/speccrew-pm-sub-prd-generate/workflow.agentflow.xml +218 -0
  99. package/.speccrew/skills/speccrew-sd-backend/SKILL.md +7 -1
  100. package/.speccrew/skills/speccrew-sd-backend/workflow.agentflow.xml +264 -0
  101. package/.speccrew/skills/speccrew-sd-desktop/SKILL.md +7 -1
  102. package/.speccrew/skills/speccrew-sd-desktop/workflow.agentflow.xml +288 -0
  103. package/.speccrew/skills/speccrew-sd-framework-evaluate/SKILL.md +7 -1
  104. package/.speccrew/skills/speccrew-sd-framework-evaluate/workflow.agentflow.xml +235 -0
  105. package/.speccrew/skills/speccrew-sd-frontend/SKILL.md +7 -1
  106. package/.speccrew/skills/speccrew-sd-frontend/workflow.agentflow.xml +299 -0
  107. package/.speccrew/skills/speccrew-sd-mobile/SKILL.md +7 -1
  108. package/.speccrew/skills/speccrew-sd-mobile/workflow.agentflow.xml +301 -0
  109. package/.speccrew/skills/speccrew-test-case-design/SKILL.md +165 -284
  110. package/.speccrew/skills/speccrew-test-case-design/workflow.agentflow.xml +210 -0
  111. package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +204 -324
  112. package/.speccrew/skills/speccrew-test-code-gen/workflow.agentflow.xml +265 -0
  113. package/.speccrew/skills/speccrew-test-reporter/SKILL.md +205 -184
  114. package/.speccrew/skills/speccrew-test-reporter/workflow.agentflow.xml +284 -0
  115. package/.speccrew/skills/speccrew-test-runner/SKILL.md +242 -241
  116. package/.speccrew/skills/speccrew-test-runner/workflow.agentflow.xml +314 -0
  117. package/bin/cli.js +8 -1
  118. package/lib/commands/validate.js +565 -0
  119. package/package.json +1 -1
  120. package/workspace-template/docs/rules/{xml-workflow-spec.md → agentflow-spec.md} +5 -5
  121. package/workspace-template/scripts/validate-agentflow.js +637 -0
  122. package/.speccrew/agents/speccrew-team-leader-xml.md +0 -480
  123. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/STATUS-FORMATS.md +0 -99
  124. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/batch-orchestrator.js +0 -176
  125. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-next-batch.js +0 -150
  126. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-pending-features.js +0 -106
  127. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/mark-stale.js +0 -249
  128. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/merge-features.js +0 -300
  129. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/process-batch-results.js +0 -915
  130. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/update-feature-status.js +0 -226
  131. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/examples/features.json +0 -34
  132. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js +0 -1071
  133. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/test-inventory.js +0 -26
  134. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/STATUS-FORMATS.md +0 -550
@@ -1,12 +1,26 @@
1
1
  ---
2
2
  name: speccrew-knowledge-bizs-identify-entries
3
- description: Analyze source directory structures to identify business module entry directories for each platform. Use when initializing or updating business knowledge base to determine which directories contain user-facing entry points.
3
+ description: Analyze source directory structures to identify business module entry directories for each platform using XML workflow blocks. Use when initializing or updating business knowledge base to determine which directories contain user-facing entry points.
4
4
  tools: Read, Write, Glob, Grep, Bash
5
5
  ---
6
6
 
7
7
  # speccrew-knowledge-bizs-identify-entries
8
8
 
9
- Analyze source directory structures to identify business module entry directories for each platform.
9
+ Analyze source directory structures to identify business module entry directories for each platform using XML workflow blocks.
10
+
11
+ ## Language Adaptation
12
+
13
+ All generated documents must match the user's language. Detect the language from the user's input and generate content accordingly.
14
+
15
+ - User writes in 中文 → Generate Chinese documents, use `language: "zh"`
16
+ - User writes in English → Generate English documents, use `language: "en"`
17
+ - User writes in other languages → Use appropriate language code
18
+
19
+ ## Trigger Scenarios
20
+
21
+ - Called by `speccrew-knowledge-bizs-dispatch` Stage 1
22
+ - "Identify business module entry directories"
23
+ - "Analyze source structure for business modules"
10
24
 
11
25
  ## Input Parameters
12
26
 
@@ -22,65 +36,193 @@ Analyze source directory structures to identify business module entry directorie
22
36
  For each platform, generates:
23
37
  - `{sync_state_bizs_dir}/entry-dirs-{platform_id}.json`
24
38
 
25
- ## Workflow
26
-
27
- ### Step 1: Read Directory Tree
28
-
29
- Use `Glob` or `Bash(tree)` to read each platform's `{sourcePath}` directory structure (3 levels deep):
30
-
31
- ```bash
32
- # Windows (PowerShell)
33
- tree /F /A "{source_path}" | Select-Object -First 100
34
-
35
- # Unix/Linux/Mac
36
- tree -L 3 "{source_path}"
37
- ```
38
-
39
- ### Step 2: LLM Analysis - Identify Entry Directories
40
-
41
- Based on the directory tree and technology stack, analyze and identify entry directories for each platform type:
42
-
43
- **Backend (Spring/Java/Kotlin)**:
44
- - Find all directories containing `*Controller.java` or `*Controller.kt` files
45
- - These are API entry directories
46
- - Module name = the business package name of the entry directory (e.g., `controller/admin/chat` module `chat`)
47
-
48
- **Frontend (Vue/React)**:
49
- - Find `views/` or `pages/` directories
50
- - First-level subdirectories under these directories are business modules
51
- - Each subdirectory is an entry directory (e.g., `views/system/` → module `system`)
52
-
53
- **Mobile (UniApp)**:
54
- - Find first-level subdirectories under `pages/`
55
- - Plus top-level `pages-*` directories (module name = directory name without `pages-` prefix, e.g., `pages-bpm` → module `bpm`)
56
-
57
- **Mobile (Mini Program)**:
58
- - Find first-level subdirectories under `pages/` as modules
59
-
60
- ### Step 3: Load Exclusion Rules
61
-
62
- Read `{configs_dir}/tech-stack-mappings.json` to load exclusion patterns. Apply the following exclusion rules:
63
-
64
- **Pure Technical Directories**:
65
- `config`, `framework`, `enums`, `exception`, `util`, `utils`, `common`, `constant`, `constants`, `type`, `types`, `dto`, `vo`, `entity`, `model`, `mapper`, `repository`, `dao`, `service`, `impl`
66
-
67
- **Build/Output Directories**:
68
- `dist`, `build`, `target`, `out`, `node_modules`
69
-
70
- **Test Directories**:
71
- `test`, `tests`, `spec`, `__tests__`, `e2e`
72
-
73
- **Configuration Directories**:
74
- `.git`, `.idea`, `.vscode`, `.speccrew`
75
-
76
- **Root Module Handling**:
77
- - If an entry file is not under any subdirectory (directly under `{sourcePath}`), assign it to the `_root` module
78
-
79
- ### Step 4: Generate entry-dirs JSON
80
-
81
- Output file: `{sync_state_bizs_dir}/entry-dirs-{platform_id}.json`
39
+ ## AgentFlow Definition
40
+
41
+ <!-- @agentflow: workflow.agentflow.xml -->
42
+
43
+ > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/agentflow-spec.md`
44
+
45
+ <!-- ============================================================
46
+ Input Parameters Definition
47
+ ============================================================ -->
48
+ <block type="input" id="I1" desc="Workflow input parameters">
49
+ <field name="platforms" required="true" type="array" desc="Platform list from detection phase"/>
50
+ <field name="workspace_path" required="true" type="string" desc="Absolute path to speccrew-workspace directory"/>
51
+ <field name="sync_state_bizs_dir" required="true" type="string" desc="Absolute path to entry-dirs JSON output directory"/>
52
+ <field name="configs_dir" required="true" type="string" desc="Absolute path to configuration files directory"/>
53
+ </block>
54
+
55
+ <!-- ============================================================
56
+ Global Constraints
57
+ ============================================================ -->
58
+ <block type="rule" id="R1" level="mandatory" desc="Path constraints">
59
+ <field name="text">Use the provided absolute paths directly. DO NOT construct or derive paths yourself.</field>
60
+ <field name="text">All entryDirs paths must use forward slashes / as path separators (even on Windows)</field>
61
+ <field name="text">Do not include leading or trailing slashes in entryDirs paths</field>
62
+ </block>
63
+
64
+ <block type="rule" id="R-TECHSTACK" level="mandatory" desc="techStack values MUST match tech-stack-mappings.json keys">
65
+ <field name="text">
66
+ The techStack array values MUST exactly match keys defined in tech-stack-mappings.json (e.g., "fastapi", "vue3", "uniapp").
67
+ DO NOT prefix with language name (e.g., use "fastapi" NOT "python-fastapi", use "express" NOT "node-express").
68
+ The tech_identifier input parameter value should be used as the primary techStack entry.
69
+ </field>
70
+ </block>
71
+
72
+ <!-- ============================================================
73
+ Global Continuous Execution Rules
74
+ ============================================================ -->
75
+ <block type="rule" id="GLOBAL-R1" level="forbidden" desc="Continuous execution constraints — NEVER violate">
76
+ <field name="text">DO NOT ask user "Should I continue?" or "How would you like to proceed?" during execution</field>
77
+ <field name="text">DO NOT offer options like "Full execution / Partial / Stop" — always execute ALL tasks to completion</field>
78
+ <field name="text">DO NOT suggest "Due to context window limits, let me pause" — complete current task, use checkpoint for resumption</field>
79
+ <field name="text">DO NOT estimate workload and suggest breaking it into phases execute ALL items in sequence</field>
80
+ <field name="text">DO NOT warn about "large number of files" or "this may take a while" — proceed with generation</field>
81
+ <field name="text">Context window management: if approaching limit, save progress to checkpoint file and resume — do NOT ask user for guidance</field>
82
+ </block>
83
+
84
+ <!-- ============================================================
85
+ Main Processing Sequence
86
+ ============================================================ -->
87
+ <sequence id="S1" name="Process Platforms" status="pending" desc="Iterate each platform to identify entry directories">
88
+
89
+ <!-- Loop: Process Each Platform -->
90
+ <block type="loop" id="L1" over="${platforms}" as="platform" desc="Iterate each platform to identify entry directories">
91
+
92
+ <!-- Step 1: Read Directory Tree -->
93
+ <block type="task" id="B1" action="run-script" desc="Read each platform's sourcePath directory structure (3 levels deep)">
94
+ <field name="command">Get-ChildItem -Path "${platform.sourcePath}" -Recurse -Directory -Depth 2 | Select-Object -ExpandProperty FullName</field>
95
+ <field name="note">MUST use Get-ChildItem (NOT tree command). MUST use ${platform.sourcePath} absolute path (NOT relative path). Scan depth follows module_scan.depth configuration from tech-stack-mappings.json.</field>
96
+ <field name="output" var="directory_tree"/>
97
+ </block>
98
+
99
+ <!-- Step 2: LLM Analysis - Identify Entry Directories -->
100
+ <block type="task" id="B2" action="analyze" desc="Analyze directory tree and identify entry directories based on platform type">
101
+ <field name="input" value="${directory_tree}"/>
102
+ <field name="platform_type" value="${platform.platformType}"/>
103
+ <field name="platform_subtype" value="${platform.platformSubtype}"/>
104
+ <field name="tech_stack" value="${platform.techStack}"/>
105
+ <field name="logic_module_scan" value="Read tech-stack-mappings.json for the techStack's module_scan configuration. Use module_scan.root as the scan starting point and module_scan.depth as the grouping level (depth=1 means first-level subdirectories = one module each)"/>
106
+ <field name="logic_backend" value="Find all directories containing *Controller.java or *Controller.kt files under module_scan.root. These are API entry directories. Module name = the business package name of the entry directory. Apply module_scan.depth for grouping level"/>
107
+ <field name="logic_frontend_vue_react" value="Find directories under module_scan.root (e.g., src/views or src/pages). First-level subdirectories under module_scan.root are business modules when depth=1"/>
108
+ <field name="logic_mobile_uniapp" value="Find first-level subdirectories under module_scan.root (e.g., src/pages). Plus top-level pages-* directories (module name = directory name without pages- prefix)"/>
109
+ <field name="logic_mobile_miniprogram" value="Find first-level subdirectories under module_scan.root (e.g., pages) as modules"/>
110
+ <field name="output" var="identified_entries"/>
111
+ </block>
112
+
113
+ <!-- Step 3: Load Exclusion Rules -->
114
+ <block type="task" id="B3" action="read-file" desc="Read tech-stack-mappings.json to load exclusion patterns">
115
+ <field name="path" value="${configs_dir}/tech-stack-mappings.json"/>
116
+ <field name="output" var="exclusion_rules"/>
117
+ </block>
118
+
119
+ <!-- Gateway: Apply Exclusion Rules -->
120
+ <block type="gateway" id="G1" mode="guard" desc="Check if identified_entries is not empty">
121
+ <branch test="${identified_entries} != null AND ${identified_entries.length} > 0">
122
+ <block type="task" id="B4" action="analyze" desc="Apply exclusion rules to filter out technical directories">
123
+ <field name="input" value="${identified_entries}"/>
124
+ <field name="exclusion_rules" value="${exclusion_rules}"/>
125
+ <field name="exclusions_pure_technical" value="config, framework, enums, exception, util, utils, common, constant, constants, type, types, dto, vo, entity, model, mapper, repository, dao, service, impl"/>
126
+ <field name="exclusions_build_output" value="dist, build, target, out, node_modules"/>
127
+ <field name="exclusions_test_directories" value="test, tests, spec, __tests__, e2e"/>
128
+ <field name="exclusions_config_directories" value=".git, .idea, .vscode, .speccrew"/>
129
+ <field name="root_handling" value="Assign entry files not under any subdirectory to _root module"/>
130
+ <field name="output" var="filtered_entries"/>
131
+ </block>
132
+ </branch>
133
+ </block>
134
+
135
+ <!-- Step 4: Generate entry-dirs JSON -->
136
+ <block type="task" id="B5" action="write-file" desc="Generate entry-dirs JSON file for the platform">
137
+ <field name="path" value="${sync_state_bizs_dir}/entry-dirs-${platform.platformId}.json"/>
138
+ <field name="content_json">
139
+ {
140
+ "platformId": "${platform.platformId}",
141
+ "platformName": "${platform.platformName}",
142
+ "platformType": "${platform.platformType}",
143
+ "platformSubtype": "${platform.platformSubtype}",
144
+ "sourcePath": "${platform.sourcePath}",
145
+ "techStack": "${platform.techStack}",
146
+ "modules": [
147
+ { "name": "module-name", "entryDirs": ["relative/path/to/entry"] }
148
+ ]
149
+ }
150
+ </field>
151
+ <field name="output" var="generated_json_path"/>
152
+ </block>
153
+
154
+ <!-- Rule: Output JSON Format Validation -->
155
+ <block type="rule" id="R-FORMAT" scope="mandatory" desc="Output JSON format validation">
156
+ <field name="content">
157
+ The generated entry-dirs JSON file MUST strictly follow this structure:
158
+ - Root object MUST contain "modules" field (array type)
159
+ - Root object MUST NOT contain "businessModules", "subModules", or "components" fields
160
+ - Each module in "modules" array MUST have exactly two fields: "name" (string) and "entryDirs" (array of strings)
161
+ - For platforms with hierarchical directory structure (e.g. frontend views/system/user/), flatten into individual modules
162
+ - Module names should use hyphen-separated composite names for sub-modules (e.g. "system-user", "system-role")
163
+ - Multiple modules MUST NOT share the same entryDirs value. If multiple business areas share the same directory, they belong to ONE module.
164
+ - If the generated JSON does not match this format, you MUST regenerate it before proceeding
165
+ </field>
166
+ <field name="text">Output is strictly the entry-dirs JSON file at the specified output path. Per agentflow-spec.md "Strict Block Adherence" rule, no extra files are permitted.</field>
167
+ </block>
168
+
169
+ <!-- Checkpoint: Persist Generated JSON -->
170
+ <block type="checkpoint" id="CP1" name="entry-dirs-generated" desc="Verify entry-dirs JSON was generated">
171
+ <field name="file" value="${sync_state_bizs_dir}/entry-dirs-${platform.platformId}.json"/>
172
+ <field name="verify" value="file_exists(${sync_state_bizs_dir}/entry-dirs-${platform.platformId}.json)"/>
173
+ </block>
174
+
175
+ <!-- Step 5: Validation -->
176
+ <block type="task" id="B6" action="analyze" desc="Validate the generated entry-dirs JSON">
177
+ <field name="input" value="${generated_json_path}"/>
178
+ <field name="validation_rules">
179
+ - modules array is not empty
180
+ - each module has at least one entry directory
181
+ - module names are business-meaningful (not technical terms like config, util)
182
+ - entryDirs paths are correct and accessible
183
+ - JSON format is valid
184
+ </field>
185
+ <field name="output" var="validation_result"/>
186
+ </block>
187
+
188
+ <!-- Gateway: Validation Result -->
189
+ <block type="gateway" id="G2" mode="exclusive" desc="Handle validation result">
190
+ <branch test="${validation_result.status} == 'failed'">
191
+ <block type="error-handler" id="EH1" desc="Handle validation failure">
192
+ <catch error-type="validation_failed">
193
+ <block type="event" id="E1" action="log" level="warn" desc="Log validation failure">
194
+ <field name="message">Entry directory recognition failed for platform ${platform.platformId}</field>
195
+ </block>
196
+ <block type="task" id="B7" action="analyze" desc="Re-analyze the directory tree due to validation failure">
197
+ <field name="input" value="${directory_tree}"/>
198
+ <field name="output" var="re_analyzed_entries"/>
199
+ </block>
200
+ </catch>
201
+ </block>
202
+ </branch>
203
+ <branch test="${validation_result.status} == 'passed'">
204
+ <block type="event" id="E2" action="log" level="info" desc="Log validation success">
205
+ <field name="message">Platform ${platform.platformId} entry-dirs validation passed</field>
206
+ </block>
207
+ </branch>
208
+ </block>
209
+
210
+ </block>
211
+
212
+ </sequence>
213
+
214
+ <!-- ============================================================
215
+ Output Results
216
+ ============================================================ -->
217
+ <block type="output" id="O1" desc="Workflow output results">
218
+ <field name="generated_files" from="${generated_json_path}" type="array" desc="List of all generated entry-dirs JSON files"/>
219
+ <field name="validation_summary" from="${validation_result}" type="object" desc="Summary of validation results for all platforms"/>
220
+ </block>
221
+
222
+ </workflow>
223
+
224
+ ## Output JSON Format
82
225
 
83
- **JSON Format**:
84
226
  ```json
85
227
  {
86
228
  "platformId": "backend-ai",
@@ -98,7 +240,57 @@ Output file: `{sync_state_bizs_dir}/entry-dirs-{platform_id}.json`
98
240
  }
99
241
  ```
100
242
 
101
- **Field Definitions**:
243
+ ### Module Granularity (CRITICAL)
244
+
245
+ **Core Principle**: modules = directory-level groupings, NOT file-level features
246
+
247
+ **Configuration-Driven Approach**:
248
+ 1. Read `tech-stack-mappings.json` to get the `module_scan` configuration for the detected `techStack`
249
+ 2. Use `module_scan.root` as the scanning starting point (e.g., `src/views` for vue, `controller` for spring)
250
+ 3. Use `module_scan.depth` as the grouping level:
251
+ - `depth=1`: Each first-level subdirectory under `module_scan.root` = ONE module
252
+ - `depth=2`: Each second-level subdirectory = ONE module (e.g., for android)
253
+ 4. Each module represents a distinct source directory containing entry files
254
+
255
+ **NEVER create multiple modules pointing to the SAME entryDirs** — if 10 controller files all reside in the same directory, that is ONE module with that directory as entryDirs, NOT 10 separate modules
256
+
257
+ **Key Rules**:
258
+ - The downstream `generate-inventory.js` script handles file-level decomposition within each module's entryDirs — that is NOT the job of this skill
259
+ - Module names should correspond to directory names, not individual file names
260
+ - Typical module count for a medium project: 3-10 modules (not 30+)
261
+
262
+ **Correct example** (directory-level, vue with module_scan.root="src/views", depth=1):
263
+ ```json
264
+ {
265
+ "modules": [
266
+ { "name": "ai", "entryDirs": ["src/views/ai"] },
267
+ { "name": "bpm", "entryDirs": ["src/views/bpm"] },
268
+ { "name": "system", "entryDirs": ["src/views/system"] }
269
+ ]
270
+ }
271
+ ```
272
+
273
+ **WRONG example** (file-level — FORBIDDEN):
274
+ ```json
275
+ {
276
+ "modules": [
277
+ { "name": "system-user", "entryDirs": ["src/views/system"] },
278
+ { "name": "system-role", "entryDirs": ["src/views/system"] },
279
+ { "name": "system-dept", "entryDirs": ["src/views/system"] }
280
+ ]
281
+ }
282
+ ```
283
+
284
+ ### Format Constraints
285
+
286
+ - **MUST use `modules` array** — never use `businessModules`, `components`, or any alternative field name
287
+ - **MUST flatten hierarchy** — if a platform has sub-modules (e.g. frontend `system/user`, `system/role`), each sub-module must be a separate top-level module entry in the `modules` array
288
+ - 例如:`system` 有 `user` 和 `role` 子目录 → 生成 `{ "name": "system-user", "entryDirs": ["src/views/system/user"] }` 和 `{ "name": "system-role", "entryDirs": ["src/views/system/role"] }`
289
+ - **Forbidden fields**: `businessModules`, `subModules`, `components`, `hasSubModules` — 这些都不被下游脚本支持
290
+ - **Each module's entryDirs** must point to directories containing actual entry files (e.g. .vue, .py, .java), not parent wrapper directories
291
+
292
+ ### Field Definitions
293
+
102
294
  - `platformId`: Platform identifier (e.g., `backend-ai`, `web-vue`, `mobile-uniapp`)
103
295
  - `platformName`: (Optional) Human-readable platform name. Auto-generated as `{platform_type}-{platform_subtype}` if missing
104
296
  - `platformType`: (Optional) Platform type: `backend`, `web`, `mobile`, `desktop`. Inferred from platform_id if missing
@@ -109,21 +301,19 @@ Output file: `{sync_state_bizs_dir}/entry-dirs-{platform_id}.json`
109
301
  - `name`: Module name (business-meaningful, e.g., `chat`, `system`, `order`)
110
302
  - `entryDirs`: Array of entry directory paths (relative to `{source_path}`)
111
303
 
112
- **Path Rules**:
304
+ ### Path Rules
305
+
113
306
  - All `entryDirs` paths must be relative to `{sourcePath}`
114
307
  - Use forward slashes `/` as path separators (even on Windows)
115
308
  - Do not include leading or trailing slashes
116
309
 
117
- ### Step 5: Validation
118
-
119
- After generating the entry-dirs JSON for each platform:
120
- 1. Verify that `modules` array is not empty
121
- 2. Verify that each module has at least one entry directory
122
- 3. Verify that module names are business-meaningful (not technical terms like `config`, `util`)
123
- 4. If validation fails, re-analyze the directory tree
310
+ ## Error Handling
124
311
 
125
- **Error Handling**:
126
- If entry directory recognition fails for a platform, STOP and report the error with platform details. Do NOT continue processing that platform.
312
+ | Scenario | Handling |
313
+ |----------|----------|
314
+ | Entry directory recognition fails | STOP and report error with platform details. Do NOT continue processing that platform. |
315
+ | Validation fails | Re-analyze the directory tree and regenerate |
316
+ | Config file not found | Use default exclusion rules and log warning |
127
317
 
128
318
  ## Checklist
129
319
 
@@ -132,6 +322,8 @@ If entry directory recognition fails for a platform, STOP and report the error w
132
322
  - [ ] Module names have business meaning (not technical terms like config, util)
133
323
  - [ ] `entryDirs` paths are correct and accessible
134
324
  - [ ] JSON format is valid
325
+ - [ ] All paths use forward slashes as separators
326
+ - [ ] No leading or trailing slashes in entryDirs paths
135
327
 
136
328
  > **MANDATORY**: Use the provided absolute paths directly. DO NOT construct or derive paths yourself.
137
329
 
@@ -1,47 +1,4 @@
1
- ---
2
- name: speccrew-knowledge-bizs-identify-entries-xml
3
- description: Analyze source directory structures to identify business module entry directories for each platform using XML workflow blocks. Use when initializing or updating business knowledge base to determine which directories contain user-facing entry points.
4
- tools: Read, Write, Glob, Grep, Bash
5
- ---
6
-
7
- # speccrew-knowledge-bizs-identify-entries-xml
8
-
9
- Analyze source directory structures to identify business module entry directories for each platform using XML workflow blocks.
10
-
11
- ## Language Adaptation
12
-
13
- All generated documents must match the user's language. Detect the language from the user's input and generate content accordingly.
14
-
15
- - User writes in 中文 → Generate Chinese documents, use `language: "zh"`
16
- - User writes in English → Generate English documents, use `language: "en"`
17
- - User writes in other languages → Use appropriate language code
18
-
19
- ## Trigger Scenarios
20
-
21
- - Called by `speccrew-knowledge-bizs-dispatch` Stage 1
22
- - "Identify business module entry directories"
23
- - "Analyze source structure for business modules"
24
-
25
- ## Input Parameters
26
-
27
- | Parameter | Type | Required | Description |
28
- |-----------|------|----------|-------------|
29
- | `{platforms}` | array | Yes | Platform list from detection phase. Each item: `{platformId, sourcePath, platformType, platformSubtype, techStack}` |
30
- | `{workspace_path}` | string | Yes | Absolute path to speccrew-workspace directory |
31
- | `{sync_state_bizs_dir}` | string | Yes | Absolute path to entry-dirs JSON output directory |
32
- | `{configs_dir}` | string | Yes | Absolute path to configuration files directory (for `tech-stack-mappings.json`) |
33
-
34
- ## Output
35
-
36
- For each platform, generates:
37
- - `{sync_state_bizs_dir}/entry-dirs-{platform_id}.json`
38
-
39
- ## Workflow
40
-
41
- > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/xml-workflow-spec.md`
42
-
43
- ```xml
44
- <?xml version="1.0" encoding="UTF-8"?>
1
+ <?xml version="1.0" encoding="UTF-8"?>
45
2
  <workflow id="identify-entries-main" status="pending" version="1.0" desc="Identify business module entry directories for each platform">
46
3
 
47
4
  <!-- ============================================================
@@ -74,13 +31,13 @@ For each platform, generates:
74
31
  <!-- ============================================================
75
32
  Global Continuous Execution Rules
76
33
  ============================================================ -->
77
- <block type="rule" id="GLOBAL-R1" level="forbidden" desc="Continuous execution constraints NEVER violate">
34
+ <block type="rule" id="GLOBAL-R1" level="forbidden" desc="Continuous execution constraints 鈥?NEVER violate">
78
35
  <field name="text">DO NOT ask user "Should I continue?" or "How would you like to proceed?" during execution</field>
79
- <field name="text">DO NOT offer options like "Full execution / Partial / Stop" always execute ALL tasks to completion</field>
80
- <field name="text">DO NOT suggest "Due to context window limits, let me pause" complete current task, use checkpoint for resumption</field>
81
- <field name="text">DO NOT estimate workload and suggest breaking it into phases execute ALL items in sequence</field>
82
- <field name="text">DO NOT warn about "large number of files" or "this may take a while" proceed with generation</field>
83
- <field name="text">Context window management: if approaching limit, save progress to checkpoint file and resume do NOT ask user for guidance</field>
36
+ <field name="text">DO NOT offer options like "Full execution / Partial / Stop" 鈥?always execute ALL tasks to completion</field>
37
+ <field name="text">DO NOT suggest "Due to context window limits, let me pause" 鈥?complete current task, use checkpoint for resumption</field>
38
+ <field name="text">DO NOT estimate workload and suggest breaking it into phases 鈥?execute ALL items in sequence</field>
39
+ <field name="text">DO NOT warn about "large number of files" or "this may take a while" 鈥?proceed with generation</field>
40
+ <field name="text">Context window management: if approaching limit, save progress to checkpoint file and resume 鈥?do NOT ask user for guidance</field>
84
41
  </block>
85
42
 
86
43
  <!-- ============================================================
@@ -165,7 +122,7 @@ For each platform, generates:
165
122
  - Multiple modules MUST NOT share the same entryDirs value. If multiple business areas share the same directory, they belong to ONE module.
166
123
  - If the generated JSON does not match this format, you MUST regenerate it before proceeding
167
124
  </field>
168
- <field name="text">Output is strictly the entry-dirs JSON file at the specified output path. Per xml-workflow-spec.md "Strict Block Adherence" rule, no extra files are permitted.</field>
125
+ <field name="text">Output is strictly the entry-dirs JSON file at the specified output path. Per agentflow-spec.md "Strict Block Adherence" rule, no extra files are permitted.</field>
169
126
  </block>
170
127
 
171
128
  <!-- Checkpoint: Persist Generated JSON -->
@@ -222,136 +179,3 @@ For each platform, generates:
222
179
  </block>
223
180
 
224
181
  </workflow>
225
- ```
226
-
227
- ## Output JSON Format
228
-
229
- ```json
230
- {
231
- "platformId": "backend-ai",
232
- "platformName": "AI Module Backend",
233
- "platformType": "backend",
234
- "platformSubtype": "ai",
235
- "sourcePath": "yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai",
236
- "techStack": ["spring-boot", "mybatis-plus"],
237
- "modules": [
238
- { "name": "chat", "entryDirs": ["controller/admin/chat"] },
239
- { "name": "image", "entryDirs": ["controller/admin/image"] },
240
- { "name": "knowledge", "entryDirs": ["controller/admin/knowledge"] },
241
- { "name": "_root", "entryDirs": ["controller/admin"] }
242
- ]
243
- }
244
- ```
245
-
246
- ### Module Granularity (CRITICAL)
247
-
248
- **Core Principle**: modules = directory-level groupings, NOT file-level features
249
-
250
- **Configuration-Driven Approach**:
251
- 1. Read `tech-stack-mappings.json` to get the `module_scan` configuration for the detected `techStack`
252
- 2. Use `module_scan.root` as the scanning starting point (e.g., `src/views` for vue, `controller` for spring)
253
- 3. Use `module_scan.depth` as the grouping level:
254
- - `depth=1`: Each first-level subdirectory under `module_scan.root` = ONE module
255
- - `depth=2`: Each second-level subdirectory = ONE module (e.g., for android)
256
- 4. Each module represents a distinct source directory containing entry files
257
-
258
- **NEVER create multiple modules pointing to the SAME entryDirs** — if 10 controller files all reside in the same directory, that is ONE module with that directory as entryDirs, NOT 10 separate modules
259
-
260
- **Key Rules**:
261
- - The downstream `generate-inventory.js` script handles file-level decomposition within each module's entryDirs — that is NOT the job of this skill
262
- - Module names should correspond to directory names, not individual file names
263
- - Typical module count for a medium project: 3-10 modules (not 30+)
264
-
265
- **Correct example** (directory-level, vue with module_scan.root="src/views", depth=1):
266
- ```json
267
- {
268
- "modules": [
269
- { "name": "ai", "entryDirs": ["src/views/ai"] },
270
- { "name": "bpm", "entryDirs": ["src/views/bpm"] },
271
- { "name": "system", "entryDirs": ["src/views/system"] }
272
- ]
273
- }
274
- ```
275
-
276
- **WRONG example** (file-level — FORBIDDEN):
277
- ```json
278
- {
279
- "modules": [
280
- { "name": "system-user", "entryDirs": ["src/views/system"] },
281
- { "name": "system-role", "entryDirs": ["src/views/system"] },
282
- { "name": "system-dept", "entryDirs": ["src/views/system"] }
283
- ]
284
- }
285
- ```
286
-
287
- ### Format Constraints
288
-
289
- - **MUST use `modules` array** — never use `businessModules`, `components`, or any alternative field name
290
- - **MUST flatten hierarchy** — if a platform has sub-modules (e.g. frontend `system/user`, `system/role`), each sub-module must be a separate top-level module entry in the `modules` array
291
- - 例如:`system` 有 `user` 和 `role` 子目录 → 生成 `{ "name": "system-user", "entryDirs": ["src/views/system/user"] }` 和 `{ "name": "system-role", "entryDirs": ["src/views/system/role"] }`
292
- - **Forbidden fields**: `businessModules`, `subModules`, `components`, `hasSubModules` — 这些都不被下游脚本支持
293
- - **Each module's entryDirs** must point to directories containing actual entry files (e.g. .vue, .py, .java), not parent wrapper directories
294
-
295
- ### Field Definitions
296
-
297
- - `platformId`: Platform identifier (e.g., `backend-ai`, `web-vue`, `mobile-uniapp`)
298
- - `platformName`: (Optional) Human-readable platform name. Auto-generated as `{platform_type}-{platform_subtype}` if missing
299
- - `platformType`: (Optional) Platform type: `backend`, `web`, `mobile`, `desktop`. Inferred from platform_id if missing
300
- - `platformSubtype`: (Optional) Platform subtype (e.g., `ai`, `vue`, `uniapp`). Inferred from platform_id if missing
301
- - `sourcePath`: Absolute path to the platform source root
302
- - `techStack`: (Optional) Array of tech stack names (e.g., `["spring-boot", "mybatis-plus"]`). Default inferred from platform_type
303
- - `modules`: Array of business modules
304
- - `name`: Module name (business-meaningful, e.g., `chat`, `system`, `order`)
305
- - `entryDirs`: Array of entry directory paths (relative to `{source_path}`)
306
-
307
- ### Path Rules
308
-
309
- - All `entryDirs` paths must be relative to `{sourcePath}`
310
- - Use forward slashes `/` as path separators (even on Windows)
311
- - Do not include leading or trailing slashes
312
-
313
- ## Error Handling
314
-
315
- | Scenario | Handling |
316
- |----------|----------|
317
- | Entry directory recognition fails | STOP and report error with platform details. Do NOT continue processing that platform. |
318
- | Validation fails | Re-analyze the directory tree and regenerate |
319
- | Config file not found | Use default exclusion rules and log warning |
320
-
321
- ## Checklist
322
-
323
- - [ ] All platforms' entry-dirs JSON files have been generated
324
- - [ ] Each platform's `modules` array is non-empty
325
- - [ ] Module names have business meaning (not technical terms like config, util)
326
- - [ ] `entryDirs` paths are correct and accessible
327
- - [ ] JSON format is valid
328
- - [ ] All paths use forward slashes as separators
329
- - [ ] No leading or trailing slashes in entryDirs paths
330
-
331
- > **MANDATORY**: Use the provided absolute paths directly. DO NOT construct or derive paths yourself.
332
-
333
- ## Example Usage
334
-
335
- ```
336
- Skill: speccrew-knowledge-bizs-identify-entries-xml
337
- Args:
338
- platforms: [
339
- {
340
- "platformId": "backend-ai",
341
- "sourcePath": "/path/to/yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai",
342
- "platformType": "backend",
343
- "platformSubtype": "ai",
344
- "techStack": ["spring-boot", "mybatis-plus"]
345
- },
346
- {
347
- "platformId": "web-vue",
348
- "sourcePath": "/path/to/yudao-ui-admin/src",
349
- "platformType": "web",
350
- "platformSubtype": "vue",
351
- "techStack": ["vue3", "element-plus"]
352
- }
353
- ]
354
- workspace_path: "/path/to/speccrew-workspace"
355
- sync_state_bizs_dir: "/path/to/speccrew-workspace/knowledges/base/sync-state/knowledge-bizs"
356
- configs_dir: "/path/to/speccrew-workspace/docs/configs"
357
- ```