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,77 +1,4 @@
1
- ---
2
- name: speccrew-knowledge-bizs-ui-style-extract-xml
3
- description: Extract and aggregate UI design patterns (page types, components, layouts) from analyzed bizs feature documents using XML workflow blocks, outputting to techs ui-style-patterns directory.
4
- tools: Read, Write
5
- ---
6
-
7
- # Bizs UI Style Extract (XML Workflow)
8
-
9
- Extract and aggregate **UI design patterns** from bizs pipeline analyzed feature documents using XML workflow blocks. Through cross-module clustering analysis, identify common page types, component patterns, and layout patterns, then output them to the techs knowledge base `ui-style-patterns/` subdirectory.
10
-
11
- ## Language Adaptation
12
-
13
- **CRITICAL**: 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
- **All generated pattern documents must be in the language specified by the `language` parameter.**
20
-
21
- ## Trigger Scenarios
22
-
23
- - Called by `speccrew-knowledge-bizs-dispatch` Stage 3.5 (after Module Summarize, before System Summary)
24
- - "Extract UI patterns from bizs features"
25
- - "Aggregate UI design patterns"
26
-
27
- ## Input
28
-
29
- | Variable | Description | Required |
30
- |----------|-------------|----------|
31
- | `platform_id` | Platform identifier (e.g., web-vue, mobile-uniapp), used to locate output directory | Yes |
32
- | `platform_type` | Platform type (web, mobile, desktop), only execute for frontend platforms | Yes |
33
- | `feature_docs_path` | Completed feature documents base path, e.g., `speccrew-workspace/knowledges/bizs/{platform-type}/{module}/features/` | Yes |
34
- | `features_manifest_path` | Path to features-{platform}.json, used to get completed feature list | Yes |
35
- | `module_overviews_path` | **Parent directory** containing all module overview subdirectories. Example: `knowledges/bizs/web-vue/` (this directory contains `system/system-overview.md`, `user/user-overview.md`, etc.). **NOT** a specific module directory like `knowledges/bizs/web-vue/system/`. | Yes |
36
- | `output_path` | Output directory, e.g., `speccrew-workspace/knowledges/techs/{platform_id}/ui-style-patterns/` | Yes |
37
- | `language` | User language code | Yes |
38
-
39
- ## Output
40
-
41
- > **Directory Separation**: This skill outputs to `ui-style-patterns/` (NOT `ui-style/`).
42
- > - `ui-style/` is managed by techs pipeline (framework-level design system, existing components/pages)
43
- > - `ui-style-patterns/` is managed by bizs pipeline (business pattern aggregation from feature docs)
44
- > This separation prevents file conflicts between the two pipelines.
45
-
46
- ```
47
- {output_path}/
48
- ├── page-types/ # Page type pattern documents
49
- │ ├── {pattern-name}.md
50
- │ └── ...
51
- ├── components/ # Component pattern documents
52
- │ ├── {pattern-name}.md
53
- │ └── ...
54
- └── layouts/ # Layout pattern documents
55
- ├── {pattern-name}.md
56
- └── ...
57
- ```
58
-
59
- ## Absolute Constraints
60
-
61
- > **These rules apply to ALL document generation steps. Violation = task failure.**
62
-
63
- 1. **FORBIDDEN: `create_file` for pattern documents** — NEVER use `create_file` to write pattern documents. Each document MUST be created by copying the appropriate template then filling sections with `search_replace`.
64
-
65
- 2. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire document content in a single operation. Always use targeted `search_replace` on specific sections.
66
-
67
- 3. **MANDATORY: Template-first workflow** — Copy template MUST execute before filling sections for every pattern document.
68
-
69
- ## Workflow
70
-
71
- > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/xml-workflow-spec.md`
72
-
73
- ```xml
74
- <?xml version="1.0" encoding="UTF-8"?>
1
+ <?xml version="1.0" encoding="UTF-8"?>
75
2
  <workflow id="ui-style-extract-main" status="pending" version="1.0" desc="Extract and aggregate UI design patterns from feature documents">
76
3
 
77
4
  <!-- ============================================================
@@ -103,13 +30,13 @@ Extract and aggregate **UI design patterns** from bizs pipeline analyzed feature
103
30
  <!-- ============================================================
