speccrew 0.1.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.
- package/.speccrew/agents/speccrew-feature-designer.md +142 -0
- package/.speccrew/agents/speccrew-product-manager.md +61 -0
- package/.speccrew/agents/speccrew-system-designer.md +200 -0
- package/.speccrew/agents/speccrew-system-developer.md +238 -0
- package/.speccrew/agents/speccrew-task-worker.md +80 -0
- package/.speccrew/agents/speccrew-team-leader.md +92 -0
- package/.speccrew/agents/speccrew-test-manager.md +313 -0
- package/.speccrew/skills/speccrew-create-agents/SKILL.md +98 -0
- package/.speccrew/skills/speccrew-create-agents/templates/agents/designer-agent.md +54 -0
- package/.speccrew/skills/speccrew-create-agents/templates/agents/dev-agent.md +79 -0
- package/.speccrew/skills/speccrew-create-agents/templates/agents/test-agent.md +80 -0
- package/.speccrew/skills/speccrew-dev-backend/SKILL.md +205 -0
- package/.speccrew/skills/speccrew-dev-backend/templates/TASK-RECORD-TEMPLATE.md +118 -0
- package/.speccrew/skills/speccrew-dev-desktop/SKILL.md +258 -0
- package/.speccrew/skills/speccrew-dev-desktop/templates/TASK-RECORD-TEMPLATE.md +161 -0
- package/.speccrew/skills/speccrew-dev-frontend/SKILL.md +202 -0
- package/.speccrew/skills/speccrew-dev-frontend/templates/TASK-RECORD-TEMPLATE.md +115 -0
- package/.speccrew/skills/speccrew-dev-mobile/SKILL.md +200 -0
- package/.speccrew/skills/speccrew-dev-mobile/templates/TASK-RECORD-TEMPLATE.md +125 -0
- package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +73 -0
- package/.speccrew/skills/speccrew-fd-api-contract/templates/API-CONTRACT-TEMPLATE.md +96 -0
- package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +395 -0
- package/.speccrew/skills/speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md +387 -0
- package/.speccrew/skills/speccrew-get-timestamp/SKILL.md +80 -0
- package/.speccrew/skills/speccrew-get-timestamp/scripts/get-timestamp.js +35 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +1116 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-FASTAPI.md +462 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-JAVA.md +480 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-NET.md +464 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE.md +480 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/MODULE-OVERVIEW-TEMPLATE.md +367 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +667 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/STATUS-FORMATS.md +74 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/batch-orchestrator.js +176 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-next-batch.js +150 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-pending-features.js +106 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/mark-stale.js +249 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/process-batch-results.js +848 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/update-feature-status.js +226 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/SKILL.md +264 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/examples/features.json +34 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js +867 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/test-inventory.js +26 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/SKILL.md +165 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/apply-module-mapping.js +208 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/extract-module-summary.js +180 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/reindex-modules.js +358 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +1055 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-DESKTOP.md +303 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-ELECTRON.md +327 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MINIAPP.md +292 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MOBILE.md +281 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI.md +324 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/SKILL.md +270 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/COMPONENT-PATTERN-TEMPLATE.md +33 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/LAYOUT-PATTERN-TEMPLATE.md +33 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/PAGE-TYPE-TEMPLATE.md +33 -0
- package/.speccrew/skills/speccrew-knowledge-graph-query/SKILL.md +229 -0
- package/.speccrew/skills/speccrew-knowledge-graph-query/scripts/graph-query.js +549 -0
- package/.speccrew/skills/speccrew-knowledge-graph-write/SKILL.md +181 -0
- package/.speccrew/skills/speccrew-knowledge-graph-write/scripts/graph-write.js +651 -0
- package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +305 -0
- package/.speccrew/skills/speccrew-knowledge-module-summarize/templates/MODULE-OVERVIEW-TEMPLATE.md +400 -0
- package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +351 -0
- package/.speccrew/skills/speccrew-knowledge-system-summarize/templates/SYSTEM-OVERVIEW-TEMPLATE.md +294 -0
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +683 -0
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/STATUS-FORMATS.md +550 -0
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/templates/techs-manifest-EXAMPLE.json +35 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +1087 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/ARCHITECTURE-TEMPLATE.md +240 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COLOR-SYSTEM-TEMPLATE.md +68 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COMPONENT-LIBRARY-TEMPLATE.md +86 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-BUILD-TEMPLATE.md +466 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DATA-TEMPLATE.md +432 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DESIGN-TEMPLATE.md +1209 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DEV-TEMPLATE.md +1433 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-SYSTEM-TEST-TEMPLATE.md +1052 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-UNIT-TEST-TEMPLATE.md +946 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/INDEX-TEMPLATE.md +29 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-LAYOUTS-TEMPLATE.md +69 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +74 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/TECH-STACK-TEMPLATE.md +232 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +628 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +392 -0
- package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +489 -0
- package/.speccrew/skills/speccrew-knowledge-techs-index/templates/INDEX-TEMPLATE.md +243 -0
- package/.speccrew/skills/speccrew-knowledge-techs-init/SKILL.md +269 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +562 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/BUSINESS-COMPONENTS-TEMPLATE.md +171 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMMON-COMPONENTS-TEMPLATE.md +177 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-INDIVIDUAL-TEMPLATE.md +80 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-LIBRARY-TEMPLATE.md +118 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-INDIVIDUAL-TEMPLATE.md +97 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-PATTERNS-TEMPLATE.md +208 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/NAVIGATION-PATTERNS-TEMPLATE.md +157 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-INDIVIDUAL-TEMPLATE.md +123 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +58 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/SPACING-TEMPLATE.md +119 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/STYLE-SYSTEM-TEMPLATE.md +117 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/TYPOGRAPHY-TEMPLATE.md +107 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/UI-STYLE-GUIDE-TEMPLATE.md +171 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +434 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/BIZS-MODELING-TEMPLATE.md +332 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/PRD-TEMPLATE.md +200 -0
- package/.speccrew/skills/speccrew-pm-requirement-assess/SKILL.md +195 -0
- package/.speccrew/skills/speccrew-project-diagnosis/SKILL.md +208 -0
- package/.speccrew/skills/speccrew-project-diagnosis/templates/DIAGNOSIS-REPORT-TEMPLATE.md +202 -0
- package/.speccrew/skills/speccrew-sd-backend/SKILL.md +188 -0
- package/.speccrew/skills/speccrew-sd-backend/templates/INDEX-TEMPLATE.md +85 -0
- package/.speccrew/skills/speccrew-sd-backend/templates/SD-BACKEND-TEMPLATE.md +269 -0
- package/.speccrew/skills/speccrew-sd-desktop/SKILL.md +192 -0
- package/.speccrew/skills/speccrew-sd-desktop/templates/INDEX-TEMPLATE.md +271 -0
- package/.speccrew/skills/speccrew-sd-desktop/templates/SD-DESKTOP-TEMPLATE.md +673 -0
- package/.speccrew/skills/speccrew-sd-frontend/SKILL.md +176 -0
- package/.speccrew/skills/speccrew-sd-frontend/templates/INDEX-TEMPLATE.md +184 -0
- package/.speccrew/skills/speccrew-sd-frontend/templates/SD-FRONTEND-TEMPLATE.md +382 -0
- package/.speccrew/skills/speccrew-sd-mobile/SKILL.md +189 -0
- package/.speccrew/skills/speccrew-sd-mobile/templates/INDEX-TEMPLATE.md +219 -0
- package/.speccrew/skills/speccrew-sd-mobile/templates/SD-MOBILE-TEMPLATE.md +534 -0
- package/.speccrew/skills/speccrew-test-case-design/SKILL.md +284 -0
- package/.speccrew/skills/speccrew-test-case-design/templates/TEST-CASE-DESIGN-TEMPLATE.md +263 -0
- package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +313 -0
- package/.speccrew/skills/speccrew-test-code-gen/templates/TEST-CODE-PLAN-TEMPLATE.md +180 -0
- package/.speccrew/skills/speccrew-test-execute/SKILL.md +283 -0
- package/.speccrew/skills/speccrew-test-execute/templates/BUG-REPORT-TEMPLATE.md +50 -0
- package/.speccrew/skills/speccrew-test-execute/templates/TEST-REPORT-TEMPLATE.md +57 -0
- package/.speccrew/skills/speccrew-workflow-diagnose/SKILL.md +155 -0
- package/LICENSE +21 -0
- package/README.ar.md +318 -0
- package/README.en.md +318 -0
- package/README.es.md +318 -0
- package/README.md +340 -0
- package/bin/cli.js +62 -0
- package/lib/commands/doctor.js +138 -0
- package/lib/commands/init.js +231 -0
- package/lib/commands/list.js +114 -0
- package/lib/commands/uninstall.js +117 -0
- package/lib/commands/update.js +351 -0
- package/lib/ide-adapters.js +73 -0
- package/lib/utils.js +104 -0
- package/package.json +28 -0
- package/workspace-template/docs/configs/document-templates.json +667 -0
- package/workspace-template/docs/configs/platform-mapping.json +194 -0
- package/workspace-template/docs/configs/tech-stack-mappings.json +313 -0
- package/workspace-template/docs/configs/validation-rules.json +87 -0
- package/workspace-template/docs/rules/mermaid-rule.md +114 -0
- package/workspace-template/docs/solutions/Agent/346/212/200/350/203/275/345/256/232/344/271/211+/351/234/200/346/261/202/346/226/207/346/241/243+UML/344/275/277/347/224/250/346/250/241/346/235/277/357/274/210ISA-95/345/205/255/346/256/265/345/274/217/350/236/215/345/220/210/347/211/210/357/274/211.md +586 -0
- package/workspace-template/docs/solutions/agent-knowledge-map.md +238 -0
- package/workspace-template/docs/solutions/bizs-knowledge-pipeline.md +678 -0
- package/workspace-template/docs/solutions/harness.md +410 -0
- package/workspace-template/docs/solutions/knowledge-incremental-sync-spec.md +943 -0
- package/workspace-template/docs/solutions/techs-knowledge-pipeline.md +803 -0
- package/workspace-template/docs/solutions/workspace-structure.md +318 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: speccrew-knowledge-module-summarize
|
|
3
|
+
description: Summarize a module's features to complete MODULE-OVERVIEW.md. Reads all FEATURE-DETAIL.md files of a module and generates the complete module overview with entities, dependencies, and business rules.
|
|
4
|
+
tools: Read, Write, Glob
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Module Summarize - Complete Module Overview
|
|
8
|
+
|
|
9
|
+
Read all {{feature_name}}.md files of a specific module, extract and summarize information to complete {{module_name}}-overview.md (full version with entities, dependencies, flows, and rules).
|
|
10
|
+
|
|
11
|
+
## Language Adaptation
|
|
12
|
+
|
|
13
|
+
**CRITICAL**: Generate all content in the language specified by the `language` parameter.
|
|
14
|
+
|
|
15
|
+
- `language: "zh"` → Generate all content in 中文
|
|
16
|
+
- `language: "en"` → Generate all content in English
|
|
17
|
+
- Other languages → Use the specified language
|
|
18
|
+
|
|
19
|
+
**All output content (entity names, descriptions, business rules, flow descriptions) must be in the target language only.**
|
|
20
|
+
|
|
21
|
+
## Trigger Scenarios
|
|
22
|
+
|
|
23
|
+
- "Summarize module {name} features"
|
|
24
|
+
- "Complete module overview for {name}"
|
|
25
|
+
- "Finalize module documentation for {name}"
|
|
26
|
+
|
|
27
|
+
## Input
|
|
28
|
+
|
|
29
|
+
- `module_name`: Module name to summarize
|
|
30
|
+
- `module_path`: Path to module directory (e.g., `speccrew-workspace/knowledges/bizs/{{platform_type}}/{{module_name}}/`) containing:
|
|
31
|
+
- {{module_name}}-overview.md (initial version)
|
|
32
|
+
- features/{{feature_name}}.md files
|
|
33
|
+
- `language`: Target language for generated content (e.g., "zh", "en") - **REQUIRED**
|
|
34
|
+
|
|
35
|
+
## Output
|
|
36
|
+
|
|
37
|
+
- `{{module_path}}/{{module_name}}-overview.md` - Complete module overview (overwritten)
|
|
38
|
+
|
|
39
|
+
## Workflow
|
|
40
|
+
|
|
41
|
+
```mermaid
|
|
42
|
+
flowchart TD
|
|
43
|
+
Start([Start]) --> Step1[Step 1: Read Prerequisites]
|
|
44
|
+
Step1 --> Step2[Step 2: Extract Entities]
|
|
45
|
+
Step2 --> Step3[Step 3: Identify Dependencies]
|
|
46
|
+
Step3 --> Step4[Step 4: Summarize Business Rules]
|
|
47
|
+
Step4 --> Step5[Step 5: Generate Complete MODULE-OVERVIEW.md]
|
|
48
|
+
Step5 --> Step6[Step 6: Report Results]
|
|
49
|
+
Step6 --> End([End])
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Step 1: Read Prerequisites
|
|
53
|
+
|
|
54
|
+
Before processing, read all required files:
|
|
55
|
+
|
|
56
|
+
1. **Read Template**: `templates/MODULE-OVERVIEW-TEMPLATE.md` - Understand the required content structure and section formats
|
|
57
|
+
|
|
58
|
+
2. **Read Initial Module Overview**: `{{module_path}}/{{module_name}}-overview.md` (initial skeleton created by dispatch) containing:
|
|
59
|
+
- Section 1: Module Basic Information
|
|
60
|
+
- Section 2: Feature List Table with links to detail docs
|
|
61
|
+
- Remaining sections: Empty placeholders
|
|
62
|
+
- **If missing**: Create a minimal skeleton from feature inventory data
|
|
63
|
+
|
|
64
|
+
3. **Read All Feature Details**: Find and read all `{{module_path}}/features/{{feature_name}}.md` files
|
|
65
|
+
|
|
66
|
+
**Edge Cases**:
|
|
67
|
+
- **No feature documents found**: Generate a minimal overview with only Section 1-2, return with `status: "partial"`
|
|
68
|
+
- **Incomplete feature documents**: Extract available data, note gaps with `<!-- DATA INCOMPLETE: {feature_name} missing Section X -->`
|
|
69
|
+
|
|
70
|
+
For each feature-detail.md, extract and categorize the following:
|
|
71
|
+
|
|
72
|
+
**From Section 3 (Business Entities / State Objects)** — Priority: High
|
|
73
|
+
- **Backend modules**: Entity names, database fields, types, relationships, ORM constraints
|
|
74
|
+
- **Frontend modules**: State objects (Store/State), component prop interfaces, computed/derived data
|
|
75
|
+
- Aggregate across features to build module-level entity list (deduplicate by entity name)
|
|
76
|
+
|
|
77
|
+
**From Section 4 (Dependencies)** — Priority: High
|
|
78
|
+
- **Backend**: Internal module API calls, external service dependencies, shared DTOs
|
|
79
|
+
- **Frontend**: Component imports, Store/State dependencies, route guard dependencies, shared composables/hooks
|
|
80
|
+
- Classify as: "Provided by this module" vs "Consumed from other modules"
|
|
81
|
+
|
|
82
|
+
**From Section 6 (Business Rules)** — Priority: High
|
|
83
|
+
- Validation rules, state transitions, authorization rules, data consistency constraints
|
|
84
|
+
- Associate each rule with its originating feature
|
|
85
|
+
|
|
86
|
+
**From Section 5 (Core Processes)** — Priority: Medium
|
|
87
|
+
- Step sequences, branching logic, exception handling paths
|
|
88
|
+
- Identify cross-feature flows that span multiple features
|
|
89
|
+
|
|
90
|
+
**From Section 2 (Feature Details / API Definitions)** — Priority: Medium
|
|
91
|
+
- Data constraints: field types, ranges, uniqueness, required fields
|
|
92
|
+
- Build constraint matrix for entities
|
|
93
|
+
|
|
94
|
+
### Step 2: Extract Entities
|
|
95
|
+
|
|
96
|
+
Aggregate entities from all features:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
From Feature A: Order, OrderItem
|
|
100
|
+
From Feature B: Order, Payment
|
|
101
|
+
---------------------------------
|
|
102
|
+
Module Entities: Order, OrderItem, Payment
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
For each entity, collect:
|
|
106
|
+
- Fields and types
|
|
107
|
+
- Validation constraints
|
|
108
|
+
- Relationships (from multiple features)
|
|
109
|
+
|
|
110
|
+
### Step 3: Identify Dependencies
|
|
111
|
+
|
|
112
|
+
Analyze feature details to identify:
|
|
113
|
+
- **Internal dependencies**: Other modules this module calls
|
|
114
|
+
- **External dependencies**: Third-party services, APIs
|
|
115
|
+
- **Data dependencies**: Shared entities, common DTOs
|
|
116
|
+
|
|
117
|
+
### Step 4: Summarize Business Rules
|
|
118
|
+
|
|
119
|
+
Collect all business rules from feature details:
|
|
120
|
+
- Validation rules
|
|
121
|
+
- State transition rules
|
|
122
|
+
- Authorization rules
|
|
123
|
+
- Data consistency rules
|
|
124
|
+
|
|
125
|
+
### Step 5: Generate Complete MODULE-OVERVIEW.md
|
|
126
|
+
|
|
127
|
+
**IMPORTANT**: ALL generated content (entity descriptions, business rules, flow descriptions, section headers, and narrative text) MUST be written in the language specified by the `language` parameter. Only code identifiers, file paths, and technical terms (class names, API endpoints) remain in their original language.
|
|
128
|
+
|
|
129
|
+
1. **Read Configuration**:
|
|
130
|
+
- Read `speccrew-workspace/docs/rules/mermaid-rule.md` - Get Mermaid diagram compatibility guidelines
|
|
131
|
+
|
|
132
|
+
2. **Use template `templates/MODULE-OVERVIEW-TEMPLATE.md`, fill all sections**:
|
|
133
|
+
- Follow [Mermaid Diagram Guide](#mermaid-diagram-guide) for diagram generation
|
|
134
|
+
|
|
135
|
+
**Section 1: Module Basic Info** (from initial version)
|
|
136
|
+
- Keep existing information
|
|
137
|
+
|
|
138
|
+
**Section 2: Feature List** (from initial version)
|
|
139
|
+
- Keep feature list table
|
|
140
|
+
- Ensure all links to {{feature_name}}.md are correct
|
|
141
|
+
|
|
142
|
+
**Section 3: Business Entities** (NEW)
|
|
143
|
+
|
|
144
|
+
**Backend example:**
|
|
145
|
+
| Entity Name | Description | Key Attributes | Business Rules |
|
|
146
|
+
|---|---|---|---|
|
|
147
|
+
| Order | Order master data | id, orderNo, amount, status | Status flow constraint |
|
|
148
|
+
|
|
149
|
+
**Frontend example:**
|
|
150
|
+
| Entity Name | Description | Key Attributes | Business Rules |
|
|
151
|
+
|---|---|---|---|
|
|
152
|
+
| OrderState | Order list view state | orders[], selectedOrder, loading, error | loading prevents re-fetch |
|
|
153
|
+
| OrderFormProps | Order form component interface | order: Order, editable: boolean, onSave: Function | order required |
|
|
154
|
+
|
|
155
|
+
Include ER diagram based on entity relationships.
|
|
156
|
+
|
|
157
|
+
**Section 4: Dependencies** (NEW)
|
|
158
|
+
|
|
159
|
+
**Backend example:**
|
|
160
|
+
| Direction | Target | Content | Method |
|
|
161
|
+
|---|---|---|---|
|
|
162
|
+
| Uses | UserService | Get user info | API call |
|
|
163
|
+
|
|
164
|
+
**Frontend example:**
|
|
165
|
+
| Direction | Target | Content | Method |
|
|
166
|
+
|---|---|---|---|
|
|
167
|
+
| Imports | UserStore | Get user state | Store injection |
|
|
168
|
+
| Imports | UserCard | Display user info | Component import |
|
|
169
|
+
|
|
170
|
+
**Section 5: Core Business Flows** (NEW)
|
|
171
|
+
|
|
172
|
+
Based on feature interactions, identify core flows:
|
|
173
|
+
|
|
174
|
+
**Backend example:**
|
|
175
|
+
Create Order: Validate params → Calculate amount → Save to DB → Notify downstream
|
|
176
|
+
|
|
177
|
+
**Frontend example:**
|
|
178
|
+
Order List: Load data → Display list → User selects → Load detail → Display detail → Edit → Submit → Update state
|
|
179
|
+
|
|
180
|
+
**Section 6: Business Rules** (NEW)
|
|
181
|
+
|
|
182
|
+
| Rule ID | Rule Name | Description | Related Features |
|
|
183
|
+
|---------|-----------|-------------|------------------|
|
|
184
|
+
| R001 | Order amount > 0 | Order total must be positive | create-order |
|
|
185
|
+
| R002 | Stock check | Must check inventory before order | create-order |
|
|
186
|
+
|
|
187
|
+
Apply source traceability rules (see [Reference Guides > Source Traceability Guide](#source-traceability-guide))
|
|
188
|
+
|
|
189
|
+
### Step 6: Report Results
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
Module summarization completed:
|
|
193
|
+
- Module: {{module_name}}
|
|
194
|
+
- Features Processed: {{feature_count}}
|
|
195
|
+
- Entities Extracted: {{entity_count}}
|
|
196
|
+
- Dependencies Identified: {{dependency_count}}
|
|
197
|
+
- Business Rules Summarized: {{rule_count}}
|
|
198
|
+
- Output: {{module_name}}-overview.md (complete)
|
|
199
|
+
- Status: success
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Reference Guides
|
|
203
|
+
|
|
204
|
+
### Mermaid Diagram Guide
|
|
205
|
+
|
|
206
|
+
When generating Mermaid diagrams, follow these compatibility guidelines:
|
|
207
|
+
|
|
208
|
+
**Key Requirements:**
|
|
209
|
+
- Use only basic node definitions: `A[text content]`
|
|
210
|
+
- No HTML tags (e.g., `<br/>`)
|
|
211
|
+
- No nested subgraphs
|
|
212
|
+
- No `direction` keyword
|
|
213
|
+
- No `style` definitions
|
|
214
|
+
- Use standard `graph TB/LR` syntax only
|
|
215
|
+
|
|
216
|
+
**Diagram Types:**
|
|
217
|
+
|
|
218
|
+
| Diagram Type | Use Case | Example |
|
|
219
|
+
|---------|---------|------|
|
|
220
|
+
| `graph TB/LR` | Module structure, dependencies | Project structure diagram, dependency graph |
|
|
221
|
+
| `sequenceDiagram` | Interaction flow, API calls | User operation flow, service call chain |
|
|
222
|
+
| `flowchart TD` | Business logic, conditional branches | State transition, exception handling |
|
|
223
|
+
| `classDiagram` | Class structure, entity relationships | Data model, service interface |
|
|
224
|
+
| `erDiagram` | Database table relationships | Entity relationship diagram |
|
|
225
|
+
| `stateDiagram-v2` | State machine | Order status, approval status |
|
|
226
|
+
|
|
227
|
+
### Source Traceability Guide
|
|
228
|
+
|
|
229
|
+
Aggregate source file references from all feature documents:
|
|
230
|
+
|
|
231
|
+
> **Note**: Use relative paths from the generated document to the source file. Do NOT use `file://` protocol.
|
|
232
|
+
|
|
233
|
+
**CRITICAL: Dynamic Relative Path Calculation**
|
|
234
|
+
|
|
235
|
+
The document generation location is `speccrew-workspace/knowledges/bizs/{platform_id}/{module_path}/{file}.md`, which has a **variable depth** from the project root. You MUST dynamically calculate the relative path depth based on the actual document location.
|
|
236
|
+
|
|
237
|
+
**Calculation Method:**
|
|
238
|
+
1. Count the number of directory separators (`/`) from the project root to the document's directory
|
|
239
|
+
2. Each directory level requires one `../` to traverse up to the project root
|
|
240
|
+
3. Example: Document at `speccrew-workspace/knowledges/bizs/backend-ai/chat/overview.md` (5 levels) → Use `../../../../../src/...`
|
|
241
|
+
|
|
242
|
+
**Common Path Depths Reference:**
|
|
243
|
+
| Document Location | Depth | Relative Path Prefix |
|
|
244
|
+
|---|---|---|
|
|
245
|
+
| `speccrew-workspace/knowledges/bizs/{platform}/{module}/` | 5+ | `../../../../../` |
|
|
246
|
+
| `speccrew-workspace/knowledges/bizs/{platform}/{module}/{sub}/` | 6+ | `../../../../../../` |
|
|
247
|
+
|
|
248
|
+
**Source reference examples by tech stack (assuming document at depth 5):**
|
|
249
|
+
|
|
250
|
+
Backend (Java): `[OrderController.java](../../../../../src/main/java/.../OrderController.java#L10-L25)`
|
|
251
|
+
Backend (Python): `[views.py](../../../../../app/order/views.py#L10-L25)`
|
|
252
|
+
Backend (Node.js): `[orderController.js](../../../../../src/modules/order/orderController.js#L10-L25)`
|
|
253
|
+
Frontend (Vue): `[OrderList.vue](../../../../../src/views/order/OrderList.vue#L10-L25)`
|
|
254
|
+
Frontend (React): `[OrderDetail.tsx](../../../../../src/pages/order/OrderDetail.tsx#L10-L25)`
|
|
255
|
+
|
|
256
|
+
1. **File Reference Block** (at document start):
|
|
257
|
+
```markdown
|
|
258
|
+
<cite>
|
|
259
|
+
**Referenced Files**
|
|
260
|
+
- [OrderController.*](path/to/source/OrderController.*)
|
|
261
|
+
- [OrderService.*](path/to/source/OrderService.*)
|
|
262
|
+
</cite>
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
2. **Diagram Source** (after each Mermaid diagram):
|
|
266
|
+
```markdown
|
|
267
|
+
**Diagram Source**
|
|
268
|
+
- [OrderController.*](path/to/source/OrderController.*#L45-L60)
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
3. **Section Source** (at end of document):
|
|
272
|
+
```markdown
|
|
273
|
+
**Section Source**
|
|
274
|
+
- [OrderController.*](path/to/source/OrderController.*#L1-L100)
|
|
275
|
+
- [OrderService.*](path/to/source/OrderService.*#L1-L80)
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
## Notes
|
|
279
|
+
|
|
280
|
+
> **Note**: This skill focuses on document aggregation only. Knowledge graph data (nodes, edges) is handled separately by the dispatch skill's `process-batch-results.js` script during Stage 2. Module-summarize does NOT read from or write to the knowledge graph.
|
|
281
|
+
|
|
282
|
+
## Return
|
|
283
|
+
|
|
284
|
+
**Return Value (JSON format):**
|
|
285
|
+
|
|
286
|
+
```json
|
|
287
|
+
{
|
|
288
|
+
"status": "success|failed",
|
|
289
|
+
"module_name": "module_name",
|
|
290
|
+
"output_file": "module_name-overview.md",
|
|
291
|
+
"message": "Module summarization completed with N features processed"
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Checklist
|
|
298
|
+
|
|
299
|
+
- [ ] Step 1: Prerequisites read (template, initial overview, feature details)
|
|
300
|
+
- [ ] Step 2: Entities extracted and aggregated
|
|
301
|
+
- [ ] Step 3: Dependencies identified
|
|
302
|
+
- [ ] Step 4: Business rules collected
|
|
303
|
+
- [ ] Step 5: Section 3-6 completed in {{module_name}}-overview.md
|
|
304
|
+
- [ ] Step 6: Results reported
|
|
305
|
+
|
package/.speccrew/skills/speccrew-knowledge-module-summarize/templates/MODULE-OVERVIEW-TEMPLATE.md
ADDED
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
# Module Overview Document - [Module Name]
|
|
2
|
+
|
|
3
|
+
> **Applicable Scenario**: Describes a single business module's responsibility boundaries, feature list, entity relationships, and external dependencies, for AI Agent to understand module details
|
|
4
|
+
> **Target Audience**: devcrew-product-manager, devcrew-solution-manager, devcrew-developer
|
|
5
|
+
> **Related Document**: [System Overview Document](../system-overview.md)
|
|
6
|
+
>
|
|
7
|
+
> <!-- AI-TAG: MODULE_OVERVIEW -->
|
|
8
|
+
> <!-- AI-CONTEXT: Read this document to understand module responsibilities, feature list, entity relationships, and dependency interfaces, used for requirement analysis and solution design -->
|
|
9
|
+
|
|
10
|
+
<cite>
|
|
11
|
+
**Referenced Files**
|
|
12
|
+
<!-- Path Note: {relativePath} must be dynamically calculated based on document depth. See SKILL.md "Source Traceability Guide" for calculation method. -->
|
|
13
|
+
- [{EntryPoint}]({relativePath}/{sourcePath}/{entryPointFile}) <!-- Backend: Controller/View/Router; Frontend: Page/View component -->
|
|
14
|
+
- [{BusinessLogic}]({relativePath}/{sourcePath}/{businessLogicFile}) <!-- Backend: Service; Frontend: Store/Composable/Hook -->
|
|
15
|
+
- [{DataModel}]({relativePath}/{sourcePath}/{dataModelFile}) <!-- Backend: Entity/Model; Frontend: Type/Interface definition -->
|
|
16
|
+
</cite>
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 1. Module Basic Information
|
|
21
|
+
|
|
22
|
+
### 1.1 Module Positioning
|
|
23
|
+
|
|
24
|
+
| Item | Description |
|
|
25
|
+
|------|-------------|
|
|
26
|
+
| Module Name | {Fill in module name} |
|
|
27
|
+
| Business Domain | {e.g., Sales Domain, Inventory Domain} |
|
|
28
|
+
| Module Responsibility | {One sentence describing core module responsibility} |
|
|
29
|
+
| Business Value | {What business problem it solves, what value it brings} |
|
|
30
|
+
|
|
31
|
+
### 1.2 Module Boundary
|
|
32
|
+
|
|
33
|
+
<!-- AI-TAG: MODULE_BOUNDARY -->
|
|
34
|
+
<!-- AI-NOTE: Module boundaries help AI understand responsibility scope, avoiding scope creep during requirement analysis -->
|
|
35
|
+
|
|
36
|
+
```mermaid
|
|
37
|
+
graph TB
|
|
38
|
+
subgraph ThisModule["{Module Name}"]
|
|
39
|
+
subgraph Responsible["Responsible"]
|
|
40
|
+
R1[Responsibility 1: Order lifecycle management]
|
|
41
|
+
R2[Responsibility 2: Order status flow control]
|
|
42
|
+
R3[Responsibility 3: Order data statistics]
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
subgraph External["External Modules"]
|
|
47
|
+
subgraph DependsOn["This Module Depends On"]
|
|
48
|
+
D1[Module X: Get user data]
|
|
49
|
+
D2[Module Y: Get product data]
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
subgraph DependedBy["Depend On This Module"]
|
|
53
|
+
U1[Module Z: Use order data]
|
|
54
|
+
U2[Module W: Receive status notification]
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
subgraph NotResponsible["Not Responsible"]
|
|
58
|
+
NR1[Payment Processing: Payment Module]
|
|
59
|
+
NR2[Logistics Tracking: Logistics Module]
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
ThisModule -.-> D1
|
|
64
|
+
ThisModule -.-> D2
|
|
65
|
+
U1 -.-> ThisModule
|
|
66
|
+
U2 -.-> ThisModule
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Diagram Source**
|
|
70
|
+
- [{Module} Entry Point]({relativePath}/{sourcePath}/{moduleEntryFile})
|
|
71
|
+
|
|
72
|
+
**Boundary Description:**
|
|
73
|
+
| Type | Content | Description |
|
|
74
|
+
|------|---------|-------------|
|
|
75
|
+
| **Responsible** | {Responsibility 1, Responsibility 2, Responsibility 3} | Core responsibilities of this module |
|
|
76
|
+
| **Depends On** | {Module X, Module Y} | External modules called by this module |
|
|
77
|
+
| **Depended By** | {Module Z, Module W} | External modules that call this module |
|
|
78
|
+
| **Not Responsible** | {Payment Processing, Logistics Tracking} | Explicitly out of this module's scope |
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 2. Feature List
|
|
83
|
+
|
|
84
|
+
### 2.1 Feature Tree
|
|
85
|
+
|
|
86
|
+
<!-- AI-TAG: FEATURE_TREE -->
|
|
87
|
+
<!-- AI-NOTE: Feature tree helps AI understand module feature structure, used for requirement matching and scope judgment -->
|
|
88
|
+
|
|
89
|
+
```mermaid
|
|
90
|
+
mindmap
|
|
91
|
+
root(([{Module Name}]))
|
|
92
|
+
Feature Group A
|
|
93
|
+
Feature A1 ✅
|
|
94
|
+
Feature A2 ✅
|
|
95
|
+
Feature A3 🚧
|
|
96
|
+
Feature A4 ⏳
|
|
97
|
+
Feature Group B
|
|
98
|
+
Feature B1 ✅
|
|
99
|
+
Feature B2 🚧
|
|
100
|
+
Feature Group C
|
|
101
|
+
Feature C1 ⏳
|
|
102
|
+
Feature C2 ⏳
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Status Legend:** ✅ Released / 🚧 In Development / ⏳ Planned / ❌ Deprecated
|
|
106
|
+
|
|
107
|
+
### 2.2 Feature List Table
|
|
108
|
+
|
|
109
|
+
| Feature Group | Feature | Description | Status | Priority | Remarks |
|
|
110
|
+
|---------------|---------|-------------|--------|----------|---------|
|
|
111
|
+
| {Order Management} | {Create Order} | {Supports manual/import creation} | ✅ | P0 | {Released} |
|
|
112
|
+
| {Order Management} | {Query Order} | {Multi-dimensional filter query} | ✅ | P0 | {Released} |
|
|
113
|
+
| {Order Review} | {Submit Review} | {Submit order to review process} | 🚧 | P1 | {In Development} |
|
|
114
|
+
| {Data Statistics} | {Order Report} | {Statistics by time/region} | ⏳ | P2 | {Planned} |
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 3. Business Entities and Relationships
|
|
119
|
+
|
|
120
|
+
### 3.1 Core Entity List
|
|
121
|
+
|
|
122
|
+
| Entity Name | Type | Description | Key Attributes | Business Rules |
|
|
123
|
+
|---|---|---|---|---|
|
|
124
|
+
| *{Entity1}* | *Data Entity / State Object* | *{description}* | *{key fields}* | *{constraints}* |
|
|
125
|
+
|
|
126
|
+
<!--
|
|
127
|
+
Backend examples: Order (DB Entity), OrderDTO (Data Transfer Object)
|
|
128
|
+
Frontend examples: OrderState (Store State), OrderFormProps (Component Interface)
|
|
129
|
+
-->
|
|
130
|
+
|
|
131
|
+
### 3.2 Entity Relationship Diagram
|
|
132
|
+
|
|
133
|
+
<!-- AI-TAG: ENTITY_RELATIONSHIP -->
|
|
134
|
+
<!-- AI-NOTE: ER diagram is crucial for Solution Agent to design databases and APIs -->
|
|
135
|
+
|
|
136
|
+
```mermaid
|
|
137
|
+
erDiagram
|
|
138
|
+
ENTITY_A["Entity A: Order Master"] {
|
|
139
|
+
int OrderID PK
|
|
140
|
+
string OrderNo UK
|
|
141
|
+
decimal OrderAmount
|
|
142
|
+
int OrderStatus
|
|
143
|
+
datetime CreateTime
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
ENTITY_B["Entity B: Order Detail"] {
|
|
147
|
+
int DetailID PK
|
|
148
|
+
int OrderID FK
|
|
149
|
+
int ProductID
|
|
150
|
+
int Quantity
|
|
151
|
+
decimal UnitPrice
|
|
152
|
+
decimal Subtotal
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
ENTITY_C["Entity C: Order Log"] {
|
|
156
|
+
int LogID PK
|
|
157
|
+
int OrderID FK
|
|
158
|
+
int OperationType
|
|
159
|
+
string OperationContent
|
|
160
|
+
datetime OperationTime
|
|
161
|
+
int Operator
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
ENTITY_D["Entity D: Order Attachment"] {
|
|
165
|
+
int AttachmentID PK
|
|
166
|
+
int OrderID FK
|
|
167
|
+
string AttachmentName
|
|
168
|
+
string AttachmentPath
|
|
169
|
+
datetime UploadTime
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
ENTITY_A ||--o{ ENTITY_B : "1:N"
|
|
173
|
+
ENTITY_A ||--o{ ENTITY_C : "1:N"
|
|
174
|
+
ENTITY_A ||--o{ ENTITY_D : "1:N"
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
<!-- For frontend modules, replace ER diagram with State Relationship diagram:
|
|
178
|
+
```mermaid
|
|
179
|
+
classDiagram
|
|
180
|
+
class OrderState {
|
|
181
|
+
+Order[] orders
|
|
182
|
+
+Order selectedOrder
|
|
183
|
+
+boolean loading
|
|
184
|
+
+string error
|
|
185
|
+
+fetchOrders()
|
|
186
|
+
+selectOrder(id)
|
|
187
|
+
}
|
|
188
|
+
class OrderFormState {
|
|
189
|
+
+Order formData
|
|
190
|
+
+boolean isDirty
|
|
191
|
+
+Object errors
|
|
192
|
+
+validate()
|
|
193
|
+
+submit()
|
|
194
|
+
}
|
|
195
|
+
OrderState --> OrderFormState : provides selectedOrder
|
|
196
|
+
```
|
|
197
|
+
-->
|
|
198
|
+
|
|
199
|
+
### 3.3 Entity State Transition
|
|
200
|
+
|
|
201
|
+
<!-- AI-TAG: STATE_MACHINE -->
|
|
202
|
+
<!-- AI-NOTE: State machine is important for understanding business rules and implementing state control logic -->
|
|
203
|
+
|
|
204
|
+
**Entity A (Order) State Machine:**
|
|
205
|
+
|
|
206
|
+
```mermaid
|
|
207
|
+
stateDiagram-v2
|
|
208
|
+
[*] --> Draft: Create Order
|
|
209
|
+
|
|
210
|
+
Draft --> PendingReview: Submit Review
|
|
211
|
+
Draft --> Cancelled: Cancel Order
|
|
212
|
+
|
|
213
|
+
PendingReview --> Approved: Review Passed
|
|
214
|
+
PendingReview --> Rejected: Review Rejected
|
|
215
|
+
|
|
216
|
+
Approved --> Completed: Business Complete
|
|
217
|
+
|
|
218
|
+
Rejected --> Draft: Re-edit
|
|
219
|
+
|
|
220
|
+
Cancelled --> [*]
|
|
221
|
+
Completed --> [*]
|
|
222
|
+
|
|
223
|
+
note right of Draft
|
|
224
|
+
Initial state
|
|
225
|
+
Editable
|
|
226
|
+
end note
|
|
227
|
+
|
|
228
|
+
note right of Approved
|
|
229
|
+
Review passed
|
|
230
|
+
Not modifiable
|
|
231
|
+
end note
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
| State | Description | Transferable States | Trigger Condition |
|
|
235
|
+
|-------|-------------|---------------------|-------------------|
|
|
236
|
+
| {Draft} | {Draft state} | {PendingReview/Cancelled} | {Submit/Cancel} |
|
|
237
|
+
| {PendingReview} | {Waiting for review} | {Approved/Rejected} | {Review passed/rejected} |
|
|
238
|
+
| {Approved} | {Review passed} | {Completed} | {Business complete} |
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## 4. External Dependencies and Interfaces
|
|
243
|
+
|
|
244
|
+
### 4.1 Module Dependency Relationships
|
|
245
|
+
|
|
246
|
+
| Dependency Direction | Module Name | Dependency Content | Dependency Method | Description |
|
|
247
|
+
|---------------------|-------------|-------------------|-------------------|-------------|
|
|
248
|
+
| {This module depends on} | {User Center} | {Get user info} | {API call} | {Get details by user ID} |
|
|
249
|
+
| {This module depends on} | {Product Module} | {Get product info} | {API call} | {Get details by product ID} |
|
|
250
|
+
| {Depends on this module} | {Payment Module} | {Query order info} | {API call} | {Validate order during payment} |
|
|
251
|
+
| {Depends on this module} | {Logistics Module} | {Receive order shipment} | {Message subscription} | {Notify after order review passed} |
|
|
252
|
+
|
|
253
|
+
### 4.2 External Interfaces Provided
|
|
254
|
+
|
|
255
|
+
| Interface Name | Type | Caller/Consumer | Description |
|
|
256
|
+
|---|---|---|---|
|
|
257
|
+
| *{Interface1}* | *API / Component / Hook / Event* | *{caller}* | *{description}* |
|
|
258
|
+
|
|
259
|
+
<!--
|
|
260
|
+
Backend examples: GET /api/orders (REST API), OrderCreatedEvent (Message)
|
|
261
|
+
Frontend examples: <OrderDetail :order="order" /> (Component Props), useOrder(id) (Hook/Composable), emit('save', order) (Event)
|
|
262
|
+
-->
|
|
263
|
+
|
|
264
|
+
### 4.3 Dependent Module Interfaces
|
|
265
|
+
|
|
266
|
+
| Interface Name | Provider | Function Description | Call Scenario |
|
|
267
|
+
|----------------|----------|---------------------|---------------|
|
|
268
|
+
| {Get User} | {User Center} | {Get user by ID} | {Validate when creating order} |
|
|
269
|
+
| {Get Product} | {Product Module} | {Get product by ID} | {Validate when creating order} |
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## 5. Core Business Processes
|
|
274
|
+
|
|
275
|
+
### 5.1 Core Process Within Module
|
|
276
|
+
|
|
277
|
+
<!-- AI-TAG: CORE_PROCESS -->
|
|
278
|
+
<!-- AI-NOTE: Core processes are important for Solution Agent to design solutions and plan interfaces -->
|
|
279
|
+
|
|
280
|
+
**Process: {Create Order Process}**
|
|
281
|
+
|
|
282
|
+
```mermaid
|
|
283
|
+
flowchart TD
|
|
284
|
+
Start([Start]) --> Validate[Validate Parameters]
|
|
285
|
+
|
|
286
|
+
Validate -->|Passed| Calculate[Calculate Amount]
|
|
287
|
+
Validate -->|Failed| ValError[Return Parameter Error]
|
|
288
|
+
ValError --> End1([End])
|
|
289
|
+
|
|
290
|
+
Calculate --> Save[Save Order]
|
|
291
|
+
Calculate -->|Exception| CalError[Return Calculation Error]
|
|
292
|
+
CalError --> End1
|
|
293
|
+
|
|
294
|
+
Save -->|Success| Notify[Notify Downstream]
|
|
295
|
+
Save -->|DB Exception| SaveError[Return System Error]
|
|
296
|
+
SaveError --> End1
|
|
297
|
+
|
|
298
|
+
Notify -->|Success| End2([End])
|
|
299
|
+
Notify -->|Failed| LogError[Log Compensation]
|
|
300
|
+
LogError --> End2
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
**Diagram Source**
|
|
304
|
+
- [{Module} Business Logic]({relativePath}/{sourcePath}/{moduleLogicFile})
|
|
305
|
+
|
|
306
|
+
**Process Step Description:**
|
|
307
|
+
|
|
308
|
+
| Step | Step Name | Processing Logic | Input | Output | Exception Handling |
|
|
309
|
+
|------|-----------|------------------|-------|--------|-------------------|
|
|
310
|
+
| 1 | {Parameter Validation} | {Validate user, product, inventory} | {Request parameters} | {Validation result} | {Return parameter error} |
|
|
311
|
+
| 2 | {Amount Calculation} | {Calculate product amount, discount, shipping} | {Product info} | {Order amount} | {Calculation exception} |
|
|
312
|
+
| 3 | {Save Order} | {Write to order master and detail tables} | {Order data} | {Order ID} | {Database exception} |
|
|
313
|
+
| 4 | {Notify Downstream} | {Send order creation message} | {Order ID} | {Send result} | {Log only, no retry} |
|
|
314
|
+
|
|
315
|
+
<!-- For frontend modules, core processes typically include:
|
|
316
|
+
1. Data Loading Flow: Component mount → Fetch data → Loading state → Render
|
|
317
|
+
2. User Interaction Flow: User action → Validate → API call → Update state → Feedback
|
|
318
|
+
3. Navigation Flow: Route change → Guard check → Load page data → Render
|
|
319
|
+
-->
|
|
320
|
+
|
|
321
|
+
### 5.2 Exception Handling Rules
|
|
322
|
+
|
|
323
|
+
| Exception Scenario | Exception Type | Handling Strategy | User Prompt | Log Record |
|
|
324
|
+
|-------------------|----------------|-------------------|-------------|------------|
|
|
325
|
+
| {Parameter validation failed} | {Business Exception} | {Return error directly} | {Show specific error} | {Log warning} |
|
|
326
|
+
| {Product not exist} | {Business Exception} | {Return error} | {Prompt product invalid} | {Log warning} |
|
|
327
|
+
| {Database timeout} | {System Exception} | {Retry 3 times} | {Prompt system busy} | {Log error} |
|
|
328
|
+
| {Downstream notification failed} | {System Exception} | {Log for compensation} | {No prompt to user} | {Log error} |
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## 6. Business Rules and Constraints
|
|
333
|
+
|
|
334
|
+
### 6.1 Business Rules
|
|
335
|
+
|
|
336
|
+
| Rule ID | Rule Name | Rule Description | Trigger Scenario | Related Entity |
|
|
337
|
+
|---------|-----------|------------------|------------------|----------------|
|
|
338
|
+
| {R001} | {Order Amount Validation} | {Order amount must be greater than 0} | {When creating order} | {Order Master} |
|
|
339
|
+
| {R002} | {Inventory Deduction Rule} | {Deduct inventory after order review passed} | {When review passed} | {Order+Inventory} |
|
|
340
|
+
| {R003} | {Status Flow Rule} | {Completed orders cannot be modified} | {When modifying order} | {Order Master} |
|
|
341
|
+
|
|
342
|
+
### 6.2 Data Constraints
|
|
343
|
+
|
|
344
|
+
| Constraint Type | Constraint Object | Constraint Rule | Description |
|
|
345
|
+
|-----------------|-------------------|-----------------|-------------|
|
|
346
|
+
| {Uniqueness} | {Order No} | {Globally unique} | {Business order number, cannot duplicate} |
|
|
347
|
+
| {Required} | {User ID} | {Not null} | {Must associate with user} |
|
|
348
|
+
| {Range} | {Order Amount} | {≥0} | {Amount cannot be negative} |
|
|
349
|
+
| {Association} | {Order Detail} | {At least 1 item} | {Order must have details} |
|
|
350
|
+
|
|
351
|
+
### 6.3 Permission Rules
|
|
352
|
+
|
|
353
|
+
| Operation / Component | Required Permission | No Permission Handling |
|
|
354
|
+
|---|---|---|
|
|
355
|
+
| *{operation or component}* | *{permission}* | *{handling}* |
|
|
356
|
+
|
|
357
|
+
<!--
|
|
358
|
+
Backend: Create Order → order:create → Return 403
|
|
359
|
+
Frontend: /orders/create route → order:create → Redirect to 403 page
|
|
360
|
+
Frontend: <CreateButton /> → order:create → Hide component
|
|
361
|
+
Frontend: Price field in OrderForm → order:edit_price → Readonly
|
|
362
|
+
-->
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
## 7. Related Pages and Prototypes (Optional)
|
|
367
|
+
|
|
368
|
+
### 7.1 Page List
|
|
369
|
+
|
|
370
|
+
| Page Name | Page Type | Function Description | Related Feature | Prototype Document |
|
|
371
|
+
|-----------|-----------|---------------------|-----------------|-------------------|
|
|
372
|
+
| {Order List Page} | {List Page} | {Display order list} | {Query Order} | [Link](ui-prototype.md) |
|
|
373
|
+
| {Order Detail Page} | {Detail Page} | {Display order details} | {View Order} | [Link](ui-prototype.md) |
|
|
374
|
+
| {Order Edit Page} | {Form Page} | {Edit order info} | {Modify Order} | [Link](ui-prototype.md) |
|
|
375
|
+
|
|
376
|
+
### 7.2 Page Prototype
|
|
377
|
+
|
|
378
|
+
> For detailed page prototypes, please refer to [Feature Detail Design Template](./FEATURE-DETAIL-TEMPLATE.md)
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
## 8. Change History
|
|
383
|
+
|
|
384
|
+
| Date | Version | Change Content | Change Type | Owner | Impact Scope |
|
|
385
|
+
|------|---------|----------------|-------------|-------|--------------|
|
|
386
|
+
| {Date} | {v1.2} | {Added order review feature} | {New Feature} | {Zhang San} | {Added review status, review interface} |
|
|
387
|
+
| {Date} | {v1.1} | {Optimized order query performance} | {Performance} | {Li Si} | {Query interface} |
|
|
388
|
+
| {Date} | {v1.0} | {Module initial version} | {Initial Release} | {Wang Wu} | {All} |
|
|
389
|
+
|
|
390
|
+
---
|
|
391
|
+
|
|
392
|
+
**Document Status:** 📝 Draft / 👀 In Review / ✅ Published
|
|
393
|
+
**Last Updated:** {Date}
|
|
394
|
+
**Maintainer:** {Name}
|
|
395
|
+
**Related System Document:** [System Overview Document](../system-overview.md)
|
|
396
|
+
|
|
397
|
+
**Section Source**
|
|
398
|
+
- [{Module} Entry]({relativePath}/{sourcePath}/{moduleEntryFile})
|
|
399
|
+
- [{Module} Logic]({relativePath}/{sourcePath}/{moduleLogicFile})
|
|
400
|
+
- [{Module} Model]({relativePath}/{sourcePath}/{moduleModelFile})
|