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,15 +1,19 @@
1
1
  ---
2
2
  name: speccrew-knowledge-bizs-ui-graph
3
- description: Constructs knowledge graph data (nodes, edges, relationships) from UI analysis results. Generates graph JSON files and completion markers for the bizs knowledge pipeline.
3
+ description: Constructs knowledge graph data (nodes, edges, relationships) from UI analysis results using XML workflow blocks. Generates graph JSON files and completion markers for the bizs knowledge pipeline.
4
4
  tools: Read, Write, Glob, Grep, Bash
5
5
  ---
6
6
 
7
- # UI Knowledge Graph Constructor
7
+ # UI Knowledge Graph Constructor (XML Workflow)
8
8
 
9
9
  > **CRITICAL CONSTRAINT**: DO NOT create temporary scripts, batch files, or workaround code files (`.py`, `.bat`, `.sh`, `.ps1`, etc.) under any circumstances.
10
10
 
11
11
  Construct knowledge graph data (nodes, edges, relationships) from UI feature analysis results and write completion marker files for the bizs knowledge pipeline.
12
12
 
13
+ ## Language Adaptation
14
+
15
+ This skill automatically adapts to the user's input language. All documentation and output will be generated in the same language as the user's query.
16
+
13
17
  ## Trigger Scenarios
14
18
 
15
19
  - "Construct graph data for UI feature {fileName}"
@@ -38,58 +42,266 @@ Construct knowledge graph data (nodes, edges, relationships) from UI feature ana
38
42
  1. `{{completed_dir}}/{module}-{subpath}-{fileName}.graph.json` - Graph data with nodes and edges
39
43
  2. `{{completed_dir}}/{module}-{subpath}-{fileName}.graph-done.json` - Graph completion marker
40
44
 