104
31
  Global Continuous Execution Rules
105
32
  ============================================================ -->
106
- <block type="rule" id="GLOBAL-R1" level="forbidden" desc="Continuous execution constraints NEVER violate">
33
+ <block type="rule" id="GLOBAL-R1" level="forbidden" desc="Continuous execution constraints 鈥?NEVER violate">
107
34
  <field name="text">DO NOT ask user "Should I continue?" or "How would you like to proceed?" during execution</field>
108
- <field name="text">DO NOT offer options like "Full execution / Partial / Stop" always execute ALL tasks to completion</field>
109
- <field name="text">DO NOT suggest "Due to context window limits, let me pause" complete current task, use checkpoint for resumption</field>
110
- <field name="text">DO NOT estimate workload and suggest breaking it into phases execute ALL items in sequence</field>
111
- <field name="text">DO NOT warn about "large number of files" or "this may take a while" proceed with generation</field>
112
- <field name="text">Context window management: if approaching limit, save progress to checkpoint file and resume do NOT ask user for guidance</field>
35
+ <field name="text">DO NOT offer options like "Full execution / Partial / Stop" 鈥?always execute ALL tasks to completion</field>
36
+ <field name="text">DO NOT suggest "Due to context window limits, let me pause" 鈥?complete current task, use checkpoint for resumption</field>
37
+ <field name="text">DO NOT estimate workload and suggest breaking it into phases 鈥?execute ALL items in sequence</field>
38
+ <field name="text">DO NOT warn about "large number of files" or "this may take a while" 鈥?proceed with generation</field>
39
+ <field name="text">Context window management: if approaching limit, save progress to checkpoint file and resume 鈥?do NOT ask user for guidance</field>
113
40
  </block>
114
41
 
115
42
  <!-- ============================================================
@@ -332,74 +259,3 @@ Extract and aggregate **UI design patterns** from bizs pipeline analyzed feature
332
259
  </block>
333
260
 
334
261
  </workflow>
335
- ```
336
-
337
- ## Generation Rules
338
-
339
- 1. **Pattern Quality**:
340
- - Each pattern must have clear applicable scenarios
341
- - Generalized ASCII wireframe (not feature-specific)
342
- - At least 2 instance references (from same or different modules)
343
-
344
- 2. **Template Compliance**:
345
- - All sections from template must be filled
346
- - Instance reference paths must be relative and valid
347
-
348
- 3. **Mermaid Compliance**:
349
- - Follow all rules in `mermaid-rule.md`
350
- - Use basic `graph TB` or `graph LR` syntax
351
- - No prohibited syntax elements
352
-
353
- 4. **Language Consistency**:
354
- - All content in the specified `language`
355
- - Template section headers remain in English
356
- - Content text matches user language
357
-
358
- ## Error Handling
359
-
360
- | Scenario | Handling |
361
- |----------|----------|
362
- | No completed features | Return empty result, log warning |
363
- | No patterns identified | Return empty result, log message |
364
- | Template not found | Use default structure, log warning |
365
- | Feature document missing | Skip feature, continue with others |
366
-
367
- ## Checklist
368
-
369
- - [ ] Step 1: Features manifest loaded, completed features identified
370
- - [ ] Step 2: All completed feature documents read
371
- - [ ] Step 3: All module overviews read
372
- - [ ] Step 4: Cross-module clustering analysis completed
373
- - [ ] Step 5: Pattern documents generated with correct templates
374
- - [ ] Step 5: File naming follows kebab-case convention
375
- - [ ] Step 5: ASCII wireframes are generalized versions
376
- - [ ] Step 5: Instance references use relative paths
377
- - [ ] Step 5: Mermaid diagrams follow mermaid-rule.md
378
- - [ ] Step 6: Summary returned with file list
379
-
380
- ## Return
381
-
382
- After completion, return a summary object to the caller:
383
-
384
- ```json
385
- {
386
- "status": "completed",
387
- "platform_id": "web-vue",
388
- "patterns": {
389
- "page_types": {
390
- "count": 3,
391
- "files": ["page-types/list-page.md", "page-types/form-page.md", "page-types/detail-page.md"]
392
- },
393
- "components": {
394
- "count": 2,
395
- "files": ["components/search-filter-bar.md", "components/modal-form.md"]
396
- },
397
- "layouts": {
398
- "count": 1,
399
- "files": ["layouts/sidebar-content.md"]
400
- }
401
- },
402
- "total_patterns": 6,
403
- "output_path": "speccrew-workspace/knowledges/techs/web-vue/ui-style-patterns/"
404
- }
405
- ```
@@ -63,130 +63,11 @@ Any Agent (speccrew-task-worker, speccrew-knowledge-dispatch, or other agents)
63
63
  }
64
64
  ```
