speccrew 0.6.69 → 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 -1087
  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,128 +1,175 @@
1
1
  ---
2
2
  name: speccrew-knowledge-bizs-init-features
3
- description: Scan source code directories to identify all platforms and generate features.json inventory for knowledge base initialization. Use when initializing business knowledge base from source code.
4
- tools: Read, Write, Glob, Grep, SearchCodebase, Skill, Bash
3
+ description: Execute generate-inventory.js script to create features.json inventory for a single platform. Called by bizs-dispatch Stage 1b for each platform.
4
+ tools: Read, Write, Bash
5
5
  ---
6
6
 
7
- ## Input
7
+ # speccrew-knowledge-bizs-init-features
8
8
 
9
- | Parameter | Type | Required | Description |
10
- |-----------|------|----------|-------------|
11
- | `source_path` | string | No | Source code directory path (default: project root) |
12
- | `language` | string | Yes | Target language for generated content (e.g., "zh", "en") |
13
- | `sync_state_bizs_dir` | string | Yes | Absolute path to features and entry-dirs JSON output directory |
14
- | `configs_dir` | string | Yes | Absolute path to configuration files directory |
15
- | `ide_skills_dir` | string | Yes | Absolute path to IDE skills directory (e.g., `.qoder/skills`) |
16
-
17
- ## Output
18
-
19
- - `{sync_state_bizs_dir}/features-{platform}.json` - Platform-specific feature inventory files
20
- - `{sync_state_bizs_dir}/entry-dirs-{platform}.json` - Entry directories configuration files
21
-
22
- ## Workflow
23
-
24
- ```mermaid
25
- flowchart TD
26
- Start([Start]) --> Step1[Step 1: Identify Platforms]
27
- Step1 --> Step2[Step 2: Identify Entry Directories]
28
- Step2 --> Step3[Step 3: Execute Inventory Scripts]
29
- Step3 --> Step4[Step 4: Report Results]
30
- Step4 --> End([End])
31
- ```
32
-
33
- ### Step 1: Identify Platforms
34
-
35
- **Detection Process:**
36
-
37
- 1. **Read Configuration:**
38
- - `{configs_dir}/platform-mapping.json` - Platform type and subtype mappings
39
- - `{configs_dir}/tech-stack-mappings.json` - Tech stack configurations and exclude directories
40
-
41
- 2. Scan `{source_path}` for platform-specific configuration files (e.g., package.json, pubspec.yaml, pom.xml)
42
-
43
- 3. Match detected files against `platform-mapping.json` → `platform_categories`
44
-
45
- 4. For each matched platform, extract `platform_type` and `platform_subtype`
46
-
47
- 5. Use `tech-stack-mappings.json` to determine:
48
- - `FileExtensions`: Which file extensions to scan
49
- - `ExcludeDirs`: Which directories to exclude
50
- - `TechStack`: Technology stack array
51
-
52
- 6. Each detected platform will generate one `features-{platform}.json` file
53
-
54
- **Example Detection:**
55
- - Found `frontend-web/package.json` with `"vue"` in dependencies
56
- - Lookup `platform-mapping.json`: `web` + `vue` → `platform_type=web`, `platform_subtype=vue`
57
- - Lookup `tech-stack-mappings.json`: vue → extensions=[".vue"], exclude_dirs=["components","utils"]
58
-
59
- ### Step 2: Identify Entry Directories
60
-
61
- For each platform detected in Step 1, identify business module entry directories.
62
-
63
- **Option A: Invoke Skill (Recommended)**
64
-
65
- Execute `speccrew-knowledge-bizs-identify-entries` skill with the following parameters:
66
-
67
- > **NOTE**: Worker dispatch is handled by the calling Agent. This Skill only specifies the parameters needed.
9
+ Execute generate-inventory.js script to create features.json inventory for a single platform. This is a Stage 1b worker skill called by dispatch after platform detection and entry directory identification are complete.
68
10
 