41
- ## Workflow
42
-
43
- ```mermaid
44
- graph TB
45
- Start([Start]) --> Step1[Step 1 Read Source File]
46
- Step1 --> Step2[Step 2 Construct Graph Nodes]
47
- Step2 --> Step3[Step 3 Construct Graph Edges]
48
- Step3 --> Step4[Step 4 Write Graph JSON]
49
- Step4 --> Step5[Step 5 Write Completion Marker]
50
- Step5 --> End([End])
51
- ```
52
-
53
- ---
54
-
55
- ### Step 1: Read Source File
56
-
57
- **Step 1 Status: 🔄 IN PROGRESS**
58
-
59
- 1. **Locate and Read the source file:**
60
- - Use `{{sourcePath}}` as the relative file path from project root
61
- - Read the feature file content to extract API imports, component usage, and navigation patterns
62
-
63
- 2. **Extract API imports:**
64
- - Scan for `import { ... } from '@/api/...'` or similar API import statements
65
- - List ALL imported API functions
66
-
67
- 3. **Extract component usage:**
68
- - Scan for component registrations and usage in templates
69
- - Identify shared/local components used
70
-
71
- 4. **Extract navigation patterns:**
72
- - Scan for `router.push`, `router.replace`, `<router-link>`, `navigate()` calls
73
- - Identify target pages for navigation
74
-
75
- **Output:** "Step 1 Status: ✅ COMPLETED - Read {{sourcePath}}, found {{apiCount}} APIs, {{componentCount}} components, {{navCount}} navigations"
76
-
77
- ---
78
-
79
- ### Step 2: Construct Graph Nodes
80
-
81
- **Step 2 Status: 🔄 IN PROGRESS**
82
-
83
- Construct nodes for the analyzed UI feature.
84
-
85
- **Node Types to Construct:**
86
-
87
- | Node Type | Source | ID Format | Context Fields |
88
- |-----------|--------|-----------|----------------|
89
- | `page` | The analyzed page/screen | `page-{module}-{name}` | `route`, `components`, `events`, `platform` |
90
- | `component` | Embedded or local components | `component-{module}-{name}` | `props`, `events`, `slots` |
91
-
92
- **Node Structure:**
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="feature" required="true" type="object" desc="Complete feature object from features.json"/>
56
+ <field name="fileName" required="true" type="string" desc="Feature file name without extension"/>
57
+ <field name="sourcePath" required="true" type="string" desc="Relative path to source file"/>
58
+ <field name="documentPath" required="true" type="string" desc="Path to generated documentation"/>
59
+ <field name="module" required="true" type="string" desc="Business module name"/>
60
+ <field name="platform_type" required="true" type="string" desc="Platform type"/>
61
+ <field name="platform_subtype" required="true" type="string" desc="Platform subtype"/>
62
+ <field name="completed_dir" required="true" type="string" desc="Marker files output directory"/>
63
+ <field name="sourceFile" required="true" type="string" desc="Source features JSON file name"/>
64
+ <field name="status" required="false" type="string" default="success" desc="Analysis status from UI analysis"/>
65
+ <field name="analysisNotes" required="false" type="string" default="" desc="Analysis notes from UI analysis"/>
66
+ </block>
67
+
68
+ <!-- ============================================================
69
+ Global Continuous Execution Rules
70
+ ============================================================ -->
71
+ <block type="rule" id="GLOBAL-R1" level="forbidden" desc="Continuous execution constraints — NEVER violate">
72
+ <field name="text">DO NOT ask user "Should I continue?" or "How would you like to proceed?" during execution</field>
73
+ <field name="text">DO NOT offer options like "Full execution / Partial / Stop" — always execute ALL tasks to completion</field>
74
+ <field name="text">DO NOT suggest "Due to context window limits, let me pause" — complete current task, use checkpoint for resumption</field>
75
+ <field name="text">DO NOT estimate workload and suggest breaking it into phases — execute ALL items in sequence</field>
76
+ <field name="text">DO NOT warn about "large number of files" or "this may take a while" — proceed with generation</field>
77
+ <field name="text">Context window management: if approaching limit, save progress to checkpoint file and resume — do NOT ask user for guidance</field>
78
+ </block>
79
+
80
+ <!-- ============================================================
81
+ Step 1: Read Source File
82
+ ============================================================ -->
83
+ <sequence id="S1" name="Step 1: Read Source File" status="pending" desc="Read source file and extract components">
84
+ <block type="task" id="B1" action="read-file" desc="Read source file content">
85
+ <field name="path" value="${sourcePath}"/>
86
+ <field name="output" var="sourceContent"/>
87
+ </block>
88
+
89
+ <block type="task" id="B2" action="analyze" desc="Extract API imports from source content">
90
+ <field name="input" value="${sourceContent}"/>
91
+ <field name="output" var="apiImports"/>
92
+ </block>
93
+
94
+ <block type="task" id="B3" action="analyze" desc="Extract component usage from source content">
95
+ <field name="input" value="${sourceContent}"/>
96
+ <field name="output" var="componentUsage"/>
97
+ </block>
98
+
99
+ <block type="task" id="B4" action="analyze" desc="Extract navigation patterns from source content">
100
+ <field name="input" value="${sourceContent}"/>
101
+ <field name="output" var="navigationPatterns"/>
102
+ </block>
103
+
104
+ <block type="event" id="E1" action="log" level="info" desc="Log Step 1 completion">
105
+ <field name="message">Step 1 Status: COMPLETED - Read ${sourcePath}, found ${apiImports.count} APIs, ${componentUsage.count} components, ${navigationPatterns.count} navigations</field>
106
+ </block>
107
+
108
+ <block type="checkpoint" id="CP1" name="step-1-read-source" desc="Source file read complete">
109
+ <field name="file" value="${completed_dir}/.progress.json"/>
110
+ <field name="verify" value="${sourceContent} != null"/>
111
+ </block>
112
+ </sequence>
113
+
114
+ <!-- ============================================================
115
+ Step 2: Construct Graph Nodes
116
+ ============================================================ -->
117
+ <sequence id="S2" name="Step 2: Construct Graph Nodes" status="pending" desc="Build page and component nodes">
118
+ <block type="task" id="B5" action="analyze" desc="Construct page node">
119
+ <field name="type" value="page"/>
120
+ <field name="id" value="page-${module}-${fileName}"/>
121
+ <field name="name" value="${fileName}"/>
122
+ <field name="module" value="${module}"/>
123
+ <field name="sourcePath" value="${sourcePath}"/>
124
+ <field name="documentPath" value="${documentPath}"/>
125
+ <field name="context_route" value="${extractedRoute}"/>
126
+ <field name="context_components" value="${componentUsage.list}"/>
127
+ <field name="context_platform" value="${platform_type}-${platform_subtype}"/>
128
+ <field name="output" var="pageNode"/>
129
+ </block>
130
+
131
+ <block type="loop" id="L1" over="${componentUsage.list}" as="component" desc="Construct component nodes">
132
+ <block type="task" id="B6" action="analyze" desc="Construct component node for ${component.name}">
133
+ <field name="type" value="component"/>
134
+ <field name="id" value="component-${module}-${component.name}"/>
135
+ <field name="name" value="${component.name}"/>
136
+ <field name="module" value="${module}"/>
137
+ <field name="sourcePath" value="${component.path}"/>
138
+ <field name="documentPath" value="${documentPath}"/>
139
+ <field name="context_props" value="${component.props}"/>
140
+ <field name="context_events" value="${component.events}"/>
141
+ <field name="output" var="componentNodes[]" append="true"/>
142
+ </block>
143
+ </block>
144
+
145
+ <block type="event" id="E2" action="log" level="info" desc="Log Step 2 completion">
146
+ <field name="message">Step 2 Status: COMPLETED - Constructed ${nodeCount} nodes</field>
147
+ </block>
148
+
149
+ <block type="checkpoint" id="CP2" name="step-2-construct-nodes" desc="Graph nodes constructed">
150
+ <field name="file" value="${completed_dir}/.progress.json"/>
151
+ <field name="verify" value="${nodeCount} > 0"/>
152
+ </block>
153
+ </sequence>
154
+
155
+ <!-- ============================================================
156
+ Step 3: Construct Graph Edges
157
+ ============================================================ -->
158
+ <sequence id="S3" name="Step 3: Construct Graph Edges" status="pending" desc="Build API call, navigation, and component usage edges">
159
+ <!-- API Call Edges -->
160
+ <block type="loop" id="L2" over="${apiImports.list}" as="api" desc="Construct API call edges">
161
+ <block type="task" id="B7" action="analyze" desc="Construct calls edge for ${api.name}">
162
+ <field name="source" value="page-${module}-${fileName}"/>
163
+ <field name="target" value="api-${api.module}-${api.name}"/>
164
+ <field name="type" value="calls"/>
165
+ <field name="metadata_trigger" value="${api.trigger}"/>
166
+ <field name="metadata_method" value="${api.method}"/>
167
+ <field name="metadata_context" value="${api.context}"/>
168
+ <field name="output" var="apiEdges[]" append="true"/>
169
+ </block>
170
+ </block>
171
+
172
+ <!-- Navigation Edges -->
173
+ <block type="loop" id="L3" over="${navigationPatterns.list}" as="nav" desc="Construct navigation edges">
174
+ <block type="task" id="B8" action="analyze" desc="Construct navigates-to edge">
175
+ <field name="source" value="page-${module}-${fileName}"/>
176
+ <field name="target" value="page-${nav.targetModule}-${nav.targetPage}"/>
177
+ <field name="type" value="navigates-to"/>
178
+ <field name="metadata_trigger" value="${nav.trigger}"/>
179
+ <field name="metadata_method" value="${nav.method}"/>
180
+ <field name="output" var="navEdges[]" append="true"/>
181
+ </block>
182
+ </block>
183
+
184
+ <!-- Component Usage Edges -->
185
+ <block type="loop" id="L4" over="${componentUsage.list}" as="comp" desc="Construct component usage edges">
186
+ <block type="task" id="B9" action="analyze" desc="Construct uses edge for ${comp.name}">
187
+ <field name="source" value="page-${module}-${fileName}"/>
188
+ <field name="target" value="component-${module}-${comp.name}"/>
189
+ <field name="type" value="uses"/>
190
+ <field name="metadata_context" value="${comp.usageContext}"/>
191
+ <field name="output" var="useEdges[]" append="true"/>
192
+ </block>
193
+ </block>
194
+
195
+ <block type="event" id="E3" action="log" level="info" desc="Log Step 3 completion">
196
+ <field name="message">Step 3 Status: COMPLETED - Constructed ${edgeCount} edges (${apiEdges.count} API calls, ${navEdges.count} navigations, ${useEdges.count} component uses)</field>
197
+ </block>
198
+
199
+ <block type="checkpoint" id="CP3" name="step-3-construct-edges" desc="Graph edges constructed">
200
+ <field name="file" value="${completed_dir}/.progress.json"/>
201
+ <field name="verify" value="${edgeCount} >= 0"/>
202
+ </block>
203
+ </sequence>
204
+
205
+ <!-- ============================================================
206
+ Step 4: Write Graph JSON
207
+ ============================================================ -->
208
+ <sequence id="S4" name="Step 4: Write Graph JSON" status="pending" desc="Generate and write graph data file">
209
+ <block type="task" id="B10" action="analyze" desc="Calculate marker filename">
210
+ <field name="module" value="${module}"/>
211
+ <field name="subpath" value="${extractSubpath sourcePath}"/>
212
+ <field name="fileName" value="${fileName}"/>
213
+ <field name="output" var="markerFilename"/>
214
+ </block>
215
+
216
+ <block type="task" id="B11" action="write-file" desc="Write graph JSON file">
217
+ <field name="path" value="${completed_dir}/${markerFilename}.graph.json"/>
218
+ <field name="content_json">
219
+ {
220
+ "module": "${module}",
221
+ "nodes": [
222
+ ${pageNode},
223
+ ${componentNodes}
224
+ ],
225
+ "edges": [
226
+ ${apiEdges},
227
+ ${navEdges},
228
+ ${useEdges}
229
+ ]
230
+ }
231
+ </field>
232
+ </block>
233
+
234
+ <block type="event" id="E4" action="log" level="info" desc="Log Step 4 completion">
235
+ <field name="message">Step 4 Status: COMPLETED - Graph JSON written to ${completed_dir}/${markerFilename}.graph.json</field>
236
+ </block>
237
+
238
+ <block type="checkpoint" id="CP4" name="step-4-write-graph-json" desc="Graph JSON written">
239
+ <field name="file" value="${completed_dir}/.progress.json"/>
240
+ <field name="verify" value="valid-json-structure"/>
241
+ </block>
242
+ </sequence>
243
+
244
+ <!-- ============================================================
245
+ Step 5: Write Completion Marker
246
+ ============================================================ -->
247
+ <sequence id="S5" name="Step 5: Write Completion Marker" status="pending" desc="Generate and write completion marker file">
248
+ <block type="task" id="B12" action="write-file" desc="Write graph completion marker">
249
+ <field name="path" value="${completed_dir}/${markerFilename}.graph-done.json"/>
250
+ <field name="content_json">
251
+ {
252
+ "fileName": "${fileName}",
253
+ "sourcePath": "${sourcePath}",
254
+ "sourceFile": "${sourceFile}",
255
+ "module": "${module}",
256
+ "documentPath": "${documentPath}",
257
+ "marker": "graph_completed",
258
+ "graphFile": "${markerFilename}.graph.json",
259
+ "nodeCount": ${nodeCount},
260
+ "edgeCount": ${edgeCount},
261
+ "status": "${status}",
262
+ "analysisNotes": "${analysisNotes}"
263
+ }
264
+ </field>
265
+ </block>
266
+
267
+ <block type="event" id="E5" action="log" level="info" desc="Log Step 5 completion">
268
+ <field name="message">Step 5 Status: COMPLETED - Graph completion marker written to ${completed_dir}/${markerFilename}.graph-done.json</field>
269
+ </block>
270
+
271
+ <block type="checkpoint" id="CP5" name="step-5-write-marker" desc="Completion marker written">
272
+ <field name="file" value="${completed_dir}/.progress.json"/>
273
+ <field name="verify" value="valid-marker-structure"/>
274
+ </block>
275
+ </sequence>
276
+
277
+ <!-- ============================================================
278
+ Output Results
279
+ ============================================================ -->
280
+ <block type="output" id="O1" desc="Workflow output results">
281
+ <field name="status" from="success" type="string" desc="Execution status"/>
282
+ <field name="module" from="${module}" type="string" desc="Module name"/>
283
+ <field name="fileName" from="${fileName}" type="string" desc="Feature file name"/>
284
+ <field name="graphFile" from="${completed_dir}/${markerFilename}.graph.json" type="string" desc="Graph JSON file path"/>
285
+ <field name="nodeCount" from="${nodeCount}" type="number" desc="Number of nodes constructed"/>
286
+ <field name="edgeCount" from="${edgeCount}" type="number" desc="Number of edges constructed"/>
287
+ <field name="message" from="Generated graph data with ${nodeCount} nodes and ${edgeCount} edges" type="string" desc="Summary message"/>
288
+ </block>
289
+
290
+ <!-- ============================================================
291
+ Constraints
292
+ ============================================================ -->
293
+ <block type="rule" id="R1" level="mandatory" desc="Graph data constraints">
294
+ <field name="text">100% API coverage - ALL imported API functions MUST be represented as calls edges</field>
295
+ <field name="text">Valid JSON format - Both .graph.json and .graph-done.json MUST be valid JSON</field>
296
+ <field name="text">Root-level module field - .graph.json MUST include module at root level</field>
297
+ <field name="text">Correct filename pattern - Use {module}-{subpath}-{fileName} composite naming</field>
298
+ <field name="text">No file extension in fileName - The fileName field in .graph-done.json MUST NOT include extension</field>
299
+ <field name="text">documentPath as N/A - Use N/A when no document exists, never empty string</field>
300
+ </block>
301
+
302
+ </workflow>
303
+
304
+ ## Node Structure Reference
93
305
 