65
65
 
66
- ## Workflow
67
-
68
- ```mermaid
69
- graph TB
70
- Start([Start]) --> SelectAction{Action Type}
71
- SelectAction -->|get-node| GetNode[Run script: get-node]
72
- SelectAction -->|query-nodes| QueryNodes[Run script: query-nodes]
73
- SelectAction -->|get-edges| GetEdges[Run script: get-edges]
74
- SelectAction -->|search| Search[Run script: search]
75
- SelectAction -->|trace-upstream| TraceUp[Run script: trace-upstream]
76
- SelectAction -->|trace-downstream| TraceDown[Run script: trace-downstream]
77
- GetNode --> Return[Return JSON Result]
78
- QueryNodes --> Return
79
- GetEdges --> Return
80
- Search --> Return
81
- TraceUp --> Return
82
- TraceDown --> Return
83
- Return --> End([End])
84
- ```
85
-
86
- ---
87
-
88
- ## Actions
89
-
90
- ### Action: get-node
91
-
92
- Get a single node by its ID.
93
-
94
- ```bash
95
- node "{skill_path}/scripts/graph-query.js" --action "get-node" --id "{{id}}" --graphRoot "{{graphRoot}}"
96
- ```
97
-
98
- **Returns:** Single node object or empty if not found.
99
-
100
- ### Action: query-nodes
101
-
102
- Query nodes by module and/or type.
103
-
104
- ```bash
105
- # By module and type
106
- node "{skill_path}/scripts/graph-query.js" --action "query-nodes" --module "{{module}}" --type "{{type}}" --graphRoot "{{graphRoot}}"
107
-
108
- # By module only
109
- node "{skill_path}/scripts/graph-query.js" --action "query-nodes" --module "{{module}}" --graphRoot "{{graphRoot}}"
110
-
111
- # By type only
112
- node "{skill_path}/scripts/graph-query.js" --action "query-nodes" --type "{{type}}" --graphRoot "{{graphRoot}}"
113
- ```
114
-
115
- **Returns:** Array of matching nodes.
116
-
117
- ### Action: get-edges
118
-
119
- Get all edges connected to a node, filtered by direction.
120
-
121
- ```bash
122
- node "{skill_path}/scripts/graph-query.js" --action "get-edges" --nodeId "{{id}}" --direction "{{direction}}" --graphRoot "{{graphRoot}}"
123
- ```
124
-
125
- **Direction values:**
126
- - `in` — edges where this node is the `target`
127
- - `out` — edges where this node is the `source`
128
- - `both` — all edges connected to this node
129
-
130
- **Returns:** Array of matching edges.
131
-
132
- ### Action: search
133
-
134
- Search nodes by keyword across name, description, tags, and keywords fields.
135
-
136
- ```bash
137
- # Search with filters
138
- node "{skill_path}/scripts/graph-query.js" --action "search" --keyword "{{keyword}}" --type "{{type}}" --module "{{module}}" --graphRoot "{{graphRoot}}"
139
-
140
- # Search all
141
- node "{skill_path}/scripts/graph-query.js" --action "search" --keyword "{{keyword}}" --graphRoot "{{graphRoot}}"
142
- ```
143
-
144
- **Returns:** Array of matching nodes, sorted by relevance.
145
-
146
- ### Action: trace-upstream
147
-
148
- Trace all upstream dependencies of a node (what depends on / calls this node).
149
-
150
- ```bash
151
- node "{skill_path}/scripts/graph-query.js" --action "trace-upstream" --id "{{id}}" --depth {{depth}} --graphRoot "{{graphRoot}}"
152
- ```
153
-
154
- **Use case:** Impact analysis — "If I change this table, what APIs and pages are affected?"
155
-
156
- **Returns:** Tree structure of upstream nodes and edges.
157
-
158
- ```json
159
- {
160
- "root": { "id": "table-system-user", "type": "table" },
161
- "upstream": [
162
- {
163
- "node": { "id": "api-system-user-list", "type": "api" },
164
- "edge": { "type": "operates", "metadata": { "operation": "SELECT" } },
165
- "depth": 1,
166
- "upstream": [
167
- {
168
- "node": { "id": "page-system-user-list", "type": "page" },
169
- "edge": { "type": "calls", "metadata": { "trigger": "onMounted" } },
170
- "depth": 2,
171
- "upstream": []
172
- }
173
- ]
174
- }
175
- ]
176
- }
177
- ```
178
-
179
- ### Action: trace-downstream
180
-
181
- Trace all downstream dependencies of a node (what this node depends on / calls).
182
-
183
- ```bash
184
- node "{skill_path}/scripts/graph-query.js" --action "trace-downstream" --id "{{id}}" --depth {{depth}} --graphRoot "{{graphRoot}}"
185
- ```
66
+ ## AgentFlow Definition
186
67
 