69
- | Parameter | Value |
70
- |-----------|-------|
71
- | `platforms` | Platform list from Step 1 (each with platformId, sourcePath, platformType, platformSubtype, techStack) |
72
- | `workspace_path` | Absolute path to speccrew-workspace |
73
- | `sync_state_bizs_dir` | `{sync_state_bizs_dir}` |
74
- | `configs_dir` | `{configs_dir}` |
11
+ ## Language Adaptation
75
12
 
76
- Expected output: `entry-dirs-{platform_id}.json` files in `{sync_state_bizs_dir}/`.
13
+ All generated documents must match the user's language. Detect the language from the user's input and generate content accordingly.
77
14
 
78
- **Option B: Direct Execution**
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
79
18
 
80
- If executing directly (without Worker dispatch), follow the same logic as the `speccrew-knowledge-bizs-identify-entries` skill:
81
- 1. Read each platform's directory tree (3 levels deep)
82
- 2. Identify entry directories based on platform type:
83
- - **Backend**: Find directories containing `*Controller.*` files, extract business package names
84
- - **Frontend**: Find `views/` or `pages/` directories, use first-level subdirectories as modules
85
- - **Mobile**: Find `pages/` subdirectories + top-level `pages-*` directories
86
- 3. Apply exclusion rules from `{configs_dir}/tech-stack-mappings.json`
87
- 4. Generate `entry-dirs-{platform_id}.json` files to `{sync_state_bizs_dir}/`
19
+ ## Trigger Scenarios
88
20
 
89
- **Verification**: Confirm each entry-dirs JSON has non-empty `modules` array with business-meaningful names.
21
+ - Called by `speccrew-knowledge-bizs-dispatch` Stage 1b
22
+ - "Generate feature inventory for platform"
23
+ - "Create features.json from entry-dirs"
90
24
 
91
- ### Step 3: Execute Inventory Scripts
25
+ ## Input Parameters
92
26
 
93
- > **MANDATORY**: You MUST execute the provided scripts via `run_in_terminal`. DO NOT use `read_file`, `search_codebase`, `Glob`, or any other tool to substitute script execution. DO NOT manually scan files and construct JSON output yourself.
94
-
95
- Execute the inventory script for each platform using the entry-dirs JSON from Step 2:
96
-
97
- **Prerequisites:**
98
- - Node.js 14.0+
99
-
100
- **Script Location:**
101
- - All Platforms: `{ide_skills_dir}/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js`
102
-
103
- **Execution Command:**
104
- ```bash
105
- node "{ide_skills_dir}/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js" --entryDirsFile "{sync_state_bizs_dir}/entry-dirs-{platform_id}.json" --outputDir "{sync_state_bizs_dir}"
106
- ```
107
-
108
- **Parameters:**
109
- - `--entryDirsFile`: Path to the `entry-dirs-{platform_id}.json` file in `{sync_state_bizs_dir}/`
110
- - `--outputDir`: Output directory for `features-{platform}.json` (use `{sync_state_bizs_dir}`)
27
+ | Parameter | Type | Required | Description |
28
+ |-----------|------|----------|-------------|
29
+ | `platformId` | string | Yes | Platform identifier (e.g., "backend-system", "frontend-web", "mobile-app") |
30
+ | `platformName` | string | Yes | Platform display name |
31
+ | `platformType` | string | Yes | Platform type: backend, web, mobile |
32
+ | `platformSubtype` | string | No | Platform subtype (e.g., vue, react, uniapp) |
33
+ | `sourcePath` | string | Yes | Absolute path to platform source root |
34
+ | `techIdentifier` | string | Yes | Technology stack identifier |
35
+ | `entryDirsFile` | string | Yes | Absolute path to entry-dirs JSON file |
36
+ | `outputDir` | string | Yes | Absolute path to features JSON output directory |
37
+ | `workspace_path` | string | Yes | Absolute path to speccrew-workspace directory |
38
+ | `sync_state_bizs_dir` | string | Yes | Absolute path to sync-state/knowledge-bizs directory |
39
+ | `language` | string | Yes | Language code for generated content |
111
40
 