94
306
  ```json
95
307
  {
@@ -110,43 +322,7 @@ Construct nodes for the analyzed UI feature.
110
322
  }
111
323
  ```
112
324
 
113
- **Node ID Naming Convention:**
114
-
115
- ```
116
- {type}-{module}-{name}
117
-
118
- Examples:
119
- page-system-user-list
120
- page-system-user-detail
121
- component-system-user-form
122
- component-shared-delete-confirm
123
- ```
124
-
125
- **IMPORTANT:**
126
- - `module` comes from `{{module}}` input variable
127
- - `name` should be a short, readable slug derived from the page/component name
128
- - Each node must include `sourcePath` and `documentPath`
129
- - For pages, include route information and used components in context
130
-
131
- **Output:** "Step 2 Status: ✅ COMPLETED - Constructed {{nodeCount}} nodes"
132
-
133
- ---
134
-
135
- ### Step 3: Construct Graph Edges
136
-
137
- **Step 3 Status: 🔄 IN PROGRESS**
138
-
139
- Construct edges representing relationships between the UI feature and other entities.
140
-
141
- **Edge Types to Construct:**
142
-
143
- | Edge Type | Direction | When to Create |
144
- |-----------|-----------|----------------|
145
- | `calls` | page → api | Page calls an API endpoint |
146
- | `navigates-to` | page → page | Page navigates to another page |
147
- | `uses` | page → component | Page uses a shared/local component |
148
-
149
- **Edge Structure:**
325
+ ## Edge Structure Reference
150
326
 
