speccrew 0.6.57 → 0.6.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze-xml/SKILL.md +15 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-identify-entries-xml/SKILL.md +21 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js +17 -1
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze-xml/SKILL.md +15 -0
- package/package.json +1 -1
- package/workspace-template/docs/rules/xml-workflow-spec.md +17 -0
|
@@ -353,6 +353,21 @@ Before executing the workflow, verify the following inputs:
|
|
|
353
353
|
</block>
|
|
354
354
|
|
|
355
355
|
<!-- ==================== STEP 5A: COPY TEMPLATE TO DOCUMENT PATH ==================== -->
|
|
356
|
+
<!-- Document Output Path Rule -->
|
|
357
|
+
<block type="rule" id="R-DOCPATH" level="mandatory" desc="Document output path MUST use documentPath parameter">
|
|
358
|
+
<field name="text">
|
|
359
|
+
The output document file MUST be created at the EXACT path specified by ${documentPath} input parameter.
|
|
360
|
+
DO NOT use the template file name (e.g., FEATURE-DETAIL-TEMPLATE-*.md) as the output file name.
|
|
361
|
+
The documentPath already contains the correct target path including file name (e.g., speccrew-workspace/knowledges/bizs/backend-system/admin/cache/cache_controller.md).
|
|
362
|
+
Before creating the file, ensure the parent directory exists (create if necessary).
|
|
363
|
+
</field>
|
|
364
|
+
</block>
|
|
365
|
+
|
|
366
|
+
<!-- Ensure Document Output Directory Exists -->
|
|
367
|
+
<block type="task" id="B14a" action="run-script" desc="Ensure document output directory exists">
|
|
368
|
+
<field name="command">node -e "require('fs').mkdirSync(require('path').dirname('${documentPath}'), {recursive: true})"</field>
|
|
369
|
+
</block>
|
|
370
|
+
|
|
356
371
|
<!-- Replace Top-Level Placeholders -->
|
|
357
372
|
<block type="task" id="B14" action="replace-placeholders" desc="Replace template placeholders">
|
|
358
373
|
<field name="template" value="${templateContent}"/>
|
|
@@ -152,6 +152,19 @@ For each platform, generates:
|
|
|
152
152
|
<field name="output" var="generated_json_path"/>
|
|
153
153
|
</block>
|
|
154
154
|
|
|
155
|
+
<!-- Rule: Output JSON Format Validation -->
|
|
156
|
+
<block type="rule" id="R-FORMAT" scope="mandatory" desc="Output JSON format validation">
|
|
157
|
+
<field name="content">
|
|
158
|
+
The generated entry-dirs JSON file MUST strictly follow this structure:
|
|
159
|
+
- Root object MUST contain "modules" field (array type)
|
|
160
|
+
- Root object MUST NOT contain "businessModules", "subModules", or "components" fields
|
|
161
|
+
- Each module in "modules" array MUST have exactly two fields: "name" (string) and "entryDirs" (array of strings)
|
|
162
|
+
- For platforms with hierarchical directory structure (e.g. frontend views/system/user/), flatten into individual modules
|
|
163
|
+
- Module names should use hyphen-separated composite names for sub-modules (e.g. "system-user", "system-role")
|
|
164
|
+
- If the generated JSON does not match this format, you MUST regenerate it before proceeding
|
|
165
|
+
</field>
|
|
166
|
+
</block>
|
|
167
|
+
|
|
155
168
|
<!-- Checkpoint: Persist Generated JSON -->
|
|
156
169
|
<block type="checkpoint" id="CP1" name="entry-dirs-generated" desc="Verify entry-dirs JSON was generated">
|
|
157
170
|
<field name="file" value="${sync_state_bizs_dir}/entry-dirs-${platform.platformId}.json"/>
|
|
@@ -227,6 +240,14 @@ For each platform, generates:
|
|
|
227
240
|
}
|
|
228
241
|
```
|
|
229
242
|
|
|
243
|
+
### Format Constraints
|
|
244
|
+
|
|
245
|
+
- **MUST use `modules` array** — never use `businessModules`, `components`, or any alternative field name
|
|
246
|
+
- **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
|
|
247
|
+
- 例如:`system` 有 `user` 和 `role` 子目录 → 生成 `{ "name": "system-user", "entryDirs": ["src/views/system/user"] }` 和 `{ "name": "system-role", "entryDirs": ["src/views/system/role"] }`
|
|
248
|
+
- **Forbidden fields**: `businessModules`, `subModules`, `components`, `hasSubModules` — 这些都不被下游脚本支持
|
|
249
|
+
- **Each module's entryDirs** must point to directories containing actual entry files (e.g. .vue, .py, .java), not parent wrapper directories
|
|
250
|
+
|
|
230
251
|
### Field Definitions
|
|
231
252
|
|
|
232
253
|
- `platformId`: Platform identifier (e.g., `backend-ai`, `web-vue`, `mobile-uniapp`)
|
package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js
CHANGED
|
@@ -647,8 +647,24 @@ function main() {
|
|
|
647
647
|
console.error('Error: entryDirsFile missing required field "sourcePath"');
|
|
648
648
|
process.exit(1);
|
|
649
649
|
}
|
|
650
|
+
// Check for common format mistakes
|
|
651
|
+
if (entryDirsData.businessModules && Array.isArray(entryDirsData.businessModules)) {
|
|
652
|
+
console.error('Error: entryDirsFile uses unsupported "businessModules" format.');
|
|
653
|
+
console.error('Expected: { "modules": [ { "name": "...", "entryDirs": ["..."] } ] }');
|
|
654
|
+
console.error('Received: { "businessModules": [...] }');
|
|
655
|
+
console.error('');
|
|
656
|
+
console.error('Fix: The entry-dirs JSON must use a flat "modules" array.');
|
|
657
|
+
console.error('Each module should have "name" (string) and "entryDirs" (array of strings).');
|
|
658
|
+
console.error('Sub-modules must be flattened into top-level entries.');
|
|
659
|
+
console.error('Re-run the identify-entries skill to regenerate with correct format.');
|
|
660
|
+
process.exit(1);
|
|
661
|
+
}
|
|
662
|
+
|
|
650
663
|
if (!entryDirsData.modules || !Array.isArray(entryDirsData.modules)) {
|
|
651
|
-
console.error('Error: entryDirsFile missing required field "modules" array');
|
|
664
|
+
console.error('Error: entryDirsFile missing required field "modules" array.');
|
|
665
|
+
console.error('Expected format: { "platformId": "...", "modules": [ { "name": "...", "entryDirs": ["..."] } ] }');
|
|
666
|
+
const foundKeys = Object.keys(entryDirsData).join(', ');
|
|
667
|
+
console.error(`Found top-level keys: ${foundKeys}`);
|
|
652
668
|
process.exit(1);
|
|
653
669
|
}
|
|
654
670
|
|
|
@@ -285,6 +285,21 @@ Analyze one specific UI feature from source code, extract business functionality
|
|
|
285
285
|
|
|
286
286
|
<!-- ==================== STEP 5A: COPY TEMPLATE TO DOCUMENT PATH ==================== -->
|
|
287
287
|
<sequence id="S5a" name="Step 5a: Copy Template" status="pending" desc="Copy template to document path">
|
|
288
|
+
<!-- Document Output Path Rule -->
|
|
289
|
+
<block type="rule" id="R-DOCPATH" level="mandatory" desc="Document output path MUST use documentPath parameter">
|
|
290
|
+
<field name="text">
|
|
291
|
+
The output document file MUST be created at the EXACT path specified by ${documentPath} input parameter.
|
|
292
|
+
DO NOT use the template file name (e.g., FEATURE-DETAIL-TEMPLATE-*.md) as the output file name.
|
|
293
|
+
The documentPath already contains the correct target path including file name (e.g., speccrew-workspace/knowledges/bizs/web-vue/src/views/system/user/index.md).
|
|
294
|
+
Before creating the file, ensure the parent directory exists (create if necessary).
|
|
295
|
+
</field>
|
|
296
|
+
</block>
|
|
297
|
+
|
|
298
|
+
<!-- Ensure Document Output Directory Exists -->
|
|
299
|
+
<block type="task" id="B5a0" action="run-script" desc="Ensure document output directory exists">
|
|
300
|
+
<field name="command">node -e "require('fs').mkdirSync(require('path').dirname('${documentPath}'), {recursive: true})"</field>
|
|
301
|
+
</block>
|
|
302
|
+
|
|
288
303
|
<!-- Prepare Placeholder Replacements -->
|
|
289
304
|
<block type="task" id="B5a1" action="analyze" desc="Prepare replacements">
|
|
290
305
|
<field name="language" value="${language}"/>
|
package/package.json
CHANGED
|
@@ -481,3 +481,20 @@ Team Leader executes:
|
|
|
481
481
|
6. **`loop parallel="true"`** = dispatch all iterations concurrently
|
|
482
482
|
7. **`rule level="forbidden"`** = immediate stop if violated
|
|
483
483
|
8. **Input/Output blocks** define the contract — respect required parameters
|
|
484
|
+
|
|
485
|
+
### Block Execution Announcement Protocol
|
|
486
|
+
|
|
487
|
+
Before executing each `<block>`, the agent MUST announce the block being executed. The announcement format is:
|
|
488
|
+
|
|
489
|
+
```
|
|
490
|
+
📋 Block [{block-id}] (type={block-type}, action={action}) — {block-desc}
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
**Rules:**
|
|
494
|
+
1. The announcement MUST be made BEFORE the block execution begins, not after.
|
|
495
|
+
2. ALL block types require announcement: `task`, `loop`, `checkpoint`, `rule`, `gateway`, `input`, `output`.
|
|
496
|
+
3. For `<block type="loop">` blocks, announce the loop entry with iteration context (e.g., "Loop [S2-L2] — Iterating over ${batch}, 5 items, parallel=true").
|
|
497
|
+
4. For `<block type="checkpoint">` blocks, announce the checkpoint and its validation result.
|
|
498
|
+
5. For `<block type="rule">` blocks, announce the rule being applied.
|
|
499
|
+
6. This protocol applies to ALL agents executing XML workflows — both orchestrating agents (Team Leader) and worker agents.
|
|
500
|
+
7. Nested blocks inside loops should also be announced for each iteration.
|