speccrew 0.6.5 → 0.6.6
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.
|
@@ -172,61 +172,29 @@ flowchart TB
|
|
|
172
172
|
|
|
173
173
|
---
|
|
174
174
|
|
|
175
|
-
## Stage 1a: Entry Directory Recognition
|
|
175
|
+
## Stage 1a: Entry Directory Recognition
|
|
176
176
|
|
|
177
|
-
**Goal**: For each detected platform,
|
|
177
|
+
**Goal**: For each detected platform, analyze the source directory tree and identify all entry directories (API controllers for backend, views/pages for frontend), then classify them into business modules.
|
|
178
178
|
|
|
179
|
-
> **IMPORTANT**: This stage is executed **directly by the dispatch agent (Leader)
|
|
179
|
+
> **IMPORTANT**: This stage is executed **directly by the dispatch agent (Leader)**, NOT delegated to a Worker Agent.
|
|
180
180
|
|
|
181
181
|
**Prerequisite**: Stage 0 completed. Platform list confirmed with `platformId`, `sourcePath`, `platformType`, `platformSubtype`, and `techIdentifier` for each platform.
|
|
182
182
|
|
|
183
|
-
**Execution
|
|
184
|
-
|
|
185
|
-
### Step 1: Read Directory Tree
|
|
186
|
-
|
|
187
|
-
Use `ListDir` or `Bash(tree)` to read the platform's `{source_path}` directory structure (3 levels deep):
|
|
188
|
-
|
|
189
|
-
```bash
|
|
190
|
-
# Windows (PowerShell)
|
|
191
|
-
tree /F /A "{source_path}" | Select-Object -First 100
|
|
192
|
-
|
|
193
|
-
# Unix/Linux/Mac
|
|
194
|
-
tree -L 3 "{source_path}"
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
### Step 2: LLM Analysis - Identify Entry Directories
|
|
183
|
+
**Execution**: Follow the `speccrew-knowledge-bizs-identify-entries` skill workflow:
|
|
198
184
|
|
|
199
|
-
|
|
185
|
+
1. For each platform, read the source directory tree (3 levels deep)
|
|
186
|
+
2. Identify entry directories based on platform type:
|
|
187
|
+
- **Backend (Spring/Java/Kotlin)**: Find directories containing `*Controller.java` or `*Controller.kt` files. Module name = business package name of the entry directory
|
|
188
|
+
- **Frontend (Vue/React)**: Find `views/` or `pages/` directories. First-level subdirectories = business modules
|
|
189
|
+
- **Mobile (UniApp)**: Find first-level subdirectories under `pages/` + top-level `pages-*` directories
|
|
190
|
+
- **Mobile (Mini Program)**: Find first-level subdirectories under `pages/`
|
|
191
|
+
3. Apply exclusion rules from `tech-stack-mappings.json` (technical dirs, build dirs, test dirs, config dirs)
|
|
192
|
+
4. Generate `entry-dirs-{platform_id}.json` files
|
|
193
|
+
5. Validate: modules array non-empty, module names are business-meaningful
|
|
200
194
|
|
|
201
|
-
|
|
202
|
-
- Find all directories containing `*Controller.java` or `*Controller.kt` files
|
|
203
|
-
- These are API entry directories
|
|
204
|
-
- Module name = the business package name of the entry directory (e.g., `controller/admin/chat` → module `chat`)
|
|
195
|
+
> For detailed entry identification logic, exclusion rules, JSON format, and validation rules, refer to the `speccrew-knowledge-bizs-identify-entries` skill documentation.
|
|
205
196
|
|
|
206
|
-
**
|
|
207
|
-
- Find `views/` or `pages/` directories
|
|
208
|
-
- First-level subdirectories under these directories are business modules
|
|
209
|
-
- Each subdirectory is an entry directory (e.g., `views/system/` → module `system`)
|
|
210
|
-
|
|
211
|
-
**Mobile (UniApp)**:
|
|
212
|
-
- Find first-level subdirectories under `pages/`
|
|
213
|
-
- Plus top-level `pages-*` directories (module name = directory name without `pages-` prefix, e.g., `pages-bpm` → module `bpm`)
|
|
214
|
-
|
|
215
|
-
**Mobile (Mini Program)**:
|
|
216
|
-
- Find first-level subdirectories under `pages/` as modules
|
|
217
|
-
|
|
218
|
-
**Exclusion Rules** (directories to ignore):
|
|
219
|
-
- Pure technical directories: `config`, `framework`, `enums`, `exception`, `util`, `utils`, `common`, `constant`, `constants`, `type`, `types`, `dto`, `vo`, `entity`, `model`, `mapper`, `repository`, `dao`, `service`, `impl`
|
|
220
|
-
- Build/output directories: `dist`, `build`, `target`, `out`, `node_modules`
|
|
221
|
-
- Test directories: `test`, `tests`, `spec`, `__tests__`, `e2e`
|
|
222
|
-
- Configuration directories: `.git`, `.idea`, `.vscode`, `.speccrew`
|
|
223
|
-
|
|
224
|
-
**Root Module Handling**:
|
|
225
|
-
- If an entry file is not under any subdirectory (directly under `{source_path}`), assign it to the `_root` module
|
|
226
|
-
|
|
227
|
-
### Step 3: Generate entry-dirs JSON
|
|
228
|
-
|
|
229
|
-
Output file: `{speccrew_workspace}/knowledges/base/sync-state/knowledge-bizs/entry-dirs-{platform_id}.json`
|
|
197
|
+
**Output**: `{speccrew_workspace}/knowledges/base/sync-state/knowledge-bizs/entry-dirs-{platform_id}.json`
|
|
230
198
|
|
|
231
199
|
**JSON Format**:
|
|
232
200
|
```json
|
|
@@ -239,37 +207,11 @@ Output file: `{speccrew_workspace}/knowledges/base/sync-state/knowledge-bizs/ent
|
|
|
239
207
|
"techStack": ["spring-boot", "mybatis-plus"],
|
|
240
208
|
"modules": [
|
|
241
209
|
{ "name": "chat", "entryDirs": ["controller/admin/chat"] },
|
|
242
|
-
{ "name": "image", "entryDirs": ["controller/admin/image"] }
|
|
243
|
-
{ "name": "knowledge", "entryDirs": ["controller/admin/knowledge"] },
|
|
244
|
-
{ "name": "_root", "entryDirs": ["controller/admin"] }
|
|
210
|
+
{ "name": "image", "entryDirs": ["controller/admin/image"] }
|
|
245
211
|
]
|
|
246
212
|
}
|
|
247
213
|
```
|
|
248
214
|
|
|
249
|
-
**Field Definitions**:
|
|
250
|
-
- `platformId`: Platform identifier (e.g., `backend-ai`, `web-vue`, `mobile-uniapp`)
|
|
251
|
-
- `platformName`: (Optional) Human-readable platform name. Auto-generated as `{platform_type}-{platform_subtype}` if missing
|
|
252
|
-
- `platformType`: (Optional) Platform type: `backend`, `web`, `mobile`, `desktop`. Inferred from platform_id if missing
|
|
253
|
-
- `platformSubtype`: (Optional) Platform subtype (e.g., `ai`, `vue`, `uniapp`). Inferred from platform_id if missing
|
|
254
|
-
- `sourcePath`: Absolute path to the platform source root
|
|
255
|
-
- `techStack`: (Optional) Array of tech stack names (e.g., `["spring-boot", "mybatis-plus"]`). Default inferred from platform_type
|
|
256
|
-
- `modules`: Array of business modules
|
|
257
|
-
- `name`: Module name (business-meaningful, e.g., `chat`, `system`, `order`)
|
|
258
|
-
- `entryDirs`: Array of entry directory paths (relative to `{source_path}`)
|
|
259
|
-
|
|
260
|
-
**Path Rules**:
|
|
261
|
-
- All `entryDirs` paths must be relative to `{source_path}`
|
|
262
|
-
- Use forward slashes `/` as path separators (even on Windows)
|
|
263
|
-
- Do not include leading or trailing slashes
|
|
264
|
-
|
|
265
|
-
### Step 4: Validation
|
|
266
|
-
|
|
267
|
-
After generating the entry-dirs JSON:
|
|
268
|
-
1. Verify that `modules` array is not empty
|
|
269
|
-
2. Verify that each module has at least one entry directory
|
|
270
|
-
3. Verify that module names are business-meaningful (not technical terms like `config`, `util`)
|
|
271
|
-
4. If validation fails, re-analyze the directory tree
|
|
272
|
-
|
|
273
215
|
**Error handling**: If entry directory recognition fails for a platform, STOP and report the error with platform details. Do NOT proceed to Stage 1b for that platform.
|
|
274
216
|
|
|
275
217
|
---
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
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.
|
|
4
|
+
tools: Read, Write, Glob, Grep, Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# speccrew-knowledge-bizs-identify-entries
|
|
8
|
+
|
|
9
|
+
Analyze source directory structures to identify business module entry directories for each platform.
|
|
10
|
+
|
|
11
|
+
## Input Parameters
|
|
12
|
+
|
|
13
|
+
| Parameter | Type | Required | Description |
|
|
14
|
+
|-----------|------|----------|-------------|
|
|
15
|
+
| `{platforms}` | array | Yes | Platform list from detection phase. Each item: `{platformId, sourcePath, platformType, platformSubtype, techStack}` |
|
|
16
|
+
| `{workspace_path}` | string | Yes | Path to speccrew-workspace directory |
|
|
17
|
+
|
|
18
|
+
## Output
|
|
19
|
+
|
|
20
|
+
For each platform, generates:
|
|
21
|
+
- `{workspace_path}/knowledges/base/sync-state/knowledge-bizs/entry-dirs-{platform_id}.json`
|
|
22
|
+
|
|
23
|
+
## Workflow
|
|
24
|
+
|
|
25
|
+
### Step 1: Read Directory Tree
|
|
26
|
+
|
|
27
|
+
Use `Glob` or `Bash(tree)` to read each platform's `{sourcePath}` directory structure (3 levels deep):
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Windows (PowerShell)
|
|
31
|
+
tree /F /A "{source_path}" | Select-Object -First 100
|
|
32
|
+
|
|
33
|
+
# Unix/Linux/Mac
|
|
34
|
+
tree -L 3 "{source_path}"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Step 2: LLM Analysis - Identify Entry Directories
|
|
38
|
+
|
|
39
|
+
Based on the directory tree and technology stack, analyze and identify entry directories for each platform type:
|
|
40
|
+
|
|
41
|
+
**Backend (Spring/Java/Kotlin)**:
|
|
42
|
+
- Find all directories containing `*Controller.java` or `*Controller.kt` files
|
|
43
|
+
- These are API entry directories
|
|
44
|
+
- Module name = the business package name of the entry directory (e.g., `controller/admin/chat` → module `chat`)
|
|
45
|
+
|
|
46
|
+
**Frontend (Vue/React)**:
|
|
47
|
+
- Find `views/` or `pages/` directories
|
|
48
|
+
- First-level subdirectories under these directories are business modules
|
|
49
|
+
- Each subdirectory is an entry directory (e.g., `views/system/` → module `system`)
|
|
50
|
+
|
|
51
|
+
**Mobile (UniApp)**:
|
|
52
|
+
- Find first-level subdirectories under `pages/`
|
|
53
|
+
- Plus top-level `pages-*` directories (module name = directory name without `pages-` prefix, e.g., `pages-bpm` → module `bpm`)
|
|
54
|
+
|
|
55
|
+
**Mobile (Mini Program)**:
|
|
56
|
+
- Find first-level subdirectories under `pages/` as modules
|
|
57
|
+
|
|
58
|
+
### Step 3: Load Exclusion Rules
|
|
59
|
+
|
|
60
|
+
Read `{workspace_path}/docs/configs/tech-stack-mappings.json` to load exclusion patterns. Apply the following exclusion rules:
|
|
61
|
+
|
|
62
|
+
**Pure Technical Directories**:
|
|
63
|
+
`config`, `framework`, `enums`, `exception`, `util`, `utils`, `common`, `constant`, `constants`, `type`, `types`, `dto`, `vo`, `entity`, `model`, `mapper`, `repository`, `dao`, `service`, `impl`
|
|
64
|
+
|
|
65
|
+
**Build/Output Directories**:
|
|
66
|
+
`dist`, `build`, `target`, `out`, `node_modules`
|
|
67
|
+
|
|
68
|
+
**Test Directories**:
|
|
69
|
+
`test`, `tests`, `spec`, `__tests__`, `e2e`
|
|
70
|
+
|
|
71
|
+
**Configuration Directories**:
|
|
72
|
+
`.git`, `.idea`, `.vscode`, `.speccrew`
|
|
73
|
+
|
|
74
|
+
**Root Module Handling**:
|
|
75
|
+
- If an entry file is not under any subdirectory (directly under `{sourcePath}`), assign it to the `_root` module
|
|
76
|
+
|
|
77
|
+
### Step 4: Generate entry-dirs JSON
|
|
78
|
+
|
|
79
|
+
Output file: `{workspace_path}/knowledges/base/sync-state/knowledge-bizs/entry-dirs-{platform_id}.json`
|
|
80
|
+
|
|
81
|
+
**JSON Format**:
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"platformId": "backend-ai",
|
|
85
|
+
"platformName": "AI Module Backend",
|
|
86
|
+
"platformType": "backend",
|
|
87
|
+
"platformSubtype": "ai",
|
|
88
|
+
"sourcePath": "yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai",
|
|
89
|
+
"techStack": ["spring-boot", "mybatis-plus"],
|
|
90
|
+
"modules": [
|
|
91
|
+
{ "name": "chat", "entryDirs": ["controller/admin/chat"] },
|
|
92
|
+
{ "name": "image", "entryDirs": ["controller/admin/image"] },
|
|
93
|
+
{ "name": "knowledge", "entryDirs": ["controller/admin/knowledge"] },
|
|
94
|
+
{ "name": "_root", "entryDirs": ["controller/admin"] }
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Field Definitions**:
|
|
100
|
+
- `platformId`: Platform identifier (e.g., `backend-ai`, `web-vue`, `mobile-uniapp`)
|
|
101
|
+
- `platformName`: (Optional) Human-readable platform name. Auto-generated as `{platform_type}-{platform_subtype}` if missing
|
|
102
|
+
- `platformType`: (Optional) Platform type: `backend`, `web`, `mobile`, `desktop`. Inferred from platform_id if missing
|
|
103
|
+
- `platformSubtype`: (Optional) Platform subtype (e.g., `ai`, `vue`, `uniapp`). Inferred from platform_id if missing
|
|
104
|
+
- `sourcePath`: Absolute path to the platform source root
|
|
105
|
+
- `techStack`: (Optional) Array of tech stack names (e.g., `["spring-boot", "mybatis-plus"]`). Default inferred from platform_type
|
|
106
|
+
- `modules`: Array of business modules
|
|
107
|
+
- `name`: Module name (business-meaningful, e.g., `chat`, `system`, `order`)
|
|
108
|
+
- `entryDirs`: Array of entry directory paths (relative to `{source_path}`)
|
|
109
|
+
|
|
110
|
+
**Path Rules**:
|
|
111
|
+
- All `entryDirs` paths must be relative to `{sourcePath}`
|
|
112
|
+
- Use forward slashes `/` as path separators (even on Windows)
|
|
113
|
+
- Do not include leading or trailing slashes
|
|
114
|
+
|
|
115
|
+
### Step 5: Validation
|
|
116
|
+
|
|
117
|
+
After generating the entry-dirs JSON for each platform:
|
|
118
|
+
1. Verify that `modules` array is not empty
|
|
119
|
+
2. Verify that each module has at least one entry directory
|
|
120
|
+
3. Verify that module names are business-meaningful (not technical terms like `config`, `util`)
|
|
121
|
+
4. If validation fails, re-analyze the directory tree
|
|
122
|
+
|
|
123
|
+
**Error Handling**:
|
|
124
|
+
If entry directory recognition fails for a platform, STOP and report the error with platform details. Do NOT continue processing that platform.
|
|
125
|
+
|
|
126
|
+
## Checklist
|
|
127
|
+
|
|
128
|
+
- [ ] All platforms' entry-dirs JSON files have been generated
|
|
129
|
+
- [ ] Each platform's `modules` array is non-empty
|
|
130
|
+
- [ ] Module names have business meaning (not technical terms like config, util)
|
|
131
|
+
- [ ] `entryDirs` paths are correct and accessible
|
|
132
|
+
- [ ] JSON format is valid
|
|
133
|
+
|
|
134
|
+
## Example Usage
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
Skill: speccrew-knowledge-bizs-identify-entries
|
|
138
|
+
Args:
|
|
139
|
+
platforms: [
|
|
140
|
+
{
|
|
141
|
+
"platformId": "backend-ai",
|
|
142
|
+
"sourcePath": "/path/to/yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai",
|
|
143
|
+
"platformType": "backend",
|
|
144
|
+
"platformSubtype": "ai",
|
|
145
|
+
"techStack": ["spring-boot", "mybatis-plus"]
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"platformId": "web-vue",
|
|
149
|
+
"sourcePath": "/path/to/yudao-ui-admin/src",
|
|
150
|
+
"platformType": "web",
|
|
151
|
+
"platformSubtype": "vue",
|
|
152
|
+
"techStack": ["vue3", "element-plus"]
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
workspace_path: "/path/to/speccrew-workspace"
|
|
156
|
+
```
|
|
@@ -20,7 +20,7 @@ tools: Read, Write, Glob, Grep, SearchCodebase, Skill, Bash
|
|
|
20
20
|
```mermaid
|
|
21
21
|
flowchart TD
|
|
22
22
|
Start([Start]) --> Step1[Step 1: Identify Platforms]
|
|
23
|
-
Step1 --> Step2[Step 2:
|
|
23
|
+
Step1 --> Step2[Step 2: Identify Entry Directories]
|
|
24
24
|
Step2 --> Step3[Step 3: Execute Inventory Scripts]
|
|
25
25
|
Step3 --> Step4[Step 4: Report Results]
|
|
26
26
|
Step4 --> End([End])
|
|
@@ -52,26 +52,39 @@ flowchart TD
|
|
|
52
52
|
- Lookup `platform-mapping.json`: `web` + `vue` → `platform_type=web`, `platform_subtype=vue`
|
|
53
53
|
- Lookup `tech-stack-mappings.json`: vue → extensions=[".vue"], exclude_dirs=["components","utils"]
|
|
54
54
|
|
|
55
|
-
### Step 2:
|
|
55
|
+
### Step 2: Identify Entry Directories
|
|
56
56
|
|
|
57
|
-
For each detected
|
|
57
|
+
For each platform detected in Step 1, identify business module entry directories.
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
|
64
|
-
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
67
|
-
|
|
68
|
-
|
|
59
|
+
**Option A: Invoke Skill (Recommended)**
|
|
60
|
+
|
|
61
|
+
Dispatch Worker with `speccrew-knowledge-bizs-identify-entries` skill:
|
|
62
|
+
|
|
63
|
+
| Parameter | Value |
|
|
64
|
+
|-----------|-------|
|
|
65
|
+
| `platforms` | Platform list from Step 1 (each with platformId, sourcePath, platformType, platformSubtype, techStack) |
|
|
66
|
+
| `workspace_path` | `speccrew-workspace` |
|
|
67
|
+
|
|
68
|
+
Worker generates `entry-dirs-{platform_id}.json` files in `{workspace_path}/knowledges/base/sync-state/knowledge-bizs/`.
|
|
69
|
+
|
|
70
|
+
**Option B: Direct Execution**
|
|
71
|
+
|
|
72
|
+
If executing directly (without Worker dispatch), follow the same logic as the `speccrew-knowledge-bizs-identify-entries` skill:
|
|
73
|
+
1. Read each platform's directory tree (3 levels deep)
|
|
74
|
+
2. Identify entry directories based on platform type:
|
|
75
|
+
- **Backend**: Find directories containing `*Controller.*` files, extract business package names
|
|
76
|
+
- **Frontend**: Find `views/` or `pages/` directories, use first-level subdirectories as modules
|
|
77
|
+
- **Mobile**: Find `pages/` subdirectories + top-level `pages-*` directories
|
|
78
|
+
3. Apply exclusion rules from `tech-stack-mappings.json`
|
|
79
|
+
4. Generate `entry-dirs-{platform_id}.json` files
|
|
80
|
+
|
|
81
|
+
**Verification**: Confirm each entry-dirs JSON has non-empty `modules` array with business-meaningful names.
|
|
69
82
|
|
|
70
83
|
### Step 3: Execute Inventory Scripts
|
|
71
84
|
|
|
72
85
|
> **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.
|
|
73
86
|
|
|
74
|
-
Execute the inventory script for each platform:
|
|
87
|
+
Execute the inventory script for each platform using the entry-dirs JSON from Step 2:
|
|
75
88
|
|
|
76
89
|
**Prerequisites:**
|
|
77
90
|
- Node.js 14.0+
|
|
@@ -79,94 +92,26 @@ Execute the inventory script for each platform:
|
|
|
79
92
|
**Script Location (relative to this skill's directory):**
|
|
80
93
|
- All Platforms: `{skill_path}/scripts/generate-inventory.js`
|
|
81
94
|
|
|
82
|
-
**
|
|
95
|
+
**Execution Command:**
|
|
83
96
|
```bash
|
|
84
|
-
node "scripts/generate-inventory.js"
|
|
85
|
-
--sourcePath "frontend-web/src/views" \
|
|
86
|
-
--outputFileName "features-web.json" \
|
|
87
|
-
--platformName "Web Frontend" \
|
|
88
|
-
--platformType "web" \
|
|
89
|
-
--platformSubtype "vue" \
|
|
90
|
-
--techStack "vue,typescript" \
|
|
91
|
-
--fileExtensions ".vue" \
|
|
92
|
-
--excludeDirs "components,composables,hooks,utils"
|
|
97
|
+
node "{skill_path}/scripts/generate-inventory.js" --entryDirsFile "{entry_dirs_file_path}"
|
|
93
98
|
```
|
|
94
99
|
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
node "scripts/generate-inventory.js" \
|
|
98
|
-
--sourcePath "frontend-mobile/pages" \
|
|
99
|
-
--outputFileName "features-mobile.json" \
|
|
100
|
-
--platformName "Mobile App" \
|
|
101
|
-
--platformType "mobile" \
|
|
102
|
-
--platformSubtype "uniapp" \
|
|
103
|
-
--techStack "uniapp,vue" \
|
|
104
|
-
--fileExtensions ".vue" \
|
|
105
|
-
--excludeDirs "components,utils"
|
|
106
|
-
```
|
|
100
|
+
Where `{entry_dirs_file_path}` is the full path to the `entry-dirs-{platform_id}.json` file generated in Step 2.
|
|
107
101
|
|
|
108
|
-
**Example
|
|
102
|
+
**Example:**
|
|
109
103
|
```bash
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
--outputFileName "features-backend.json" \
|
|
113
|
-
--platformName "Backend API" \
|
|
114
|
-
--platformType "backend" \
|
|
115
|
-
--platformSubtype "spring" \
|
|
116
|
-
--techStack "spring-boot,java" \
|
|
117
|
-
--fileExtensions ".java" \
|
|
118
|
-
--excludeDirs ""
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
**Example - Backend Platform (Spring Multi-Module):**
|
|
104
|
+
# Execute for each platform's entry-dirs file
|
|
105
|
+
node "scripts/generate-inventory.js" --entryDirsFile "d:/project/speccrew-workspace/knowledges/base/sync-state/knowledge-bizs/entry-dirs-backend-system.json"
|
|
122
106
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
For projects with multiple backend modules (e.g., ruoyi-vue-pro), execute the script once per module:
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
# Module 1: AI
|
|
129
|
-
node "scripts/generate-inventory.js" \
|
|
130
|
-
--sourcePath "yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai" \
|
|
131
|
-
--outputFileName "features-backend-ai.json" \
|
|
132
|
-
--platformName "Backend API - AI Module" \
|
|
133
|
-
--platformType "backend" \
|
|
134
|
-
--platformSubtype "ai" \
|
|
135
|
-
--techIdentifier "spring" \
|
|
136
|
-
--techStack "spring-boot,java" \
|
|
137
|
-
--fileExtensions ".java" \
|
|
138
|
-
--excludeDirs ""
|
|
139
|
-
|
|
140
|
-
# Module 2: System
|
|
141
|
-
node "scripts/generate-inventory.js" \
|
|
142
|
-
--sourcePath "yudao-module-system/src/main/java/cn/iocoder/yudao/module/system" \
|
|
143
|
-
--outputFileName "features-backend-system.json" \
|
|
144
|
-
--platformName "Backend API - System Module" \
|
|
145
|
-
--platformType "backend" \
|
|
146
|
-
--platformSubtype "system" \
|
|
147
|
-
--techIdentifier "spring" \
|
|
148
|
-
--techStack "spring-boot,java" \
|
|
149
|
-
--fileExtensions ".java" \
|
|
150
|
-
--excludeDirs ""
|
|
107
|
+
node "scripts/generate-inventory.js" --entryDirsFile "d:/project/speccrew-workspace/knowledges/base/sync-state/knowledge-bizs/entry-dirs-web-vue.json"
|
|
151
108
|
```
|
|
152
109
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
```bash
|
|
160
|
-
node "scripts/generate-inventory.js" \
|
|
161
|
-
--sourcePath "." \
|
|
162
|
-
--outputFileName "features-backend-all.json" \
|
|
163
|
-
--platformName "Backend API - All Modules" \
|
|
164
|
-
--platformType "backend" \
|
|
165
|
-
--platformSubtype "spring" \
|
|
166
|
-
--techStack "spring-boot,java" \
|
|
167
|
-
--fileExtensions ".java" \
|
|
168
|
-
--excludeDirs "test,target,.git"
|
|
169
|
-
```
|
|
110
|
+
**Script Parameters**:
|
|
111
|
+
- `--entryDirsFile`: (Required) Path to the `entry-dirs-{platform_id}.json` file generated in Step 2
|
|
112
|
+
- `--techIdentifier`: (Optional) Technology identifier for tech-stack lookup (auto-detected from platform mapping if omitted)
|
|
113
|
+
- `--fileExtensions`: (Optional) Comma-separated list of file extensions to include
|
|
114
|
+
- `--excludeDirs`: (Optional) Additional directories to exclude
|
|
170
115
|
|
|
171
116
|
**Output: `features-{platform}.json` Structure:**
|
|
172
117
|
```json
|
|
@@ -175,7 +120,10 @@ node "scripts/generate-inventory.js" \
|
|
|
175
120
|
"platformType": "web",
|
|
176
121
|
"sourcePath": "frontend-web/src/views",
|
|
177
122
|
"techStack": ["vue", "typescript"],
|
|
178
|
-
"modules": [
|
|
123
|
+
"modules": [
|
|
124
|
+
{ "name": "chat", "featureCount": 12 },
|
|
125
|
+
{ "name": "image", "featureCount": 8 }
|
|
126
|
+
],
|
|
179
127
|
"totalFiles": 25,
|
|
180
128
|
"analyzedCount": 0,
|
|
181
129
|
"pendingCount": 25,
|
|
@@ -196,12 +144,10 @@ node "scripts/generate-inventory.js" \
|
|
|
196
144
|
```
|
|
197
145
|
|
|
198
146
|
**Module Detection Rule:**
|
|
199
|
-
-
|
|
200
|
-
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
- Files at root level (no subdirectory) → module = `_root`
|
|
204
|
-
- The top-level `modules` array lists all unique module names found
|
|
147
|
+
- 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
|
|
148
|
+
- Each file is assigned to the module whose `entryDirs` path matches the file's relative directory
|
|
149
|
+
- The top-level `modules` array lists all modules with their feature counts
|
|
150
|
+
- Files not matching any entry directory → module = `_root`
|
|
205
151
|
|
|
206
152
|
**sourcePath Format:**
|
|
207
153
|
- In both full-scan mode and entry-dirs mode, `sourcePath` is always a **project-root-relative path**
|
|
@@ -251,6 +197,12 @@ Final Output:
|
|
|
251
197
|
- [ ] Each platform has correct `platformName`, `platformType`, `techStack` configuration
|
|
252
198
|
- [ ] Source directories located for all platforms
|
|
253
199
|
|
|
200
|
+
### Entry Directory Identification
|
|
201
|
+
- [ ] Entry-dirs JSON files generated for all platforms
|
|
202
|
+
- [ ] Each platform has non-empty modules array
|
|
203
|
+
- [ ] Module names are business-meaningful (not technical terms like `config`, `util`, `controller`)
|
|
204
|
+
- [ ] Entry directory paths are correct and accessible
|
|
205
|
+
|
|
254
206
|
### Inventory Generation
|
|
255
207
|
- [ ] **Inventory scripts executed**: Node.js script generated `features-{platform}.json` files
|
|
256
208
|
- [ ] **Inventory files valid**: JSON structure correct, all features listed
|