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,208 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: speccrew-project-diagnosis
|
|
3
|
+
description: Project diagnosis and evaluation Skill. Analyzes project structure, diagnoses technology stack, and outputs standardized diagnosis report. Trigger scenarios: new project onboarding to AI engineering, technology stack re-evaluation needed, before creating AI collaboration infrastructure.
|
|
4
|
+
tools: Read, Glob, Grep, List, ReadFile, Search
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Trigger Scenarios
|
|
8
|
+
|
|
9
|
+
- New project onboarding to AI engineering workflow, requires comprehensive diagnosis
|
|
10
|
+
- Significant technology stack changes, needs re-evaluation
|
|
11
|
+
- Before creating or rebuilding AI collaboration infrastructure
|
|
12
|
+
- User says "diagnose project", "evaluate tech stack", "analyze project structure"
|
|
13
|
+
|
|
14
|
+
# Language Requirement
|
|
15
|
+
|
|
16
|
+
**CRITICAL**: Before generating the diagnosis report, detect the language used by the user throughout the conversation. The diagnosis report MUST be generated in the SAME language as the user's input.
|
|
17
|
+
|
|
18
|
+
- If user communicated in Chinese -> Generate report in Chinese
|
|
19
|
+
- If user communicated in English -> Generate report in English
|
|
20
|
+
- If user communicated in other languages -> Generate report in that language
|
|
21
|
+
- Do NOT default to English if user used another language
|
|
22
|
+
|
|
23
|
+
# Diagnosis Goal
|
|
24
|
+
|
|
25
|
+
> Note: Deep identification of business domains and repetitive operation patterns should be gradually accumulated by specific Agents during actual usage after infrastructure creation.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
**Diagnosis Report Output**: `speccrew-workspace/docs/diagnosis-reports/diagnosis-report-{YYYY-MM-DD-HHmm}.md`
|
|
30
|
+
|
|
31
|
+
- **Template**: [templates/DIAGNOSIS-REPORT-TEMPLATE.md](templates/DIAGNOSIS-REPORT-TEMPLATE.md)
|
|
32
|
+
- **Naming Convention**: Date-time suffix using 24-hour format `HHmm` (e.g., `diagnosis-report-2026-03-15-1326.md` for 13:26), supports multiple diagnoses on the same day
|
|
33
|
+
|
|
34
|
+
## Get Current Timestamp
|
|
35
|
+
|
|
36
|
+
To ensure consistent timestamp format, use the `speccrew-get-timestamp` skill:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Windows PowerShell
|
|
40
|
+
powershell -ExecutionPolicy Bypass -File speccrew-get-timestamp/scripts/get-timestamp.ps1
|
|
41
|
+
|
|
42
|
+
# Linux/macOS/Git Bash
|
|
43
|
+
bash speccrew-get-timestamp/scripts/get-timestamp.sh
|
|
44
|
+
|
|
45
|
+
# Python (cross-platform)
|
|
46
|
+
python speccrew-get-timestamp/scripts/get-timestamp.py
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Default output format: `YYYY-MM-DD-HHmm` (e.g., `2026-03-17-1326`)
|
|
50
|
+
|
|
51
|
+
# Diagnosis Workflow
|
|
52
|
+
|
|
53
|
+
## Phase 1: Project Exploration (Parallel Reading)
|
|
54
|
+
|
|
55
|
+
Read the following simultaneously:
|
|
56
|
+
|
|
57
|
+
1. **Root Directory Key Files** (examples): `README.md`, `package.json`, `pyproject.toml`, `Cargo.toml`, `*.csproj`, `go.mod`, `pom.xml`, etc.
|
|
58
|
+
2. **Configuration Files** (examples): `docker-compose.yml`, `.env.template`, `.env.example`, `Dockerfile`, etc.
|
|
59
|
+
3. **Directory Structure**: Read root directory first, then decide whether to dive into subdirectories based on project complexity (typically 2-3 levels)
|
|
60
|
+
4. **Existing SpecCrew Configuration**: Record existing configuration
|
|
61
|
+
|
|
62
|
+
## Phase 2: Project Type Determination
|
|
63
|
+
|
|
64
|
+
Determine project type based on reading results:
|
|
65
|
+
|
|
66
|
+
| Project Type | Common Determination Criteria (Examples) |
|
|
67
|
+
|--------------|------------------------------------------|
|
|
68
|
+
| **Web Full-Stack** | Both frontend (Vue/React/Angular/Svelte, etc.) and backend (FastAPI/Express/Spring/Django, etc.) directories exist |
|
|
69
|
+
| **Frontend Only** | Only frontend framework, no independent backend service |
|
|
70
|
+
| **Backend/API Only** | No frontend directory, only server-side code |
|
|
71
|
+
| **Desktop Client** | Presence of Electron/Tauri/WPF/Qt, etc. characteristic files |
|
|
72
|
+
| **Mobile** | Presence of Android/iOS/Flutter/React Native, etc. characteristic files |
|
|
73
|
+
| **CLI Tool** | CLI entry point exists and no UI directory |
|
|
74
|
+
| **Hybrid** | Monorepo containing multiple types above |
|
|
75
|
+
|
|
76
|
+
## Phase 3: Deep Analysis
|
|
77
|
+
|
|
78
|
+
### 3.1 Technology Stack Identification
|
|
79
|
+
|
|
80
|
+
**Runtime & Languages** (examples)
|
|
81
|
+
- Language versions (Node.js, Python, Go, Rust, Java, C#, etc.)
|
|
82
|
+
- Runtime environment requirements
|
|
83
|
+
|
|
84
|
+
**Core Frameworks & Libraries** (examples)
|
|
85
|
+
- Frontend: Vue/React/Angular/Svelte, etc.
|
|
86
|
+
- Backend: Express/FastAPI/Spring/Django, etc.
|
|
87
|
+
- Database: PostgreSQL/MySQL/MongoDB/Redis, etc.
|
|
88
|
+
- Other key dependencies
|
|
89
|
+
|
|
90
|
+
**Build & Toolchain** (examples)
|
|
91
|
+
- Build tools: Vite/Webpack/rollup/esbuild, etc.
|
|
92
|
+
- Package managers: npm/pnpm/yarn/poetry/cargo, etc.
|
|
93
|
+
- Testing frameworks: Jest/Vitest/Pytest/Playwright, etc.
|
|
94
|
+
|
|
95
|
+
### 3.2 Directory Structure Analysis
|
|
96
|
+
|
|
97
|
+
Record actual directory conventions (examples):
|
|
98
|
+
- Source code directories (`src/`, `app/`, `lib/`, `packages/`, etc.)
|
|
99
|
+
- Configuration file locations
|
|
100
|
+
- Test file locations
|
|
101
|
+
- Static resource locations
|
|
102
|
+
- Documentation locations
|
|
103
|
+
|
|
104
|
+
### 3.3 Business Module Clue Collection (For Creating Empty Folders Only)
|
|
105
|
+
|
|
106
|
+
Collect business module names from the following locations (examples, no deep understanding needed, just list detected names):
|
|
107
|
+
- Route names in frontend routing configuration
|
|
108
|
+
- Backend API route prefixes
|
|
109
|
+
- Database Model/Entity file names
|
|
110
|
+
- Feature directory names (subdirectories under `modules/`, `features/`, `domains/`, etc.)
|
|
111
|
+
|
|
112
|
+
**Output Format**: List detected module names, mark as "To be confirmed by PM Agent"
|
|
113
|
+
|
|
114
|
+
### 3.4 Development Standards Identification
|
|
115
|
+
|
|
116
|
+
- **Code Style** (examples): ESLint, Prettier, Ruff, Black, Checkstyle, etc. configurations
|
|
117
|
+
- **Naming Conventions**: File naming, variable naming styles
|
|
118
|
+
- **Commit Standards** (examples): commitlint, conventional commits, etc.
|
|
119
|
+
- **Run Commands** (examples): package.json scripts, Makefile, Gradle tasks, etc.
|
|
120
|
+
|
|
121
|
+
## Phase 4: Generate Diagnosis Report
|
|
122
|
+
|
|
123
|
+
### 4.1 Create Diagnosis Report Directory
|
|
124
|
+
|
|
125
|
+
Ensure `speccrew-workspace/docs/diagnosis-reports/` directory exists.
|
|
126
|
+
|
|
127
|
+
### 4.2 Generate Diagnosis Report Filename
|
|
128
|
+
|
|
129
|
+
**Step 1: Get timestamp using `speccrew-get-timestamp` skill**
|
|
130
|
+
|
|
131
|
+
Run the appropriate script to get current timestamp:
|
|
132
|
+
- Windows: `powershell -ExecutionPolicy Bypass -File speccrew-get-timestamp/scripts/get-timestamp.ps1`
|
|
133
|
+
- Linux/macOS: `bash speccrew-get-timestamp/scripts/get-timestamp.sh`
|
|
134
|
+
- Or use Python: `python speccrew-get-timestamp/scripts/get-timestamp.py`
|
|
135
|
+
|
|
136
|
+
**Step 2: Generate filename**
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
diagnosis-report-{timestamp}.md
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Example: If script returns `2026-03-17-1326`, filename is `diagnosis-report-2026-03-17-1326.md`
|
|
143
|
+
|
|
144
|
+
### 4.3 Fill Report Content
|
|
145
|
+
|
|
146
|
+
Based on template `templates/DIAGNOSIS-REPORT-TEMPLATE.md`, generate the diagnosis report.
|
|
147
|
+
|
|
148
|
+
**Dynamic Content Filling Rules**:
|
|
149
|
+
|
|
150
|
+
1. **architecture/ Subdirectories**: Based on project type determined in Phase 2, select corresponding subdirectory combinations
|
|
151
|
+
- Web Full-Stack -> system, conventions, frontend, backend, data
|
|
152
|
+
- Frontend Only -> system, conventions, frontend
|
|
153
|
+
- Backend Only -> system, conventions, backend, data
|
|
154
|
+
- Desktop Client -> system, conventions, desktop
|
|
155
|
+
- Mobile -> system, conventions, mobile
|
|
156
|
+
|
|
157
|
+
2. **bizs/modules/ Initial Clues**: Fill in business module names collected in Phase 3.3
|
|
158
|
+
|
|
159
|
+
3. **Recommended Agents to Generate**: For EACH identified technology stack, generate 3 Agents (designer, dev, test)
|
|
160
|
+
- **Rule**: Every tech stack gets its own set of 3 Agents
|
|
161
|
+
- **Naming Pattern**: `speccrew-{role}-{techstack}`
|
|
162
|
+
- **Example 1** (Vue + Java):
|
|
163
|
+
- `speccrew-designer-vue`, `speccrew-dev-vue`, `speccrew-test-vue`
|
|
164
|
+
- `speccrew-designer-java`, `speccrew-dev-java`, `speccrew-test-java`
|
|
165
|
+
- **Example 2** (Vue + Java + Electron):
|
|
166
|
+
- `speccrew-designer-vue`, `speccrew-dev-vue`, `speccrew-test-vue`
|
|
167
|
+
- `speccrew-designer-java`, `speccrew-dev-java`, `speccrew-test-java`
|
|
168
|
+
- `speccrew-designer-electron`, `speccrew-dev-electron`, `speccrew-test-electron`
|
|
169
|
+
- **Example 3** (React + Node.js + React Native):
|
|
170
|
+
- `speccrew-designer-react`, `speccrew-dev-react`, `speccrew-test-react`
|
|
171
|
+
- `speccrew-designer-nodejs`, `speccrew-dev-nodejs`, `speccrew-test-nodejs`
|
|
172
|
+
- `speccrew-designer-reactnative`, `speccrew-dev-reactnative`, `speccrew-test-reactnative`
|
|
173
|
+
|
|
174
|
+
# Output Requirements
|
|
175
|
+
|
|
176
|
+
1. **Diagnosis report must be complete**: Cover all sections above, mark uncertain content as "To be confirmed"
|
|
177
|
+
2. **Information must be accurate**: All technology stack versions and paths must come from actual files, no guessing
|
|
178
|
+
3. **Format standardization**: Use the template format above for easy parsing by subsequent Skills
|
|
179
|
+
|
|
180
|
+
# Verification Checklist
|
|
181
|
+
|
|
182
|
+
- [ ] Project type determination has clear basis
|
|
183
|
+
- [ ] Technology stack version info comes from actual configuration files
|
|
184
|
+
- [ ] Directory structure comes from actual scan results
|
|
185
|
+
- [ ] Business module clues listed (marked "To be confirmed by PM Agent")
|
|
186
|
+
- [ ] Repetitive operation pattern identification noted as "To be accumulated later"
|
|
187
|
+
- [ ] Diagnosis report saved to specified path
|
|
188
|
+
|
|
189
|
+
# Output Summary
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
## Project Diagnosis Complete
|
|
193
|
+
|
|
194
|
+
### Diagnosis Result Summary
|
|
195
|
+
- Project Type: xxx
|
|
196
|
+
- Main Tech Stack: xxx, xxx, xxx
|
|
197
|
+
- Identified Business Domains: x
|
|
198
|
+
- Candidate Skills: x
|
|
199
|
+
|
|
200
|
+
### Diagnosis Report Location
|
|
201
|
+
See "Diagnosis Report Output" above
|
|
202
|
+
|
|
203
|
+
### Suggested Next Step
|
|
204
|
+
|
|
205
|
+
1. **User Review**: Please review the diagnosis report above and confirm if the project type, technology stack, and business module identification are accurate
|
|
206
|
+
2. **Leader Agent Initialization**: After confirmation, inform the Leader Agent to initiate software engineering infrastructure creation
|
|
207
|
+
```
|
|
208
|
+
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# Project Diagnosis Report
|
|
2
|
+
|
|
3
|
+
Generated At: {{GeneratedAt}}
|
|
4
|
+
|
|
5
|
+
## 1. Project Basic Information
|
|
6
|
+
|
|
7
|
+
| Item | Content |
|
|
8
|
+
|------|---------|
|
|
9
|
+
| Project Name | {{ProjectName}} |
|
|
10
|
+
| Project Type | {{WebFullStack/FrontendOnly/BackendOnly/DesktopClient/Mobile/CLI/Hybrid}} |
|
|
11
|
+
| Determination Basis | {{DeterminationBasis}} |
|
|
12
|
+
|
|
13
|
+
## 2. Technology Stack List
|
|
14
|
+
|
|
15
|
+
### 2.1 Runtime & Languages
|
|
16
|
+
- Language: {{LanguageAndVersion}}
|
|
17
|
+
- Runtime: {{RuntimeEnvironment}}
|
|
18
|
+
|
|
19
|
+
### 2.2 Core Frameworks
|
|
20
|
+
- Frontend: {{FrontendFrameworkAndVersion}}
|
|
21
|
+
- Backend: {{BackendFrameworkAndVersion}}
|
|
22
|
+
- Database: {{DatabaseType}}
|
|
23
|
+
|
|
24
|
+
### 2.3 Toolchain
|
|
25
|
+
- Build: {{BuildTools}}
|
|
26
|
+
- Package Management: {{PackageManager}}
|
|
27
|
+
- Testing: {{TestingFramework}}
|
|
28
|
+
|
|
29
|
+
## 3. Project Directory Structure Conventions
|
|
30
|
+
|
|
31
|
+
Source code directory structure of the diagnosed project:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
{{ProjectRootDirectoryStructure}}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## 4. Development Standards
|
|
38
|
+
|
|
39
|
+
- Code Linting: {{LintingToolsAndConfig}}
|
|
40
|
+
- Naming Style: {{NamingConventions}}
|
|
41
|
+
- Commit Standards: {{CommitStandards}}
|
|
42
|
+
|
|
43
|
+
## 5. Follow-up Work Recommendations
|
|
44
|
+
|
|
45
|
+
Based on diagnosis results, recommend creating the following:
|
|
46
|
+
|
|
47
|
+
### 5.1 Recommended Agents to Generate
|
|
48
|
+
|
|
49
|
+
Based on project type `{{ProjectType}}`, recommend generating the following Agents:
|
|
50
|
+
|
|
51
|
+
| Agent | Responsibility |
|
|
52
|
+
|-------|----------------|
|
|
53
|
+
| devcrew-designer-[techstack] | Detailed design |
|
|
54
|
+
| devcrew-dev-[techstack] | Development implementation |
|
|
55
|
+
| devcrew-test-[techstack] | Testing and validation |
|
|
56
|
+
|
|
57
|
+
### 5.2 Recommended devcrew-workspace Directory Structure
|
|
58
|
+
|
|
59
|
+
Based on project type and diagnosis results, recommend creating the following directory structure:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
devcrew-workspace/
|
|
63
|
+
├── docs/ # Management documents
|
|
64
|
+
│ ├── diagnosis-reports/ # Diagnosis reports
|
|
65
|
+
│ │ └── diagnosis-report-{date}.md
|
|
66
|
+
│ ├── README.md
|
|
67
|
+
│ └── AGENTS.md
|
|
68
|
+
├── knowledge/ # Project knowledge base
|
|
69
|
+
│ ├── README.md
|
|
70
|
+
│ ├── constitution.md
|
|
71
|
+
│ ├── architecture/ # Architecture docs (subdirs dynamically selected by project type)
|
|
72
|
+
│ │ ├── system/ # System overall architecture
|
|
73
|
+
│ │ ├── conventions/ # Development conventions
|
|
74
|
+
│ │ {{#if hasFrontend}}├── frontend/ # Frontend architecture (Web Full-Stack / Frontend Only){{/if}}
|
|
75
|
+
│ │ {{#if hasBackend}}├── backend/ # Backend architecture (Web Full-Stack / Backend Only){{/if}}
|
|
76
|
+
│ │ {{#if hasDatabase}}├── data/ # Data architecture (Web Full-Stack / Backend Only){{/if}}
|
|
77
|
+
│ │ {{#if hasDesktop}}├── desktop/ # Desktop architecture (Desktop Client){{/if}}
|
|
78
|
+
│ │ {{#if hasMobile}}└── mobile/ # Mobile architecture (Mobile){{/if}}
|
|
79
|
+
│ ├── bizs/ # Business knowledge (empty initially, content accumulated by PM Agent)
|
|
80
|
+
│ │ {{#each detectedModules}}├── {{this}}/ # {{this}} module{{/each}}
|
|
81
|
+
│ └── domain/ # Domain knowledge (empty initially, content accumulated later)
|
|
82
|
+
│ ├── standards/
|
|
83
|
+
│ ├── glossary/
|
|
84
|
+
│ └── qa/
|
|
85
|
+
└── projects/ # Iteration projects
|
|
86
|
+
└── archive/ # Archive directory
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**architecture/ Subdirectory Description**:
|
|
90
|
+
Based on project type `[{{ProjectType}}]` determined in Phase 2, dynamically select corresponding subdirectory combinations:
|
|
91
|
+
|
|
92
|
+
| Project Type | Recommended Subdirectories | Mapping to SKILL.md Phase 2 |
|
|
93
|
+
|--------------|----------------------------|----------------------------|
|
|
94
|
+
| Web Full-Stack | system, conventions, frontend, backend, data | system, conventions, frontend, backend, data |
|
|
95
|
+
| Frontend Only | system, conventions, frontend | system, conventions, frontend |
|
|
96
|
+
| Backend Only | system, conventions, backend, data | system, conventions, backend, data |
|
|
97
|
+
| Desktop Client | system, conventions, desktop | system, conventions, desktop |
|
|
98
|
+
| Mobile | system, conventions, mobile | system, conventions, mobile |
|
|
99
|
+
| Hybrid | Create based on actual included platforms | Combine subdirs from detected platforms |
|
|
100
|
+
|
|
101
|
+
**bizs/ Dynamic Generation Rules**:
|
|
102
|
+
|
|
103
|
+
Based on Phase 3.3 Business Module Clue Collection, dynamically generate `bizs/` subdirectories:
|
|
104
|
+
|
|
105
|
+
| Condition | Generated Content |
|
|
106
|
+
|-----------|-------------------|
|
|
107
|
+
| `hasModules=true` | Create subdirectories named after detected business modules (e.g., `bizs/User/`, `bizs/Order/`) |
|
|
108
|
+
| `hasModules=false` | Skip `bizs/` directory creation or create empty structure |
|
|
109
|
+
|
|
110
|
+
**Initial Clues from Phase 3.3** (detected from code structure, to be confirmed by PM Agent):
|
|
111
|
+
- {{Module1FromRoute/DirectoryAnalysis}} (Source: frontend routing / backend API routes / directory structure)
|
|
112
|
+
- {{Module2FromRoute/DirectoryAnalysis}} (Source: frontend routing / backend API routes / directory structure)
|
|
113
|
+
- ...
|
|
114
|
+
|
|
115
|
+
> **Note**:
|
|
116
|
+
> - `hasModules` = true when business modules detected from routes/entities/directories
|
|
117
|
+
> - Business flows will be organized by PM Agent during PRD phase
|
|
118
|
+
> - PM Agent will confirm and refine during actual project execution
|
|
119
|
+
|
|
120
|
+
## 6. Business Analysis (Initial)
|
|
121
|
+
|
|
122
|
+
Based on source code route/directory structure analysis, preliminary identification of business modules:
|
|
123
|
+
|
|
124
|
+
### 6.1 Frontend Page Modules
|
|
125
|
+
|
|
126
|
+
| Route Path | Page Name | Possible Function | Associated Module |
|
|
127
|
+
|------------|-----------|-------------------|-------------------|
|
|
128
|
+
| {{RoutePath1}} | {{PageName1}} | {{FunctionDesc1}} | {{ModuleName1}} |
|
|
129
|
+
| {{RoutePath2}} | {{PageName2}} | {{FunctionDesc2}} | {{ModuleName2}} |
|
|
130
|
+
|
|
131
|
+
> Data Source: Frontend routing configuration / pages directory structure analysis
|
|
132
|
+
|
|
133
|
+
### 6.2 Backend API Modules
|
|
134
|
+
|
|
135
|
+
| Route Prefix | Module Name | Possible Function | HTTP Methods |
|
|
136
|
+
|--------------|-------------|-------------------|--------------|
|
|
137
|
+
| {{ApiPrefix1}} | {{ModuleName1}} | {{FunctionDesc1}} | {{Methods1}} |
|
|
138
|
+
| {{ApiPrefix2}} | {{ModuleName2}} | {{FunctionDesc2}} | {{Methods2}} |
|
|
139
|
+
|
|
140
|
+
> Data Source: Backend router files / API directory structure analysis
|
|
141
|
+
|
|
142
|
+
### 6.3 Data Model Clues
|
|
143
|
+
|
|
144
|
+
| Table/Model Name | Associated Module | Possible Purpose | Key Fields |
|
|
145
|
+
|------------------|-------------------|------------------|------------|
|
|
146
|
+
| {{TableName1}} | {{Module1}} | {{Purpose1}} | {{Fields1}} |
|
|
147
|
+
| {{TableName2}} | {{Module2}} | {{Purpose2}} | {{Fields2}} |
|
|
148
|
+
|
|
149
|
+
> Data Source: ORM model files / database migration files analysis
|
|
150
|
+
|
|
151
|
+
### 6.4 Business Module Summary
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
{{ProjectName}}
|
|
155
|
+
├── {{Module1Name}}
|
|
156
|
+
│ ├── Frontend: {{Pages1}}
|
|
157
|
+
│ ├── Backend: {{Apis1}}
|
|
158
|
+
│ └── Data: {{Tables1}}
|
|
159
|
+
├── {{Module2Name}}
|
|
160
|
+
│ ├── Frontend: {{Pages2}}
|
|
161
|
+
│ ├── Backend: {{Apis2}}
|
|
162
|
+
│ └── Data: {{Tables2}}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
> Note: This is preliminary analysis based on code structure only. Business logic details need to be confirmed by PM Agent during requirements phase.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 7. Knowledge Base Initialization Guide
|
|
170
|
+
|
|
171
|
+
Based on this diagnosis report, the following knowledge base structure should be generated during initialization:
|
|
172
|
+
|
|
173
|
+
### 7.1 Techs Layer (Auto-generated by Techs Pipeline)
|
|
174
|
+
|
|
175
|
+
| Directory | Generated By | Input From This Report |
|
|
176
|
+
|-----------|--------------|------------------------|
|
|
177
|
+
| `knowledges/techs/{platform}/` | Techs Pipeline | Section 2: Technology Stack |
|
|
178
|
+
| `knowledges/techs/{platform}/architecture.md` | Techs Pipeline | Section 2.2, 3: Framework & directory structure |
|
|
179
|
+
| `knowledges/techs/{platform}/conventions-*.md` | Techs Pipeline | Section 4: Development standards |
|
|
180
|
+
|
|
181
|
+
### 7.2 Business Layer (Framework generated by Leader Agent)
|
|
182
|
+
|
|
183
|
+
| Directory | Generated By | Input From This Report |
|
|
184
|
+
|-----------|--------------|------------------------|
|
|
185
|
+
| `bizs/{ModuleName}/` | Leader Agent | Section 6.4: Business module summary |
|
|
186
|
+
|
|
187
|
+
### 7.3 Domain Layer (Empty initially)
|
|
188
|
+
|
|
189
|
+
| Directory | Content | Populated By |
|
|
190
|
+
|-----------|---------|--------------|
|
|
191
|
+
| `domain/standards/` | Industry standards | PM Agent on-demand |
|
|
192
|
+
| `domain/glossary/` | Business terminology | PM Agent during PRD phase |
|
|
193
|
+
| `domain/qa/` | Q&A knowledge | All Agents gradually |
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## 8. Content for Deep Identification
|
|
198
|
+
|
|
199
|
+
The following needs to be gradually accumulated during Agent usage:
|
|
200
|
+
- **Business Flows**: Organized by PM Agent during PRD phase, associated with corresponding modules
|
|
201
|
+
- **Domain Knowledge**: Added to `domain/` when involving industry standards
|
|
202
|
+
- **Repetitive Operation Patterns**: Identified by Dev Agent during development and accumulated as Skills
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: speccrew-sd-backend
|
|
3
|
+
description: Backend System Design SOP. Guide System Designer Agent to generate platform-specific backend detailed design documents by filling technology implementation details into the Feature Spec skeleton. Reads techs knowledge to determine actual framework syntax, ORM patterns, and conventions.
|
|
4
|
+
tools: Read, Write, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Trigger Scenarios
|
|
8
|
+
|
|
9
|
+
- Feature Spec has been confirmed, user requests backend system design
|
|
10
|
+
- System Designer Agent receives task to create backend detailed design for a specific platform
|
|
11
|
+
- User asks "Design backend implementation" or "Create backend design for {platform}"
|
|
12
|
+
|
|
13
|
+
# Workflow
|
|
14
|
+
|
|
15
|
+
## Step 1: Read Inputs
|
|
16
|
+
|
|
17
|
+
Read in order:
|
|
18
|
+
|
|
19
|
+
1. **Feature Spec document(s)**: `speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/[feature-name]-feature-spec.md`
|
|
20
|
+
2. **API Contract**: `speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/[feature-name]-api-contract.md`
|
|
21
|
+
3. **Backend techs knowledge** (paths from agent context):
|
|
22
|
+
- `speccrew-workspace/knowledges/techs/{platform_id}/tech-stack.md`
|
|
23
|
+
- `speccrew-workspace/knowledges/techs/{platform_id}/architecture.md`
|
|
24
|
+
- `speccrew-workspace/knowledges/techs/{platform_id}/conventions-design.md`
|
|
25
|
+
- `speccrew-workspace/knowledges/techs/{platform_id}/conventions-dev.md`
|
|
26
|
+
- `speccrew-workspace/knowledges/techs/{platform_id}/conventions-data.md` (critical for backend: ORM, data modeling, migration)
|
|
27
|
+
4. **Design template**: `speccrew-sd-backend/templates/SD-BACKEND-TEMPLATE.md`
|
|
28
|
+
5. **Index template**: `speccrew-sd-backend/templates/INDEX-TEMPLATE.md`
|
|
29
|
+
|
|
30
|
+
## Step 2: Analyze Existing Code Structure
|
|
31
|
+
|
|
32
|
+
Use Glob/Grep to understand current backend codebase:
|
|
33
|
+
|
|
34
|
+
| Analysis Target | Purpose |
|
|
35
|
+
|-----------------|---------|
|
|
36
|
+
| Controller/Router layer structure | Understand routing patterns and naming conventions |
|
|
37
|
+
| Service layer organization | Identify service boundaries and reuse opportunities |
|
|
38
|
+
| Repository/DAO layer patterns | Review data access patterns |
|
|
39
|
+
| Entity/Model definitions | Understand existing data models |
|
|
40
|
+
| Middleware stack | Identify cross-cutting concerns |
|
|
41
|
+
| Exception handling patterns | Review error handling approach |
|
|
42
|
+
| Database migration structure | Understand migration naming and structure |
|
|
43
|
+
| Naming conventions | Ensure consistency with existing code |
|
|
44
|
+
|
|
45
|
+
## Step 3: Extract Functions from Feature Spec
|
|
46
|
+
|
|
47
|
+
Parse Feature Spec to identify all backend-relevant functions.
|
|
48
|
+
|
|
49
|
+
For each function, extract:
|
|
50
|
+
|
|
51
|
+
| Aspect | Content |
|
|
52
|
+
|--------|---------|
|
|
53
|
+
| **API Interfaces** | From Feature Spec Section 2.N backend part |
|
|
54
|
+
| **Data Access Requirements** | What data needs to be read/written |
|
|
55
|
+
| **Business Logic Flow** | Core processing steps |
|
|
56
|
+
| **Cross-Module Dependencies** | Dependencies on other modules or services |
|
|
57
|
+
|
|
58
|
+
Cross-reference with API Contract for exact endpoint specifications.
|
|
59
|
+
|
|
60
|
+
Mark each function as:
|
|
61
|
+
|
|
62
|
+
| Marker | Meaning |
|
|
63
|
+
|--------|---------|
|
|
64
|
+
| `[EXISTING]` | Reuse current implementation, no changes needed |
|
|
65
|
+
| `[MODIFIED]` | Modify existing implementation |
|
|
66
|
+
| `[NEW]` | Create brand new implementation |
|
|
67
|
+
|
|
68
|
+
**Checkpoint A: Present function list with markers to user for confirmation before proceeding.**
|
|
69
|
+
|
|
70
|
+
## Step 4: Generate Module Design Documents
|
|
71
|
+
|
|
72
|
+
For each function (or logical group = one controller/module):
|
|
73
|
+
|
|
74
|
+
### 4.1 Read Template
|
|
75
|
+
|
|
76
|
+
Read the SD-BACKEND-TEMPLATE.md to understand document structure.
|
|
77
|
+
|
|
78
|
+
### 4.2 Fill Template Sections
|
|
79
|
+
|
|
80
|
+
Fill each section with technology-specific implementation details:
|
|
81
|
+
|
|
82
|
+
| Section | Content Source |
|
|
83
|
+
|---------|----------------|
|
|
84
|
+
| **Module Structure** | Use actual framework layering from techs knowledge |
|
|
85
|
+
| **Interface Pseudo-code** | Use actual framework decorators/annotations |
|
|
86
|
+
| **Database Design** | Use actual ORM entity definitions from conventions-data.md |
|
|
87
|
+
| **Transaction Boundaries** | Use actual framework transaction mechanism |
|
|
88
|
+
| **Exception Handling** | Use actual exception classes and error codes |
|
|
89
|
+
|
|
90
|
+
**Pseudo-code Requirements:**
|
|
91
|
+
- MUST use actual framework syntax from techs knowledge
|
|
92
|
+
- Spring Boot: `@RestController`, `@PostMapping`, `@Valid`, `@Transactional`, etc.
|
|
93
|
+
- NestJS: `@Controller`, `@Post`, `@Body`, `@UseGuards`, etc.
|
|
94
|
+
- Go: `gin.Context`, `echo.Context`, GORM annotations, etc.
|
|
95
|
+
|
|
96
|
+
### 4.3 Write Output
|
|
97
|
+
|
|
98
|
+
Write to: `speccrew-workspace/iterations/{number}-{type}-{name}/03.system-design/{platform_id}/{module}-design.md`
|
|
99
|
+
|
|
100
|
+
## Step 5: Generate Platform INDEX.md
|
|
101
|
+
|
|
102
|
+
After all module designs are complete:
|
|
103
|
+
|
|
104
|
+
### 5.1 Read Index Template
|
|
105
|
+
|
|
106
|
+
Read INDEX-TEMPLATE.md to understand platform-level document structure.
|
|
107
|
+
|
|
108
|
+
### 5.2 Fill Index Sections
|
|
109
|
+
|
|
110
|
+
| Section | Content |
|
|
111
|
+
|---------|---------|
|
|
112
|
+
| **Tech Stack Summary** | Extract from techs knowledge |
|
|
113
|
+
| **Shared Design Decisions** | Middleware stack, data source config, base service classes, common utilities |
|
|
114
|
+
| **Module List Table** | Links to each module design document |
|
|
115
|
+
| **Cross-Module Interaction Notes** | Shared services, event-driven patterns, dependencies |
|
|
116
|
+
| **Database Schema Overview** | New tables, modified tables, entity relationships |
|
|
117
|
+
|
|
118
|
+
### 5.3 Write Output
|
|
119
|
+
|
|
120
|
+
Write to: `speccrew-workspace/iterations/{number}-{type}-{name}/03.system-design/{platform_id}/INDEX.md`
|
|
121
|
+
|
|
122
|
+
## Step 6: Present Summary
|
|
123
|
+
|
|
124
|
+
Present to user:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
Backend System Design Summary for: {feature-name}
|
|
128
|
+
Platform: {platform_id}
|
|
129
|
+
|
|
130
|
+
Module Designs: {count}
|
|
131
|
+
├── [NEW] {count} modules
|
|
132
|
+
├── [MODIFIED] {count} modules
|
|
133
|
+
└── [EXISTING] {count} modules (no design needed)
|
|
134
|
+
|
|
135
|
+
Database Changes:
|
|
136
|
+
├── New Tables: {count}
|
|
137
|
+
├── Modified Tables: {count}
|
|
138
|
+
└── Migration Files: {count}
|
|
139
|
+
|
|
140
|
+
Key Design Decisions:
|
|
141
|
+
- {decision 1}
|
|
142
|
+
- {decision 2}
|
|
143
|
+
- {decision 3}
|
|
144
|
+
|
|
145
|
+
Files Generated:
|
|
146
|
+
- {list all file paths}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
# Key Rules
|
|
150
|
+
|
|
151
|
+
| Rule | Description |
|
|
152
|
+
|------|-------------|
|
|
153
|
+
| **Actual Framework Syntax** | All pseudo-code MUST use actual framework/library syntax from techs knowledge |
|
|
154
|
+
| **API Contract is READ-ONLY** | Do NOT modify API Contract, stop and report if issues found |
|
|
155
|
+
| **Migration Strategy Required** | Database design must include migration strategy, not just final schema |
|
|
156
|
+
| **Explicit Transaction Boundaries** | Transaction boundaries must be explicitly marked |
|
|
157
|
+
| **Exception Code Mapping** | Exception handling must map to API Contract error codes |
|
|
158
|
+
| **Follow Techs Conventions** | Naming, directory structure, patterns from techs knowledge |
|
|
159
|
+
|
|
160
|
+
# Mermaid Diagram Requirements
|
|
161
|
+
|
|
162
|
+
When generating Mermaid diagrams, follow compatibility guidelines:
|
|
163
|
+
|
|
164
|
+
- Use only basic node definitions: `A[text content]`
|
|
165
|
+
- No HTML tags (e.g., `<br/>`)
|
|
166
|
+
- No nested subgraphs
|
|
167
|
+
- No `direction` keyword
|
|
168
|
+
- No `style` definitions
|
|
169
|
+
- No special characters in node text
|
|
170
|
+
- Use standard `graph TB/LR` or `flowchart TD/LR` or `erDiagram` syntax only
|
|
171
|
+
|
|
172
|
+
# Checklist
|
|
173
|
+
|
|
174
|
+
- [ ] All techs knowledge documents loaded before design
|
|
175
|
+
- [ ] Feature Spec and API Contract read and understood
|
|
176
|
+
- [ ] Existing codebase structure analyzed (Glob/Grep)
|
|
177
|
+
- [ ] Function extraction completed with [EXISTING]/[MODIFIED]/[NEW] markers
|
|
178
|
+
- [ ] Checkpoint A passed: function list confirmed with user
|
|
179
|
+
- [ ] Every API in API Contract has a corresponding implementation design
|
|
180
|
+
- [ ] Database entities cover all data requirements from Feature Spec
|
|
181
|
+
- [ ] Transaction boundaries defined for multi-step operations
|
|
182
|
+
- [ ] Exception types map to API Contract error codes
|
|
183
|
+
- [ ] Pseudo-code uses actual framework syntax (not generic)
|
|
184
|
+
- [ ] conventions-data.md ORM patterns followed
|
|
185
|
+
- [ ] Migration requirements documented
|
|
186
|
+
- [ ] INDEX.md generated with complete module list
|
|
187
|
+
- [ ] All files written to correct paths under 03.system-design/{platform_id}/
|
|
188
|
+
- [ ] All Mermaid diagrams follow compatibility guidelines
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Backend System Design Index - {PlatformId}
|
|
2
|
+
|
|
3
|
+
> Platform: {PlatformId} | Framework: {Framework} | Language: {Language}
|
|
4
|
+
> Feature Spec: {FeatureSpecPath}
|
|
5
|
+
> Generated: {Timestamp}
|
|
6
|
+
|
|
7
|
+
## 1. Platform Tech Stack Summary
|
|
8
|
+
|
|
9
|
+
| Category | Technology | Version | Purpose |
|
|
10
|
+
|----------|-----------|---------|---------|
|
|
11
|
+
| Framework | {e.g., Spring Boot} | {version} | {purpose} |
|
|
12
|
+
| ORM | {e.g., MyBatis-Plus} | {version} | {purpose} |
|
|
13
|
+
| Database | {e.g., MySQL} | {version} | {purpose} |
|
|
14
|
+
| Cache | {e.g., Redis} | {version} | {purpose} |
|
|
15
|
+
| Auth | {e.g., Spring Security + JWT} | {version} | {purpose} |
|
|
16
|
+
| API Docs | {e.g., Swagger/SpringDoc} | {version} | {purpose} |
|
|
17
|
+
|
|
18
|
+
## 2. Shared Design Decisions
|
|
19
|
+
|
|
20
|
+
### 2.1 Middleware Stack
|
|
21
|
+
|
|
22
|
+
| Middleware | Order | Purpose | Configuration |
|
|
23
|
+
|-----------|-------|---------|--------------|
|
|
24
|
+
| {middleware} | {order} | {purpose} | {key config} |
|
|
25
|
+
|
|
26
|
+
### 2.2 Data Source Configuration
|
|
27
|
+
|
|
28
|
+
{Description of database connection, connection pool, read-write separation if applicable}
|
|
29
|
+
|
|
30
|
+
### 2.3 Base Classes and Shared Services
|
|
31
|
+
|
|
32
|
+
| Class/Service | Path | Purpose | Used By |
|
|
33
|
+
|--------------|------|---------|---------|
|
|
34
|
+
| {base class} | {path} | {purpose} | {which modules} |
|
|
35
|
+
|
|
36
|
+
### 2.4 Common Utilities
|
|
37
|
+
|
|
38
|
+
| Utility | Path | Purpose |
|
|
39
|
+
|---------|------|---------|
|
|
40
|
+
| {utility} | {path} | {purpose} |
|
|
41
|
+
|
|
42
|
+
### 2.5 Authentication and Authorization
|
|
43
|
+
|
|
44
|
+
{Description of auth mechanism, permission model, annotation-based access control}
|
|
45
|
+
|
|
46
|
+
## 3. Module Design Index
|
|
47
|
+
|
|
48
|
+
| Module | Scope | APIs | Entities | Status | Document |
|
|
49
|
+
|--------|-------|------|----------|--------|----------|
|
|
50
|
+
| {module-name} | {brief scope} | {count} | {count} | [NEW]/[MODIFIED] | [{module-name}-design.md](./{module-name}-design.md) |
|
|
51
|
+
|
|
52
|
+
## 4. Cross-Module Interaction Notes
|
|
53
|
+
|
|
54
|
+
{Describe any shared services, event-driven patterns, or cross-module dependencies}
|
|
55
|
+
|
|
56
|
+
## 5. Database Schema Overview
|
|
57
|
+
|
|
58
|
+
### 5.1 New Tables
|
|
59
|
+
|
|
60
|
+
| Table | Module | Description |
|
|
61
|
+
|-------|--------|-------------|
|
|
62
|
+
| {table} | {module} | {purpose} |
|
|
63
|
+
|
|
64
|
+
### 5.2 Modified Tables
|
|
65
|
+
|
|
66
|
+
| Table | Module | Change Type | Description |
|
|
67
|
+
|-------|--------|------------|-------------|
|
|
68
|
+
| {table} | {module} | ADD COLUMN/MODIFY/... | {what changed} |
|
|
69
|
+
|
|
70
|
+
### 5.3 Entity Relationship Overview
|
|
71
|
+
|
|
72
|
+
```mermaid
|
|
73
|
+
erDiagram
|
|
74
|
+
ENTITY_A ||--o{ ENTITY_B : "has"
|
|
75
|
+
ENTITY_B ||--o{ ENTITY_C : "contains"
|
|
76
|
+
ENTITY_A ||--o| ENTITY_D : "references"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 6. Directory Structure Impact
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
{source-directory}/
|
|
83
|
+
├── {new directories and files to be created}
|
|
84
|
+
└── {modified directories and files}
|
|
85
|
+
```
|