151
327
  ```json
152
328
  {
@@ -161,58 +337,19 @@ Construct edges representing relationships between the UI feature and other enti
161
337
  }
162
338
  ```
163
339
 
164
- **CRITICAL - API Coverage Requirements (100% Coverage Mandatory):**
165
-
166
- 1. **Extract ALL Imported API Functions:**
167
- - Scan the entire source file for ALL API import statements
168
- - EVERY function imported from API modules MUST be extracted as a `calls` edge
169
-
170
- 2. **API Call Categories to Cover:**
171
-
172
- | Category | Examples | Where to Look |
173
- |----------|----------|---------------|
174
- | Page Initialization | `getList`, `getDetail`, `getPage` | `onMounted`, `created`, `useEffect` |
175
- | Data Query | `getUserList`, `searchOrders` | Search forms, filter changes |
176
- | Create Operations | `createUser`, `addOrder` | Form submission handlers |
177
- | Update Operations | `updateUser`, `editOrder` | Edit form submissions |
178
- | Status Update | `updateUserStatus`, `toggleEnable` | Status switch handlers |
179
- | Special Operations | `resetPassword`, `exportData`, `importData` | Action buttons |
180
- | Delete Operations | `deleteUser`, `removeOrder` | Delete confirmation handlers |
181
- | Dictionary/Options | `getDictList`, `getOptions` | Dropdown initialization |
182
-
183
- 3. **How to Identify API Calls:**
184
- - Look for: `import { func1, func2 } from '@/api/xxx'` statements
185
- - Look for: Direct API function calls in event handlers
186
- - Look for: API calls in lifecycle hooks (Vue: `onMounted`, React: `useEffect`)
187
- - Look for: API calls in watch/computed setters
188
-
189
- 4. **API Coverage Verification Checklist:**
190
- - [ ] List ALL imported API functions from the source file
191
- - [ ] For each imported API, verify there is a corresponding `calls` edge
192
- - [ ] Check event handlers for API calls
193
- - [ ] Check lifecycle hooks for initialization API calls
194
- - [ ] Check status toggles, action buttons for special operation APIs
195
- - [ ] Verify no imported API is left unmapped
196
-
197
- 5. **Edge Metadata Requirements:**
198
- - `trigger`: Event name (e.g., "onClick", "onMounted", "onSubmit")
199
- - `method`: The API function name being called
200
- - `context`: Brief description of when/why this API is called
201
-
202
- **Target Node ID Format for APIs:**
203
- - `api-{module}-{name}` (will be matched with api-analyze output)
204
-
205
- **Output:** "Step 3 Status: ✅ COMPLETED - Constructed {{edgeCount}} edges ({{apiEdgeCount}} API calls, {{navEdgeCount}} navigations, {{useEdgeCount}} component uses)"
340
+ ## Node ID Naming Convention
206
341
 