112
- **Example:**
113
- ```bash
114
- # Execute for each platform's entry-dirs file
115
- node "d:/project/.qoder/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js" --entryDirsFile "d:/project/speccrew-workspace/knowledges/base/sync-state/knowledge-bizs/entry-dirs-backend-system.json" --outputDir "d:/project/speccrew-workspace/knowledges/base/sync-state/knowledge-bizs"
116
- ```
41
+ ## Output
117
42
 
118
- **Script Parameters**:
119
- - `--entryDirsFile`: (Required) Path to the `entry-dirs-{platform_id}.json` file in `{sync_state_bizs_dir}/`
120
- - `--outputDir`: (Required) Output directory for `features-{platform}.json` (use `{sync_state_bizs_dir}`)
121
- - `--techIdentifier`: (Optional) Technology identifier for tech-stack lookup (auto-detected from platform mapping if omitted)
122
- - `--fileExtensions`: (Optional) Comma-separated list of file extensions to include
123
- - `--excludeDirs`: (Optional) Additional directories to exclude
43
+ - `${outputDir}/features-${platformId}.json`
44
+
45
+ ## AgentFlow Definition
46
+
47
+ <!-- @agentflow: workflow.agentflow.xml -->
48
+
49
+ > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/agentflow-spec.md`
50
+
51
+ <!-- ============================================================
52
+ Input Parameters Definition
53
+ ============================================================ -->
54
+ <block type="input" id="I1" desc="Workflow input parameters">
55
+ <field name="platformId" required="true" type="string" desc="Platform identifier"/>
56
+ <field name="platformName" required="true" type="string" desc="Platform display name"/>
57
+ <field name="platformType" required="true" type="string" desc="Platform type: backend/web/mobile"/>
58
+ <field name="platformSubtype" required="false" type="string" desc="Platform subtype"/>
59
+ <field name="sourcePath" required="true" type="string" desc="Absolute path to platform source root"/>
60
+ <field name="techIdentifier" required="true" type="string" desc="Technology stack identifier"/>
61
+ <field name="entryDirsFile" required="true" type="string" desc="Absolute path to entry-dirs JSON file"/>
62
+ <field name="outputDir" required="true" type="string" desc="Absolute path to features JSON output directory"/>
63
+ <field name="workspace_path" required="true" type="string" desc="Absolute path to speccrew-workspace directory"/>
64
+ <field name="sync_state_bizs_dir" required="true" type="string" desc="Absolute path to sync-state/knowledge-bizs directory"/>
65
+ <field name="language" required="true" type="string" desc="Language code for generated content"/>
66
+ </block>
67
+
68
+ <!-- ============================================================
69
+ Global Constraints
70
+ ============================================================ -->
71
+ <block type="rule" id="R1" level="mandatory" desc="Path constraints">
72
+ <field name="text">Use the provided absolute paths directly. DO NOT construct or derive paths yourself.</field>
73
+ <field name="text">All paths must use forward slashes / as path separators (even on Windows)</field>
74
+ </block>
75
+
76
+ <block type="rule" id="R2" level="forbidden" desc="Script execution constraints">
77
+ <field name="text">DO NOT manually scan source files or manually construct features JSON</field>
78
+ <field name="text">MUST execute generate-inventory.js script - if script not found, STOP and report error</field>
79
+ <field name="text">DO NOT use read_file, Glob, Grep, or search_codebase as substitutes for script execution</field>
80
+ </block>
81
+
82
+ <!-- ============================================================
83
+ Global Continuous Execution Rules
84
+ ============================================================ -->
85
+ <block type="rule" id="GLOBAL-R1" level="forbidden" desc="Continuous execution constraints — NEVER violate">
86
+ <field name="text">DO NOT ask user "Should I continue?" or "How would you like to proceed?" during execution</field>
87
+ <field name="text">DO NOT offer options like "Full execution / Partial / Stop" — always execute ALL tasks to completion</field>
88
+ <field name="text">DO NOT suggest "Due to context window limits, let me pause" — complete current task, use checkpoint for resumption</field>
89
+ <field name="text">DO NOT estimate workload and suggest breaking it into phases — execute ALL items in sequence</field>
90
+ <field name="text">DO NOT warn about "large number of files" or "this may take a while" — proceed with generation</field>
91
+ <field name="text">Context window management: if approaching limit, save progress to checkpoint file and resume — do NOT ask user for guidance</field>
92
+ </block>
93
+
94
+ <!-- ============================================================
95
+ Main Processing Sequence
96
+ ============================================================ -->
97
+ <sequence id="S1" name="Generate Features Inventory" status="pending" desc="Execute script to generate features.json">
98
+
99
+ <!-- Step 1: Verify entry-dirs JSON exists and is valid -->
100
+ <block type="task" id="B1" action="read-file" desc="Read entry-dirs JSON to verify file exists and modules non-empty">
101
+ <field name="path" value="${entryDirsFile}"/>
102
+ <field name="output" var="entry_dirs_content"/>
103
+ </block>
104
+
105
+ <!-- Gateway: Validate entry-dirs content -->
106
+ <block type="gateway" id="G1" mode="guard" desc="Verify entry-dirs has modules"
107
+ test="${entry_dirs_content.modules} != null AND ${entry_dirs_content.modules.length} > 0"
108
+ fail-action="stop">
109
+ <field name="message">Entry-dirs JSON must have non-empty modules array: ${entryDirsFile}</field>
110
+ </block>
111
+
112
+ <!-- Step 2: Execute generate-inventory.js script -->
113
+ <block type="task" id="B2" action="run-script" desc="Execute generate-inventory.js to create features.json">
114
+ <field name="command">node "${workspace_path}/../.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js" --entryDirsFile "${entryDirsFile}" --outputDir "${outputDir}"</field>
115
+ <field name="note">Script path discovery: Worker must locate generate-inventory.js in IDE skills directory. Search order: 1) .qoder/skills/ 2) .speccrew/skills/ 3) .cursor/skills/ - all relative to project root (workspace_path parent). If script not found, STOP and report error.</field>
116
+ <field name="output" var="script_result"/>
117
+ </block>
118
+
119
+ <!-- Checkpoint: Verify features.json generated -->
120
+ <block type="checkpoint" id="CP1" name="features-generated" desc="Verify features JSON was generated">
121
+ <field name="file" value="${outputDir}/features-${platformId}.json"/>
122
+ <field name="verify" value="file_exists(${outputDir}/features-${platformId}.json)"/>
123
+ </block>
124
+
125
+ <!-- Step 3: Validate output JSON structure -->
126
+ <block type="task" id="B3" action="analyze" desc="Validate features.json structure">
127
+ <field name="input" value="${outputDir}/features-${platformId}.json"/>
128
+ <field name="validation_rules">
129
+ - platformName matches input platformName
130
+ - platformType matches input platformType
131
+ - techStack is valid array
132
+ - features array is non-empty
133
+ - each feature has: fileName, sourcePath, module, analyzed=false
134
+ - sourcePath uses forward slashes
135
+ </field>
136
+ <field name="output" var="validation_result"/>
137
+ </block>
138
+
139
+ <!-- Gateway: Handle validation result -->
140
+ <block type="gateway" id="G2" mode="exclusive" desc="Handle validation result">
141
+ <branch test="${validation_result.status} == 'failed'">
142
+ <block type="event" id="E1" action="log" level="error" desc="Log validation failure">
143
+ <field name="message">Features JSON validation failed for platform ${platformId}: ${validation_result.errors}</field>
144
+ </block>
145
+ <block type="error-handler" id="EH1" desc="Handle validation failure">
146
+ <catch error-type="validation_failed">
147
+ <field name="action">STOP - features.json structure invalid, manual intervention required</field>
148
+ </catch>
149
+ </block>
150
+ </branch>
151
+ <branch test="${validation_result.status} == 'passed'">
152
+ <block type="event" id="E2" action="log" level="info" desc="Log validation success">
153
+ <field name="message">Platform ${platformId} features.json validation passed</field>
154
+ </block>
155
+ </branch>
156
+ </block>
157
+
158
+ </sequence>
159
+
160
+ <!-- ============================================================
161
+ Output Results
162
+ ============================================================ -->
163
+ <block type="output" id="O1" desc="Workflow output results">
164
+ <field name="generated_file" value="${outputDir}/features-${platformId}.json" type="string" desc="Path to generated features JSON"/>
165
+ <field name="feature_count" from="${validation_result.feature_count}" type="number" desc="Number of features in inventory"/>
166
+ <field name="validation_status" from="${validation_result.status}" type="string" desc="Validation result status"/>
167
+ </block>
168
+
169
+ </workflow>
170
+
171
+ ## Output JSON Format
124
172
 
125
- **Output: `features-{platform}.json` Structure:**
126
173
  ```json
