speccrew 0.6.69 → 0.7.1
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/agents/speccrew-task-worker.md +1 -1
- package/.speccrew/agents/speccrew-team-leader.md +336 -189
- package/.speccrew/skills/speccrew-agentflow-manager/SKILL.md +161 -0
- package/.speccrew/skills/speccrew-agentflow-manager/workflow.agentflow.xml +347 -0
- package/.speccrew/skills/speccrew-deploy-build/SKILL.md +3 -56
- package/.speccrew/skills/speccrew-deploy-build/workflow.agentflow.xml +125 -0
- package/.speccrew/skills/speccrew-deploy-migrate/SKILL.md +3 -64
- package/.speccrew/skills/speccrew-deploy-migrate/workflow.agentflow.xml +135 -0
- package/.speccrew/skills/speccrew-deploy-smoke-test/SKILL.md +4 -156
- package/.speccrew/skills/speccrew-deploy-smoke-test/workflow.agentflow.xml +178 -0
- package/.speccrew/skills/speccrew-deploy-startup/SKILL.md +3 -135
- package/.speccrew/skills/speccrew-deploy-startup/workflow.agentflow.xml +223 -0
- package/.speccrew/skills/speccrew-dev-backend/SKILL.md +10 -2
- package/.speccrew/skills/speccrew-dev-backend/workflow.agentflow.xml +254 -0
- package/.speccrew/skills/speccrew-dev-desktop-electron/SKILL.md +10 -2
- package/.speccrew/skills/speccrew-dev-desktop-electron/workflow.agentflow.xml +259 -0
- package/.speccrew/skills/speccrew-dev-desktop-tauri/SKILL.md +10 -2
- package/.speccrew/skills/speccrew-dev-desktop-tauri/workflow.agentflow.xml +245 -0
- package/.speccrew/skills/speccrew-dev-frontend/SKILL.md +10 -2
- package/.speccrew/skills/speccrew-dev-frontend/workflow.agentflow.xml +262 -0
- package/.speccrew/skills/speccrew-dev-mobile/SKILL.md +10 -2
- package/.speccrew/skills/speccrew-dev-mobile/workflow.agentflow.xml +244 -0
- package/.speccrew/skills/speccrew-dev-review-backend/SKILL.md +10 -2
- package/.speccrew/skills/speccrew-dev-review-backend/workflow.agentflow.xml +251 -0
- package/.speccrew/skills/speccrew-dev-review-desktop/SKILL.md +10 -2
- package/.speccrew/skills/speccrew-dev-review-desktop/workflow.agentflow.xml +214 -0
- package/.speccrew/skills/speccrew-dev-review-frontend/SKILL.md +10 -2
- package/.speccrew/skills/speccrew-dev-review-frontend/workflow.agentflow.xml +213 -0
- package/.speccrew/skills/speccrew-dev-review-mobile/SKILL.md +10 -2
- package/.speccrew/skills/speccrew-dev-review-mobile/workflow.agentflow.xml +214 -0
- package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +7 -1
- package/.speccrew/skills/speccrew-fd-api-contract/workflow.agentflow.xml +222 -0
- package/.speccrew/skills/speccrew-fd-feature-analyze/SKILL.md +7 -1
- package/.speccrew/skills/speccrew-fd-feature-analyze/workflow.agentflow.xml +223 -0
- package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +7 -1
- package/.speccrew/skills/speccrew-fd-feature-design/workflow.agentflow.xml +322 -0
- package/.speccrew/skills/speccrew-get-timestamp/SKILL.md +3 -39
- package/.speccrew/skills/speccrew-get-timestamp/workflow.agentflow.xml +43 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +57 -508
- package/.speccrew/skills/{speccrew-knowledge-bizs-api-analyze-xml/SKILL.md → speccrew-knowledge-bizs-api-analyze/workflow.agentflow.xml} +1 -154
- package/.speccrew/skills/speccrew-knowledge-bizs-api-graph/SKILL.md +73 -283
- package/.speccrew/skills/{speccrew-knowledge-bizs-api-graph-xml/SKILL.md → speccrew-knowledge-bizs-api-graph/workflow.agentflow.xml} +0 -298
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +931 -801
- package/.speccrew/skills/{speccrew-knowledge-bizs-dispatch-xml/SKILL.md → speccrew-knowledge-bizs-dispatch/workflow.agentflow.xml} +42 -272
- package/.speccrew/skills/speccrew-knowledge-bizs-identify-entries/SKILL.md +263 -71
- package/.speccrew/skills/{speccrew-knowledge-bizs-identify-entries-xml/SKILL.md → speccrew-knowledge-bizs-identify-entries/workflow.agentflow.xml} +8 -184
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/SKILL.md +200 -181
- package/.speccrew/skills/{speccrew-knowledge-bizs-init-features-xml/SKILL.md → speccrew-knowledge-bizs-init-features/workflow.agentflow.xml} +7 -134
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/SKILL.md +5 -89
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/workflow.agentflow.xml +129 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +454 -326
- package/.speccrew/skills/{speccrew-knowledge-bizs-ui-analyze-xml/SKILL.md → speccrew-knowledge-bizs-ui-analyze/workflow.agentflow.xml} +8 -128
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-graph/SKILL.md +302 -247
- package/.speccrew/skills/{speccrew-knowledge-bizs-ui-graph-xml/SKILL.md → speccrew-knowledge-bizs-ui-graph/workflow.agentflow.xml} +7 -199
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/SKILL.md +267 -156
- package/.speccrew/skills/{speccrew-knowledge-bizs-ui-style-extract-xml/SKILL.md → speccrew-knowledge-bizs-ui-style-extract/workflow.agentflow.xml} +7 -151
- package/.speccrew/skills/speccrew-knowledge-graph-query/SKILL.md +3 -122
- package/.speccrew/skills/speccrew-knowledge-graph-query/workflow.agentflow.xml +106 -0
- package/.speccrew/skills/speccrew-knowledge-graph-write/SKILL.md +3 -80
- package/.speccrew/skills/speccrew-knowledge-graph-write/workflow.agentflow.xml +152 -0
- package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +371 -265
- package/.speccrew/skills/{speccrew-knowledge-module-summarize-xml/SKILL.md → speccrew-knowledge-module-summarize/workflow.agentflow.xml} +7 -197
- package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +45 -333
- package/.speccrew/skills/{speccrew-knowledge-system-summarize-xml/SKILL.md → speccrew-knowledge-system-summarize/workflow.agentflow.xml} +0 -177
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +174 -727
- package/.speccrew/skills/{speccrew-knowledge-techs-dispatch-xml/SKILL.md → speccrew-knowledge-techs-dispatch/workflow.agentflow.xml} +10 -351
- package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +20 -150
- package/.speccrew/skills/{speccrew-knowledge-techs-generate-xml/SKILL.md → speccrew-knowledge-techs-generate/workflow.agentflow.xml} +0 -169
- package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +75 -587
- package/.speccrew/skills/{speccrew-knowledge-techs-generate-conventions-xml/SKILL.md → speccrew-knowledge-techs-generate-conventions/workflow.agentflow.xml} +0 -153
- package/.speccrew/skills/speccrew-knowledge-techs-generate-quality/SKILL.md +463 -297
- package/.speccrew/skills/{speccrew-knowledge-techs-generate-quality-xml/SKILL.md → speccrew-knowledge-techs-generate-quality/workflow.agentflow.xml} +0 -164
- package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +57 -292
- package/.speccrew/skills/{speccrew-knowledge-techs-generate-ui-style-xml/SKILL.md → speccrew-knowledge-techs-generate-ui-style/workflow.agentflow.xml} +2 -193
- package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +49 -335
- package/.speccrew/skills/{speccrew-knowledge-techs-index-xml/SKILL.md → speccrew-knowledge-techs-index/workflow.agentflow.xml} +0 -167
- package/.speccrew/skills/speccrew-knowledge-techs-init/SKILL.md +28 -109
- package/.speccrew/skills/{speccrew-knowledge-techs-init-xml/SKILL.md → speccrew-knowledge-techs-init/workflow.agentflow.xml} +0 -189
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +3 -487
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/workflow.agentflow.xml +278 -0
- package/.speccrew/skills/speccrew-pm-knowledge-detector/SKILL.md +3 -71
- package/.speccrew/skills/speccrew-pm-knowledge-detector/workflow.agentflow.xml +108 -0
- package/.speccrew/skills/speccrew-pm-module-initializer/SKILL.md +3 -107
- package/.speccrew/skills/speccrew-pm-module-initializer/workflow.agentflow.xml +139 -0
- package/.speccrew/skills/speccrew-pm-module-matcher/SKILL.md +3 -115
- package/.speccrew/skills/speccrew-pm-module-matcher/workflow.agentflow.xml +146 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +3 -343
- package/.speccrew/skills/speccrew-pm-requirement-analysis/workflow.agentflow.xml +174 -0
- package/.speccrew/skills/speccrew-pm-requirement-assess/SKILL.md +3 -91
- package/.speccrew/skills/speccrew-pm-requirement-assess/workflow.agentflow.xml +173 -0
- package/.speccrew/skills/speccrew-pm-requirement-clarify/SKILL.md +3 -224
- package/.speccrew/skills/speccrew-pm-requirement-clarify/workflow.agentflow.xml +159 -0
- package/.speccrew/skills/speccrew-pm-requirement-model/SKILL.md +3 -275
- package/.speccrew/skills/speccrew-pm-requirement-model/workflow.agentflow.xml +210 -0
- package/.speccrew/skills/speccrew-pm-requirement-simple/SKILL.md +3 -76
- package/.speccrew/skills/speccrew-pm-requirement-simple/workflow.agentflow.xml +120 -0
- package/.speccrew/skills/speccrew-pm-sub-prd-generate/SKILL.md +7 -1
- package/.speccrew/skills/speccrew-pm-sub-prd-generate/workflow.agentflow.xml +218 -0
- package/.speccrew/skills/speccrew-sd-backend/SKILL.md +7 -1
- package/.speccrew/skills/speccrew-sd-backend/workflow.agentflow.xml +264 -0
- package/.speccrew/skills/speccrew-sd-desktop/SKILL.md +7 -1
- package/.speccrew/skills/speccrew-sd-desktop/workflow.agentflow.xml +288 -0
- package/.speccrew/skills/speccrew-sd-framework-evaluate/SKILL.md +7 -1
- package/.speccrew/skills/speccrew-sd-framework-evaluate/workflow.agentflow.xml +235 -0
- package/.speccrew/skills/speccrew-sd-frontend/SKILL.md +7 -1
- package/.speccrew/skills/speccrew-sd-frontend/workflow.agentflow.xml +299 -0
- package/.speccrew/skills/speccrew-sd-mobile/SKILL.md +7 -1
- package/.speccrew/skills/speccrew-sd-mobile/workflow.agentflow.xml +301 -0
- package/.speccrew/skills/speccrew-test-case-design/SKILL.md +165 -284
- package/.speccrew/skills/speccrew-test-case-design/workflow.agentflow.xml +210 -0
- package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +204 -324
- package/.speccrew/skills/speccrew-test-code-gen/workflow.agentflow.xml +265 -0
- package/.speccrew/skills/speccrew-test-reporter/SKILL.md +205 -184
- package/.speccrew/skills/speccrew-test-reporter/workflow.agentflow.xml +284 -0
- package/.speccrew/skills/speccrew-test-runner/SKILL.md +242 -241
- package/.speccrew/skills/speccrew-test-runner/workflow.agentflow.xml +314 -0
- package/bin/cli.js +8 -1
- package/lib/commands/init.js +11 -3
- package/lib/commands/update.js +11 -3
- package/lib/commands/validate.js +565 -0
- package/lib/utils.js +43 -0
- package/package.json +1 -1
- package/workspace-template/docs/rules/{xml-workflow-spec.md → agentflow-spec.md} +5 -5
- package/workspace-template/scripts/validate-agentflow.js +637 -0
- package/.speccrew/agents/speccrew-team-leader-xml.md +0 -480
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/STATUS-FORMATS.md +0 -99
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/batch-orchestrator.js +0 -176
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-next-batch.js +0 -150
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-pending-features.js +0 -106
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/mark-stale.js +0 -249
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/merge-features.js +0 -300
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/process-batch-results.js +0 -915
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/update-feature-status.js +0 -226
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/examples/features.json +0 -34
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js +0 -1087
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/test-inventory.js +0 -26
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/STATUS-FORMATS.md +0 -550
|
@@ -1,113 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: speccrew-knowledge-bizs-api-analyze-xml
|
|
3
|
-
description: Analyze a single API controller from source code to extract business features and generate API documentation using XML Block workflow. Used by Worker Agent in parallel execution during knowledge base initialization Stage 2. Each worker analyzes one API controller file.
|
|
4
|
-
tools: Read, Write, Edit, Glob, Grep, Bash
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# API Feature Analysis - Single Controller (XML Block Workflow)
|
|
8
|
-
|
|
9
|
-
> **CRITICAL CONSTRAINT**: DO NOT create temporary scripts, batch files, or workaround code files (`.py`, `.bat`, `.sh`, `.ps1`, etc.) under any circumstances. If execution encounters errors, STOP and report the exact error. Fixes must be applied to the Skill definition or source scripts — not patched at runtime.
|
|
10
|
-
|
|
11
|
-
Analyze one specific API controller from source code, extract all business features (API endpoints), and generate feature documentation. This skill operates at controller granularity - one worker per controller file.
|
|
12
|
-
|
|
13
|
-
## Trigger Scenarios
|
|
14
|
-
|
|
15
|
-
- "Analyze API controller {fileName} from source code"
|
|
16
|
-
- "Extract API features from controller {fileName}"
|
|
17
|
-
- "Generate documentation for API controller {fileName}"
|
|
18
|
-
- "Analyze API feature from features.json"
|
|
19
|
-
|
|
20
|
-
## Input Variables
|
|
21
|
-
|
|
22
|
-
| Variable | Type | Description | Example |
|
|
23
|
-
|----------|------|-------------|---------|
|
|
24
|
-
| `${feature}` | object | Complete feature object from features.json | - |
|
|
25
|
-
| `${fileName}` | string | Controller file name | `"UserController"`, `"OrderController"` |
|
|
26
|
-
| `${sourcePath}` | string | Relative path to source file | `"yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java"` |
|
|
27
|
-
| `${documentPath}` | string | Target path for generated document | `"speccrew-workspace/knowledges/bizs/admin-api/system/user/UserController.md"` |
|
|
28
|
-
| `${module}` | string | Business module name (from feature.module) | `"system"`, `"trade"`, `"_root"` |
|
|
29
|
-
| `${analyzed}` | boolean | Analysis status flag | `true` / `false` |
|
|
30
|
-
| `${platform_type}` | string | Platform type | `"admin-api"`, `"app-api"` |
|
|
31
|
-
| `${platform_subtype}` | string | Platform subtype | `"spring-boot"`, `"java"` |
|
|
32
|
-
| `${tech_stack}` | array | Platform tech stack | `["java", "spring-boot", "mybatis-plus"]` |
|
|
33
|
-
| `${completed_dir}` | string | Marker files output directory | `"speccrew-workspace/knowledges/base/sync-state/knowledge-bizs/completed"` |
|
|
34
|
-
| `${sourceFile}` | string | Source features JSON file name | `"features-admin-api.json"` |
|
|
35
|
-
| `${language}` | string | Target language for content | `"zh"`, `"en"` |
|
|
36
|
-
|
|
37
|
-
## Language Adaptation
|
|
38
|
-
|
|
39
|
-
**CRITICAL**: Generate all content in the language specified by the `${language}` parameter.
|
|
40
|
-
|
|
41
|
-
- `${language} == "zh"` → Generate all content in 中文
|
|
42
|
-
- `${language} == "en"` → Generate all content in English
|
|
43
|
-
- Other languages → Use the specified language
|
|
44
|
-
|
|
45
|
-
**All output content (feature names, descriptions, business rules) must be in the target language only.**
|
|
46
|
-
|
|
47
|
-
## Output Variables
|
|
48
|
-
|
|
49
|
-
| Variable | Type | Description |
|
|
50
|
-
|----------|------|-------------|
|
|
51
|
-
| `${status}` | string | Analysis status: `"success"`, `"partial"`, or `"failed"` |
|
|
52
|
-
| `${feature_name}` | string | Name of the analyzed controller |
|
|
53
|
-
| `${generated_file}` | string | Path to the generated documentation file |
|
|
54
|
-
| `${message}` | string | Summary message for status update |
|
|
55
|
-
|
|
56
|
-
## Execution Requirements
|
|
57
|
-
|
|
58
|
-
This skill operates in **strict sequential execution mode**:
|
|
59
|
-
- Execute steps in exact order (Step 1 → Step 2 → ... → Step 7)
|
|
60
|
-
- Output step status after each step completion
|
|
61
|
-
- Do NOT skip any step
|
|
62
|
-
|
|
63
|
-
## Output
|
|
64
|
-
|
|
65
|
-
**Generated Files:**
|
|
66
|
-
1. `${documentPath}` - Controller documentation file
|
|
67
|
-
2. `${completed_dir}/{module}-{subpath}-{fileName}.done.json` - Completion status marker
|
|
68
|
-
|
|
69
|
-
**Graph Data Generation:**
|
|
70
|
-
Graph data (nodes, edges) construction is handled by `speccrew-knowledge-bizs-api-graph-xml` Skill.
|
|
71
|
-
After completing API analysis, dispatch will invoke the graph skill to generate `.graph.json` files.
|
|
72
|
-
|
|
73
|
-
**See Also:**
|
|
74
|
-
- `speccrew-knowledge-bizs-api-graph-xml` - Constructs knowledge graph data from API analysis results
|
|
75
|
-
|
|
76
|
-
**Return Value:**
|
|
77
|
-
```json
|
|
78
|
-
{
|
|
79
|
-
"status": "success|partial|failed",
|
|
80
|
-
"feature": {
|
|
81
|
-
"fileName": "UserController",
|
|
82
|
-
"sourcePath": "yudao-module-system/.../controller/admin/user/UserController.java"
|
|
83
|
-
},
|
|
84
|
-
"platformType": "admin-api",
|
|
85
|
-
"module": "system",
|
|
86
|
-
"featureName": "user-management-api",
|
|
87
|
-
"generatedFile": "speccrew-workspace/knowledges/bizs/admin-api/system/user/UserController.md",
|
|
88
|
-
"message": "Successfully analyzed UserController with 8 API endpoints"
|
|
89
|
-
}
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
The return value is used by dispatch to update the feature status in `features-{platform}.json`.
|
|
93
|
-
|
|
94
|
-
## Execution Checklist
|
|
95
|
-
|
|
96
|
-
Before executing the workflow, verify the following inputs:
|
|
97
|
-
|
|
98
|
-
- Controller: `${fileName}` (`${sourcePath}`)
|
|
99
|
-
- Target: `${documentPath}`
|
|
100
|
-
- Language: `${language}`
|
|
101
|
-
- Module: `${module}`
|
|
102
|
-
- Platform: `${platform_type}`/`${platform_subtype}`
|
|
103
|
-
- Completed Dir: `${completed_dir}`
|
|
104
|
-
- Source File: `${sourceFile}`
|
|
105
|
-
|
|
106
|
-
## Workflow
|
|
107
|
-
|
|
108
|
-
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/xml-workflow-spec.md`
|
|
109
|
-
|
|
110
|
-
```xml
|
|
111
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
112
2
|
<workflow id="api-controller-analysis" status="pending" version="1.0" desc="API controller analysis workflow">
|
|
113
3
|
|
|
@@ -590,7 +480,7 @@ Before executing the workflow, verify the following inputs:
|
|
|
590
480
|
|
|
591
481
|
<!-- Dispatch to Graph Skill for .graph.json -->
|
|
592
482
|
<block type="task" id="B32" action="dispatch-to-worker" desc="Dispatch graph generation">
|
|
593
|
-
<field name="skill">speccrew-knowledge-bizs-api-graph
|
|
483
|
+
<field name="skill">speccrew-knowledge-bizs-api-graph</field>
|
|
594
484
|
<field name="parameters">
|
|
595
485
|
<field name="controllerFile">${fileName}</field>
|
|
596
486
|
<field name="sourcePath">${sourcePath}</field>
|
|
@@ -661,46 +551,3 @@ Before executing the workflow, verify the following inputs:
|
|
|
661
551
|
</block>
|
|
662
552
|
|
|
663
553
|
</workflow>
|
|
664
|
-
```
|
|
665
|
-
|
|
666
|
-
## Reference Guides
|
|
667
|
-
|
|
668
|
-
### Mermaid Guide
|
|
669
|
-
|
|
670
|
-
When generating Mermaid diagrams, follow compatibility guidelines:
|
|
671
|
-
- Use `graph TB` or `graph LR` syntax (not `flowchart`)
|
|
672
|
-
- No parentheses `()` in node text
|
|
673
|
-
- No HTML tags like `<br/>`
|
|
674
|
-
- No `style` definitions
|
|
675
|
-
|
|
676
|
-
### Business Flow Guidelines
|
|
677
|
-
|
|
678
|
-
- One diagram per API request
|
|
679
|
-
- Focus on business operations
|
|
680
|
-
- Refer to `templates/FEATURE-DETAIL-TEMPLATE.md`
|
|
681
|
-
|
|
682
|
-
## Constraints
|
|
683
|
-
|
|
684
|
-
1. **DO NOT analyze files outside the specified `${sourcePath}`**
|
|
685
|
-
2. **DO NOT generate separate documents for internal/private methods**
|
|
686
|
-
3. **All content MUST be in the language specified by `${language}`**
|
|
687
|
-
4. **Use `search_replace` for section filling, NEVER rewrite entire document**
|
|
688
|
-
5. **Mermaid diagrams MUST follow the rules in `mermaid-rule.md`**
|
|
689
|
-
6. **All links MUST use relative paths, NEVER `file://` protocol**
|
|
690
|
-
7. **Marker files MUST follow naming convention: `{module}-{subpath}-{fileName}.done.json`**
|
|
691
|
-
8. **fileName in .done.json MUST NOT include file extension**
|
|
692
|
-
9. **ALL paths in JSON MUST be relative, not absolute**
|
|
693
|
-
|
|
694
|
-
## Checklist
|
|
695
|
-
|
|
696
|
-
- [ ] Template file selected based on `${tech_stack}`
|
|
697
|
-
- [ ] Template content read successfully
|
|
698
|
-
- [ ] Controller file read and analyzed
|
|
699
|
-
- [ ] API endpoints extracted with business flows
|
|
700
|
-
- [ ] API consumers found
|
|
701
|
-
- [ ] Template copied to document path
|
|
702
|
-
- [ ] All sections filled using search_replace
|
|
703
|
-
- [ ] All content in target language (`${language}`)
|
|
704
|
-
- [ ] Results reported in JSON format
|
|
705
|
-
- [ ] .done.json marker file written successfully
|
|
706
|
-
- [ ] .graph.json generation dispatched to graph skill
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: speccrew-knowledge-bizs-api-graph
|
|
3
|
-
description: Constructs knowledge graph data (nodes, edges, relationships) from API analysis results. Generates graph JSON files and completion markers for the bizs knowledge pipeline.
|
|
3
|
+
description: Constructs knowledge graph data (nodes, edges, relationships) from API 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
|
-
# API Knowledge Graph Constructor
|
|
7
|
+
# API 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. If execution encounters errors, STOP and report the exact error. Fixes must be applied to the Skill definition or source scripts — not patched at runtime.
|
|
10
10
|
|
|
11
11
|
Construct knowledge graph data structures (nodes and edges) from API analysis results. This skill transforms structured API documentation into graph JSON format for knowledge base integration.
|
|
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 from API analysis results"
|
|
@@ -42,7 +46,7 @@ Construct knowledge graph data structures (nodes and edges) from API analysis re
|
|
|
42
46
|
## Execution Requirements
|
|
43
47
|
|
|
44
48
|
This skill operates in **strict sequential execution mode**:
|
|
45
|
-
- Execute steps in exact order (Step 1 → Step 2 → ... → Step
|
|
49
|
+
- Execute steps in exact order (Step 1 → Step 2 → ... → Step 6)
|
|
46
50
|
- Output step status after each step completion
|
|
47
51
|
- Do NOT skip any step
|
|
48
52
|
|
|
@@ -65,70 +69,71 @@ This skill operates in **strict sequential execution mode**:
|
|
|
65
69
|
}
|
|
66
70
|
```
|
|
67
71
|
|
|
68
|
-
##
|
|
69
|
-
|
|
70
|
-
```mermaid
|
|
71
|
-
graph TB
|
|
72
|
-
Start([Start]) --> Step1[Step 1 Read API Analysis Document]
|
|
73
|
-
Step1 --> Step2[Step 2 Extract Graph Nodes]
|
|
74
|
-
Step2 --> Step3[Step 3 Extract Graph Edges]
|
|
75
|
-
Step3 --> Step4[Step 4 Write Graph JSON]
|
|
76
|
-
Step4 --> Step5[Step 5 Write Graph Completion Marker]
|
|
77
|
-
Step5 --> Step6[Step 6 Report Results]
|
|
78
|
-
Step6 --> End([End])
|
|
79
|
-
```
|
|
72
|
+
## AgentFlow Definition
|
|
80
73
|
|
|
81
|
-
|
|
74
|
+
<!-- @agentflow: workflow.agentflow.xml -->
|
|
82
75
|
|
|
83
|
-
|
|
76
|
+
## Node ID Naming Convention
|
|
84
77
|
|
|
85
|
-
|
|
78
|
+
```
|
|
79
|
+
{type}-{module}-{name}
|
|
86
80
|
|
|
87
|
-
|
|
81
|
+
Examples:
|
|
82
|
+
api-system-user-list
|
|
83
|
+
api-system-user-create
|
|
84
|
+
service-system-user-service
|
|
85
|
+
table-system-system_user
|
|
86
|
+
dto-system-user-create-req
|
|
87
|
+
```
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
## Marker File Naming Convention
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
- Database tables accessed
|
|
95
|
-
- DTOs used
|
|
96
|
-
- Business rules and permissions
|
|
91
|
+
```
|
|
92
|
+
{output_dir}/{module}-{subpath}-{fileName}.graph.json
|
|
93
|
+
```
|
|
97
94
|
|
|
98
|
-
|
|
95
|
+
**How to Extract Each Component:**
|
|
99
96
|
|
|
100
|
-
|
|
97
|
+
1. **module**: Use `{{module}}` input variable directly (e.g., `system`, `trade`, `ai`)
|
|
101
98
|
|
|
102
|
-
|
|
99
|
+
2. **subpath**: Extract from `{{sourcePath}}`:
|
|
100
|
+
- For Java: Remove package prefix up to the business layer (e.g., `controller/admin/`, `controller/app/`)
|
|
101
|
+
- Remove the file name at the end
|
|
102
|
+
- Replace path separators (`/`) with hyphens (`-`)
|
|
103
|
+
- If the file is at module root, subpath will be empty → omit from filename
|
|
103
104
|
|
|
104
|
-
|
|
105
|
+
3. **fileName**: Use `{{fileName}}` input variable (class name WITHOUT extension)
|
|
105
106
|
|
|
106
|
-
**
|
|
107
|
+
**Examples:**
|
|
107
108
|
|
|
108
|
-
|
|
109
|
+
| sourcePath | module | subpath | fileName | Marker Filename |
|
|
110
|
+
|------------|--------|---------|----------|-----------------|
|
|
111
|
+
| `yudao-module-system/.../controller/admin/notify/NotifyMessageController.java` | `system` | `controller-admin-notify` | `NotifyMessageController` | `system-controller-admin-notify-NotifyMessageController.graph.json` |
|
|
112
|
+
| `yudao-module-system/.../controller/admin/user/UserController.java` | `system` | `controller-admin-user` | `UserController` | `system-controller-admin-user-UserController.graph.json` |
|
|
113
|
+
| `yudao-module-ai/.../controller/admin/chat/ChatConversationController.java` | `ai` | `controller-admin-chat` | `ChatConversationController` | `ai-controller-admin-chat-ChatConversationController.graph.json` |
|
|
109
114
|
|
|
110
|
-
|
|
115
|
+
## Node Type Reference
|
|
111
116
|
|
|
112
|
-
|
|
|
113
|
-
|
|
114
|
-
| `api` |
|
|
115
|
-
| `service` |
|
|
116
|
-
| `table` |
|
|
117
|
-
| `dto` |
|
|
117
|
+
| Type | Description | Required Metadata |
|
|
118
|
+
|------|-------------|-------------------|
|
|
119
|
+
| `api` | API endpoint | `method`, `path`, `permissions` |
|
|
120
|
+
| `service` | Service class | `methods` |
|
|
121
|
+
| `table` | Database table | `fields`, `indexes` |
|
|
122
|
+
| `dto` | Data Transfer Object | `fields`, `validation` |
|
|
118
123
|
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
{type}-{module}-{name}
|
|
124
|
+
## Edge Type Reference
|
|
122
125
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
| Type | Description | Source → Target |
|
|
127
|
+
|------|-------------|-----------------|
|
|
128
|
+
| `operates` | API operates on table | api → table |
|
|
129
|
+
| `invokes` | API calls service | api → service |
|
|
130
|
+
| `references` | API uses DTO | api → dto |
|
|
131
|
+
| `depends-on` | Service dependency | service → service |
|
|
132
|
+
| `maps-to` | DTO maps to table | dto → table |
|
|
133
|
+
|
|
134
|
+
## Node Structure Examples
|
|
130
135
|
|
|
131
|
-
|
|
136
|
+
### API Node Example
|
|
132
137
|
```json
|
|
133
138
|
{
|
|
134
139
|
"id": "api-{module}-{endpoint-name}",
|
|
@@ -146,7 +151,7 @@ Examples:
|
|
|
146
151
|
}
|
|
147
152
|
```
|
|
148
153
|
|
|
149
|
-
|
|
154
|
+
### Service Node Example
|
|
150
155
|
```json
|
|
151
156
|
{
|
|
152
157
|
"id": "service-{module}-{service-name}",
|
|
@@ -161,7 +166,7 @@ Examples:
|
|
|
161
166
|
}
|
|
162
167
|
```
|
|
163
168
|
|
|
164
|
-
|
|
169
|
+
### Table Node Example
|
|
165
170
|
```json
|
|
166
171
|
{
|
|
167
172
|
"id": "table-{module}-{table-name}",
|
|
@@ -177,7 +182,7 @@ Examples:
|
|
|
177
182
|
}
|
|
178
183
|
```
|
|
179
184
|
|
|
180
|
-
|
|
185
|
+
### DTO Node Example
|
|
181
186
|
```json
|
|
182
187
|
{
|
|
183
188
|
"id": "dto-{module}-{dto-name}",
|
|
@@ -193,48 +198,9 @@ Examples:
|
|
|
193
198
|
}
|
|
194
199
|
```
|
|
195
200
|
|
|
196
|
-
|
|
197
|
-
- `module` comes from `{{module}}` input variable
|
|
198
|
-
- `name` should be a short, readable slug derived from the entity name
|
|
199
|
-
- Each node must include `sourcePath` and `documentPath` (if applicable)
|
|
200
|
-
- Convert class names to kebab-case for node IDs (e.g., `UserService` → `user-service`)
|
|
201
|
-
|
|
202
|
-
**Output:** "Step 2 Status: ✅ COMPLETED - Extracted {{nodeCount}} graph nodes ({{apiCount}} APIs, {{serviceCount}} services, {{tableCount}} tables, {{dtoCount}} DTOs)"
|
|
203
|
-
|
|
204
|
-
---
|
|
205
|
-
|
|
206
|
-
### Step 3: Extract Graph Edges
|
|
207
|
-
|
|
208
|
-
**Step 3 Status: 🔄 IN PROGRESS**
|
|
209
|
-
|
|
210
|
-
Based on the API analysis document, extract graph edges representing relationships between nodes.
|
|
201
|
+
## Edge Structure Examples
|
|
211
202
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
| Edge Type | Direction | When to Create |
|
|
215
|
-
|-----------|-----------|----------------|
|
|
216
|
-
| `operates` | api → table | API endpoint reads/writes a database table |
|
|
217
|
-
| `invokes` | api → service | Controller calls a service method |
|
|
218
|
-
| `references` | api → dto | API endpoint uses a request/response DTO |
|
|
219
|
-
| `depends-on` | service → service | Service depends on another service |
|
|
220
|
-
| `maps-to` | dto → table | DO/Entity maps to database table |
|
|
221
|
-
|
|
222
|
-
**Edge Structure:**
|
|
223
|
-
```json
|
|
224
|
-
{
|
|
225
|
-
"source": "api-system-user-create",
|
|
226
|
-
"target": "table-system-system_user",
|
|
227
|
-
"type": "operates",
|
|
228
|
-
"metadata": {
|
|
229
|
-
"operation": "INSERT",
|
|
230
|
-
"description": "Create new user record"
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
**Edge Examples:**
|
|
236
|
-
|
|
237
|
-
1. **API → Table (operates):**
|
|
203
|
+
### API to Table Edge (operates)
|
|
238
204
|
```json
|
|
239
205
|
{
|
|
240
206
|
"source": "api-system-user-list",
|
|
@@ -247,7 +213,7 @@ Based on the API analysis document, extract graph edges representing relationshi
|
|
|
247
213
|
}
|
|
248
214
|
```
|
|
249
215
|
|
|
250
|
-
|
|
216
|
+
### API to Service Edge (invokes)
|
|
251
217
|
```json
|
|
252
218
|
{
|
|
253
219
|
"source": "api-system-user-create",
|
|
@@ -260,7 +226,7 @@ Based on the API analysis document, extract graph edges representing relationshi
|
|
|
260
226
|
}
|
|
261
227
|
```
|
|
262
228
|
|
|
263
|
-
|
|
229
|
+
### API to DTO Edge (references)
|
|
264
230
|
```json
|
|
265
231
|
{
|
|
266
232
|
"source": "api-system-user-create",
|
|
@@ -273,7 +239,7 @@ Based on the API analysis document, extract graph edges representing relationshi
|
|
|
273
239
|
}
|
|
274
240
|
```
|
|
275
241
|
|
|
276
|
-
|
|
242
|
+
### Service to Service Edge (depends-on)
|
|
277
243
|
```json
|
|
278
244
|
{
|
|
279
245
|
"source": "service-system-user-service",
|
|
@@ -285,7 +251,7 @@ Based on the API analysis document, extract graph edges representing relationshi
|
|
|
285
251
|
}
|
|
286
252
|
```
|
|
287
253
|
|
|
288
|
-
|
|
254
|
+
### DTO to Table Edge (maps-to)
|
|
289
255
|
```json
|
|
290
256
|
{
|
|
291
257
|
"source": "dto-system-user-do",
|
|
@@ -297,185 +263,28 @@ Based on the API analysis document, extract graph edges representing relationshi
|
|
|
297
263
|
}
|
|
298
264
|
```
|
|
299
265
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
---
|
|
303
|
-
|
|
304
|
-
### Step 4: Write Graph JSON
|
|
305
|
-
|
|
306
|
-
**Step 4 Status: 🔄 IN PROGRESS**
|
|
307
|
-
|
|
308
|
-
Write the complete graph data to JSON file.
|
|
309
|
-
|
|
310
|
-
**Marker File Naming Convention:**
|
|
311
|
-
```
|
|
312
|
-
{output_dir}/{module}-{subpath}-{fileName}.graph.json
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
**How to Extract Each Component:**
|
|
316
|
-
|
|
317
|
-
1. **module**: Use `{{module}}` input variable directly (e.g., `system`, `trade`, `ai`)
|
|
318
|
-
|
|
319
|
-
2. **subpath**: Extract from `{{sourcePath}}`:
|
|
320
|
-
- For Java: Remove package prefix up to the business layer (e.g., `controller/admin/`, `controller/app/`)
|
|
321
|
-
- Remove the file name at the end
|
|
322
|
-
- Replace path separators (`/`) with hyphens (`-`)
|
|
323
|
-
- If the file is at module root, subpath will be empty → omit from filename
|
|
266
|
+
## Pre-write Verification Checklist
|
|
324
267
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
**Examples:**
|
|
328
|
-
|
|
329
|
-
| sourcePath | module | subpath | fileName | Marker Filename |
|
|
330
|
-
|------------|--------|---------|----------|-----------------|
|
|
331
|
-
| `yudao-module-system/.../controller/admin/notify/NotifyMessageController.java` | `system` | `controller-admin-notify` | `NotifyMessageController` | `system-controller-admin-notify-NotifyMessageController.graph.json` |
|
|
332
|
-
| `yudao-module-system/.../controller/admin/user/UserController.java` | `system` | `controller-admin-user` | `UserController` | `system-controller-admin-user-UserController.graph.json` |
|
|
333
|
-
| `yudao-module-ai/.../controller/admin/chat/ChatConversationController.java` | `ai` | `controller-admin-chat` | `ChatConversationController` | `ai-controller-admin-chat-ChatConversationController.graph.json` |
|
|
334
|
-
|
|
335
|
-
**CRITICAL - API Endpoint Coverage Check:**
|
|
336
|
-
Before writing the graph.json file, verify:
|
|
337
|
-
- [ ] ALL public API endpoint methods in the controller are represented as `api` nodes
|
|
338
|
-
- [ ] Status update endpoints (updateStatus, toggleEnable) are included
|
|
339
|
-
- [ ] Special operation endpoints (resetPassword, export, import, batch operations) are included
|
|
340
|
-
- [ ] Each `api` node has proper metadata with HTTP method and path
|
|
341
|
-
- [ ] No public endpoint method is left without a corresponding node
|
|
342
|
-
|
|
343
|
-
**Pre-write Verification (MUST check before writing):**
|
|
268
|
+
### Graph JSON Verification:
|
|
344
269
|
- [ ] Root-level `module` field is present (MANDATORY)
|
|
345
270
|
- [ ] `nodes` and `edges` are arrays (can be empty)
|
|
346
271
|
- [ ] Valid JSON (no trailing commas, all strings quoted)
|
|
347
272
|
- [ ] All node IDs are unique
|
|
348
273
|
- [ ] All edge source/target references point to valid node IDs
|
|
349
274
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
"id": "api-{module}-{endpoint-name}",
|
|
357
|
-
"type": "api",
|
|
358
|
-
"name": "<display name>",
|
|
359
|
-
"module": "{{module}}",
|
|
360
|
-
"sourcePath": "{{sourcePath}}",
|
|
361
|
-
"documentPath": "{{api_analysis_path}}",
|
|
362
|
-
"description": "...",
|
|
363
|
-
"metadata": {
|
|
364
|
-
"method": "GET",
|
|
365
|
-
"path": "/admin-api/system/user/page",
|
|
366
|
-
"permissions": ["system:user:query"]
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
],
|
|
370
|
-
"edges": [
|
|
371
|
-
{
|
|
372
|
-
"source": "api-...",
|
|
373
|
-
"target": "service-...",
|
|
374
|
-
"type": "invokes",
|
|
375
|
-
"metadata": { ... }
|
|
376
|
-
}
|
|
377
|
-
]
|
|
378
|
-
}
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
**⚠️ CRITICAL - Module Field Requirement:**
|
|
382
|
-
- The `.graph.json` file **MUST** have a root-level `module` field
|
|
383
|
-
- Do NOT assume scripts will fall back to reading from `.done` file
|
|
384
|
-
- Missing `module` field will cause the graph merge pipeline to reject this file
|
|
385
|
-
|
|
386
|
-
**⚠️ CRITICAL - Path Format:**
|
|
387
|
-
- `sourcePath` in nodes: Relative path (as-is from input)
|
|
388
|
-
- `documentPath` in nodes: Relative path (as-is from input)
|
|
389
|
-
- NEVER convert relative paths to absolute paths in JSON content
|
|
390
|
-
|
|
391
|
-
**Full Path Example:**
|
|
392
|
-
`d:/dev/speccrew/speccrew-workspace/knowledges/base/sync-state/knowledge-bizs/completed/system-controller-admin-user-UserController.graph.json`
|
|
393
|
-
|
|
394
|
-
**Output:** "Step 4 Status: ✅ COMPLETED - Graph JSON written to {{output_dir}}/{module}-{subpath}-{fileName}.graph.json ({{fileSize}} bytes)"
|
|
395
|
-
|
|
396
|
-
---
|
|
397
|
-
|
|
398
|
-
### Step 5: Write Graph Completion Marker
|
|
399
|
-
|
|
400
|
-
**Step 5 Status: 🔄 IN PROGRESS**
|
|
401
|
-
|
|
402
|
-
Write the `.graph-done.json` completion marker file to signal successful graph data generation.
|
|
403
|
-
|
|
404
|
-
**Marker File Path:**
|
|
405
|
-
|
|
406
|
-
```
|
|
407
|
-
{output_dir}/{module}-{subpath}-{fileName}.graph-done.json
|
|
408
|
-
```
|
|
409
|
-
|
|
410
|
-
**Marker JSON Structure:**
|
|
411
|
-
|
|
412
|
-
```json
|
|
413
|
-
{
|
|
414
|
-
"fileName": "{{fileName}}",
|
|
415
|
-
"module": "{{module}}",
|
|
416
|
-
"marker": "graph_completed",
|
|
417
|
-
"graphFile": "{module}-{subpath}-{fileName}.graph.json",
|
|
418
|
-
"nodeCount": {{node_count}},
|
|
419
|
-
"edgeCount": {{edge_count}},
|
|
420
|
-
"status": "completed"
|
|
421
|
-
}
|
|
422
|
-
```
|
|
423
|
-
|
|
424
|
-
**Field Descriptions:**
|
|
425
|
-
|
|
426
|
-
| Field | Description | Example |
|
|
427
|
-
|-------|-------------|---------|
|
|
428
|
-
| `fileName` | Feature file name WITHOUT extension | `"UserController"` |
|
|
429
|
-
| `module` | Business module name | `"system"` |
|
|
430
|
-
| `marker` | Fixed marker type | `"graph_completed"` |
|
|
431
|
-
| `graphFile` | Corresponding graph JSON filename | `"system-controller-admin-user-UserController.graph.json"` |
|
|
432
|
-
| `nodeCount` | Number of nodes in graph | `15` |
|
|
433
|
-
| `edgeCount` | Number of edges in graph | `23` |
|
|
434
|
-
| `status` | Completion status | `"completed"` |
|
|
275
|
+
### API Endpoint Coverage Check:
|
|
276
|
+
- [ ] ALL public API endpoint methods in the controller are represented as `api` nodes
|
|
277
|
+
- [ ] Status update endpoints (updateStatus, toggleEnable) are included
|
|
278
|
+
- [ ] Special operation endpoints (resetPassword, export, import, batch operations) are included
|
|
279
|
+
- [ ] Each `api` node has proper metadata with HTTP method and path
|
|
280
|
+
- [ ] No public endpoint method is left without a corresponding node
|
|
435
281
|
|
|
436
|
-
|
|
282
|
+
### Completion Marker Verification:
|
|
437
283
|
- [ ] Filename follows `{module}-{subpath}-{fileName}.graph-done.json` pattern
|
|
438
284
|
- [ ] JSON is valid
|
|
439
285
|
- [ ] All required fields are present
|
|
440
286
|
- [ ] `nodeCount` and `edgeCount` match actual graph data
|
|
441
287
|
|
|
442
|
-
**Output:** "Step 5 Status: ✅ COMPLETED - Graph completion marker written to {{output_dir}}/{module}-{subpath}-{fileName}.graph-done.json"
|
|
443
|
-
|
|
444
|
-
---
|
|
445
|
-
|
|
446
|
-
### Step 6: Report Results
|
|
447
|
-
|
|
448
|
-
**Step 6 Status: 🔄 IN PROGRESS**
|
|
449
|
-
|
|
450
|
-
Return graph construction result summary to dispatch:
|
|
451
|
-
|
|
452
|
-
```json
|
|
453
|
-
{
|
|
454
|
-
"status": "success",
|
|
455
|
-
"module": "{{module}}",
|
|
456
|
-
"fileName": "{{fileName}}",
|
|
457
|
-
"graphFile": "{{output_dir}}/{module}-{subpath}-{fileName}.graph.json",
|
|
458
|
-
"nodeCount": {{node_count}},
|
|
459
|
-
"edgeCount": {{edge_count}},
|
|
460
|
-
"message": "Generated graph data with {{node_count}} nodes and {{edge_count}} edges"
|
|
461
|
-
}
|
|
462
|
-
```
|
|
463
|
-
|
|
464
|
-
Or in case of failure:
|
|
465
|
-
|
|
466
|
-
```json
|
|
467
|
-
{
|
|
468
|
-
"status": "failed",
|
|
469
|
-
"module": "{{module}}",
|
|
470
|
-
"fileName": "{{fileName}}",
|
|
471
|
-
"message": "{{error_message}}"
|
|
472
|
-
}
|
|
473
|
-
```
|
|
474
|
-
|
|
475
|
-
**Output:** "Step 6 Status: ✅ COMPLETED - Graph construction {{status}}: {{message}}"
|
|
476
|
-
|
|
477
|
-
---
|
|
478
|
-
|
|
479
288
|
## Constraints
|
|
480
289
|
|
|
481
290
|
1. **Single Document Input**: This skill processes ONE API analysis document at a time
|
|
@@ -484,22 +293,3 @@ Or in case of failure:
|
|
|
484
293
|
4. **Node Uniqueness**: Each node ID must be unique within the graph
|
|
485
294
|
5. **Edge Validity**: Edge source/target must reference existing node IDs
|
|
486
295
|
6. **Path Format**: Use relative paths, NEVER absolute paths in JSON content
|
|
487
|
-
|
|
488
|
-
## Node Type Reference
|
|
489
|
-
|
|
490
|
-
| Type | Description | Required Metadata |
|
|
491
|
-
|------|-------------|-------------------|
|
|
492
|
-
| `api` | API endpoint | `method`, `path`, `permissions` |
|
|
493
|
-
| `service` | Service class | `methods` |
|
|
494
|
-
| `table` | Database table | `fields`, `indexes` |
|
|
495
|
-
| `dto` | Data Transfer Object | `fields`, `validation` |
|
|
496
|
-
|
|
497
|
-
## Edge Type Reference
|
|
498
|
-
|
|
499
|
-
| Type | Description | Source → Target |
|
|
500
|
-
|------|-------------|-----------------|
|
|
501
|
-
| `operates` | API operates on table | api → table |
|
|
502
|
-
| `invokes` | API calls service | api → service |
|
|
503
|
-
| `references` | API uses DTO | api → dto |
|
|
504
|
-
| `depends-on` | Service dependency | service → service |
|
|
505
|
-
| `maps-to` | DTO maps to table | dto → table |
|