207
- ---
208
-
209
- ### Step 4: Write Graph JSON
210
-
211
- **Step 4 Status: 🔄 IN PROGRESS**
342
+ ```
343
+ {type}-{module}-{name}
212
344
 
213
- Write the graph data to the `.graph.json` marker file.
345
+ Examples:
346
+ page-system-user-list
347
+ page-system-user-detail
348
+ component-system-user-form
349
+ component-shared-delete-confirm
350
+ ```
214
351
 
215
- **Marker File Naming Convention:**
352
+ ## Marker File Naming Convention
216
353
 
217
354
  ```
218
355
  {completed_dir}/{module}-{subpath}-{fileName}.graph.json
@@ -246,111 +383,33 @@ The marker filename MUST follow the composite naming pattern `{module}-{subpath}
246
383
  - If the file is directly in the module root directory: `{module}-{fileName}.graph.json`
247
384
  - Example: `yudao-ui/.../system/index.vue` → `system-index.graph.json`
248
385
 
249
- **Complete JSON Structure:**
386
+ ## Edge Types Reference
250
387
 
251
- ```json
252
- {
253
- "module": "{{module}}",
254
- "nodes": [
255
- {
256
- "id": "page-{{module}}-{{feature-name}}",
257
- "type": "page",
258
- "name": "<display name>",
259
- "module": "{{module}}",
260
- "sourcePath": "{{sourcePath}}",
261
- "documentPath": "{{documentPath}}",
262
- "description": "...",
263
- "tags": [...],
264
- "keywords": [...],
265
- "context": { "route": "...", "components": [...] }
266
- }
267
- ],
268
- "edges": [
269
- {
270
- "source": "page-...",
271
- "target": "api-...",
272
- "type": "calls",
273
- "metadata": { "trigger": "...", "method": "..." }
274
- }
275
- ]
276
- }
277
- ```
388
+ | Edge Type | Direction | When to Create |
389
+ |-----------|-----------|----------------|
390
+ | `calls` | page → api | Page calls an API endpoint |
391
+ | `navigates-to` | page → page | Page navigates to another page |
392
+ | `uses` | page → component | Page uses a shared/local component |
393
+
394
+ ## API Coverage Verification Checklist
278
395
 