127
174
  {
128
175
  "platformName": "Web Frontend",
@@ -140,7 +187,7 @@ node "d:/project/.qoder/skills/speccrew-knowledge-bizs-init-features/scripts/gen
140
187
  "features": [
141
188
  {
142
189
  "fileName": "index",
143
- "sourcePath": "yudao-ui/yudao-ui-admin-uniapp/src/pages/bpm/index.vue",
190
+ "sourcePath": "frontend-web/src/views/system/user/index.vue",
144
191
  "documentPath": "speccrew-workspace/knowledges/bizs/web-vue/src/views/system/user/index.md",
145
192
  "module": "system",
146
193
  "analyzed": false,
@@ -152,76 +199,48 @@ node "d:/project/.qoder/skills/speccrew-knowledge-bizs-init-features/scripts/gen
152
199
  }
153
200
  ```
154
201
 
155
- **Module Detection Rule:**
156
- - When using `--entryDirsFile` mode (recommended), the `module` field for each feature is determined by matching the file's path against the entry directories defined in the entry-dirs JSON
157
- - Each file is assigned to the module whose `entryDirs` path matches the file's relative directory
158
- - The top-level `modules` array lists all modules with their feature counts
159
- - Files not matching any entry directory → module = `_root`
160
-
161
- **sourcePath Format:**
162
- - In both full-scan mode and entry-dirs mode, `sourcePath` is always a **project-root-relative path**
163
- - Example: `yudao-ui/yudao-ui-admin-uniapp/src/pages/bpm/index.vue` (NOT `pages/bpm/index.vue`)
164
- - Example: `yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java`
165
-
166
- **Verification Checklist:**
167
- - [ ] All `features-{platform}.json` files exist and are valid JSON
168
- - [ ] Each file has correct platform metadata (platformName, platformType, techStack)
169
- - [ ] All features have `analyzed: false` initially
170
- - [ ] File paths are correct and accessible
171
-
172
- ### Step 4: Report Results
173
-
174
- ```
175
- Feature Inventory Generated
176
- - Platforms Found: [N]
177
- - Platform 1: [platform_name] ([platform_type]) - [feature_count] features
178
- - Platform 2: [platform_name] ([platform_type]) - [feature_count] features
179
- - Total Features: [N]
180
-
181
- Platform Inventory Files:
182
- - Web Frontend:
183
- - Inventory File: {sync_state_bizs_dir}/features-web.json
184
- - Total Features: [N]
185
- - Status: Generated
186
- - Mobile App:
187
- - Inventory File: {sync_state_bizs_dir}/features-mobile.json
188
- - Total Features: [N]
189
- - Status: Generated ✓
190
- - Backend API:
191
- - Inventory File: {sync_state_bizs_dir}/features-api.json
192
- - Total Features: [N]
193
- - Status: Generated ✓
194
-
195
- Final Output:
196
- - Platform Files:
197
- - {sync_state_bizs_dir}/features-web.json
198
- - {sync_state_bizs_dir}/features-mobile.json
199
- - {sync_state_bizs_dir}/features-api.json
200
- ```
202
+ ### Field Definitions
203
+
204
+ - `platformName`: Human-readable platform name
205
+ - `platformType`: Platform type (backend, web, mobile)
206
+ - `sourcePath`: Platform source root path (project-root-relative)
207
+ - `techStack`: Array of technology identifiers
208
+ - `modules`: Array of modules with feature counts
209
+ - `totalFiles`: Total number of feature files
210
+ - `analyzedCount`: Number of analyzed features (initially 0)
211
+ - `pendingCount`: Number of pending features (initially totalFiles)
212
+ - `generatedAt`: ISO timestamp when file was generated
213
+ - `features`: Array of feature objects
214
+ - `fileName`: File name without extension
215
+ - `sourcePath`: Relative path to source file (project-root-relative)
216
+ - `documentPath`: Relative path to target document
217
+ - `module`: Module name this feature belongs to
218
+ - `analyzed`: Whether analysis is complete (initially false)
219
+ - `startedAt`: Analysis start timestamp (null initially)
220
+ - `completedAt`: Analysis completion timestamp (null initially)
221
+ - `analysisNotes`: Analysis notes (null initially)
222
+
223
+ ## Error Handling
224
+
225
+ | Scenario | Handling |
226
+ |----------|----------|
227
+ | entry-dirs JSON not found | STOP and report error with file path |
228
+ | entry-dirs modules array empty | STOP - cannot generate features without entry directories |
229
+ | generate-inventory.js script not found | STOP and report error - do NOT attempt manual generation |
230
+ | Script execution fails | STOP and report error with exit code and stderr |
231
+ | features.json validation fails | STOP - manual intervention required |
232
+ | features array empty | WARNING - platform may have no recognizable features |
201
233
 
202
234
  ## Checklist
203
235
 
204
- ### Platform Detection
205
- - [ ] Platforms identified (Web, Mobile, Desktop, or API)
206
- - [ ] Each platform has correct `platformName`, `platformType`, `techStack` configuration
207
- - [ ] Source directories located for all platforms
208
-
209
- ### Entry Directory Identification
210
- - [ ] Entry-dirs JSON files generated for all platforms
211
- - [ ] Each platform has non-empty modules array
212
- - [ ] Module names are business-meaningful (not technical terms like `config`, `util`, `controller`)
213
- - [ ] Entry directory paths are correct and accessible
214
-
215
- ### Inventory Generation
216
- - [ ] **Inventory scripts executed**: Node.js script generated `features-{platform}.json` files
217
- - [ ] **Inventory files valid**: JSON structure correct, all features listed
218
- - [ ] **Total count verified**: `totalFiles` matches actual source file count per platform
219
- - [ ] **File paths correct**: All `sourcePath` and `documentPath` values are accurate (sourcePath MUST be project-root-relative path)
220
-
221
- ### Output Generation
222
- - [ ] All platform inventory files generated in `{sync_state_bizs_dir}` directory
223
- - [ ] Output path verified
224
- - [ ] Results reported
225
-
226
- > **MANDATORY**: Use the provided absolute paths directly. DO NOT construct or derive paths yourself. DO NOT manually create JSON files.
227
-
236
+ - [ ] entry-dirs JSON file exists and is readable
237
+ - [ ] entry-dirs JSON has non-empty modules array
238
+ - [ ] generate-inventory.js script located and executed
239
+ - [ ] features-${platformId}.json file generated
240
+ - [ ] Output JSON has valid platform metadata
241
+ - [ ] features array is non-empty
242
+ - [ ] Each feature has required fields (fileName, sourcePath, module, analyzed)
243
+ - [ ] All sourcePath values use forward slashes
244
+ - [ ] analyzed field is false for all features (initial state)
245
+
246
+ > **MANDATORY**: Use the provided absolute paths directly. DO NOT construct or derive paths yourself. DO NOT manually create JSON files - MUST execute the script.
@@ -1,53 +1,4 @@
1
- ---
2
- name: speccrew-knowledge-bizs-init-features-xml
3
- description: Execute generate-inventory.js script to create features.json inventory for a single platform. Called by bizs-dispatch-xml Stage 1b for each platform.
4
- tools: Read, Write, Bash
5
- ---
6
-
7
- # speccrew-knowledge-bizs-init-features-xml
8
-
9
- Execute generate-inventory.js script to create features.json inventory for a single platform. This is a Stage 1b worker skill called by dispatch-xml after platform detection and entry directory identification are complete.
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-xml` Stage 1b
22
- - "Generate feature inventory for platform"
23
- - "Create features.json from entry-dirs"
24
-
25
- ## Input Parameters
26
-
27
- | Parameter | Type | Required | Description |
28
- |-----------|------|----------|-------------|
29
- | `platformId` | string | Yes | Platform identifier (e.g., "backend-system", "frontend-web", "mobile-app") |
30
- | `platformName` | string | Yes | Platform display name |
31
- | `platformType` | string | Yes | Platform type: backend, web, mobile |
32
- | `platformSubtype` | string | No | Platform subtype (e.g., vue, react, uniapp) |
33
- | `sourcePath` | string | Yes | Absolute path to platform source root |
34
- | `techIdentifier` | string | Yes | Technology stack identifier |
35
- | `entryDirsFile` | string | Yes | Absolute path to entry-dirs JSON file |
36
- | `outputDir` | string | Yes | Absolute path to features JSON output directory |
37
- | `workspace_path` | string | Yes | Absolute path to speccrew-workspace directory |
38
- | `sync_state_bizs_dir` | string | Yes | Absolute path to sync-state/knowledge-bizs directory |
39
- | `language` | string | Yes | Language code for generated content |
40
-
41
- ## Output
42
-
43
- - `${outputDir}/features-${platformId}.json`
44
-
45
- ## Workflow
46
-
47
- > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/xml-workflow-spec.md`
48
-
49
- ```xml
50
- <?xml version="1.0" encoding="UTF-8"?>
1
+ <?xml version="1.0" encoding="UTF-8"?>
51
2
  <workflow id="init-features-main" status="pending" version="1.0" desc="Generate features.json inventory for a single platform">
52
3
 
53
4
  <!-- ============================================================
@@ -84,13 +35,13 @@ All generated documents must match the user's language. Detect the language from
84
35
  <!-- ============================================================
85
36
  Global Continuous Execution Rules
86
37
  ============================================================ -->
87
- <block type="rule" id="GLOBAL-R1" level="forbidden" desc="Continuous execution constraints NEVER violate">
38
+ <block type="rule" id="GLOBAL-R1" level="forbidden" desc="Continuous execution constraints 鈥?NEVER violate">
88
39
  <field name="text">DO NOT ask user "Should I continue?" or "How would you like to proceed?" during execution</field>
89
- <field name="text">DO NOT offer options like "Full execution / Partial / Stop" always execute ALL tasks to completion</field>
90
- <field name="text">DO NOT suggest "Due to context window limits, let me pause" complete current task, use checkpoint for resumption</field>
91
- <field name="text">DO NOT estimate workload and suggest breaking it into phases execute ALL items in sequence</field>
92
- <field name="text">DO NOT warn about "large number of files" or "this may take a while" proceed with generation</field>
93
- <field name="text">Context window management: if approaching limit, save progress to checkpoint file and resume do NOT ask user for guidance</field>
40
+ <field name="text">DO NOT offer options like "Full execution / Partial / Stop" 鈥?always execute ALL tasks to completion</field>
41
+ <field name="text">DO NOT suggest "Due to context window limits, let me pause" 鈥?complete current task, use checkpoint for resumption</field>
42
+ <field name="text">DO NOT estimate workload and suggest breaking it into phases 鈥?execute ALL items in sequence</field>
43
+ <field name="text">DO NOT warn about "large number of files" or "this may take a while" 鈥?proceed with generation</field>
44
+ <field name="text">Context window management: if approaching limit, save progress to checkpoint file and resume 鈥?do NOT ask user for guidance</field>
94
45
  </block>
95
46
 
96
47
  <!-- ============================================================
@@ -169,81 +120,3 @@ All generated documents must match the user's language. Detect the language from
169
120
  </block>
170
121
 
171
122
  </workflow>
172
- ```
173
-
174
- ## Output JSON Format
175
-
176
- ```json
177
- {
178
- "platformName": "Web Frontend",
179
- "platformType": "web",
180
- "sourcePath": "frontend-web/src/views",
181
- "techStack": ["vue", "typescript"],
182
- "modules": [
183
- { "name": "chat", "featureCount": 12 },
184
- { "name": "image", "featureCount": 8 }
185
- ],
186
- "totalFiles": 25,
187
- "analyzedCount": 0,
188
- "pendingCount": 25,
189
- "generatedAt": "2024-01-15-103000",
190
- "features": [
191
- {
192
- "fileName": "index",
193
- "sourcePath": "frontend-web/src/views/system/user/index.vue",
194
- "documentPath": "speccrew-workspace/knowledges/bizs/web-vue/src/views/system/user/index.md",
195
- "module": "system",
196
- "analyzed": false,
197
- "startedAt": null,
198
- "completedAt": null,
199
- "analysisNotes": null
200
- }
201
- ]
202
- }
203
- ```
204
-
205
- ### Field Definitions
206
-
207
- - `platformName`: Human-readable platform name
208
- - `platformType`: Platform type (backend, web, mobile)
209
- - `sourcePath`: Platform source root path (project-root-relative)
210
- - `techStack`: Array of technology identifiers
211
- - `modules`: Array of modules with feature counts
212
- - `totalFiles`: Total number of feature files
213
- - `analyzedCount`: Number of analyzed features (initially 0)
214
- - `pendingCount`: Number of pending features (initially totalFiles)
215
- - `generatedAt`: ISO timestamp when file was generated
216
- - `features`: Array of feature objects
217
- - `fileName`: File name without extension
218
- - `sourcePath`: Relative path to source file (project-root-relative)
219
- - `documentPath`: Relative path to target document
220
- - `module`: Module name this feature belongs to
221
- - `analyzed`: Whether analysis is complete (initially false)
222
- - `startedAt`: Analysis start timestamp (null initially)
223
- - `completedAt`: Analysis completion timestamp (null initially)
224
- - `analysisNotes`: Analysis notes (null initially)
225
-
226
- ## Error Handling
227
-
228
- | Scenario | Handling |
229
- |----------|----------|
230
- | entry-dirs JSON not found | STOP and report error with file path |
231
- | entry-dirs modules array empty | STOP - cannot generate features without entry directories |
232
- | generate-inventory.js script not found | STOP and report error - do NOT attempt manual generation |
233
- | Script execution fails | STOP and report error with exit code and stderr |
234
- | features.json validation fails | STOP - manual intervention required |
235
- | features array empty | WARNING - platform may have no recognizable features |
236
-
237
- ## Checklist
238
-
239
- - [ ] entry-dirs JSON file exists and is readable
240
- - [ ] entry-dirs JSON has non-empty modules array
241
- - [ ] generate-inventory.js script located and executed
242
- - [ ] features-${platformId}.json file generated
243
- - [ ] Output JSON has valid platform metadata
244
- - [ ] features array is non-empty
245
- - [ ] Each feature has required fields (fileName, sourcePath, module, analyzed)
246
- - [ ] All sourcePath values use forward slashes
247
- - [ ] analyzed field is false for all features (initial state)
248
-
249
- > **MANDATORY**: Use the provided absolute paths directly. DO NOT construct or derive paths yourself. DO NOT manually create JSON files - MUST execute the script.