187
- **Use case:** Dependency analysis — "What does this page call? What tables does this API touch?"
68
+ <!-- @agentflow: workflow.agentflow.xml -->
188
69
 
189
- **Returns:** Tree structure of downstream nodes and edges (same format as trace-upstream).
70
+ > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/agentflow-spec.md`
190
71
 
191
72
  ---
192
73
 
@@ -0,0 +1,106 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <workflow id="knowledge-graph-query" status="pending" version="1.0" desc="Query knowledge graph to find nodes, edges, relationships">
3
+
4
+ <!-- ============================================================
5
+ Input Parameters Definition
6
+ ============================================================ -->
7
+ <block type="input" id="I1" desc="Workflow input parameters">
8
+ <field name="action" required="true" type="string" desc="Query action: get-node, query-nodes, get-edges, search, trace-upstream, trace-downstream"/>
9
+ <field name="id" required="false" type="string" desc="Node ID (for get-node, trace-*)"/>
10
+ <field name="module" required="false" type="string" desc="Filter by module (for query-nodes, search)"/>
11
+ <field name="type" required="false" type="string" desc="Filter by node type (for query-nodes, search)"/>
12
+ <field name="keyword" required="false" type="string" desc="Search keyword (for search)"/>
13
+ <field name="direction" required="false" type="string" desc="Edge direction: in, out, both (for get-edges)"/>
14
+ <field name="depth" required="false" type="number" default="2" desc="Trace depth (for trace-*)"/>
15
+ <field name="nodeId" required="false" type="string" desc="Node ID for get-edges"/>
16
+ <field name="graphRoot" required="true" type="string" desc="Path to graph root directory"/>
17
+ <field name="skill_path" required="true" type="string" desc="Path to this skill directory"/>
18
+ </block>
19
+
20
+ <!-- ============================================================
21
+ Global Constraints
22
+ ============================================================ -->
23
+ <block type="rule" id="R1" level="mandatory" desc="Query constraints">
24
+ <field name="text">action must be one of: get-node, query-nodes, get-edges, search, trace-upstream, trace-downstream</field>
25
+ <field name="text">graphRoot path must be correct (speccrew-workspace/knowledges/bizs/graph)</field>
26
+ <field name="text">For get-node / trace-*: id must follow {type}-{module}-{name} format</field>
27
+ <field name="text">For get-edges: direction must be one of in, out, both</field>
28
+ <field name="text">For trace-*: depth must be a positive integer (default: 2)</field>
29
+ </block>
30
+
31
+ <!-- ============================================================
32
+ Action Gateway
33
+ ============================================================ -->
34
+ <block type="gateway" id="G0" mode="exclusive" desc="Select query action">
35
+
36
+ <!-- Action: get-node -->
37
+ <branch test="${action} == 'get-node'" name="Get Node">
38
+ <block type="task" id="B1" action="run-script" desc="Get single node by ID">
39
+ <field name="command">node "${skill_path}/scripts/graph-query.js" --action "get-node" --id "${id}" --graphRoot "${graphRoot}"</field>
40
+ <field name="output" var="query_result"/>
41
+ </block>
42
+ </branch>
43
+
44
+ <!-- Action: query-nodes -->
45
+ <branch test="${action} == 'query-nodes'" name="Query Nodes">
46
+ <block type="task" id="B2" action="run-script" desc="Query nodes by module and/or type">
47
+ <field name="command">node "${skill_path}/scripts/graph-query.js" --action "query-nodes" --module "${module}" --type "${type}" --graphRoot "${graphRoot}"</field>
48
+ <field name="note">module and type parameters are optional filters</field>
49
+ <field name="output" var="query_result"/>
50
+ </block>
51
+ </branch>
52
+
53
+ <!-- Action: get-edges -->
54
+ <branch test="${action} == 'get-edges'" name="Get Edges">
55
+ <block type="task" id="B3" action="run-script" desc="Get edges for node">
56
+ <field name="command">node "${skill_path}/scripts/graph-query.js" --action "get-edges" --nodeId "${nodeId}" --direction "${direction}" --graphRoot "${graphRoot}"</field>
57
+ <field name="rules">
58
+ Direction values:
59
+ - in: edges where this node is the target
60
+ - out: edges where this node is the source
61
+ - both: all edges connected to this node
62
+ </field>
63
+ <field name="output" var="query_result"/>
64
+ </block>
65
+ </branch>
66
+
67
+ <!-- Action: search -->
68
+ <branch test="${action} == 'search'" name="Search">
69
+ <block type="task" id="B4" action="run-script" desc="Search nodes by keyword">
70
+ <field name="command">node "${skill_path}/scripts/graph-query.js" --action "search" --keyword "${keyword}" --type "${type}" --module "${module}" --graphRoot "${graphRoot}"</field>
71
+ <field name="note">Searches across name, description, tags, and keywords fields</field>
72
+ <field name="output" var="query_result"/>
73
+ </block>
74
+ </branch>
75
+
76
+ <!-- Action: trace-upstream -->
77
+ <branch test="${action} == 'trace-upstream'" name="Trace Upstream">
78
+ <block type="task" id="B5" action="run-script" desc="Trace upstream dependencies">
79
+ <field name="command">node "${skill_path}/scripts/graph-query.js" --action "trace-upstream" --id "${id}" --depth ${depth} --graphRoot "${graphRoot}"</field>
80
+ <field name="note">Use case: Impact analysis — "If I change this table, what APIs and pages are affected?"</field>
81
+ <field name="output" var="query_result"/>
82
+ </block>
83
+ </branch>
84
+
85
+ <!-- Action: trace-downstream -->
86
+ <branch test="${action} == 'trace-downstream'" name="Trace Downstream">
87
+ <block type="task" id="B6" action="run-script" desc="Trace downstream dependencies">
88
+ <field name="command">node "${skill_path}/scripts/graph-query.js" --action "trace-downstream" --id "${id}" --depth ${depth} --graphRoot "${graphRoot}"</field>
89
+ <field name="note">Use case: Dependency analysis — "What does this page call? What tables does this API touch?"</field>
90
+ <field name="output" var="query_result"/>
91
+ </block>
92
+ </branch>
93
+
94
+ </block>
95
+
96
+ <!-- ============================================================
97
+ Output Results
98
+ ============================================================ -->
99
+ <block type="output" id="O1" desc="Workflow output results">
100
+ <field name="status" from="${query_result.status}" type="string" desc="Query result: success or not-found"/>
101
+ <field name="action" from="${action}" type="string" desc="Action performed"/>
102
+ <field name="resultCount" from="${query_result.resultCount}" type="number" desc="Number of results returned"/>
103
+ <field name="data" from="${query_result.data}" type="array" desc="Query result data"/>
104
+ </block>
105
+
106
+ </workflow>
@@ -55,88 +55,11 @@ Dispatch Agent (speccrew-knowledge-dispatch)
55
55
  }
56
56
  ```
