speccrew 0.7.74 → 0.7.76
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-feature-designer.md +4 -647
- package/.speccrew/agents/speccrew-product-manager.md +5 -480
- package/.speccrew/agents/speccrew-system-deployer.md +6 -457
- package/.speccrew/agents/speccrew-system-developer.md +9 -913
- package/.speccrew/agents/speccrew-test-manager.md +403 -1112
- package/.speccrew/skills/speccrew-agentflow-manager/SKILL.md +6 -149
- package/.speccrew/skills/speccrew-deploy-build/SKILL.md +2 -59
- package/.speccrew/skills/speccrew-deploy-migrate/SKILL.md +2 -64
- package/.speccrew/skills/speccrew-deploy-smoke-test/SKILL.md +2 -75
- package/.speccrew/skills/speccrew-deploy-startup/SKILL.md +2 -70
- package/.speccrew/skills/speccrew-dev-backend/SKILL.md +2 -381
- package/.speccrew/skills/speccrew-dev-desktop-electron/SKILL.md +2 -369
- package/.speccrew/skills/speccrew-dev-desktop-tauri/SKILL.md +2 -362
- package/.speccrew/skills/speccrew-dev-frontend/SKILL.md +2 -304
- package/.speccrew/skills/speccrew-dev-mobile/SKILL.md +2 -294
- package/.speccrew/skills/speccrew-dev-review-backend/SKILL.md +2 -204
- package/.speccrew/skills/speccrew-dev-review-desktop/SKILL.md +2 -173
- package/.speccrew/skills/speccrew-dev-review-frontend/SKILL.md +2 -169
- package/.speccrew/skills/speccrew-dev-review-mobile/SKILL.md +2 -173
- package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +2 -251
- package/.speccrew/skills/speccrew-fd-feature-analyze/SKILL.md +2 -254
- package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +2 -748
- package/.speccrew/skills/speccrew-feature-designer-orchestration/SKILL.md +6 -105
- package/.speccrew/skills/speccrew-get-timestamp/SKILL.md +6 -33
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +3 -138
- package/.speccrew/skills/speccrew-knowledge-bizs-api-graph/SKILL.md +3 -283
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +3 -1014
- package/.speccrew/skills/speccrew-knowledge-bizs-identify-entries/SKILL.md +4 -343
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/SKILL.md +4 -235
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/SKILL.md +6 -72
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +3 -534
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-graph/SKILL.md +3 -432
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/SKILL.md +4 -391
- package/.speccrew/skills/speccrew-knowledge-graph-query/SKILL.md +3 -98
- package/.speccrew/skills/speccrew-knowledge-graph-write/SKILL.md +3 -92
- package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +3 -181
- package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +3 -148
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +3 -330
- package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +6 -159
- package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +3 -142
- package/.speccrew/skills/speccrew-knowledge-techs-generate-quality/SKILL.md +3 -568
- package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +3 -180
- package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +3 -154
- package/.speccrew/skills/speccrew-knowledge-techs-init/SKILL.md +3 -176
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +3 -135
- package/.speccrew/skills/speccrew-pm-knowledge-detector/SKILL.md +4 -88
- package/.speccrew/skills/speccrew-pm-module-initializer/SKILL.md +4 -178
- package/.speccrew/skills/speccrew-pm-module-matcher/SKILL.md +3 -102
- package/.speccrew/skills/speccrew-pm-phase0-init/SKILL.md +5 -78
- package/.speccrew/skills/speccrew-pm-phase1-knowledge-check/SKILL.md +5 -85
- package/.speccrew/skills/speccrew-pm-phase2-complexity-assess/SKILL.md +4 -100
- package/.speccrew/skills/speccrew-pm-phase5-subprd-dispatch/SKILL.md +14 -106
- package/.speccrew/skills/speccrew-pm-phase6-verify-confirm/SKILL.md +7 -84
- package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +6 -66
- package/.speccrew/skills/speccrew-pm-requirement-assess/SKILL.md +4 -96
- package/.speccrew/skills/speccrew-pm-requirement-clarify/SKILL.md +4 -131
- package/.speccrew/skills/speccrew-pm-requirement-model/SKILL.md +6 -79
- package/.speccrew/skills/speccrew-pm-requirement-simple/SKILL.md +4 -76
- package/.speccrew/skills/speccrew-pm-sub-prd-generate/SKILL.md +3 -281
- package/.speccrew/skills/speccrew-product-manager-orchestration/SKILL.md +6 -165
- package/.speccrew/skills/speccrew-system-deployer-orchestration/SKILL.md +6 -79
- package/.speccrew/skills/speccrew-system-designer-orchestration/SKILL.md +2 -35
- package/.speccrew/skills/speccrew-system-developer-orchestration/SKILL.md +6 -98
- package/.speccrew/skills/speccrew-task-worker-execution/SKILL.md +6 -94
- package/.speccrew/skills/speccrew-team-leader-routing/SKILL.md +6 -79
- package/.speccrew/skills/speccrew-test-case-design/SKILL.md +2 -58
- package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +2 -61
- package/.speccrew/skills/speccrew-test-manager-orchestration/SKILL.md +6 -94
- package/.speccrew/skills/speccrew-test-reporter/SKILL.md +2 -102
- package/.speccrew/skills/speccrew-test-runner/SKILL.md +3 -121
- package/package.json +1 -1
|
@@ -1,117 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: speccrew-feature-designer-orchestration
|
|
3
|
-
version: 1.0.0
|
|
4
3
|
description: Feature Designer 的核心编排技能,负责加载功能清单、协调功能分析、功能规格设计与 API 契约生成。处理单个功能(直接调用)和多个功能(Worker 分发)两种工作流路径。
|
|
5
4
|
tools: Read, Write, Glob, Grep, Bash, Agent
|
|
6
5
|
---
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
>
|
|
10
|
-
> **Step 1**: Load XML workflow specification: `speccrew-workspace/docs/rules/agentflow-spec.md` — this defines all block types and action-to-tool mappings
|
|
11
|
-
>
|
|
12
|
-
> **Step 2**: Execute this SKILL.md's XML workflow **block by block in document order**. For EVERY block, you MUST follow this 3-step cycle:
|
|
13
|
-
>
|
|
14
|
-
> ```
|
|
15
|
-
> 🏷️ Block [ID] (action=[action]) — [desc]
|
|
16
|
-
> 🔧 Tool: [which IDE tool to call]
|
|
17
|
-
> ✅ Result: [output or status]
|
|
18
|
-
> ```
|
|
19
|
-
>
|
|
20
|
-
> Action-to-tool mapping:
|
|
21
|
-
> - `action="run-skill"` → Invoke via **Skill tool** (pass the `<field name="skill">` value EXACTLY)
|
|
22
|
-
> - `action="run-script"` → Execute via **Terminal tool** (pass the `<field name="command">` value EXACTLY)
|
|
23
|
-
> - `action="dispatch-to-worker"` → Create **Task** via **Task tool** for `speccrew-task-worker`
|
|
24
|
-
> - `action="read-file"` → Read via **Read tool**
|
|
25
|
-
> - `action="log"` → Output message directly
|
|
26
|
-
> - `action="confirm"` → Present to user and wait for response
|
|
27
|
-
>
|
|
28
|
-
> **Step 3**: Execute ALL blocks sequentially without pausing (only stop at explicit `<event action="confirm">` blocks)
|
|
7
|
+
# Trigger Scenarios
|
|
29
8
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
1. **Stage Gate Verification** - 验证 PRD 阶段已完成确认
|
|
35
|
-
2. **Feature List Loading** - 从 .prd-feature-list.json 加载功能清单
|
|
36
|
-
3. **Feature Analysis Orchestration** - 协调功能分析(单个直接调用,多个分发 Worker)
|
|
37
|
-
4. **Feature Design Orchestration** - 协调功能规格设计
|
|
38
|
-
5. **API Contract Generation** - 生成 API 契约文档
|
|
39
|
-
6. **Joint Confirmation** - 汇总确认所有设计产出
|
|
40
|
-
|
|
41
|
-
## Invocation Method
|
|
42
|
-
|
|
43
|
-
**CRITICAL**: This skill is loaded directly by Feature Designer Agent — do NOT invoke via Worker Agent.
|
|
44
|
-
|
|
45
|
-
```xml
|
|
46
|
-
<block type="task" action="run-skill" desc="Feature Designer orchestration workflow">
|
|
47
|
-
<field name="skill">speccrew-feature-designer-orchestration</field>
|
|
48
|
-
</block>
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## Input Parameters
|
|
52
|
-
|
|
53
|
-
| Parameter | Type | Required | Description |
|
|
54
|
-
|-----------|------|----------|-------------|
|
|
55
|
-
| `prd_path` | string | Yes | PRD 文档目录路径 |
|
|
56
|
-
| `iteration_path` | string | Yes | 当前迭代目录路径 |
|
|
57
|
-
| `workspace_root` | string | Yes | speccrew-workspace 根目录路径 |
|
|
58
|
-
| `frontend_platforms` | array | No | 前端平台列表(从 techs-manifest 读取) |
|
|
59
|
-
|
|
60
|
-
## Output
|
|
61
|
-
|
|
62
|
-
- `status` - 执行状态 (success / partial / failed)
|
|
63
|
-
- `feature_specs` - 生成的功能规格文件列表
|
|
64
|
-
- `api_contracts` - 生成的 API 契约文件列表
|
|
65
|
-
- `workflow_stage` - 当前工作流阶段状态
|
|
66
|
-
- `next_agent` - 下一步建议的 Agent
|
|
67
|
-
|
|
68
|
-
---
|
|
9
|
+
- Feature Designer Agent starts feature design workflow after PRD confirmation
|
|
10
|
+
- PRD stage confirmed and feature list needs to be loaded
|
|
11
|
+
- User requests feature specification design or API contract generation
|
|
69
12
|
|
|
70
13
|
## AgentFlow Definition
|
|
71
14
|
|
|
72
15
|
<!-- @agentflow: SKILL.xml -->
|
|
73
16
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
## CONTINUOUS EXECUTION RULES
|
|
77
|
-
|
|
78
|
-
This skill MUST execute tasks continuously without unnecessary interruptions.
|
|
79
|
-
|
|
80
|
-
### FORBIDDEN Interruptions
|
|
81
|
-
|
|
82
|
-
1. DO NOT ask user "Should I continue?" after completing a subtask
|
|
83
|
-
2. DO NOT suggest "Let me split this into batches" or "Let's do this in parts"
|
|
84
|
-
3. DO NOT pause to list what you plan to do next — just do it
|
|
85
|
-
4. DO NOT ask for confirmation before generating output files
|
|
86
|
-
5. DO NOT warn about "large number of files" — proceed with generation
|
|
87
|
-
6. DO NOT offer "Should I proceed with the remaining items?"
|
|
88
|
-
|
|
89
|
-
### When to Pause (ONLY these cases)
|
|
90
|
-
|
|
91
|
-
1. CHECKPOINT gates defined in workflow (user confirmation required by design)
|
|
92
|
-
2. Ambiguous requirements that genuinely need clarification
|
|
93
|
-
3. Unrecoverable errors that prevent further progress
|
|
94
|
-
4. Security-sensitive operations (e.g., deleting existing files)
|
|
95
|
-
|
|
96
|
-
### Worker Enforcement Rules
|
|
97
|
-
|
|
98
|
-
This agent is an **orchestrator/dispatcher**. When multiple Features exist, it MUST delegate all skill execution to `speccrew-task-worker` agents.
|
|
99
|
-
|
|
100
|
-
| Condition | Action | Tool |
|
|
101
|
-
|-----------|--------|------|
|
|
102
|
-
| 1 Feature | Direct skill invocation allowed | Skill tool |
|
|
103
|
-
| 2+ Features | **MUST** dispatch Workers | speccrew-task-worker via Agent tool |
|
|
104
|
-
|
|
105
|
-
### FORBIDDEN Actions (When Features ≥ 2)
|
|
106
|
-
|
|
107
|
-
1. ❌ DO NOT invoke `speccrew-fd-feature-analyze` skill directly
|
|
108
|
-
2. ❌ DO NOT invoke `speccrew-fd-feature-design` skill directly
|
|
109
|
-
3. ❌ DO NOT invoke `speccrew-fd-api-contract` skill directly
|
|
110
|
-
4. ❌ DO NOT generate `.feature-analysis.md` files yourself
|
|
111
|
-
5. ❌ DO NOT generate `.feature-spec.md` files yourself
|
|
112
|
-
6. ❌ DO NOT generate `.api-contract.md` files yourself
|
|
113
|
-
7. ❌ DO NOT create any document content as fallback if worker fails
|
|
114
|
-
|
|
115
|
-
### Name Lock Rule
|
|
116
|
-
|
|
117
|
-
After Phase 2 Feature List is confirmed, feature_name is immutable. All Skills MUST use the exact parameter value for output filenames. Name translation or substitution is FORBIDDEN.
|
|
17
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: speccrew-workspace/docs/rules/agentflow-spec.md
|
|
18
|
+
> Then read and execute the XML workflow in SKILL.xml block-by-block as the authoritative execution plan.
|
|
@@ -3,42 +3,15 @@ name: speccrew-get-timestamp
|
|
|
3
3
|
description: Get current timestamp in various formats for file naming and logging. Use when generating dated filenames, report timestamps, or any scenario requiring consistent datetime formatting.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Trigger Scenarios
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Any Agent or script requiring timestamp generation
|
|
13
|
-
|
|
14
|
-
## Input
|
|
15
|
-
|
|
16
|
-
- `format` (optional): Timestamp format, default is `YYYY-MM-DD-HHmmss`
|
|
17
|
-
- `YYYY-MM-DD-HHmmss`: Full datetime for filenames (e.g., `2026-03-17-132645`)
|
|
18
|
-
- `YYYY-MM-DD`: Date only (e.g., `2026-03-17`)
|
|
19
|
-
- `HHmm`: Time only 24h format (e.g., `1326`)
|
|
20
|
-
- `ISO`: ISO 8601 format (e.g., `2026-03-17T13:26:45+08:00`)
|
|
21
|
-
|
|
22
|
-
## Output
|
|
23
|
-
|
|
24
|
-
- Timestamp string in specified format (printed to stdout)
|
|
25
|
-
|
|
26
|
-
## Supported Formats
|
|
27
|
-
|
|
28
|
-
| Format | Description | Example |
|
|
29
|
-
|--------|-------------|---------|
|
|
30
|
-
| `YYYY-MM-DD-HHmmss` | Full datetime for filenames | `2026-03-17-132645` |
|
|
31
|
-
| `YYYY-MM-DD` | Date only | `2026-03-17` |
|
|
32
|
-
| `HHmm` | Time only (24h) | `1326` |
|
|
33
|
-
| `ISO` | ISO 8601 format | `2026-03-17T13:26:45+08:00` |
|
|
8
|
+
- Any Agent or script requires timestamp generation
|
|
9
|
+
- User requests formatted timestamp for file naming or logging
|
|
10
|
+
- Workflow step needs consistent datetime formatting
|
|
34
11
|
|
|
35
12
|
## AgentFlow Definition
|
|
36
13
|
|
|
37
14
|
<!-- @agentflow: SKILL.xml -->
|
|
38
15
|
|
|
39
|
-
> **REQUIRED**: Before executing this workflow, read the XML workflow specification:
|
|
40
|
-
|
|
41
|
-
## Script Location
|
|
42
|
-
|
|
43
|
-
- **Node.js**: `scripts/get-timestamp.js` (cross-platform, unified implementation)
|
|
44
|
-
|
|
16
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: speccrew-workspace/docs/rules/agentflow-spec.md
|
|
17
|
+
> Then read and execute the XML workflow in SKILL.xml block-by-block as the authoritative execution plan.
|
|
@@ -4,147 +4,12 @@ description: Analyze a single API controller from source code to extract busines
|
|
|
4
4
|
tools: Read, Write, Edit, Glob, Grep, Bash
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
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
|
-
|
|
7
|
+
# Trigger Scenarios
|
|
15
8
|
- "Analyze API controller {fileName} from source code"
|
|
16
9
|
- "Extract API features from controller {fileName}"
|
|
17
10
|
- "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` 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` - 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
11
|
|
|
106
12
|
## AgentFlow Definition
|
|
107
|
-
|
|
108
13
|
<!-- @agentflow: SKILL.xml -->
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
### Mermaid Guide
|
|
113
|
-
|
|
114
|
-
When generating Mermaid diagrams, follow compatibility guidelines:
|
|
115
|
-
- Use `graph TB` or `graph LR` syntax (not `flowchart`)
|
|
116
|
-
- No parentheses `()` in node text
|
|
117
|
-
- No HTML tags like `<br/>`
|
|
118
|
-
- No `style` definitions
|
|
119
|
-
|
|
120
|
-
### Business Flow Guidelines
|
|
121
|
-
|
|
122
|
-
- One diagram per API request
|
|
123
|
-
- Focus on business operations
|
|
124
|
-
- Refer to `templates/FEATURE-DETAIL-TEMPLATE.md`
|
|
125
|
-
|
|
126
|
-
## Constraints
|
|
127
|
-
|
|
128
|
-
1. **DO NOT analyze files outside the specified `${sourcePath}`**
|
|
129
|
-
2. **DO NOT generate separate documents for internal/private methods**
|
|
130
|
-
3. **All content MUST be in the language specified by `${language}`**
|
|
131
|
-
4. **Use `search_replace` for section filling, NEVER rewrite entire document**
|
|
132
|
-
5. **Mermaid diagrams MUST follow the rules in `mermaid-rule.md`**
|
|
133
|
-
6. **All links MUST use relative paths, NEVER `file://` protocol**
|
|
134
|
-
7. **Marker files MUST follow naming convention: `{module}-{subpath}-{fileName}.done.json`**
|
|
135
|
-
8. **fileName in .done.json MUST NOT include file extension**
|
|
136
|
-
9. **ALL paths in JSON MUST be relative, not absolute**
|
|
137
|
-
|
|
138
|
-
## Checklist
|
|
139
|
-
|
|
140
|
-
- [ ] Template file selected based on `${tech_stack}`
|
|
141
|
-
- [ ] Template content read successfully
|
|
142
|
-
- [ ] Controller file read and analyzed
|
|
143
|
-
- [ ] API endpoints extracted with business flows
|
|
144
|
-
- [ ] API consumers found
|
|
145
|
-
- [ ] Template copied to document path
|
|
146
|
-
- [ ] All sections filled using search_replace
|
|
147
|
-
- [ ] All content in target language (`${language}`)
|
|
148
|
-
- [ ] Results reported in JSON format
|
|
149
|
-
- [ ] .done.json marker file written successfully
|
|
150
|
-
- [ ] .graph.json generation dispatched to graph skill
|
|
14
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: speccrew-workspace/docs/rules/agentflow-spec.md
|
|
15
|
+
> Then read and execute the XML workflow in SKILL.xml block-by-block as the authoritative execution plan.
|
|
@@ -4,292 +4,12 @@ description: Constructs knowledge graph data (nodes, edges, relationships) from
|
|
|
4
4
|
tools: Read, Write, Glob, Grep, Bash
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
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
|
-
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
|
-
|
|
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
|
-
|
|
17
|
-
## Trigger Scenarios
|
|
18
|
-
|
|
7
|
+
# Trigger Scenarios
|
|
19
8
|
- "Construct graph data from API analysis results"
|
|
20
9
|
- "Generate knowledge graph nodes and edges for API feature"
|
|
21
10
|
- "Write graph JSON for API controller"
|
|
22
11
|
|
|
23
|
-
## Input Parameters
|
|
24
|
-
|
|
25
|
-
| Parameter | Required | Description | Example |
|
|
26
|
-
|-----------|----------|-------------|---------|
|
|
27
|
-
| `api_analysis_path` | Yes | Path to the API analysis document (from bizs-api-analyze) | `"speccrew-workspace/knowledges/bizs/admin-api/system/user/UserController.md"` |
|
|
28
|
-
| `platform_id` | Yes | Target platform identifier | `"admin-api"`, `"app-api"` |
|
|
29
|
-
| `output_dir` | Yes | Output directory for graph data | `"speccrew-workspace/knowledges/base/sync-state/knowledge-bizs/completed"` |
|
|
30
|
-
| `module` | Yes | Business module name | `"system"`, `"trade"`, `"ai"` |
|
|
31
|
-
| `fileName` | Yes | Controller class name (without extension) | `"UserController"` |
|
|
32
|
-
| `sourcePath` | Yes | Relative path to source file | `"yudao-module-system/.../UserController.java"` |
|
|
33
|
-
| `sourceFile` | Yes | Source features JSON filename | `"features-admin-api.json"` |
|
|
34
|
-
| `language` | Yes | Target language for content | `"zh"`, `"en"` |
|
|
35
|
-
| `subpath` | No | Subpath extracted from sourcePath (for marker naming) | `"controller-admin-user"` |
|
|
36
|
-
|
|
37
|
-
## Output Variables
|
|
38
|
-
|
|
39
|
-
| Variable | Type | Description |
|
|
40
|
-
|----------|------|-------------|
|
|
41
|
-
| `{{status}}` | string | Graph construction status: `"success"` or `"failed"` |
|
|
42
|
-
| `{{graph_file}}` | string | Path to the generated graph JSON file |
|
|
43
|
-
| `{{node_count}}` | integer | Number of nodes generated |
|
|
44
|
-
| `{{edge_count}}` | integer | Number of edges generated |
|
|
45
|
-
|
|
46
|
-
## Execution Requirements
|
|
47
|
-
|
|
48
|
-
This skill operates in **strict sequential execution mode**:
|
|
49
|
-
- Execute steps in exact order (Step 1 → Step 2 → ... → Step 6)
|
|
50
|
-
- Output step status after each step completion
|
|
51
|
-
- Do NOT skip any step
|
|
52
|
-
|
|
53
|
-
## Output
|
|
54
|
-
|
|
55
|
-
**Generated Files:**
|
|
56
|
-
1. `{{output_dir}}/{module}-{subpath}-{fileName}.graph.json` - Graph data with nodes and edges
|
|
57
|
-
2. `{{output_dir}}/{module}-{subpath}-{fileName}.graph-done.json` - Graph completion marker
|
|
58
|
-
|
|
59
|
-
**Return Value:**
|
|
60
|
-
```json
|
|
61
|
-
{
|
|
62
|
-
"status": "success|failed",
|
|
63
|
-
"module": "{{module}}",
|
|
64
|
-
"fileName": "{{fileName}}",
|
|
65
|
-
"graphFile": "{{output_dir}}/{module}-{subpath}-{fileName}.graph.json",
|
|
66
|
-
"nodeCount": 15,
|
|
67
|
-
"edgeCount": 23,
|
|
68
|
-
"message": "Generated graph data with 15 nodes and 23 edges"
|
|
69
|
-
}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
12
|
## AgentFlow Definition
|
|
73
|
-
|
|
74
13
|
<!-- @agentflow: SKILL.xml -->
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
{type}-{module}-{name}
|
|
80
|
-
|
|
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
|
-
|
|
89
|
-
## Marker File Naming Convention
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
{output_dir}/{module}-{subpath}-{fileName}.graph.json
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
**How to Extract Each Component:**
|
|
96
|
-
|
|
97
|
-
1. **module**: Use `{{module}}` input variable directly (e.g., `system`, `trade`, `ai`)
|
|
98
|
-
|
|
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
|
|
104
|
-
|
|
105
|
-
3. **fileName**: Use `{{fileName}}` input variable (class name WITHOUT extension)
|
|
106
|
-
|
|
107
|
-
**Examples:**
|
|
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` |
|
|
114
|
-
|
|
115
|
-
## Node Type Reference
|
|
116
|
-
|
|
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` |
|
|
123
|
-
|
|
124
|
-
## Edge Type Reference
|
|
125
|
-
|
|
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
|
|
135
|
-
|
|
136
|
-
### API Node Example
|
|
137
|
-
```json
|
|
138
|
-
{
|
|
139
|
-
"id": "api-{module}-{endpoint-name}",
|
|
140
|
-
"type": "api",
|
|
141
|
-
"name": "<display name>",
|
|
142
|
-
"module": "{{module}}",
|
|
143
|
-
"sourcePath": "{{sourcePath}}",
|
|
144
|
-
"documentPath": "{{api_analysis_path}}",
|
|
145
|
-
"description": "...",
|
|
146
|
-
"metadata": {
|
|
147
|
-
"method": "GET",
|
|
148
|
-
"path": "/admin-api/system/user/page",
|
|
149
|
-
"permissions": ["system:user:query"]
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### Service Node Example
|
|
155
|
-
```json
|
|
156
|
-
{
|
|
157
|
-
"id": "service-{module}-{service-name}",
|
|
158
|
-
"type": "service",
|
|
159
|
-
"name": "UserService",
|
|
160
|
-
"module": "{{module}}",
|
|
161
|
-
"sourcePath": "relative/path/to/UserService.java",
|
|
162
|
-
"description": "User business logic service",
|
|
163
|
-
"metadata": {
|
|
164
|
-
"methods": ["getUserPage", "createUser", "updateUser"]
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### Table Node Example
|
|
170
|
-
```json
|
|
171
|
-
{
|
|
172
|
-
"id": "table-{module}-{table-name}",
|
|
173
|
-
"type": "table",
|
|
174
|
-
"name": "system_user",
|
|
175
|
-
"module": "{{module}}",
|
|
176
|
-
"sourcePath": "",
|
|
177
|
-
"description": "User table",
|
|
178
|
-
"metadata": {
|
|
179
|
-
"fields": ["id", "username", "password", "status"],
|
|
180
|
-
"indexes": ["idx_username"]
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### DTO Node Example
|
|
186
|
-
```json
|
|
187
|
-
{
|
|
188
|
-
"id": "dto-{module}-{dto-name}",
|
|
189
|
-
"type": "dto",
|
|
190
|
-
"name": "UserCreateReqVO",
|
|
191
|
-
"module": "{{module}}",
|
|
192
|
-
"sourcePath": "relative/path/to/UserCreateReqVO.java",
|
|
193
|
-
"description": "Create user request DTO",
|
|
194
|
-
"metadata": {
|
|
195
|
-
"fields": ["username", "password", "nickname"],
|
|
196
|
-
"validation": ["@NotBlank username", "@Size(max=50) nickname"]
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
## Edge Structure Examples
|
|
202
|
-
|
|
203
|
-
### API to Table Edge (operates)
|
|
204
|
-
```json
|
|
205
|
-
{
|
|
206
|
-
"source": "api-system-user-list",
|
|
207
|
-
"target": "table-system-system_user",
|
|
208
|
-
"type": "operates",
|
|
209
|
-
"metadata": {
|
|
210
|
-
"operation": "SELECT",
|
|
211
|
-
"description": "Query user list with pagination"
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
### API to Service Edge (invokes)
|
|
217
|
-
```json
|
|
218
|
-
{
|
|
219
|
-
"source": "api-system-user-create",
|
|
220
|
-
"target": "service-system-user-service",
|
|
221
|
-
"type": "invokes",
|
|
222
|
-
"metadata": {
|
|
223
|
-
"method": "createUser",
|
|
224
|
-
"description": "Create user business logic"
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
### API to DTO Edge (references)
|
|
230
|
-
```json
|
|
231
|
-
{
|
|
232
|
-
"source": "api-system-user-create",
|
|
233
|
-
"target": "dto-system-user-create-req",
|
|
234
|
-
"type": "references",
|
|
235
|
-
"metadata": {
|
|
236
|
-
"usage": "request",
|
|
237
|
-
"description": "Create user request body"
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
### Service to Service Edge (depends-on)
|
|
243
|
-
```json
|
|
244
|
-
{
|
|
245
|
-
"source": "service-system-user-service",
|
|
246
|
-
"target": "service-system-permission-service",
|
|
247
|
-
"type": "depends-on",
|
|
248
|
-
"metadata": {
|
|
249
|
-
"description": "User service depends on permission service for role checks"
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
### DTO to Table Edge (maps-to)
|
|
255
|
-
```json
|
|
256
|
-
{
|
|
257
|
-
"source": "dto-system-user-do",
|
|
258
|
-
"target": "table-system-system_user",
|
|
259
|
-
"type": "maps-to",
|
|
260
|
-
"metadata": {
|
|
261
|
-
"description": "UserDO maps to system_user table"
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
## Pre-write Verification Checklist
|
|
267
|
-
|
|
268
|
-
### Graph JSON Verification:
|
|
269
|
-
- [ ] Root-level `module` field is present (MANDATORY)
|
|
270
|
-
- [ ] `nodes` and `edges` are arrays (can be empty)
|
|
271
|
-
- [ ] Valid JSON (no trailing commas, all strings quoted)
|
|
272
|
-
- [ ] All node IDs are unique
|
|
273
|
-
- [ ] All edge source/target references point to valid node IDs
|
|
274
|
-
|
|
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
|
|
281
|
-
|
|
282
|
-
### Completion Marker Verification:
|
|
283
|
-
- [ ] Filename follows `{module}-{subpath}-{fileName}.graph-done.json` pattern
|
|
284
|
-
- [ ] JSON is valid
|
|
285
|
-
- [ ] All required fields are present
|
|
286
|
-
- [ ] `nodeCount` and `edgeCount` match actual graph data
|
|
287
|
-
|
|
288
|
-
## Constraints
|
|
289
|
-
|
|
290
|
-
1. **Single Document Input**: This skill processes ONE API analysis document at a time
|
|
291
|
-
2. **JSON Format**: All output files MUST be valid JSON
|
|
292
|
-
3. **Module Field**: The root-level `module` field is MANDATORY in graph JSON
|
|
293
|
-
4. **Node Uniqueness**: Each node ID must be unique within the graph
|
|
294
|
-
5. **Edge Validity**: Edge source/target must reference existing node IDs
|
|
295
|
-
6. **Path Format**: Use relative paths, NEVER absolute paths in JSON content
|
|
14
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: speccrew-workspace/docs/rules/agentflow-spec.md
|
|
15
|
+
> Then read and execute the XML workflow in SKILL.xml block-by-block as the authoritative execution plan.
|