279
- > **⚠️ CRITICAL - module Field Requirement:**
280
- > - The `.graph.json` file **MUST** have a root-level `module` field
281
- > - Missing `module` field will cause the graph merge pipeline to reject this file
396
+ - [ ] List ALL imported API functions from the source file
397
+ - [ ] For each imported API, verify there is a corresponding `calls` edge
398
+ - [ ] Check event handlers for API calls
399
+ - [ ] Check lifecycle hooks for initialization API calls
400
+ - [ ] Check status toggles, action buttons for special operation APIs
401
+ - [ ] Verify no imported API is left unmapped
282
402
 
283
- **Pre-write Verification:**
403
+ ## Pre-write Verification Checklist
404
+
405
+ ### Graph JSON Verification:
284
406
  - [ ] Filename follows `{module}-{subpath}-{fileName}.graph.json` pattern
285
407
  - [ ] JSON is valid (no trailing commas, all strings quoted)
286
408
  - [ ] Root-level `module` field is present
287
409
  - [ ] `nodes` and `edges` are arrays
288
410
  - [ ] ALL imported API functions are represented as `calls` edges
289
411
 
290
- **Output:** "Step 4 Status: ✅ COMPLETED - Graph JSON written to {{completed_dir}}/{marker-filename}.graph.json"
291
-
292
- ---
293
-
294
- ### Step 5: Write Graph Completion Marker
295
-
296
- **Step 5 Status: 🔄 IN PROGRESS**
297
-
298
- Write the `.graph-done.json` completion marker file to signal successful graph data generation.
299
-
300
- **Marker File Path:**
301
-
302
- ```
303
- {completed_dir}/{module}-{subpath}-{fileName}.graph-done.json
304
- ```
305
-
306
- **Complete JSON Template (ALL fields required):**
307
-
308
- ```json
309
- {
310
- "fileName": "{{fileName}}",
311
- "sourcePath": "{{sourcePath}}",
312
- "sourceFile": "{{sourceFile}}",
313
- "module": "{{module}}",
314
- "documentPath": "{{documentPath}}",
315
- "marker": "graph_completed",
316
- "graphFile": "{module}-{subpath}-{fileName}.graph.json",
317
- "nodeCount": {{node_count}},
318
- "edgeCount": {{edge_count}},
319
- "status": "{{status}}",
320
- "analysisNotes": "{{analysisNotes}}"
321
- }
322
- ```
323
-
324
- **Field Descriptions:**
325
-
326
- | Field | Required | Description | Example |
327
- |-------|----------|-------------|---------|
328
- | `fileName` | ✅ YES | Feature file name **WITHOUT extension** | `"index"` |
329
- | `sourcePath` | ✅ YES | Relative path to source file | `"frontend-web/src/views/system/user/index.vue"` |
330
- | `sourceFile` | ✅ YES | Source features JSON filename | `"features-web-vue.json"` |
331
- | `module` | ✅ YES | Business module name | `"system"` |
332
- | `documentPath` | ✅ YES | Path to generated document | `"speccrew-workspace/knowledges/..."` |
333
- | `marker` | ✅ YES | Fixed marker type | `"graph_completed"` |
334
- | `graphFile` | ✅ YES | Corresponding graph JSON filename | `"system-notify-message-index.graph.json"` |
335
- | `nodeCount` | ✅ YES | Number of nodes in graph | `5` |
336
- | `edgeCount` | ✅ YES | Number of edges in graph | `12` |
337
- | `status` | ✅ YES | Analysis status | `"success"`, `"partial"`, or `"failed"` |
338
- | `analysisNotes` | ✅ YES | Summary message | `"Successfully analyzed..."` |
339
-
340
- > **⚠️ CRITICAL - fileName Field Rules:**
341
- > - The `fileName` field MUST contain only the feature file name **WITHOUT file extension**
342
- > - ✅ CORRECT: `"fileName": "index"`
343
- > - ❌ WRONG: `"fileName": "index.vue"` (includes extension)
344
-
345
- > **⚠️ CRITICAL - sourcePath Validation:**
346
- > - `sourcePath` MUST be a project-root-relative path
347
- > - NEVER use platform-source-relative short paths
348
-
349
- > **⚠️ CRITICAL - documentPath Rules:**
350
- > - When no corresponding document exists, `documentPath` MUST be `"N/A"`
351
- > - NEVER use empty string `""` for `documentPath`
352
-
353
- **Pre-write Verification:**
412
+ ### Completion Marker Verification:
354
413
  - [ ] Filename follows `{module}-{subpath}-{fileName}.graph-done.json` pattern