57
57
 
58
- ## Workflow
59
-
60
- ```mermaid
61
- graph TB
62
- Start([Start]) --> CheckAction{Action Type}
63
- CheckAction -->|batch-write| WriteTmp[Write graphData to temp file]
64
- WriteTmp --> AddNodes[Run script: add-nodes]
65
- AddNodes --> AddEdges[Run script: add-edges]
66
- AddEdges --> UpdateIndex[Run script: rebuild-index]
67
- UpdateIndex --> UpdateMeta[Run script: update-meta]
68
- UpdateMeta --> Report[Report Results]
69
- CheckAction -->|init-module| InitModule[Run script: init-module]
70
- InitModule --> Report
71
- CheckAction -->|update-node| UpdateNode[Run script: update-node]
72
- UpdateNode --> Report
73
- CheckAction -->|remove-node| RemoveNode[Run script: remove-node]
74
- RemoveNode --> Report
75
- Report --> End([End])
76
- ```
77
-
78
- ---
79
-
80
- ## Actions
81
-
82
- ### Action: batch-write
83
-
84
- **Primary use case.** Write all nodes and edges from a skill's `graphData` output to the graph.
85
-
86
- **Steps:**
87
-
88
- 1. **Write graphData to temp file:**
89
- - Create temp file at `{{graphRoot}}/temp/` with the `graphData` JSON content
90
- - Temp file name: `batch-{module}-{timestamp}.json`
91
-
92
- 2. **Add nodes:**
93
- ```
94
- node "{skill_path}/scripts/graph-write.js" --action "add-nodes" --platformId "{{platformId}}" --module "{{module}}" --file "{{tempFilePath}}" --graphRoot "{{graphRoot}}"
95
- ```
96
-
97
- 3. **Add edges:**
98
- ```
99
- node "{skill_path}/scripts/graph-write.js" --action "add-edges" --platformId "{{platformId}}" --module "{{module}}" --file "{{tempFilePath}}" --graphRoot "{{graphRoot}}"
100
- ```
101
-
102
- 4. **Update index and metadata** (automatic, handled by script)
103
-
104
- 5. **Clean up temp file**
105
-
106
- **Deduplication Rule:**
107
- - Nodes with the same `id` are **replaced** (last write wins)
108
- - Edges with the same `source` + `target` + `type` combination are **replaced**
109
-
110
- ### Action: init-module
58
+ ## AgentFlow Definition
111
59
 
