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,1087 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: speccrew-knowledge-techs-generate
|
|
3
|
+
description: Stage 2 of technology knowledge initialization - Generate technology documentation for a specific platform. Extracts tech stack, architecture, and conventions from configuration files and source code. Creates INDEX.md, tech-stack.md, architecture.md, and conventions-*.md files. Used by Worker Agent in parallel for each detected platform.
|
|
4
|
+
tools: Read, Write, Glob, Grep, Skill
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
> **⚠️ DEPRECATED**: This skill has been split into two specialized skills for parallel execution:
|
|
8
|
+
> - **`speccrew-knowledge-techs-generate-conventions`** — Generates convention documents (INDEX, tech-stack, architecture, conventions-*)
|
|
9
|
+
> - **`speccrew-knowledge-techs-generate-ui-style`** — Generates UI style documents (ui-style/ directory, frontend platforms only)
|
|
10
|
+
>
|
|
11
|
+
> **Do NOT invoke this skill directly.** Use the specialized skills via `speccrew-knowledge-techs-dispatch` Stage 2 dual-worker orchestration.
|
|
12
|
+
> This file is retained as reference documentation only.
|
|
13
|
+
|
|
14
|
+
# Stage 2: Generate Platform Technology Documents
|
|
15
|
+
|
|
16
|
+
Generate comprehensive technology documentation for a specific platform by analyzing its configuration files and source code structure.
|
|
17
|
+
|
|
18
|
+
## Language Adaptation
|
|
19
|
+
|
|
20
|
+
**CRITICAL**: Generate all content in the language specified by the `language` parameter.
|
|
21
|
+
|
|
22
|
+
- `language: "zh"` → Generate all content in 中文
|
|
23
|
+
- `language: "en"` → Generate all content in English
|
|
24
|
+
- Other languages → Use the specified language
|
|
25
|
+
|
|
26
|
+
## Trigger Scenarios
|
|
27
|
+
|
|
28
|
+
- "Generate technology documents for {platform}"
|
|
29
|
+
- "Create tech stack documentation"
|
|
30
|
+
- "Extract conventions from {platform}"
|
|
31
|
+
- "Generate platform tech docs"
|
|
32
|
+
|
|
33
|
+
## User
|
|
34
|
+
|
|
35
|
+
Worker Agent (speccrew-task-worker)
|
|
36
|
+
|
|
37
|
+
## Input
|
|
38
|
+
|
|
39
|
+
- `platform_id`: Platform identifier (e.g., "web-react", "backend-nestjs")
|
|
40
|
+
- `platform_type`: Platform type (web, mobile, backend, desktop)
|
|
41
|
+
- `framework`: Primary framework (react, nestjs, flutter, etc.)
|
|
42
|
+
- `source_path`: Platform source directory
|
|
43
|
+
- `config_files`: List of configuration file paths
|
|
44
|
+
- `convention_files`: List of convention file paths (eslint, prettier, etc.)
|
|
45
|
+
- `output_path`: Output directory for generated documents (e.g., `speccrew-workspace/knowledges/techs/{platform_id}/`)
|
|
46
|
+
- `language`: Target language (e.g., "zh", "en") - **REQUIRED**
|
|
47
|
+
- `completed_dir`: (Optional) Directory for analysis coverage report output. If provided, the analysis JSON will be written here instead of the knowledges directory
|
|
48
|
+
|
|
49
|
+
## Output
|
|
50
|
+
|
|
51
|
+
Generate the following documents in `{output_path}/`:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
{output_path}/
|
|
55
|
+
├── INDEX.md # Platform technology index (Required)
|
|
56
|
+
├── tech-stack.md # Technology stack details (Required)
|
|
57
|
+
├── architecture.md # Architecture conventions (Required)
|
|
58
|
+
├── conventions-design.md # Design conventions (Required)
|
|
59
|
+
├── conventions-dev.md # Development conventions (Required)
|
|
60
|
+
├── conventions-unit-test.md # Unit testing conventions (Required)
|
|
61
|
+
├── conventions-system-test.md # System testing conventions (Required)
|
|
62
|
+
├── conventions-build.md # Build & Deployment conventions (Required)
|
|
63
|
+
├── conventions-data.md # Data conventions (Optional)
|
|
64
|
+
└── ui-style/ # UI style analysis (Optional, frontend platforms only)
|
|
65
|
+
├── ui-style-guide.md # Main UI style guide
|
|
66
|
+
├── page-types/ # Page type analysis
|
|
67
|
+
├── components/ # Component analysis
|
|
68
|
+
├── layouts/ # Layout patterns
|
|
69
|
+
└── styles/ # Styling conventions
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Platform Type to Document Mapping
|
|
73
|
+
|
|
74
|
+
| Platform Type | Required Documents | Optional Documents | Generate conventions-data.md? |
|
|
75
|
+
|---------------|-------------------|-------------------|------------------------------|
|
|
76
|
+
| `backend` | All 8 docs | - | ✅ **必须生成** - 包含 ORM、数据建模、缓存策略 |
|
|
77
|
+
| `web` | All 8 docs | conventions-data.md | ⚠️ **条件生成** - 仅当使用 ORM/数据层时(Prisma、TypeORM、Sequelize 等) |
|
|
78
|
+
| `mobile` | All 8 docs | conventions-data.md | ❌ **默认不生成** - 根据实际技术栈判断 |
|
|
79
|
+
| `desktop` | All 8 docs | conventions-data.md | ❌ **默认不生成** - 根据实际技术栈判断 |
|
|
80
|
+
| `api` | All 8 docs | conventions-data.md | ⚠️ **条件生成** - 根据是否有数据层 |
|
|
81
|
+
|
|
82
|
+
### Decision Logic for conventions-data.md
|
|
83
|
+
|
|
84
|
+
**Step 1: Check Platform Type**
|
|
85
|
+
- If `backend` → **Generate** (always)
|
|
86
|
+
- If `web`/`mobile`/`desktop`/`api` → Proceed to Step 2
|
|
87
|
+
|
|
88
|
+
**Step 2: Detect Data Layer (for non-backend platforms)**
|
|
89
|
+
|
|
90
|
+
Check configuration files for data layer indicators:
|
|
91
|
+
|
|
92
|
+
| Indicator | Technology | Action |
|
|
93
|
+
|-----------|------------|--------|
|
|
94
|
+
| `prisma` in package.json dependencies | Prisma ORM | Generate conventions-data.md |
|
|
95
|
+
| `typeorm` in package.json dependencies | TypeORM | Generate conventions-data.md |
|
|
96
|
+
| `sequelize` in package.json dependencies | Sequelize | Generate conventions-data.md |
|
|
97
|
+
| `mongoose` in package.json dependencies | Mongoose | Generate conventions-data.md |
|
|
98
|
+
| `drizzle-orm` in package.json dependencies | Drizzle ORM | Generate conventions-data.md |
|
|
99
|
+
| `firebase` / `@react-native-firebase` | Firebase | Generate conventions-data.md (lightweight) |
|
|
100
|
+
| `sqlite` / `realm` / `@realm/react` | SQLite/Realm | Generate conventions-data.md (lightweight) |
|
|
101
|
+
| `core-data` in iOS project | Core Data | Generate conventions-data.md |
|
|
102
|
+
| `room` in Android project | Room Persistence | Generate conventions-data.md |
|
|
103
|
+
| None detected | - | **Skip** conventions-data.md |
|
|
104
|
+
|
|
105
|
+
**Step 3: Report Decision**
|
|
106
|
+
```
|
|
107
|
+
Platform: {platform_id}
|
|
108
|
+
Type: {platform_type}
|
|
109
|
+
Framework: {framework}
|
|
110
|
+
Data Layer Detected: {yes/no/technology}
|
|
111
|
+
Generate conventions-data.md: {yes/no}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Workflow
|
|
115
|
+
|
|
116
|
+
```mermaid
|
|
117
|
+
flowchart TD
|
|
118
|
+
Start([Start]) --> Step0[Step 0: Read Document Templates]
|
|
119
|
+
Step0 --> Step1[Step 1: Read Configuration Files]
|
|
120
|
+
Step1 --> Step2[Step 2: Extract Technology Stack]
|
|
121
|
+
Step2 --> Step3[Step 3: Analyze Conventions]
|
|
122
|
+
Step3 --> Step4[Step 4: Invoke UI Style Analysis]
|
|
123
|
+
Step4 --> Step5[Step 5: Generate Documents]
|
|
124
|
+
Step5 --> Step6[Step 6: Write Output Files]
|
|
125
|
+
Step6 --> Step7[Step 7: Generate Analysis Coverage Report]
|
|
126
|
+
Step7 --> Step8[Step 8: Report Results]
|
|
127
|
+
Step8 --> End([End])
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Step 0: Read Document Templates
|
|
131
|
+
|
|
132
|
+
Before processing, read all template files to understand the required content structure for each document type:
|
|
133
|
+
- **Read**: `templates/INDEX-TEMPLATE.md` - Platform overview and navigation hub structure
|
|
134
|
+
- **Read**: `templates/TECH-STACK-TEMPLATE.md` - Technology stack details structure
|
|
135
|
+
- **Read**: `templates/ARCHITECTURE-TEMPLATE.md` - Architecture patterns and conventions structure
|
|
136
|
+
- **Read**: `templates/CONVENTIONS-DESIGN-TEMPLATE.md` - Design principles and patterns structure
|
|
137
|
+
- **Read**: `templates/CONVENTIONS-DEV-TEMPLATE.md` - Development conventions structure
|
|
138
|
+
- **Read**: `templates/CONVENTIONS-UNIT-TEST-TEMPLATE.md` - Unit testing conventions structure
|
|
139
|
+
- **Read**: `templates/CONVENTIONS-SYSTEM-TEST-TEMPLATE.md` - System testing conventions structure
|
|
140
|
+
- **Read**: `templates/CONVENTIONS-BUILD-TEMPLATE.md` - Build and deployment conventions structure
|
|
141
|
+
- **Read**: `templates/CONVENTIONS-DATA-TEMPLATE.md` - Data layer conventions structure (if applicable)
|
|
142
|
+
- **Purpose**: Understand each template's chapters and example content requirements
|
|
143
|
+
- **Key principle**: Extract information from source code according to template section requirements
|
|
144
|
+
|
|
145
|
+
### Step 1: Read Configuration Files
|
|
146
|
+
|
|
147
|
+
Read and parse all configuration files for the platform:
|
|
148
|
+
|
|
149
|
+
**Primary Config Files:**
|
|
150
|
+
- package.json / pom.xml / requirements.txt / pubspec.yaml / go.mod
|
|
151
|
+
- tsconfig.json / jsconfig.json
|
|
152
|
+
- Build config: vite.config.* / webpack.config.* / next.config.* / nest-cli.json
|
|
153
|
+
|
|
154
|
+
**Convention Files:**
|
|
155
|
+
- ESLint: .eslintrc.* / eslint.config.*
|
|
156
|
+
- Prettier: .prettierrc.* / prettier.config.*
|
|
157
|
+
- Testing: jest.config.* / vitest.config.* / pytest.ini
|
|
158
|
+
- Git: .gitignore, .gitattributes
|
|
159
|
+
|
|
160
|
+
### Step 2: Extract Technology Stack
|
|
161
|
+
|
|
162
|
+
Parse configuration files to extract:
|
|
163
|
+
|
|
164
|
+
**Core Framework:**
|
|
165
|
+
- Name and version from dependencies
|
|
166
|
+
- Primary language (TypeScript, JavaScript, Dart, etc.)
|
|
167
|
+
|
|
168
|
+
**Dependencies:**
|
|
169
|
+
- Production dependencies (grouped by purpose)
|
|
170
|
+
- Development dependencies
|
|
171
|
+
- Key library versions
|
|
172
|
+
|
|
173
|
+
**Build Tools:**
|
|
174
|
+
- Bundler (Vite, Webpack, Rollup)
|
|
175
|
+
- Transpiler (TypeScript, Babel)
|
|
176
|
+
- Task runner (npm scripts, Gradle, Maven)
|
|
177
|
+
|
|
178
|
+
**Example Extraction:**
|
|
179
|
+
```json
|
|
180
|
+
{
|
|
181
|
+
"framework": "React",
|
|
182
|
+
"framework_version": "18.2.0",
|
|
183
|
+
"language": "TypeScript",
|
|
184
|
+
"language_version": "5.3.0",
|
|
185
|
+
"build_tool": "Vite 5.0.0",
|
|
186
|
+
"key_dependencies": [
|
|
187
|
+
{ "name": "react-router-dom", "version": "6.20.0", "purpose": "Routing" },
|
|
188
|
+
{ "name": "zustand", "version": "4.4.0", "purpose": "State Management" }
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Step 3: Analyze Conventions
|
|
194
|
+
|
|
195
|
+
1. **Read Configuration**:
|
|
196
|
+
- Read `speccrew-workspace/docs/rules/mermaid-rule.md` - Get Mermaid diagram compatibility guidelines
|
|
197
|
+
|
|
198
|
+
2. **Extract conventions from configuration files:**
|
|
199
|
+
|
|
200
|
+
**From ESLint Config:**
|
|
201
|
+
- Enabled rules
|
|
202
|
+
- Code style preferences
|
|
203
|
+
- Import/export patterns
|
|
204
|
+
|
|
205
|
+
**From Prettier Config:**
|
|
206
|
+
- Formatting rules (semi, quotes, tabWidth)
|
|
207
|
+
- Print width
|
|
208
|
+
|
|
209
|
+
**From Project Structure:**
|
|
210
|
+
- Directory conventions (src/, components/, utils/)
|
|
211
|
+
- File naming patterns
|
|
212
|
+
- Module organization
|
|
213
|
+
|
|
214
|
+
3. **Apply Mermaid Rules**:
|
|
215
|
+
- Follow compatibility guidelines from `mermaid-rule.md`
|
|
216
|
+
- See: [Mermaid Diagram Guide](#mermaid-diagram-guide)
|
|
217
|
+
|
|
218
|
+
### Domain-Specific Convention Extraction (MANDATORY)
|
|
219
|
+
|
|
220
|
+
In addition to the general conventions above, you MUST actively search for and extract the following domain-specific topics. These are critical for downstream Agents (solution, design, development, testing).
|
|
221
|
+
|
|
222
|
+
**For Frontend Platforms (web-vue, mobile-uniapp, etc.):**
|
|
223
|
+
|
|
224
|
+
| Topic | What to Search For | Where to Look |
|
|
225
|
+
|-------|-------------------|---------------|
|
|
226
|
+
| **i18n/Internationalization** | i18n framework config, locale files, translation key patterns | `locales/`, `i18n/`, `lang/`, package.json deps |
|
|
227
|
+
| **Authorization & Permissions** | Permission directives (`v-hasPermi`), route guards, permission stores | `permission/`, `router/`, `store/`, `utils/auth` |
|
|
228
|
+
| **Menu Registration** | Menu config, dynamic menu loading, menu-to-route mapping | `router/`, `store/`, `layout/`, API calls for menus |
|
|
229
|
+
| **Data Dictionary** | Dict components (`DictTag`), dict stores, dict API calls | `components/Dict`, `utils/dict`, `store/` |
|
|
230
|
+
| **Logging** | Error reporting service, console policy, error boundaries | `utils/log`, `plugins/sentry`, error handling config |
|
|
231
|
+
| **API Request Layer** | Axios/fetch instance, interceptors, token refresh, base URL config | `utils/request`, `api/`, `config/`, `interceptors/` |
|
|
232
|
+
| **Data Validation** | Form validation rules, custom validators, validation timing | `utils/validate`, form schemas, component props validation |
|
|
233
|
+
| **File Upload** | Upload components, upload API calls, file size limits | `components/Upload`, `api/file`, `utils/upload` |
|
|
234
|
+
|
|
235
|
+
**For Backend Platforms (backend-spring, etc.):**
|
|
236
|
+
|
|
237
|
+
| Topic | What to Search For | Where to Look |
|
|
238
|
+
|-------|-------------------|---------------|
|
|
239
|
+
| **Authorization & Permissions** | `@PreAuthorize`, `@DataPermission`, security config, permission enums | Security config, controller annotations, framework modules |
|
|
240
|
+
| **Data Dictionary** | Dict entity, dict service, dict cache, dict enum patterns | `dict/`, `system/` module, enum classes |
|
|
241
|
+
| **Multi-tenancy** | Tenant interceptor/plugin, tenant column, tenant context, `@TenantIgnore` | MyBatis plugins, framework config, base entity |
|
|
242
|
+
| **Backend i18n** | messages.properties, MessageSource, i18n config, ValidationMessages | `resources/i18n/`, `messages*.properties`, i18n config beans |
|
|
243
|
+
| **Logging** | Logger usage, log config (logback.xml/log4j2), operation log annotation, audit trail | `logback*.xml`, `log4j2*.xml`, `@OperateLog`, `operatelog/` module |
|
|
244
|
+
| **Exception Handling** | GlobalExceptionHandler, business exceptions, error codes, error response format | `handler/`, `exception/`, `enums/ErrorCode`, `GlobalExceptionHandler` |
|
|
245
|
+
| **Caching** | @Cacheable, RedisTemplate, cache key patterns, cache config | `cache/`, `redis/`, `CacheConfig`, `@Cacheable` annotations |
|
|
246
|
+
| **Data Validation** | @Valid, @Validated, custom validators, validation groups | DTO classes, `validator/`, `@NotNull/@Size` patterns |
|
|
247
|
+
| **Scheduled Jobs** | @Scheduled, Quartz config, XXL-Job handler, cron expressions | `job/`, `task/`, `schedule/`, `@Scheduled` methods |
|
|
248
|
+
| **File Storage** | FileService, upload API, OSS/S3 config, file path patterns | `file/`, `infra/file/`, `FileClient`, storage config |
|
|
249
|
+
|
|
250
|
+
**If a topic is not found in the source code**, explicitly state "Not applicable" in the corresponding template section. Do NOT leave the section empty or skip it silently.
|
|
251
|
+
|
|
252
|
+
### Analysis Tracking (MANDATORY)
|
|
253
|
+
|
|
254
|
+
During Step 3, you MUST maintain an internal tracking record for each topic you search. For every topic in the tables above:
|
|
255
|
+
|
|
256
|
+
1. **Search** the source code using the "Where to Look" paths
|
|
257
|
+
2. **Record** the result:
|
|
258
|
+
- `found` — Topic implementation found, relevant files identified
|
|
259
|
+
- `not_found` — Searched all suggested paths, no implementation exists
|
|
260
|
+
- `partial` — Some aspects found but incomplete
|
|
261
|
+
3. **List** all files you actually read/analyzed for that topic
|
|
262
|
+
|
|
263
|
+
This tracking data will be used in Step 8 to generate the analysis coverage report. Do NOT skip any topic — if a topic is not applicable to this platform type, record it as `not_found` with a note.
|
|
264
|
+
|
|
265
|
+
**Topic Checklist by Platform Type:**
|
|
266
|
+
|
|
267
|
+
**Frontend Topics (web, mobile, desktop):**
|
|
268
|
+
1. i18n / Internationalization
|
|
269
|
+
2. Authorization & Permissions
|
|
270
|
+
3. Menu Registration & Routing
|
|
271
|
+
4. Data Dictionary Usage
|
|
272
|
+
5. Logging & Error Reporting
|
|
273
|
+
6. API Request Layer (Axios/fetch)
|
|
274
|
+
7. Data Validation
|
|
275
|
+
8. File Upload & Storage
|
|
276
|
+
9. UI Style System (handled in Step 4)
|
|
277
|
+
|
|
278
|
+
**Backend Topics (backend):**
|
|
279
|
+
1. Backend Internationalization
|
|
280
|
+
2. Authorization & Permissions (annotations, data permission)
|
|
281
|
+
3. Data Dictionary Management
|
|
282
|
+
4. Logging & Audit Trail
|
|
283
|
+
5. Exception Handling & Error Codes
|
|
284
|
+
6. Caching Strategy
|
|
285
|
+
7. Data Validation (JSR 380, custom validators)
|
|
286
|
+
8. Scheduled Jobs & Task Scheduling
|
|
287
|
+
9. File Storage
|
|
288
|
+
10. Multi-tenancy
|
|
289
|
+
|
|
290
|
+
### Step 4: UI Style Analysis (Frontend Platforms Only) - WITH FALLBACK
|
|
291
|
+
|
|
292
|
+
If `platform_type` is `web`, `mobile`, or `desktop`:
|
|
293
|
+
|
|
294
|
+
**Directory Ownership**:
|
|
295
|
+
- `ui-style/` — Fully managed by techs pipeline (this skill)
|
|
296
|
+
- Contains: ui-style-guide.md, styles/, page-types/, components/, layouts/
|
|
297
|
+
- Source: Framework-level design system analysis from source code
|
|
298
|
+
- `ui-style-patterns/` — Managed by bizs pipeline (Stage 3.5: bizs-ui-style-extract)
|
|
299
|
+
- Contains: Business pattern aggregation from feature documents
|
|
300
|
+
- NOT created or written by this skill
|
|
301
|
+
- May not exist if bizs pipeline has not been executed
|
|
302
|
+
|
|
303
|
+
**Primary Path (UI Analyzer Available and Succeeds)**:
|
|
304
|
+
1. **CRITICAL**: Use the Skill tool to invoke `speccrew-knowledge-techs-ui-analyze` with these exact parameters:
|
|
305
|
+
```
|
|
306
|
+
skill: "speccrew-knowledge-techs-ui-analyze"
|
|
307
|
+
args: "source_path={source_path};platform_id={platform_id};platform_type={platform_type};framework={framework};output_path={output_path}/ui-style/;language={language}"
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
2. **Wait for completion** and verify output files exist:
|
|
311
|
+
- `{output_path}/ui-style/ui-style-guide.md` ✓
|
|
312
|
+
- `{output_path}/ui-style/page-types/page-type-summary.md` ✓
|
|
313
|
+
- `{output_path}/ui-style/page-types/[type]-pages.md` (one per discovered type) ✓
|
|
314
|
+
- `{output_path}/ui-style/components/component-library.md` ✓
|
|
315
|
+
- `{output_path}/ui-style/components/common-components.md` ✓
|
|
316
|
+
- `{output_path}/ui-style/components/business-components.md` ✓
|
|
317
|
+
- `{output_path}/ui-style/layouts/page-layouts.md` ✓
|
|
318
|
+
- `{output_path}/ui-style/layouts/navigation-patterns.md` ✓
|
|
319
|
+
- `{output_path}/ui-style/styles/color-system.md` ✓
|
|
320
|
+
- `{output_path}/ui-style/styles/typography.md` ✓
|
|
321
|
+
- `{output_path}/ui-style/styles/spacing-system.md` ✓
|
|
322
|
+
|
|
323
|
+
3. If all outputs verified → proceed to next step
|
|
324
|
+
4. Record: `ui_style_analysis_level = "full"`
|
|
325
|
+
|
|
326
|
+
**Secondary Path (UI Analyzer Fails or Partial Output)**:
|
|
327
|
+
|
|
328
|
+
**MANDATORY: UI Style Fallback Path - Complete Directory Structure**
|
|
329
|
+
|
|
330
|
+
When UI Style Analyzer fails or produces incomplete output, you MUST create ALL of the following directories and files. Skipping ANY item is FORBIDDEN.
|
|
331
|
+
|
|
332
|
+
**Required Directory Structure (MANDATORY - ALL items must be created):**
|
|
333
|
+
```
|
|
334
|
+
ui-style/
|
|
335
|
+
├── ui-style-guide.md ← MANDATORY
|
|
336
|
+
├── page-types/
|
|
337
|
+
│ └── page-type-summary.md ← MANDATORY
|
|
338
|
+
├── components/
|
|
339
|
+
│ └── component-library.md ← MANDATORY
|
|
340
|
+
├── layouts/
|
|
341
|
+
│ └── page-layouts.md ← MANDATORY
|
|
342
|
+
└── styles/
|
|
343
|
+
└── color-system.md ← MANDATORY
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
**Self-Verification Checklist (MUST complete before reporting success):**
|
|
347
|
+
- [ ] ui-style/ui-style-guide.md exists and has content
|
|
348
|
+
- [ ] ui-style/page-types/page-type-summary.md exists and has content
|
|
349
|
+
- [ ] ui-style/components/component-library.md exists and has content
|
|
350
|
+
- [ ] ui-style/layouts/page-layouts.md exists and has content
|
|
351
|
+
- [ ] ui-style/styles/color-system.md exists and has content
|
|
352
|
+
|
|
353
|
+
If ANY file in the checklist is missing, you MUST create it before proceeding to the next step. Do NOT report "completed" with missing files.
|
|
354
|
+
|
|
355
|
+
**Execution Steps:**
|
|
356
|
+
|
|
357
|
+
1. Create ui-style directory structure:
|
|
358
|
+
`{output_path}/ui-style/`, `{output_path}/ui-style/page-types/`, `{output_path}/ui-style/components/`, `{output_path}/ui-style/layouts/`, `{output_path}/ui-style/styles/`
|
|
359
|
+
|
|
360
|
+
2. Generate minimal ui-style-guide.md by manually scanning source code:
|
|
361
|
+
- Design system: identify UI framework from dependencies (Material UI, Ant Design, Tailwind, etc.)
|
|
362
|
+
- Color system: scan for CSS variables, theme files, or color constants in `{source_path}/src/styles/` or `{source_path}/src/theme/`
|
|
363
|
+
- Typography: scan for font-family declarations
|
|
364
|
+
- Component library: list directories under `{source_path}/src/components/`
|
|
365
|
+
- Page types: list directories/files under `{source_path}/src/pages/` or `{source_path}/src/views/`
|
|
366
|
+
|
|
367
|
+
3. Content structure for minimal ui-style-guide.md:
|
|
368
|
+
```markdown
|
|
369
|
+
# UI Style Guide - {platform_id}
|
|
370
|
+
|
|
371
|
+
> Note: Generated from manual source code inspection. Automated UI analysis was unavailable.
|
|
372
|
+
|
|
373
|
+
## Design System
|
|
374
|
+
- UI Framework: {detected from package.json}
|
|
375
|
+
- CSS Approach: {CSS Modules / Tailwind / styled-components / SCSS - detected from config}
|
|
376
|
+
|
|
377
|
+
## Component Library Overview
|
|
378
|
+
{list component directories found}
|
|
379
|
+
|
|
380
|
+
## Page Types Identified
|
|
381
|
+
{list page directories/files found}
|
|
382
|
+
|
|
383
|
+
## Styling Configuration
|
|
384
|
+
{extract from tailwind.config / theme file / CSS variables file}
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
4. **MANDATORY: UI Style Fallback - Copy Template + Fill Workflow**
|
|
388
|
+
|
|
389
|
+
For each ui-style sub-document, copy the template and use search_replace to fill:
|
|
390
|
+
|
|
391
|
+
**4.1 component-library.md**:
|
|
392
|
+
- Copy `templates/COMPONENT-LIBRARY-TEMPLATE.md` to `{output_path}/ui-style/components/component-library.md`
|
|
393
|
+
- Use search_replace to fill each AI-TAG section with data extracted from source code
|
|
394
|
+
- MUST include props tables for at least the top 5 most-used components
|
|
395
|
+
- Fill: COMPONENT_CATEGORIES, API_REFERENCE, COMPOSITION_PATTERNS, AGENT_GUIDE sections
|
|
396
|
+
|
|
397
|
+
**4.2 page-layouts.md**:
|
|
398
|
+
- Copy `templates/PAGE-LAYOUTS-TEMPLATE.md` to `{output_path}/ui-style/layouts/page-layouts.md`
|
|
399
|
+
- Fill layout types, slots, responsive behavior from source analysis
|
|
400
|
+
- Fill: LAYOUT_TYPES, LAYOUT_DETAILS, NAVIGATION sections
|
|
401
|
+
|
|
402
|
+
**4.3 page-type-summary.md**:
|
|
403
|
+
- Copy `templates/PAGE-TYPE-SUMMARY-TEMPLATE.md` to `{output_path}/ui-style/page-types/page-type-summary.md`
|
|
404
|
+
- Fill page classifications and routing conventions
|
|
405
|
+
- Fill: PAGE_TYPES, PAGE_TYPE_DETAILS, ROUTING sections
|
|
406
|
+
|
|
407
|
+
**4.4 color-system.md**:
|
|
408
|
+
- Copy `templates/COLOR-SYSTEM-TEMPLATE.md` to `{output_path}/ui-style/styles/color-system.md`
|
|
409
|
+
- Fill theme colors, functional colors, typography from CSS/SCSS variables
|
|
410
|
+
- Fill: THEME_COLORS, FUNCTIONAL_COLORS, SEMANTIC_TOKENS, TYPOGRAPHY, SPACING sections
|
|
411
|
+
|
|
412
|
+
5. Record: `ui_style_analysis_level = "minimal"`
|
|
413
|
+
|
|
414
|
+
**Tertiary Path (No UI Analysis Possible)**:
|
|
415
|
+
If source code scanning also fails (e.g., non-standard structure):
|
|
416
|
+
1. Create `{output_path}/ui-style/ui-style-guide.md` with references only:
|
|
417
|
+
```markdown
|
|
418
|
+
# UI Style Guide - {platform_id}
|
|
419
|
+
|
|
420
|
+
> Note: Automated and manual UI analysis were not possible for this platform.
|
|
421
|
+
> Manual inspection of source code is required.
|
|
422
|
+
|
|
423
|
+
## References
|
|
424
|
+
- Source components: {source_path}/src/components/ (if exists)
|
|
425
|
+
- Source pages: {source_path}/src/pages/ (if exists)
|
|
426
|
+
- Style files: {source_path}/src/styles/ (if exists)
|
|
427
|
+
- Package dependencies: {source_path}/package.json
|
|
428
|
+
```
|
|
429
|
+
2. Record: `ui_style_analysis_level = "reference_only"`
|
|
430
|
+
|
|
431
|
+
**In conventions-design.md, ALWAYS include UI reference section**:
|
|
432
|
+
Regardless of analysis level, conventions-design.md MUST contain:
|
|
433
|
+
```markdown
|
|
434
|
+
## UI Design Conventions
|
|
435
|
+
|
|
436
|
+
Refer to [UI Style Guide](ui-style/ui-style-guide.md) for design system details.
|
|
437
|
+
|
|
438
|
+
Analysis completeness: {ui_style_analysis_level}
|
|
439
|
+
- full: Complete automated analysis available
|
|
440
|
+
- minimal: Manual inspection results only
|
|
441
|
+
- reference_only: Source file references only - manual review needed
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
### Step 5: Generate Documents (MANDATORY: Copy Template + Fill)
|
|
445
|
+
|
|
446
|
+
**CRITICAL**: This step MUST follow the template fill workflow - copy template first, then fill sections.
|
|
447
|
+
|
|
448
|
+
1. **For Each Document, Follow This Workflow**:
|
|
449
|
+
|
|
450
|
+
**Step 5.1: Copy Template File**
|
|
451
|
+
- Copy the corresponding template file to the output path:
|
|
452
|
+
- `templates/INDEX-TEMPLATE.md` → `{output_path}/INDEX.md`
|
|
453
|
+
- `templates/TECH-STACK-TEMPLATE.md` → `{output_path}/tech-stack.md`
|
|
454
|
+
- `templates/ARCHITECTURE-TEMPLATE.md` → `{output_path}/architecture.md`
|
|
455
|
+
- `templates/CONVENTIONS-DESIGN-TEMPLATE.md` → `{output_path}/conventions-design.md`
|
|
456
|
+
- `templates/CONVENTIONS-DEV-TEMPLATE.md` → `{output_path}/conventions-dev.md`
|
|
457
|
+
- `templates/CONVENTIONS-UNIT-TEST-TEMPLATE.md` → `{output_path}/conventions-unit-test.md`
|
|
458
|
+
- `templates/CONVENTIONS-SYSTEM-TEST-TEMPLATE.md` → `{output_path}/conventions-system-test.md`
|
|
459
|
+
- `templates/CONVENTIONS-BUILD-TEMPLATE.md` → `{output_path}/conventions-build.md`
|
|
460
|
+
- `templates/CONVENTIONS-DATA-TEMPLATE.md` → `{output_path}/conventions-data.md` (if applicable)
|
|
461
|
+
|
|
462
|
+
**Step 5.2: Fill Template Sections with search_replace**
|
|
463
|
+
- Use `search_replace` tool to fill each section of the template
|
|
464
|
+
- Replace placeholder content with actual analyzed data
|
|
465
|
+
- Follow [Document Structure Standard](#document-structure-standard)
|
|
466
|
+
- Apply [Source Traceability Requirements](#source-traceability-requirements)
|
|
467
|
+
|
|
468
|
+
**MANDATORY RULES**:
|
|
469
|
+
- **Do NOT use create_file to rewrite the entire document**
|
|
470
|
+
- **Do NOT delete or skip any template section**
|
|
471
|
+
- Only replace the placeholder content within each section
|
|
472
|
+
- Preserve all template section headers and structure
|
|
473
|
+
|
|
474
|
+
2. **Document Generation Order**:
|
|
475
|
+
- Generate: INDEX.md, tech-stack.md, architecture.md, conventions-design.md, conventions-dev.md, conventions-unit-test.md, conventions-system-test.md, conventions-build.md, conventions-data.md (if applicable)
|
|
476
|
+
|
|
477
|
+
### Step 6: Write Output Files
|
|
478
|
+
|
|
479
|
+
Create output directory if not exists, then write all generated documents.
|
|
480
|
+
|
|
481
|
+
### Step 7: Generate Analysis Coverage Report (MANDATORY)
|
|
482
|
+
|
|
483
|
+
After completing all document generation, you MUST create an analysis coverage report as a JSON file.
|
|
484
|
+
|
|
485
|
+
**Output file**: `{completed_dir}/{platform_id}.analysis.json`
|
|
486
|
+
|
|
487
|
+
Where `{completed_dir}` is the directory passed via the `completed_dir` parameter (if provided). If `completed_dir` is not provided, output to the platform's knowledges directory.
|
|
488
|
+
|
|
489
|
+
**Report Format**:
|
|
490
|
+
|
|
491
|
+
```json
|
|
492
|
+
{
|
|
493
|
+
"platform_id": "{platform_id}",
|
|
494
|
+
"platform_type": "{platform_type}",
|
|
495
|
+
"analyzed_at": "{ISO 8601 timestamp}",
|
|
496
|
+
"topics": {
|
|
497
|
+
"i18n": {
|
|
498
|
+
"status": "found",
|
|
499
|
+
"files_analyzed": ["src/i18n/index.ts", "locales/zh-CN.ts"],
|
|
500
|
+
"notes": "Vue I18n with 2 locale files"
|
|
501
|
+
},
|
|
502
|
+
"authorization": {
|
|
503
|
+
"status": "found",
|
|
504
|
+
"files_analyzed": ["src/permission/index.ts", "src/router/guard.ts"],
|
|
505
|
+
"notes": "RBAC with route guards and v-hasPermi directive"
|
|
506
|
+
},
|
|
507
|
+
"data_dictionary": {
|
|
508
|
+
"status": "not_found",
|
|
509
|
+
"files_analyzed": [],
|
|
510
|
+
"notes": "No dictionary implementation found in suggested paths"
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
"config_files_analyzed": [
|
|
514
|
+
"package.json",
|
|
515
|
+
"vite.config.ts",
|
|
516
|
+
"tsconfig.json"
|
|
517
|
+
],
|
|
518
|
+
"source_dirs_scanned": [
|
|
519
|
+
"src/components/",
|
|
520
|
+
"src/views/",
|
|
521
|
+
"src/utils/",
|
|
522
|
+
"src/store/"
|
|
523
|
+
],
|
|
524
|
+
"documents_generated": [
|
|
525
|
+
"INDEX.md",
|
|
526
|
+
"tech-stack.md",
|
|
527
|
+
"architecture.md",
|
|
528
|
+
"conventions-dev.md",
|
|
529
|
+
"conventions-design.md",
|
|
530
|
+
"conventions-unit-test.md",
|
|
531
|
+
"conventions-build.md"
|
|
532
|
+
],
|
|
533
|
+
"coverage_summary": {
|
|
534
|
+
"topics_found": 7,
|
|
535
|
+
"topics_partial": 1,
|
|
536
|
+
"topics_not_found": 1,
|
|
537
|
+
"topics_total": 9,
|
|
538
|
+
"coverage_percent": 78
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
**Rules**:
|
|
544
|
+
- Every topic from the Topic Checklist in Step 3 MUST appear in the `topics` object
|
|
545
|
+
- `files_analyzed` MUST list the actual file paths you read (relative to source_path)
|
|
546
|
+
- `status` MUST be one of: `found`, `not_found`, `partial`
|
|
547
|
+
- `coverage_percent` = (topics_found + topics_partial) / topics_total * 100, rounded to integer
|
|
548
|
+
- `documents_generated` MUST list all .md files actually created
|
|
549
|
+
- Use `create_file` to write this JSON file (this is the ONE exception where create_file is allowed — for JSON output files)
|
|
550
|
+
|
|
551
|
+
### Step 8: Report Results
|
|
552
|
+
|
|
553
|
+
```
|
|
554
|
+
Platform Technology Documents Generated: {{platform_id}}
|
|
555
|
+
- INDEX.md: ✓
|
|
556
|
+
- tech-stack.md: ✓
|
|
557
|
+
- architecture.md: ✓
|
|
558
|
+
- conventions-design.md: ✓
|
|
559
|
+
- conventions-dev.md: ✓
|
|
560
|
+
- conventions-unit-test.md: ✓
|
|
561
|
+
- conventions-system-test.md: ✓
|
|
562
|
+
- conventions-build.md: ✓
|
|
563
|
+
- conventions-data.md: ✓ (or skipped if not applicable)
|
|
564
|
+
- ui-style-guide.md: ✓ (frontend platforms only, analysis level: {{ui_style_analysis_level}})
|
|
565
|
+
- {{platform_id}}.analysis.json: ✓ (analysis coverage report)
|
|
566
|
+
- Output Directory: {{output_path}}
|
|
567
|
+
- Analysis Report: {{completed_dir}}/{{platform_id}}.analysis.json (or knowledges dir if completed_dir not provided)
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
---
|
|
571
|
+
|
|
572
|
+
## Reference Guides
|
|
573
|
+
|
|
574
|
+
### Mermaid Diagram Guide
|
|
575
|
+
|
|
576
|
+
When generating Mermaid diagrams, follow these compatibility guidelines:
|
|
577
|
+
|
|
578
|
+
**Key Requirements:**
|
|
579
|
+
- Use only basic node definitions: `A[text content]`
|
|
580
|
+
- No HTML tags (e.g., `<br/>`)
|
|
581
|
+
- No nested subgraphs
|
|
582
|
+
- No `direction` keyword
|
|
583
|
+
- No `style` definitions
|
|
584
|
+
- Use standard `graph TB/LR` syntax only
|
|
585
|
+
|
|
586
|
+
**Diagram Types:**
|
|
587
|
+
|
|
588
|
+
| Diagram Type | Use Case | Example Scenario |
|
|
589
|
+
|--------------|----------|------------------|
|
|
590
|
+
| `graph TB/LR` | Structure & Dependency | Module relationships, component hierarchy |
|
|
591
|
+
| `flowchart TD` | Business Logic Flow | Request processing, decision trees |
|
|
592
|
+
| `sequenceDiagram` | Interaction Flow | API calls, service communication |
|
|
593
|
+
| `classDiagram` | Class Structure | Entity relationships, inheritance |
|
|
594
|
+
| `erDiagram` | Database Schema | Table relationships, data model |
|
|
595
|
+
| `stateDiagram-v2` | State Machine | Order status, workflow states |
|
|
596
|
+
|
|
597
|
+
### Source Traceability Requirements
|
|
598
|
+
|
|
599
|
+
**CRITICAL: All source file links MUST use RELATIVE PATHS. Absolute paths and `file://` protocol are STRICTLY FORBIDDEN.**
|
|
600
|
+
|
|
601
|
+
**FORBIDDEN:**
|
|
602
|
+
- ❌ Do NOT use absolute paths (e.g., `d:/dev/ruoyi-vue-pro/...`)
|
|
603
|
+
- ❌ Do NOT use `file://` protocol (e.g., `file://d:/dev/...`)
|
|
604
|
+
- ❌ Do NOT hardcode machine-specific paths
|
|
605
|
+
- ✅ ALWAYS use relative paths calculated from the document's location
|
|
606
|
+
|
|
607
|
+
**Dynamic Relative Path Calculation:**
|
|
608
|
+
|
|
609
|
+
Documents are located at: `speccrew-workspace/knowledges/techs/{platform_id}/{document}.md`
|
|
610
|
+
This is 4 levels deep from the project root:
|
|
611
|
+
- speccrew-workspace (1)
|
|
612
|
+
- knowledges (2)
|
|
613
|
+
- techs (3)
|
|
614
|
+
- {platform_id} (4)
|
|
615
|
+
|
|
616
|
+
Therefore, to reference a source file from the project root, use `../../../../` as the prefix.
|
|
617
|
+
|
|
618
|
+
Example calculation:
|
|
619
|
+
- Document: `speccrew-workspace/knowledges/techs/backend-spring/architecture.md`
|
|
620
|
+
- Source file: `yudao-server/src/main/java/.../YudaoServerApplication.java`
|
|
621
|
+
- Relative path: `../../../../yudao-server/src/main/java/.../YudaoServerApplication.java`
|
|
622
|
+
|
|
623
|
+
For root INDEX.md (one level less deep):
|
|
624
|
+
- Document: `speccrew-workspace/knowledges/techs/INDEX.md`
|
|
625
|
+
- Prefix: `../../../` (3 levels)
|
|
626
|
+
|
|
627
|
+
**1. File Reference Block (`<cite>`)**
|
|
628
|
+
|
|
629
|
+
Place at the beginning of each document:
|
|
630
|
+
|
|
631
|
+
```markdown
|
|
632
|
+
<cite>
|
|
633
|
+
**Files Referenced in This Document**
|
|
634
|
+
- [package.json](../../../../yudao-ui/yudao-ui-admin-vue3/package.json)
|
|
635
|
+
- [tsconfig.json](../../../../yudao-ui/yudao-ui-admin-vue3/tsconfig.json)
|
|
636
|
+
</cite>
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
**2. Diagram Source Annotation**
|
|
640
|
+
|
|
641
|
+
After each Mermaid diagram:
|
|
642
|
+
|
|
643
|
+
```markdown
|
|
644
|
+
**Diagram Source**
|
|
645
|
+
- [file-name.ext](../../../../yudao-server/src/main/java/...#L10-L50)
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
**3. Section Source Annotation**
|
|
649
|
+
|
|
650
|
+
At the end of each major section:
|
|
651
|
+
|
|
652
|
+
```markdown
|
|
653
|
+
**Section Source**
|
|
654
|
+
- [file-name.ext](../../../../yudao-server/src/main/java/...#L10-L50)
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
For generic guidance sections without specific file references:
|
|
658
|
+
|
|
659
|
+
```markdown
|
|
660
|
+
[This section provides general guidance, no specific file reference required]
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
### Document Structure Standard
|
|
664
|
+
|
|
665
|
+
All generated documents must follow this structure:
|
|
666
|
+
|
|
667
|
+
```markdown
|
|
668
|
+
# {{platform_name}} {{document_type}}
|
|
669
|
+
|
|
670
|
+
<cite>
|
|
671
|
+
**Files Referenced in This Document**
|
|
672
|
+
{{source_files}}
|
|
673
|
+
</cite>
|
|
674
|
+
|
|
675
|
+
> **Target Audience**: devcrew-designer-{{platform_id}}, devcrew-dev-{{platform_id}}, devcrew-test-{{platform_id}}
|
|
676
|
+
|
|
677
|
+
## Table of Contents
|
|
678
|
+
1. [Introduction](#introduction)
|
|
679
|
+
2. [Project Structure](#project-structure)
|
|
680
|
+
3. [Core Components](#core-components)
|
|
681
|
+
4. [Architecture Overview](#architecture-overview)
|
|
682
|
+
5. [Detailed Component Analysis](#detailed-component-analysis)
|
|
683
|
+
6. [Dependency Analysis](#dependency-analysis)
|
|
684
|
+
7. [Performance Considerations](#performance-considerations)
|
|
685
|
+
8. [Troubleshooting Guide](#troubleshooting-guide)
|
|
686
|
+
9. [Conclusion](#conclusion)
|
|
687
|
+
10. [Appendix](#appendix)
|
|
688
|
+
|
|
689
|
+
... content sections ...
|
|
690
|
+
|
|
691
|
+
**Section Source**
|
|
692
|
+
- [file.ext](../../../../path/to/file#Lstart-Lend)
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
### Document Content Specifications
|
|
696
|
+
|
|
697
|
+
#### INDEX.md
|
|
698
|
+
|
|
699
|
+
Platform overview and navigation hub.
|
|
700
|
+
|
|
701
|
+
**Content:**
|
|
702
|
+
- Platform summary (type, framework, language)
|
|
703
|
+
- Technology stack overview
|
|
704
|
+
- Quick links to all convention documents
|
|
705
|
+
- Agent usage guide
|
|
706
|
+
|
|
707
|
+
#### tech-stack.md
|
|
708
|
+
|
|
709
|
+
Detailed technology stack information.
|
|
710
|
+
|
|
711
|
+
**Sections:**
|
|
712
|
+
- Overview (framework, language, build tool)
|
|
713
|
+
- Core Technologies (table with versions)
|
|
714
|
+
- Dependencies (grouped by category)
|
|
715
|
+
- UI/Framework
|
|
716
|
+
- State Management
|
|
717
|
+
- Routing
|
|
718
|
+
- HTTP/API
|
|
719
|
+
- Utilities
|
|
720
|
+
- Development Tools
|
|
721
|
+
- Configuration Files (list with paths)
|
|
722
|
+
|
|
723
|
+
#### architecture.md
|
|
724
|
+
|
|
725
|
+
Architecture patterns and conventions.
|
|
726
|
+
|
|
727
|
+
**Sections (Platform-Specific):**
|
|
728
|
+
|
|
729
|
+
**For Web (React/Vue/Angular):**
|
|
730
|
+
- Component Architecture (Atomic Design, Container/Presentational)
|
|
731
|
+
- State Management Patterns
|
|
732
|
+
- Routing Conventions
|
|
733
|
+
- API Integration Patterns
|
|
734
|
+
- Styling Approach
|
|
735
|
+
|
|
736
|
+
**For Backend (NestJS/Spring/Express):**
|
|
737
|
+
- Layered Architecture (Controller/Service/Repository)
|
|
738
|
+
- Dependency Injection
|
|
739
|
+
- Module Organization
|
|
740
|
+
- API Design Patterns
|
|
741
|
+
- Middleware/Interceptor Usage
|
|
742
|
+
|
|
743
|
+
**For Mobile (Flutter/React Native):**
|
|
744
|
+
- Widget/Component Structure
|
|
745
|
+
- State Management
|
|
746
|
+
- Navigation Patterns
|
|
747
|
+
- Platform-Specific Considerations
|
|
748
|
+
|
|
749
|
+
#### conventions-design.md
|
|
750
|
+
|
|
751
|
+
Design principles and patterns for detailed design.
|
|
752
|
+
|
|
753
|
+
**Sections:**
|
|
754
|
+
- Design Principles (SOLID, DRY, etc.)
|
|
755
|
+
- Component/Module Design Patterns
|
|
756
|
+
- **UI Design Conventions** (frontend platforms - reference ui-style analysis)
|
|
757
|
+
- Link to `ui-style/ui-style-guide.md`
|
|
758
|
+
- Link to `ui-style/page-types/page-type-summary.md`
|
|
759
|
+
- Data Flow Design
|
|
760
|
+
- Error Handling Patterns
|
|
761
|
+
- Security Considerations
|
|
762
|
+
- Performance Guidelines
|
|
763
|
+
|
|
764
|
+
#### conventions-dev.md
|
|
765
|
+
|
|
766
|
+
Development conventions for coding.
|
|
767
|
+
|
|
768
|
+
**Sections (MUST INCLUDE)**:
|
|
769
|
+
|
|
770
|
+
1. Naming Conventions
|
|
771
|
+
- File naming (with actual examples from project: e.g., UserProfile.tsx, userProfile.utils.ts)
|
|
772
|
+
- Variable/function naming with GOOD/BAD examples
|
|
773
|
+
- Class/component naming for platform
|
|
774
|
+
- Constants naming (SCREAMING_SNAKE_CASE or UPPER_CAMEL_CASE - which does project use?)
|
|
775
|
+
|
|
776
|
+
2. Directory Structure
|
|
777
|
+
- Visual tree (actual from src/ - scan and present real structure)
|
|
778
|
+
- What goes where guide:
|
|
779
|
+
| Directory | Purpose | Naming Pattern |
|
|
780
|
+
|-----------|---------|---------------|
|
|
781
|
+
| components/ | Reusable UI components | PascalCase.tsx |
|
|
782
|
+
| pages/ | Page-level components | PascalCase.tsx |
|
|
783
|
+
| hooks/ | Custom hooks | useXxx.ts |
|
|
784
|
+
| utils/ | Utility functions | camelCase.ts |
|
|
785
|
+
| services/ | API services | xxxService.ts |
|
|
786
|
+
- Module-level organization patterns
|
|
787
|
+
|
|
788
|
+
3. Code Style (Extracted from ESLint/Prettier configs)
|
|
789
|
+
|
|
790
|
+
MUST extract these specific fields:
|
|
791
|
+
|
|
792
|
+
**From Prettier/EditorConfig**:
|
|
793
|
+
| Setting | Value | Example |
|
|
794
|
+
|---------|-------|---------|
|
|
795
|
+
| Indentation | {tabs/spaces} {width} | (extract from .prettierrc or .editorconfig) |
|
|
796
|
+
| Quote style | {single/double} | ✓ const s = 'hello' |
|
|
797
|
+
| Semicolons | {always/never} | ✓ const x = 1; |
|
|
798
|
+
| Line width | {number} | Max {n} characters per line |
|
|
799
|
+
| Trailing comma | {all/es5/none} | ✓ [a, b, c,] |
|
|
800
|
+
| Arrow parens | {always/avoid} | ✓ (x) => x |
|
|
801
|
+
|
|
802
|
+
**From ESLint**:
|
|
803
|
+
- Key enabled rules (no-unused-vars, no-console, etc.)
|
|
804
|
+
- Parser settings (ecmaVersion, sourceType)
|
|
805
|
+
- Environment settings (node, browser, es6)
|
|
806
|
+
|
|
807
|
+
**GOOD vs BAD Code Examples** (generate 3-5 examples based on actual rules):
|
|
808
|
+
```
|
|
809
|
+
✓ GOOD: const userName = 'Alice';
|
|
810
|
+
✗ BAD: var user_name = "Alice";
|
|
811
|
+
Reason: Use const, camelCase naming, single quotes (from .prettierrc)
|
|
812
|
+
```
|
|
813
|
+
|
|
814
|
+
4. Import/Export Patterns
|
|
815
|
+
- ES Modules vs CommonJS (which does project use?)
|
|
816
|
+
- Barrel exports rules (index.ts patterns - does project use them?)
|
|
817
|
+
- Relative vs absolute imports (path aliases from tsconfig/vite.config?)
|
|
818
|
+
- Import ordering rules (from eslint-plugin-import config if present)
|
|
819
|
+
|
|
820
|
+
5. Git Commit Conventions
|
|
821
|
+
- Message format (Conventional Commits? Semantic? Custom? - detect from commitlint config or .commitlintrc)
|
|
822
|
+
- Commit scope examples relevant to this project
|
|
823
|
+
- Branch naming convention (if detected from git hooks or CI config)
|
|
824
|
+
|
|
825
|
+
6. Pre-Development Checklist (NEW - critical for Dev Agent onboarding)
|
|
826
|
+
- [ ] Runtime version check: extract from .nvmrc / .node-version / package.json engines / .python-version / .java-version
|
|
827
|
+
- [ ] Dependency installation command: npm install / yarn / pnpm install / mvn install / pip install -r requirements.txt
|
|
828
|
+
- [ ] Local dev server startup command: extract from package.json scripts.dev / scripts.start / Makefile
|
|
829
|
+
- [ ] Environment variables needed: list .env.local template variables (from .env.example if exists)
|
|
830
|
+
- [ ] Pre-commit hooks check: detect husky / lint-staged / pre-commit config
|
|
831
|
+
- [ ] IDE plugins recommended: based on tech stack (ESLint plugin, Prettier plugin, etc.)
|
|
832
|
+
|
|
833
|
+
7. Code Review Checklist
|
|
834
|
+
- [ ] Linting passed: {actual lint command from package.json}
|
|
835
|
+
- [ ] Formatting consistent: {actual format command}
|
|
836
|
+
- [ ] Type safety: {TypeScript strict mode / type checking command}
|
|
837
|
+
- [ ] Tests written and passing: {actual test command}
|
|
838
|
+
- [ ] Naming follows conventions (Section 1)
|
|
839
|
+
- [ ] No hardcoded secrets or sensitive data
|
|
840
|
+
- [ ] Documentation updated for public APIs
|
|
841
|
+
|
|
842
|
+
**Source extraction rules**:
|
|
843
|
+
- Prettier config: .prettierrc, .prettierrc.js, .prettierrc.json, prettier.config.js
|
|
844
|
+
- ESLint config: .eslintrc.js, .eslintrc.json, eslint.config.js (flat config)
|
|
845
|
+
- EditorConfig: .editorconfig
|
|
846
|
+
- Git hooks: .husky/, .git/hooks/, .pre-commit-config.yaml, lint-staged config in package.json
|
|
847
|
+
- Commit conventions: .commitlintrc, commitlint.config.js
|
|
848
|
+
- Runtime version: .nvmrc, .node-version, package.json engines, .tool-versions
|
|
849
|
+
- IDE config: .vscode/extensions.json, .idea/ settings
|
|
850
|
+
|
|
851
|
+
#### conventions-test.md
|
|
852
|
+
|
|
853
|
+
Testing conventions and requirements.
|
|
854
|
+
|
|
855
|
+
**Sections (MUST INCLUDE)**:
|
|
856
|
+
|
|
857
|
+
1. Unit Testing
|
|
858
|
+
- Framework (Jest/Vitest/pytest/JUnit/Go testing/etc.)
|
|
859
|
+
- Test file naming convention (*.test.ts vs *.spec.ts - extract from config)
|
|
860
|
+
- Test file location (co-located vs __tests__/ directory)
|
|
861
|
+
- Minimal test template with assertions (provide actual code example)
|
|
862
|
+
- Run command: extract from package.json scripts or project config
|
|
863
|
+
|
|
864
|
+
2. Integration Testing
|
|
865
|
+
- When to write integration tests (API integration, module boundaries)
|
|
866
|
+
- Test data management:
|
|
867
|
+
- Fixtures location and format
|
|
868
|
+
- Seeding approach (factory functions, JSON fixtures, SQL scripts)
|
|
869
|
+
- Mock external services strategy:
|
|
870
|
+
- HTTP mocking tool (nock/msw/WireMock/mockito)
|
|
871
|
+
- When to mock vs when to use real services
|
|
872
|
+
|
|
873
|
+
3. E2E Testing (CONDITIONAL: frontend/mobile platforms ONLY)
|
|
874
|
+
- E2E framework (Cypress/Playwright/Appium/Detox - detect from dependencies)
|
|
875
|
+
- Browser/device compatibility matrix:
|
|
876
|
+
| Browser/Device | Required | Notes |
|
|
877
|
+
|--------|----------|-------|
|
|
878
|
+
- Critical user flow scenarios to cover
|
|
879
|
+
- Run command (e.g., npm run test:e2e)
|
|
880
|
+
- CI environment considerations (headless mode, timeouts)
|
|
881
|
+
- If NO E2E framework detected: note "E2E framework not configured. Recommend: [Playwright/Cypress] based on {framework}"
|
|
882
|
+
|
|
883
|
+
4. Database Testing (CONDITIONAL: backend platforms ONLY)
|
|
884
|
+
- Database isolation strategy (transaction rollback / separate test DB / in-memory DB)
|
|
885
|
+
- Migration testing (schema upgrade verification)
|
|
886
|
+
- Fixture management (location, format, seeding commands)
|
|
887
|
+
- Query verification approach (EXPLAIN PLAN usage)
|
|
888
|
+
- If NO database detected: SKIP this section
|
|
889
|
+
|
|
890
|
+
5. Performance Testing
|
|
891
|
+
- Key metrics to monitor:
|
|
892
|
+
- Frontend: FCP, LCP, TTI, bundle size
|
|
893
|
+
- Backend: API response time (p50/p95/p99), throughput
|
|
894
|
+
- Load testing tool (k6/Artillery/JMeter/wrk - detect from dependencies or note recommendation)
|
|
895
|
+
- Baseline expectations (document actual values if found in config, else recommend defaults)
|
|
896
|
+
- When to run (pre-release, nightly, on-demand)
|
|
897
|
+
|
|
898
|
+
6. Coverage Requirements
|
|
899
|
+
- Target coverage percentage (extract from jest.config/vitest.config/pytest.ini/.coveragerc)
|
|
900
|
+
- If not configured: recommend industry defaults (80% statements, 70% branches)
|
|
901
|
+
- Critical paths priority list
|
|
902
|
+
- Local coverage check command (e.g., npm run test:coverage)
|
|
903
|
+
- Coverage reporting tool (istanbul/c8/coverage.py/JaCoCo)
|
|
904
|
+
|
|
905
|
+
7. Testing Troubleshooting
|
|
906
|
+
- Common failure scenarios and resolutions (platform-specific)
|
|
907
|
+
- Debugging test failures (breakpoint setup, verbose logging)
|
|
908
|
+
- Flaky test detection and investigation approach
|
|
909
|
+
- Test environment reset procedures
|
|
910
|
+
|
|
911
|
+
**Source extraction rules**:
|
|
912
|
+
- Test framework: from package.json devDependencies / pom.xml test scope / requirements-dev.txt
|
|
913
|
+
- E2E framework: from cypress.config.*, playwright.config.*, detox config
|
|
914
|
+
- Coverage config: from jest.config (coverageThreshold), vitest.config, .coveragerc, jacoco-maven-plugin
|
|
915
|
+
- Performance tools: from package.json devDependencies (k6, artillery, lighthouse)
|
|
916
|
+
- Database test config: from test configuration files, docker-compose.test.yml
|
|
917
|
+
|
|
918
|
+
#### conventions-build.md
|
|
919
|
+
|
|
920
|
+
Build & Deployment Conventions.
|
|
921
|
+
|
|
922
|
+
**Required**: YES (all platform types)
|
|
923
|
+
|
|
924
|
+
**Sections (MUST INCLUDE)**:
|
|
925
|
+
|
|
926
|
+
1. Build Tool & Configuration
|
|
927
|
+
- Primary build tool (Vite/Webpack/Rollup/Maven/Gradle/Go build/Cargo etc.)
|
|
928
|
+
- Main config file path and key settings
|
|
929
|
+
- Build commands reference table:
|
|
930
|
+
| Command | Purpose | Example |
|
|
931
|
+
|---------|---------|---------|
|
|
932
|
+
| dev | Start development server | npm run dev |
|
|
933
|
+
| build | Production build | npm run build |
|
|
934
|
+
| preview | Preview production build | npm run preview |
|
|
935
|
+
|
|
936
|
+
2. Environment Management
|
|
937
|
+
- Environment files (.env, .env.local, .env.production, application.yml, application-dev.yml)
|
|
938
|
+
- Environment variable naming conventions (VITE_ prefix / NEXT_PUBLIC_ prefix / spring profiles)
|
|
939
|
+
- Environment differences table:
|
|
940
|
+
| Setting | Development | Staging | Production |
|
|
941
|
+
|---------|-------------|---------|------------|
|
|
942
|
+
| API URL | localhost | staging-api | prod-api |
|
|
943
|
+
- Sensitive config handling (secrets, API keys - what NOT to commit)
|
|
944
|
+
|
|
945
|
+
3. Build Profiles & Outputs
|
|
946
|
+
- Build modes (development/production/test)
|
|
947
|
+
- Output directory and structure (dist/, build/, target/)
|
|
948
|
+
- Optimization strategies (code splitting, tree shaking, minification, source maps)
|
|
949
|
+
- Bundle size considerations (if frontend)
|
|
950
|
+
|
|
951
|
+
4. CI/CD Pipeline Conventions (conditional: if CI config files detected)
|
|
952
|
+
- CI config file paths (.github/workflows/, Jenkinsfile, .gitlab-ci.yml)
|
|
953
|
+
- Pipeline stages definition (lint → test → build → deploy)
|
|
954
|
+
- Deployment targets and trigger conditions
|
|
955
|
+
- If NO CI config detected: note "CI/CD pipeline not configured in repository"
|
|
956
|
+
|
|
957
|
+
5. Docker & Container (conditional: if Dockerfile detected)
|
|
958
|
+
- Dockerfile path and build command
|
|
959
|
+
- Image naming convention
|
|
960
|
+
- docker-compose configuration (if exists)
|
|
961
|
+
- If NO Dockerfile detected: SKIP this section entirely
|
|
962
|
+
|
|
963
|
+
6. Dependency Management
|
|
964
|
+
- Package manager (npm/yarn/pnpm/maven/gradle/pip/go mod)
|
|
965
|
+
- Lock file strategy (committed? .gitignore'd?)
|
|
966
|
+
- Dependency upgrade workflow
|
|
967
|
+
- Compatibility checking approach
|
|
968
|
+
|
|
969
|
+
**Source extraction rules**:
|
|
970
|
+
- Build tool: from package.json scripts / pom.xml plugins / build.gradle / Makefile / Cargo.toml
|
|
971
|
+
- Environment files: scan for .env*, application*.yml, application*.properties
|
|
972
|
+
- CI config: scan for .github/workflows/*.yml, Jenkinsfile, .gitlab-ci.yml, .circleci/config.yml
|
|
973
|
+
- Docker: scan for Dockerfile, docker-compose*.yml
|
|
974
|
+
- Package manager: detect from lock files (package-lock.json → npm, yarn.lock → yarn, pnpm-lock.yaml → pnpm)
|
|
975
|
+
|
|
976
|
+
#### conventions-data.md (Optional)
|
|
977
|
+
|
|
978
|
+
Data layer conventions (if applicable).
|
|
979
|
+
|
|
980
|
+
**Sections:**
|
|
981
|
+
- ORM/Database Tool
|
|
982
|
+
- Data Modeling Conventions
|
|
983
|
+
- Migration Patterns
|
|
984
|
+
- Query Optimization
|
|
985
|
+
- Caching Strategies
|
|
986
|
+
|
|
987
|
+
---
|
|
988
|
+
|
|
989
|
+
## Template Usage
|
|
990
|
+
|
|
991
|
+
### Template Reference
|
|
992
|
+
|
|
993
|
+
All templates are unified and located in `templates/` directory:
|
|
994
|
+
|
|
995
|
+
| Template File | Purpose |
|
|
996
|
+
|---------------|---------|
|
|
997
|
+
| `templates/INDEX-TEMPLATE.md` | Platform overview and navigation hub |
|
|
998
|
+
| `templates/TECH-STACK-TEMPLATE.md` | Technology stack details |
|
|
999
|
+
| `templates/ARCHITECTURE-TEMPLATE.md` | Architecture patterns and conventions |
|
|
1000
|
+
| `templates/CONVENTIONS-DESIGN-TEMPLATE.md` | Design principles and patterns |
|
|
1001
|
+
| `templates/CONVENTIONS-DEV-TEMPLATE.md` | Development conventions |
|
|
1002
|
+
| `templates/CONVENTIONS-UNIT-TEST-TEMPLATE.md` | Unit testing conventions |
|
|
1003
|
+
| `templates/CONVENTIONS-BUILD-TEMPLATE.md` | Build and deployment conventions |
|
|
1004
|
+
| `templates/CONVENTIONS-DATA-TEMPLATE.md` | Data layer conventions |
|
|
1005
|
+
|
|
1006
|
+
Platform-specific content is generated dynamically based on:
|
|
1007
|
+
- Platform type (web, mobile, backend, desktop)
|
|
1008
|
+
- Framework (react, vue, springboot, etc.)
|
|
1009
|
+
- Analyzed configuration files
|
|
1010
|
+
|
|
1011
|
+
## Document Generation Guidelines
|
|
1012
|
+
|
|
1013
|
+
### Be Specific
|
|
1014
|
+
|
|
1015
|
+
Extract actual values from config files:
|
|
1016
|
+
- ✓ "React 18.2.0" (from package.json)
|
|
1017
|
+
- ✗ "React (version varies)"
|
|
1018
|
+
|
|
1019
|
+
### Be Concise
|
|
1020
|
+
|
|
1021
|
+
Focus on actionable conventions:
|
|
1022
|
+
- ✓ "Use PascalCase for component files: UserProfile.tsx"
|
|
1023
|
+
- ✗ "There are many naming conventions to consider..."
|
|
1024
|
+
|
|
1025
|
+
### Include Examples
|
|
1026
|
+
|
|
1027
|
+
Wherever possible, include concrete examples:
|
|
1028
|
+
```markdown
|
|
1029
|
+
### Component Naming
|
|
1030
|
+
- ✓ UserProfile.tsx
|
|
1031
|
+
- ✓ OrderList.tsx
|
|
1032
|
+
- ✗ userProfile.tsx
|
|
1033
|
+
- ✗ order-list.tsx
|
|
1034
|
+
```
|
|
1035
|
+
|
|
1036
|
+
## Checklist
|
|
1037
|
+
|
|
1038
|
+
### Pre-Generation
|
|
1039
|
+
- [ ] All configuration files read and parsed
|
|
1040
|
+
- [ ] Technology stack extracted accurately
|
|
1041
|
+
- [ ] Conventions analyzed from config files
|
|
1042
|
+
|
|
1043
|
+
### Document Generation Decision
|
|
1044
|
+
- [ ] Platform type identified (web/mobile/backend/desktop/api)
|
|
1045
|
+
- [ ] Data layer detection completed for non-backend platforms
|
|
1046
|
+
- [ ] Decision made on whether to generate conventions-data.md
|
|
1047
|
+
- [ ] Backend platform → Always generate
|
|
1048
|
+
- [ ] Other platforms → Generate only if data layer detected
|
|
1049
|
+
|
|
1050
|
+
### Required Documents (All Platforms)
|
|
1051
|
+
- [ ] INDEX.md generated with navigation
|
|
1052
|
+
- [ ] tech-stack.md generated with dependency tables
|
|
1053
|
+
- [ ] architecture.md generated with platform-specific patterns
|
|
1054
|
+
- [ ] conventions-design.md generated with design principles
|
|
1055
|
+
- [ ] conventions-dev.md generated with naming and style rules
|
|
1056
|
+
- [ ] conventions-unit-test.md generated with unit testing requirements
|
|
1057
|
+
- [ ] conventions-system-test.md generated with system testing requirements
|
|
1058
|
+
- [ ] conventions-build.md generated with build and deployment conventions
|
|
1059
|
+
|
|
1060
|
+
### Optional Document
|
|
1061
|
+
- [ ] conventions-data.md generated (only if applicable per platform type mapping)
|
|
1062
|
+
|
|
1063
|
+
### UI Style Analysis (Frontend Platforms - web/mobile/desktop)
|
|
1064
|
+
- [ ] For web/mobile/desktop platforms: `speccrew-knowledge-techs-ui-analyze` skill invoked with correct parameters
|
|
1065
|
+
- [ ] `ui-style/ui-style-guide.md` generated
|
|
1066
|
+
- [ ] `ui-style/page-types/page-type-summary.md` generated
|
|
1067
|
+
- [ ] `ui-style/page-types/[type]-pages.md` generated (one per discovered page type)
|
|
1068
|
+
- [ ] `ui-style/components/component-library.md` generated
|
|
1069
|
+
- [ ] `ui-style/components/common-components.md` generated
|
|
1070
|
+
- [ ] `ui-style/components/business-components.md` generated
|
|
1071
|
+
- [ ] `ui-style/layouts/page-layouts.md` generated
|
|
1072
|
+
- [ ] `ui-style/layouts/navigation-patterns.md` generated
|
|
1073
|
+
- [ ] `ui-style/styles/color-system.md` generated
|
|
1074
|
+
- [ ] `ui-style/styles/typography.md` generated
|
|
1075
|
+
- [ ] `ui-style/styles/spacing-system.md` generated
|
|
1076
|
+
- [ ] UI conventions properly referenced in `conventions-design.md`
|
|
1077
|
+
|
|
1078
|
+
### Quality Checks
|
|
1079
|
+
- [ ] All files written to output_path
|
|
1080
|
+
- [ ] **Source traceability**: `<cite>` block added to each document
|
|
1081
|
+
- [ ] **Source traceability**: Diagram Source annotations added after each Mermaid diagram
|
|
1082
|
+
- [ ] **Source traceability**: Section Source annotations added at end of major sections
|
|
1083
|
+
- [ ] **Mermaid compatibility**: No `style`, `direction`, `<br/>`, or nested subgraphs
|
|
1084
|
+
- [ ] **Document completeness**: Verify all 8 required documents exist (INDEX.md, tech-stack.md, architecture.md, conventions-design.md, conventions-dev.md, conventions-unit-test.md, conventions-system-test.md, conventions-build.md)
|
|
1085
|
+
- [ ] **Analysis Coverage Report**: `{platform_id}.analysis.json` generated with all topics tracked
|
|
1086
|
+
- [ ] Results reported with conventions-data.md and ui-style-guide.md generation status (including ui_style_analysis_level)
|
|
1087
|
+
|