355
414
  - [ ] JSON is valid
356
415
  - [ ] `fileName` does NOT contain file extension
@@ -359,9 +418,14 @@ Write the `.graph-done.json` completion marker file to signal successful graph d
359
418
  - [ ] `documentPath` is `"N/A"` when no document exists (not empty string)
360
419
  - [ ] `nodeCount` and `edgeCount` match actual graph data
361
420
 
362
- **Output:** "Step 5 Status: ✅ COMPLETED - Graph completion marker written to {{completed_dir}}/{marker-filename}.graph-done.json"
421
+ ## Constraints
363
422
 
364
- ---
423
+ 1. **100% API coverage** - ALL imported API functions MUST be represented as `calls` edges
424
+ 2. **Valid JSON format** - Both `.graph.json` and `.graph-done.json` MUST be valid JSON
425
+ 3. **Root-level module field** - `.graph.json` MUST include `module` at root level
426
+ 4. **Correct filename pattern** - Use `{module}-{subpath}-{fileName}` composite naming
427
+ 5. **No file extension in fileName** - The `fileName` field in `.graph-done.json` MUST NOT include extension
428
+ 6. **documentPath as N/A** - Use `"N/A"` when no document exists, never empty string
365
429
 
366
430
  ## Task Completion Report
367
431
 
@@ -378,12 +442,3 @@ When the task is complete, report the following:
378
442
  **Files Generated:**
379
443
  - `{{completed_dir}}/{marker-filename}.graph.json`
380
444
  - `{{completed_dir}}/{marker-filename}.graph-done.json`
381
-
382
- ## Constraints
383
-
384
- 1. **100% API coverage** - ALL imported API functions MUST be represented as `calls` edges
385
- 2. **Valid JSON format** - Both `.graph.json` and `.graph-done.json` MUST be valid JSON
386
- 3. **Root-level module field** - `.graph.json` MUST include `module` at root level
387
- 4. **Correct filename pattern** - Use `{module}-{subpath}-{fileName}` composite naming
388
- 5. **No file extension in fileName** - The `fileName` field in `.graph-done.json` MUST NOT include extension
389
- 6. **documentPath as N/A** - Use `"N/A"` when no document exists, never empty string