112
- Initialize empty graph structure for a module. Used before Stage 2 analysis begins.
60
+ <!-- @agentflow: workflow.agentflow.xml -->
113
61
 
114
- ```
115
- node "{skill_path}/scripts/graph-write.js" --action "init-module" --platformId "{{platformId}}" --module "{{module}}" --graphRoot "{{graphRoot}}"
116
- ```
117
-
118
- **Creates:**
119
- - `{{graphRoot}}/nodes/{{platformId}}/{{module}}.json` — empty nodes array
120
- - `{{graphRoot}}/edges/{{platformId}}/{{module}}.json` — empty edges array
121
- - Updates `{{graphRoot}}/graph-meta.json` — adds `{{platformId}}/{{module}}` to modules list
122
- - Creates `{{graphRoot}}/edges/{{platformId}}/cross-module.json` if not exists
123
- - Creates `{{graphRoot}}/indices/index.json` if not exists
124
-
125
- ### Action: update-node
126
-
127
- Update an existing node's data fields.
128
-
129
- ```
130
- node "{skill_path}/scripts/graph-write.js" --action "update-node" --platformId "{{platformId}}" --id "{{nodeId}}" --data '{{nodeDataJson}}' --graphRoot "{{graphRoot}}"
131
- ```
132
-
133
- ### Action: remove-node
134
-
135
- Remove a node and all its connected edges.
136
-
137
- ```
138
- node "{skill_path}/scripts/graph-write.js" --action "remove-node" --platformId "{{platformId}}" --id "{{nodeId}}" --graphRoot "{{graphRoot}}"
139
- ```
62
+ > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/agentflow-spec.md`
140
63
 
141
64
  ---
142
65
 
@@ -0,0 +1,152 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <workflow id="knowledge-graph-write" status="pending" version="1.0" desc="Write graph data to knowledge graph storage">
3
+
4
+ <!-- ============================================================
5
+ Input Parameters Definition
6
+ ============================================================ -->
7
+ <block type="input" id="I1" desc="Workflow input parameters">
8
+ <field name="action" required="true" type="string" desc="Write action: batch-write, init-module, update-node, remove-node"/>
9
+ <field name="platformId" required="true" type="string" desc="Platform identifier for directory segregation"/>
10
+ <field name="module" required="false" type="string" desc="Target business module"/>
11
+ <field name="graphData" required="false" type="object" desc="Graph data from skill output (for batch-write): {nodes: [], edges: []}"/>
12
+ <field name="nodeId" required="false" type="string" desc="Node ID (for update-node / remove-node)"/>
13
+ <field name="nodeData" required="false" type="object" desc="Updated node data (for update-node)"/>
14
+ <field name="graphRoot" required="true" type="string" desc="Path to graph root directory"/>
15
+ <field name="skill_path" required="true" type="string" desc="Path to this skill directory"/>
16
+ </block>
17
+
18
+ <!-- ============================================================
19
+ Global Constraints
20
+ ============================================================ -->
21
+ <block type="rule" id="R1" level="mandatory" desc="Write constraints">
22
+ <field name="text">action must be one of: batch-write, init-module, update-node, remove-node</field>
23
+ <field name="text">platformId is required for all write actions</field>
24
+ <field name="text">graphRoot path must be correct (speccrew-workspace/knowledges/bizs/graph)</field>
25
+ <field name="text">For batch-write: graphData must contain valid nodes and edges arrays</field>
26
+ <field name="text">Index and metadata must be updated after write operations</field>
27
+ </block>
28
+
29
+ <!-- ============================================================
30
+ Action Gateway
31
+ ============================================================ -->
32
+ <block type="gateway" id="G0" mode="exclusive" desc="Select write action">
33
+
34
+ <!-- Action: batch-write -->
35
+ <branch test="${action} == 'batch-write'" name="Batch Write">
36
+
37
+ <!-- Step 1: Write graphData to temp file -->
38
+ <block type="task" id="B1" action="write-file" desc="Write graphData to temp file">
39
+ <field name="path">${graphRoot}/temp/batch-${module}-${timestamp}.json</field>
40
+ <field name="content">${graphData}</field>
41
+ <field name="output" var="temp_file_path"/>
42
+ </block>
43
+
44
+ <!-- Step 2: Add nodes -->
45
+ <block type="task" id="B2" action="run-script" desc="Add nodes from temp file">
46
+ <field name="command">node "${skill_path}/scripts/graph-write.js" --action "add-nodes" --platformId "${platformId}" --module "${module}" --file "${temp_file_path}" --graphRoot "${graphRoot}"</field>
47
+ <field name="output" var="nodes_result"/>
48
+ </block>
49
+
50
+ <!-- Step 3: Add edges -->
51
+ <block type="task" id="B3" action="run-script" desc="Add edges from temp file">
52
+ <field name="command">node "${skill_path}/scripts/graph-write.js" --action "add-edges" --platformId "${platformId}" --module "${module}" --file "${temp_file_path}" --graphRoot "${graphRoot}"</field>
53
+ <field name="output" var="edges_result"/>
54
+ </block>
55
+
56
+ <!-- Step 4: Update index -->
57
+ <block type="task" id="B4" action="run-script" desc="Rebuild global index">
58
+ <field name="command">node "${skill_path}/scripts/graph-write.js" --action "rebuild-index" --graphRoot "${graphRoot}"</field>
59
+ <field name="output" var="index_result"/>
60
+ </block>
61
+
62
+ <!-- Step 5: Update metadata -->
63
+ <block type="task" id="B5" action="run-script" desc="Update graph metadata">
64
+ <field name="command">node "${skill_path}/scripts/graph-write.js" --action "update-meta" --graphRoot "${graphRoot}"</field>
65
+ <field name="output" var="meta_result"/>
66
+ </block>
67
+
68
+ <!-- Step 6: Clean up temp file -->
69
+ <block type="task" id="B6" action="run-script" desc="Clean up temp file">
70
+ <field name="command">rm "${temp_file_path}"</field>
71
+ <field name="note">Remove temporary batch file after successful write</field>
72
+ </block>
73
+
74
+ <block type="event" id="E1" action="log" level="info" desc="Log batch write complete">
75
+ <field name="message">Batch write completed: ${nodes_result.count} nodes, ${edges_result.count} edges</field>
76
+ <field name="output" var="nodes_written" from="${nodes_result.count}"/>
77
+ <field name="output" var="edges_written" from="${edges_result.count}"/>
78
+ </block>
79
+
80
+ </branch>
81
+
82
+ <!-- Action: init-module -->
83
+ <branch test="${action} == 'init-module'" name="Initialize Module">
84
+
85
+ <block type="task" id="B7" action="run-script" desc="Initialize empty module structure">
86
+ <field name="command">node "${skill_path}/scripts/graph-write.js" --action "init-module" --platformId "${platformId}" --module "${module}" --graphRoot "${graphRoot}"</field>
87
+ <field name="rules">
88
+ Creates:
89
+ - ${graphRoot}/nodes/${platformId}/${module}.json — empty nodes array
90
+ - ${graphRoot}/edges/${platformId}/${module}.json — empty edges array
91
+ - Updates ${graphRoot}/graph-meta.json — adds ${platformId}/${module} to modules list
92
+ - Creates ${graphRoot}/edges/${platformId}/cross-module.json if not exists
93
+ - Creates ${graphRoot}/indices/index.json if not exists
94
+ </field>
95
+ <field name="output" var="init_result"/>
96
+ </block>
97
+
98
+ <block type="event" id="E2" action="log" level="info" desc="Log module init complete">
99
+ <field name="message">Module ${module} initialized for platform ${platformId}</field>
100
+ <field name="output" var="nodes_written" value="0"/>
101
+ <field name="output" var="edges_written" value="0"/>
102
+ </block>
103
+
104
+ </branch>
105
+
106
+ <!-- Action: update-node -->
107
+ <branch test="${action} == 'update-node'" name="Update Node">
108
+
109
+ <block type="task" id="B8" action="run-script" desc="Update existing node fields">
110
+ <field name="command">node "${skill_path}/scripts/graph-write.js" --action "update-node" --platformId "${platformId}" --id "${nodeId}" --data '${nodeData}' --graphRoot "${graphRoot}"</field>
111
+ <field name="output" var="update_result"/>
112
+ </block>
113
+
114
+ <block type="event" id="E3" action="log" level="info" desc="Log node update complete">
115
+ <field name="message">Node ${nodeId} updated successfully</field>
116
+ <field name="output" var="nodes_written" value="1"/>
117
+ <field name="output" var="edges_written" value="0"/>
118
+ </block>
119
+
120
+ </branch>
121
+
122
+ <!-- Action: remove-node -->
123
+ <branch test="${action} == 'remove-node'" name="Remove Node">
124
+
125
+ <block type="task" id="B9" action="run-script" desc="Remove node and connected edges">
126
+ <field name="command">node "${skill_path}/scripts/graph-write.js" --action "remove-node" --platformId "${platformId}" --id "${nodeId}" --graphRoot "${graphRoot}"</field>
127
+ <field name="output" var="remove_result"/>
128
+ </block>
129
+
130
+ <block type="event" id="E4" action="log" level="info" desc="Log node removal complete">
131
+ <field name="message">Node ${nodeId} and connected edges removed</field>
132
+ <field name="output" var="nodes_written" value="-1"/>
133
+ <field name="output" var="edges_written" value="-1"/>
134
+ </block>
135
+
136
+ </branch>
137
+
138
+ </block>
139
+
140
+ <!-- ============================================================
141
+ Output Results
142
+ ============================================================ -->
143
+ <block type="output" id="O1" desc="Workflow output results">
144
+ <field name="status" value="success" type="string" desc="Operation result"/>
145
+ <field name="action" from="${action}" type="string" desc="Action performed"/>
146
+ <field name="module" from="${module}" type="string" desc="Target module"/>
147
+ <field name="nodesWritten" from="${nodes_written}" type="number" desc="Number of nodes written"/>
148
+ <field name="edgesWritten" from="${edges_written}" type="number" desc="Number of edges written"/>
149
+ <field name="message" type="string" desc="Summary message"/>
150
+ </block>
151
+
152
+ </workflow>