speccrew 0.2.7 → 0.3.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 +220 -27
- package/.speccrew/agents/speccrew-system-designer.md +237 -31
- package/.speccrew/agents/speccrew-system-developer.md +44 -10
- package/.speccrew/skills/speccrew-dev-backend/SKILL.md +15 -1
- package/.speccrew/skills/speccrew-dev-desktop/SKILL.md +36 -7
- package/.speccrew/skills/speccrew-dev-review/SKILL.md +16 -7
- package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +150 -35
- package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +140 -18
- package/.speccrew/skills/speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md +4 -1
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +29 -15
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +51 -6
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +18 -20
- package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +7 -10
- package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +19 -23
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +151 -153
- package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +23 -63
- package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +32 -68
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +6 -2
- package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +32 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/PRD-TEMPLATE.md +16 -1
- package/.speccrew/skills/speccrew-sd-backend/SKILL.md +33 -6
- package/.speccrew/skills/speccrew-sd-frontend/SKILL.md +25 -5
- package/.speccrew/skills/speccrew-test-case-design/SKILL.md +17 -0
- package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +20 -3
- package/.speccrew/skills/speccrew-test-execute/SKILL.md +8 -0
- package/package.json +1 -1
|
@@ -4,12 +4,9 @@ description: Stage 2 of technology knowledge initialization - Generate technolog
|
|
|
4
4
|
tools: Read, Write, Glob, Grep, Skill
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
> **⚠️ DEPRECATED**: This skill has been
|
|
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)
|
|
7
|
+
> **⚠️ DEPRECATED**: This skill has been superseded by `speccrew-knowledge-techs-generate-conventions` and `speccrew-knowledge-techs-generate-ui-style`. Use those skills for new requests. This file is kept for backward compatibility only.
|
|
10
8
|
>
|
|
11
9
|
> **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
10
|
|
|
14
11
|
# Stage 2: Generate Platform Technology Documents
|
|
15
12
|
|
|
@@ -50,66 +47,19 @@ Worker Agent (speccrew-task-worker)
|
|
|
50
47
|
|
|
51
48
|
Generate the following documents in `{output_path}/`:
|
|
52
49
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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)**
|
|
50
|
+
**Required Documents (All Platforms)**:
|
|
51
|
+
- `INDEX.md` - Platform technology index
|
|
52
|
+
- `tech-stack.md` - Technology stack details
|
|
53
|
+
- `architecture.md` - Architecture conventions
|
|
54
|
+
- `conventions-design.md` - Design conventions
|
|
55
|
+
- `conventions-dev.md` - Development conventions
|
|
56
|
+
- `conventions-unit-test.md` - Unit testing conventions
|
|
57
|
+
- `conventions-system-test.md` - System testing conventions
|
|
58
|
+
- `conventions-build.md` - Build & Deployment conventions
|
|
89
59
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
```
|
|
60
|
+
**Optional Documents**:
|
|
61
|
+
- `conventions-data.md` - Data conventions (backend required; other platforms: only if ORM/data layer detected)
|
|
62
|
+
- `ui-style/` - UI style analysis (frontend platforms only)
|
|
113
63
|
|
|
114
64
|
## Workflow
|
|
115
65
|
|
|
@@ -445,6 +395,16 @@ Analysis completeness: {ui_style_analysis_level}
|
|
|
445
395
|
|
|
446
396
|
**CRITICAL**: This step MUST follow the template fill workflow - copy template first, then fill sections.
|
|
447
397
|
|
|
398
|
+
**Decision Logic for conventions-data.md**:
|
|
399
|
+
|
|
400
|
+
IF `platform_type` == `backend`:
|
|
401
|
+
- Generate conventions-data.md (REQUIRED)
|
|
402
|
+
ELSE IF `platform_type` IN [`web`, `mobile`, `desktop`, `api`]:
|
|
403
|
+
- Check package.json dependencies for data layer indicators:
|
|
404
|
+
- IF `prisma` / `typeorm` / `sequelize` / `mongoose` / `drizzle-orm` found → Generate conventions-data.md
|
|
405
|
+
- IF `firebase` / `sqlite` / `realm` found → Generate conventions-data.md (lightweight)
|
|
406
|
+
- ELSE → Skip conventions-data.md
|
|
407
|
+
|
|
448
408
|
1. **For Each Document, Follow This Workflow**:
|
|
449
409
|
|
|
450
410
|
**Step 5.1: Copy Template File**
|
|
@@ -38,6 +38,14 @@ Worker Agent (speccrew-task-worker)
|
|
|
38
38
|
|
|
39
39
|
- `{{output_path}}/INDEX.md` - Root technology knowledge index
|
|
40
40
|
|
|
41
|
+
**INDEX.md Content Structure**:
|
|
42
|
+
- Introduction (generation info, platform count)
|
|
43
|
+
- Platform Overview (table with links to all platform docs)
|
|
44
|
+
- Quick Reference (links organized by document type)
|
|
45
|
+
- Agent-to-Platform Mapping (maps agents to their platform docs)
|
|
46
|
+
- Document Guide (explains each document type)
|
|
47
|
+
- Usage Guide (how to use the knowledge)
|
|
48
|
+
|
|
41
49
|
## Workflow
|
|
42
50
|
|
|
43
51
|
```mermaid
|
|
@@ -95,79 +103,35 @@ Read `techs-manifest.json` to get the list of all platforms:
|
|
|
95
103
|
}
|
|
96
104
|
```
|
|
97
105
|
|
|
98
|
-
### Step 2: Verify Platform Documents
|
|
106
|
+
### Step 2: Verify Platform Documents
|
|
99
107
|
|
|
100
108
|
**CRITICAL**: Do NOT assume all platforms have the same document set. Must dynamically detect which documents actually exist.
|
|
101
109
|
|
|
102
|
-
|
|
110
|
+
**Step 2a: Scan Platform Directories**
|
|
103
111
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
├── tech-stack.md # Required - must exist
|
|
108
|
-
├── architecture.md # Required - must exist
|
|
109
|
-
├── conventions-design.md # Required - must exist
|
|
110
|
-
├── conventions-dev.md # Required - must exist
|
|
111
|
-
├── conventions-test.md # Required - must exist
|
|
112
|
-
├── conventions-build.md # Required - must exist
|
|
113
|
-
└── conventions-data.md # Optional - check existence dynamically
|
|
114
|
-
```
|
|
112
|
+
For each platform in manifest:
|
|
113
|
+
1. List all `.md` files in `{{techs_base_path}}/{{platform_id}}/`
|
|
114
|
+
2. Build a document availability map for each platform
|
|
115
115
|
|
|
116
|
-
**
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
3. **Validation**:
|
|
136
|
-
- If `INDEX.md` is missing → Note as error in report, skip this platform
|
|
137
|
-
- If any required document (except conventions-data.md) is missing → Note as warning
|
|
138
|
-
- Record actual document availability for dynamic link generation
|
|
139
|
-
|
|
140
|
-
#### Document Verification Matrix
|
|
141
|
-
|
|
142
|
-
For each platform directory, verify document existence with these strict rules:
|
|
143
|
-
|
|
144
|
-
| Document | Required? | If Missing | Action |
|
|
145
|
-
|----------|-----------|------------|--------|
|
|
146
|
-
| INDEX.md | YES | ERROR | Skip entire platform from root INDEX. Log: "ERROR: Platform {platform_id} skipped - INDEX.md missing" |
|
|
147
|
-
| tech-stack.md | YES | WARN | Include platform but mark document as "[Missing]" in links. Log warning |
|
|
148
|
-
| architecture.md | YES | WARN | Include platform but mark as "[Missing]". Log warning |
|
|
149
|
-
| conventions-design.md | YES | WARN | Include platform but mark as "[Missing]". Log warning |
|
|
150
|
-
| conventions-dev.md | YES | WARN | Include platform but mark as "[Missing]". Log warning |
|
|
151
|
-
| conventions-test.md | YES | WARN | Include platform but mark as "[Missing]". Log warning |
|
|
152
|
-
| conventions-build.md | YES | WARN | Include platform but mark as "[Missing]". Log warning |
|
|
153
|
-
| conventions-data.md | NO | OK | Do not warn. Do not include link. Silently skip |
|
|
154
|
-
|
|
155
|
-
**Platform Eligibility Rules**:
|
|
156
|
-
- INDEX.md missing → Platform SKIPPED entirely (not listed in root INDEX)
|
|
157
|
-
- Any required doc missing (except INDEX.md) → Platform INCLUDED but marked INCOMPLETE
|
|
158
|
-
- Only conventions-data.md missing → Platform is COMPLETE (it's optional)
|
|
159
|
-
|
|
160
|
-
**Verification Summary** (generate at end of verification step):
|
|
161
|
-
```
|
|
162
|
-
Verification Report:
|
|
163
|
-
- Total platforms in manifest: {N}
|
|
164
|
-
- Complete platforms: {X} (all 7 required docs present)
|
|
165
|
-
- Incomplete platforms: {Y} (missing some required docs) [WARN]
|
|
166
|
-
- {platform_id}: missing {doc1}, {doc2}
|
|
167
|
-
- Skipped platforms: {Z} (no INDEX.md) [ERROR]
|
|
168
|
-
- {platform_id}: INDEX.md not found
|
|
169
|
-
- Optional conventions-data.md present in: {W} platforms
|
|
170
|
-
```
|
|
116
|
+
**Step 2b: Verify Required Documents**
|
|
117
|
+
|
|
118
|
+
Check each platform for required documents:
|
|
119
|
+
| Document | Required? | If Missing |
|
|
120
|
+
|----------|-----------|------------|
|
|
121
|
+
| INDEX.md | YES | Skip entire platform from root INDEX |
|
|
122
|
+
| tech-stack.md | YES | Mark as "[Missing]" in links |
|
|
123
|
+
| architecture.md | YES | Mark as "[Missing]" in links |
|
|
124
|
+
| conventions-design.md | YES | Mark as "[Missing]" in links |
|
|
125
|
+
| conventions-dev.md | YES | Mark as "[Missing]" in links |
|
|
126
|
+
| conventions-test.md | YES | Mark as "[Missing]" in links |
|
|
127
|
+
| conventions-build.md | YES | Mark as "[Missing]" in links |
|
|
128
|
+
| conventions-data.md | NO | Silently skip link |
|
|
129
|
+
|
|
130
|
+
**Step 2c: Determine Platform Eligibility**
|
|
131
|
+
|
|
132
|
+
- IF `INDEX.md` missing → Platform SKIPPED entirely
|
|
133
|
+
- IF any required doc missing (except INDEX.md) → Platform INCLUDED but marked INCOMPLETE
|
|
134
|
+
- IF only conventions-data.md missing → Platform is COMPLETE (it's optional)
|
|
171
135
|
|
|
172
136
|
### Step 3: Extract Platform Summaries
|
|
173
137
|
|
|
@@ -84,9 +84,11 @@ Generate the following documents in `{output_path}/`:
|
|
|
84
84
|
|
|
85
85
|
3. **MANDATORY: Template-first workflow** — For every output document, the corresponding template MUST be copied to the target path first, then sections filled with `search_replace`. Skipping copy and writing content directly is FORBIDDEN.
|
|
86
86
|
|
|
87
|
-
### Step 0:
|
|
87
|
+
### Step 0: Pre-load Required Templates (Mandatory)
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
**This step must complete before any workflow step begins.**
|
|
90
|
+
|
|
91
|
+
Read all template files to understand document structures and required content:
|
|
90
92
|
|
|
91
93
|
| Template File | Output Document | Purpose |
|
|
92
94
|
|---------------|-----------------|---------|
|
|
@@ -106,6 +108,8 @@ Before analysis, read all template files to understand document structures and r
|
|
|
106
108
|
|
|
107
109
|
**Key principle**: Extract information from source code according to each template's section requirements.
|
|
108
110
|
|
|
111
|
+
**Error Handling**: IF any template file is missing THEN report error with template path and STOP workflow.
|
|
112
|
+
|
|
109
113
|
### Step 1: Discover Source Structure
|
|
110
114
|
|
|
111
115
|
**Purpose**: Gather project metadata for `ui-style-guide.md` Section 1-2 (Project Overview, Platform Summary)
|
|
@@ -305,6 +305,7 @@ Before writing, determine the PRD structure based on requirement complexity:
|
|
|
305
305
|
**Each Sub-PRD covers ONE module:**
|
|
306
306
|
- Module-specific user stories and functional requirements
|
|
307
307
|
- Module-internal process flows and use cases
|
|
308
|
+
- **Feature Breakdown** (required): List all business operation units with Feature ID, Type, and dependencies
|
|
308
309
|
- Module-specific acceptance criteria
|
|
309
310
|
- Interface contracts with other modules (referencing Master PRD dependency matrix)
|
|
310
311
|
|
|
@@ -314,11 +315,40 @@ Fill in according to the template structure, requirements:
|
|
|
314
315
|
- **Background & Goals**: Explain why we're doing this and what success looks like
|
|
315
316
|
- **User Stories**: `As a [user role], I want [to do something], so that [I can achieve some goal]`
|
|
316
317
|
- **Functional Requirements**: Group by priority (P0 Core / P1 Important / P2 Optional)
|
|
318
|
+
- **Feature Breakdown**: Extract business operation units for downstream Feature Design (see Step 9.1)
|
|
317
319
|
- **Non-functional Requirements**: Performance, security, compatibility, etc.
|
|
318
320
|
- **Acceptance Criteria**: Quantifiable, verifiable definition of done
|
|
319
321
|
- **Boundary Description**: Clearly define Not In Scope content
|
|
320
322
|
- **Assumptions & Dependencies**: Prerequisites, external dependencies
|
|
321
323
|
|
|
324
|
+
### Step 9.1: Extract Feature Breakdown
|
|
325
|
+
|
|
326
|
+
For both simple and complex requirements, extract Feature Breakdown to guide downstream Feature Design:
|
|
327
|
+
|
|
328
|
+
**Analysis Steps:**
|
|
329
|
+
1. **Analyze user stories and functional requirements** for this module/feature
|
|
330
|
+
2. **Identify business operation units** - each unit should represent:
|
|
331
|
+
- A complete business operation (e.g., "Customer List Management" includes search, filter, pagination, tag management)
|
|
332
|
+
- Can span 1-2 pages but remains business-cohesive
|
|
333
|
+
- Estimated implementation: no more than 15 code files (frontend + backend combined)
|
|
334
|
+
3. **Classify Feature Type:**
|
|
335
|
+
- `Page+API`: Frontend page with corresponding backend APIs (for full-stack architecture)
|
|
336
|
+
- `API-only`: Group of related APIs (for backend-only features)
|
|
337
|
+
4. **Assign Feature IDs**: Use format `F-{MODULE}-{NN}` (e.g., F-CRM-01, F-CRM-02)
|
|
338
|
+
5. **Document dependencies**: Identify data or workflow dependencies between features
|
|
339
|
+
|
|
340
|
+
**Granularity Guidelines:**
|
|
341
|
+
| Good Feature Size | Too Large (Split Further) |
|
|
342
|
+
|-------------------|--------------------------|
|
|
343
|
+
| Single CRUD operation group | Complete module with 5+ CRUDs |
|
|
344
|
+
| One list page with filters | Entire reporting subsystem |
|
|
345
|
+
| One form with validation | Multi-step wizard with 10+ steps |
|
|
346
|
+
| Single API endpoint group | All APIs for a domain |
|
|
347
|
+
|
|
348
|
+
**Output:** Complete the Feature Breakdown table in Section 3.4 of the PRD template.
|
|
349
|
+
|
|
350
|
+
**Note:** Even simple requirements (single-file PRD) should include Feature Breakdown, typically with 1-3 features.
|
|
351
|
+
|
|
322
352
|
### Marking Existing vs New Features
|
|
323
353
|
|
|
324
354
|
When the requirement involves modifying existing system functions, clearly mark each item:
|
|
@@ -529,6 +559,8 @@ If WORKFLOW-PROGRESS.json does not exist (backward compatibility):
|
|
|
529
559
|
- [ ] PRD structure (single vs master-sub) determined appropriately
|
|
530
560
|
- [ ] **[Master-Sub]** Master PRD includes architecture overview, module list, dependency matrix, implementation phases
|
|
531
561
|
- [ ] **[Master-Sub]** Each Sub-PRD covers exactly one module with interface contracts
|
|
562
|
+
- [ ] **Feature Breakdown** extracted with appropriate granularity (each feature ≤ 15 code files)
|
|
563
|
+
- [ ] **Feature Breakdown** includes Feature IDs, Types (Page+API / API-only), and dependencies
|
|
532
564
|
- [ ] PRD completely filled according to template structure
|
|
533
565
|
- [ ] User story granularity aligns with "single iteration completable" principle
|
|
534
566
|
- [ ] Acceptance criteria are quantifiable and verifiable
|
|
@@ -103,7 +103,22 @@ graph TB
|
|
|
103
103
|
| [Feature 1] | P0 | [Description] | [Acceptance Criteria] |
|
|
104
104
|
| [Feature 2] | P1 | [Description] | [Acceptance Criteria] |
|
|
105
105
|
|
|
106
|
-
### 3.
|
|
106
|
+
### 3.4 Feature Breakdown
|
|
107
|
+
|
|
108
|
+
> List all business operation units in this module. Each feature represents a cohesive business operation (e.g., one frontend page with its backend APIs, or one API group for backend-only). This breakdown guides downstream Feature Design to generate per-feature specs.
|
|
109
|
+
|
|
110
|
+
| Feature ID | Feature Name | Type | Pages/Endpoints | Description |
|
|
111
|
+
|------------|-------------|------|-----------------|-------------|
|
|
112
|
+
| F-{MODULE}-01 | {Feature name} | Page+API / API-only | {page count or endpoint count} | {Brief description} |
|
|
113
|
+
| F-{MODULE}-02 | {Feature name} | Page+API / API-only | {page count or endpoint count} | {Brief description} |
|
|
114
|
+
|
|
115
|
+
#### Feature Dependencies
|
|
116
|
+
|
|
117
|
+
| Feature | Depends On | Dependency Type |
|
|
118
|
+
|---------|-----------|----------------|
|
|
119
|
+
| F-{MODULE}-02 | F-{MODULE}-01 | Data dependency |
|
|
120
|
+
|
|
121
|
+
### 3.5 Feature Details
|
|
107
122
|
|
|
108
123
|
#### Feature 1: [Feature Name]
|
|
109
124
|
|
|
@@ -24,10 +24,15 @@ tools: Read, Write, Glob, Grep
|
|
|
24
24
|
|
|
25
25
|
## Step 1: Read Inputs
|
|
26
26
|
|
|
27
|
+
**Input Parameters** (from agent context):
|
|
28
|
+
- `feature_id` (optional): Feature identifier, e.g., `F-CRM-01`. If provided, use new naming format.
|
|
29
|
+
- `feature_name`: Feature name, e.g., `customer-list`.
|
|
30
|
+
- `platform_id`: Target platform, e.g., `backend-spring`, `backend-nestjs`.
|
|
31
|
+
|
|
27
32
|
Read in order:
|
|
28
33
|
|
|
29
|
-
1. **Feature Spec document(s)**: `speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/
|
|
30
|
-
2. **API Contract**: `speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/
|
|
34
|
+
1. **Feature Spec document(s)**: `speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/{feature-id}-{feature-name}-feature-spec.md`
|
|
35
|
+
2. **API Contract**: `speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/{feature-id}-{feature-name}-api-contract.md`
|
|
31
36
|
3. **Backend techs knowledge** (paths from agent context):
|
|
32
37
|
- `speccrew-workspace/knowledges/techs/{platform_id}/tech-stack.md`
|
|
33
38
|
- `speccrew-workspace/knowledges/techs/{platform_id}/architecture.md`
|
|
@@ -56,6 +61,8 @@ Use Glob/Grep to understand current backend codebase:
|
|
|
56
61
|
|
|
57
62
|
Parse Feature Spec to identify all backend-relevant functions.
|
|
58
63
|
|
|
64
|
+
> **Note**: With the new fine-grained Feature Spec format, each Feature Spec typically contains **3-8 functions** (previously 10-20). The extraction logic remains the same, but the scope is more focused.
|
|
65
|
+
|
|
59
66
|
For each function, extract:
|
|
60
67
|
|
|
61
68
|
| Aspect | Content |
|
|
@@ -91,7 +98,10 @@ Read the SD-BACKEND-TEMPLATE.md to understand document structure.
|
|
|
91
98
|
2. **Replace top-level placeholders** with known variables:
|
|
92
99
|
- Module name, feature name, platform ID, etc.
|
|
93
100
|
3. **Create the document file** using `create_file`:
|
|
94
|
-
- Target path
|
|
101
|
+
- **Target path pattern**:
|
|
102
|
+
- With `feature_id`: `speccrew-workspace/iterations/{number}-{type}-{name}/03.system-design/{platform_id}/{feature-id}-{feature-name}-design.md`
|
|
103
|
+
- Example: `03.system-design/backend-spring/F-CRM-01-customer-list-design.md`
|
|
104
|
+
- Without `feature_id` (backward compatibility): `speccrew-workspace/iterations/{number}-{type}-{name}/03.system-design/{platform_id}/{module}-design.md`
|
|
95
105
|
- Content: Template with top-level placeholders replaced
|
|
96
106
|
4. **Verify**: Document should have complete section structure ready for filling
|
|
97
107
|
|
|
@@ -113,6 +123,22 @@ Fill each section with technology-specific implementation details.
|
|
|
113
123
|
| **Transaction Boundaries** | Use actual framework transaction mechanism |
|
|
114
124
|
| **Exception Handling** | Use actual exception classes and error codes |
|
|
115
125
|
|
|
126
|
+
**How to Reference Techs Knowledge for Pseudo-code:**
|
|
127
|
+
|
|
128
|
+
1. **Read relevant techs knowledge file for the platform**:
|
|
129
|
+
- Core syntax: `tech-stack.md` for framework version and key libraries
|
|
130
|
+
- ORM patterns: `conventions-data.md` for entity definitions and transaction management
|
|
131
|
+
- Design patterns: `conventions-design.md` for layer structure and naming conventions
|
|
132
|
+
2. **Extract framework-specific syntax patterns**:
|
|
133
|
+
- Controller annotations/decorators
|
|
134
|
+
- Service injection patterns
|
|
135
|
+
- Repository/DAO method signatures
|
|
136
|
+
- Transaction management annotations
|
|
137
|
+
3. **Apply patterns in pseudo-code**:
|
|
138
|
+
- Use exact annotation/decorator syntax from techs knowledge
|
|
139
|
+
- Follow naming conventions from conventions-design.md
|
|
140
|
+
- Apply ORM patterns from conventions-data.md
|
|
141
|
+
|
|
116
142
|
**Pseudo-code Requirements:**
|
|
117
143
|
- MUST use actual framework syntax from techs knowledge
|
|
118
144
|
- Spring Boot: `@RestController`, `@PostMapping`, `@Valid`, `@Transactional`, etc.
|
|
@@ -153,7 +179,7 @@ Read INDEX-TEMPLATE.md to understand platform-level document structure.
|
|
|
153
179
|
|---------|---------|
|
|
154
180
|
| **Tech Stack Summary** | Extract from techs knowledge |
|
|
155
181
|
| **Shared Design Decisions** | Middleware stack, data source config, base service classes, common utilities |
|
|
156
|
-
| **Module List Table** | Links to each module design document |
|
|
182
|
+
| **Module List Table** | Links to each module design document. Use `feature_id` as identifier if available (e.g., `F-CRM-01`), otherwise use module name. Example: `\| F-CRM-01 \| Customer List \| F-CRM-01-customer-list-design.md \| NEW \|` |
|
|
157
183
|
| **Cross-Module Interaction Notes** | Shared services, event-driven patterns, dependencies |
|
|
158
184
|
| **Database Schema Overview** | New tables, modified tables, entity relationships |
|
|
159
185
|
|
|
@@ -202,11 +228,11 @@ After completing all steps, output a structured completion report for the System
|
|
|
202
228
|
- **Status**: SUCCESS
|
|
203
229
|
- **Task ID**: {task_id from context}
|
|
204
230
|
- **Platform**: {platform_id}
|
|
231
|
+
- **Feature ID**: {feature_id}
|
|
205
232
|
- **Feature**: {feature_name}
|
|
206
233
|
- **Output Files**:
|
|
207
234
|
- speccrew-workspace/iterations/{iter}/03.system-design/{platform_id}/INDEX.md
|
|
208
|
-
- speccrew-workspace/iterations/{iter}/03.system-design/{platform_id}/{
|
|
209
|
-
- speccrew-workspace/iterations/{iter}/03.system-design/{platform_id}/{module2}-design.md
|
|
235
|
+
- speccrew-workspace/iterations/{iter}/03.system-design/{platform_id}/{feature-id}-{feature-name}-design.md (or {module}-design.md if no feature_id)
|
|
210
236
|
- **Summary**: Backend system design completed for {feature_name} on {platform_id} with {count} module designs
|
|
211
237
|
```
|
|
212
238
|
|
|
@@ -217,6 +243,7 @@ After completing all steps, output a structured completion report for the System
|
|
|
217
243
|
- **Status**: FAILED
|
|
218
244
|
- **Task ID**: {task_id from context}
|
|
219
245
|
- **Platform**: {platform_id}
|
|
246
|
+
- **Feature ID**: {feature_id}
|
|
220
247
|
- **Feature**: {feature_name}
|
|
221
248
|
- **Output Files**: []
|
|
222
249
|
- **Error**: {description of what went wrong}
|
|
@@ -24,10 +24,15 @@ tools: Read, Write, Glob, Grep
|
|
|
24
24
|
|
|
25
25
|
## Step 1: Read Inputs
|
|
26
26
|
|
|
27
|
+
**Input Parameters** (from agent context):
|
|
28
|
+
- `feature_id` (optional): Feature identifier, e.g., `F-CRM-01`. If provided, use new naming format.
|
|
29
|
+
- `feature_name`: Feature name, e.g., `customer-list`.
|
|
30
|
+
- `platform_id`: Target platform, e.g., `frontend-vue`, `frontend-react`.
|
|
31
|
+
|
|
27
32
|
Read in order:
|
|
28
33
|
|
|
29
|
-
1. **Feature Spec document(s)**: `speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/
|
|
30
|
-
2. **API Contract**: `speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/
|
|
34
|
+
1. **Feature Spec document(s)**: `speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/{feature-id}-{feature-name}-feature-spec.md`
|
|
35
|
+
2. **API Contract**: `speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/{feature-id}-{feature-name}-api-contract.md`
|
|
31
36
|
3. **Frontend techs knowledge** (paths from agent context):
|
|
32
37
|
- `speccrew-workspace/knowledges/techs/{platform_id}/tech-stack.md`
|
|
33
38
|
- `speccrew-workspace/knowledges/techs/{platform_id}/architecture.md`
|
|
@@ -56,6 +61,8 @@ Document findings for reference in later steps.
|
|
|
56
61
|
|
|
57
62
|
Parse Feature Spec to identify all functions (Section 2.N pattern).
|
|
58
63
|
|
|
64
|
+
> **Note**: With the new fine-grained Feature Spec format, each Feature Spec typically contains **3-8 functions** (previously 10-20). The extraction logic remains the same, but the scope is more focused.
|
|
65
|
+
|
|
59
66
|
For each function, extract:
|
|
60
67
|
|
|
61
68
|
| Aspect | Content to Extract |
|
|
@@ -89,7 +96,10 @@ Read `SD-FRONTEND-TEMPLATE.md` for document structure.
|
|
|
89
96
|
2. **Replace top-level placeholders** with known variables:
|
|
90
97
|
- Module name, feature name, platform ID, etc.
|
|
91
98
|
3. **Create the document file** using `create_file`:
|
|
92
|
-
- Target path
|
|
99
|
+
- **Target path pattern**:
|
|
100
|
+
- With `feature_id`: `speccrew-workspace/iterations/{number}-{type}-{name}/03.system-design/{platform_id}/{feature-id}-{feature-name}-design.md`
|
|
101
|
+
- Example: `03.system-design/frontend-vue/F-CRM-01-customer-list-design.md`
|
|
102
|
+
- Without `feature_id` (backward compatibility): `speccrew-workspace/iterations/{number}-{type}-{name}/03.system-design/{platform_id}/{module}-design.md`
|
|
93
103
|
- Content: Template with top-level placeholders replaced
|
|
94
104
|
4. **Verify**: Document should have complete section structure ready for filling
|
|
95
105
|
|
|
@@ -161,6 +171,15 @@ Read `INDEX-TEMPLATE.md` for document structure.
|
|
|
161
171
|
|
|
162
172
|
Create table with links to each module design document.
|
|
163
173
|
|
|
174
|
+
| Column | Content |
|
|
175
|
+
|--------|---------|
|
|
176
|
+
| **ID** | Use `feature_id` if available (e.g., `F-CRM-01`), otherwise use module name |
|
|
177
|
+
| **Name** | Feature or module name |
|
|
178
|
+
| **Document** | Link to design file (e.g., `F-CRM-01-customer-list-design.md`) |
|
|
179
|
+
| **Status** | `[NEW]`, `[MODIFIED]`, or `[EXISTING]` |
|
|
180
|
+
|
|
181
|
+
Example row with `feature_id`: `| F-CRM-01 | Customer List | F-CRM-01-customer-list-design.md | NEW |`
|
|
182
|
+
|
|
164
183
|
### 5.4 Verify Output
|
|
165
184
|
|
|
166
185
|
Verify the completed INDEX.md:
|
|
@@ -207,11 +226,11 @@ After completing all steps, output a structured completion report for the System
|
|
|
207
226
|
- **Status**: SUCCESS
|
|
208
227
|
- **Task ID**: {task_id from context}
|
|
209
228
|
- **Platform**: {platform_id}
|
|
229
|
+
- **Feature ID**: {feature_id}
|
|
210
230
|
- **Feature**: {feature_name}
|
|
211
231
|
- **Output Files**:
|
|
212
232
|
- speccrew-workspace/iterations/{iter}/03.system-design/{platform_id}/INDEX.md
|
|
213
|
-
- speccrew-workspace/iterations/{iter}/03.system-design/{platform_id}/{
|
|
214
|
-
- speccrew-workspace/iterations/{iter}/03.system-design/{platform_id}/{module2}-design.md
|
|
233
|
+
- speccrew-workspace/iterations/{iter}/03.system-design/{platform_id}/{feature-id}-{feature-name}-design.md (or {module}-design.md if no feature_id)
|
|
215
234
|
- **Summary**: Frontend system design completed for {feature_name} on {platform_id} with {count} module designs
|
|
216
235
|
```
|
|
217
236
|
|
|
@@ -222,6 +241,7 @@ After completing all steps, output a structured completion report for the System
|
|
|
222
241
|
- **Status**: FAILED
|
|
223
242
|
- **Task ID**: {task_id from context}
|
|
224
243
|
- **Platform**: {platform_id}
|
|
244
|
+
- **Feature ID**: {feature_id}
|
|
225
245
|
- **Feature**: {feature_name}
|
|
226
246
|
- **Output Files**: []
|
|
227
247
|
- **Error**: {description of what went wrong}
|
|
@@ -98,6 +98,13 @@ speccrew-workspace/knowledges/techs/{platform_id}/conventions-system-test.md
|
|
|
98
98
|
| Test Data Management | Fixtures, seeding, mock strategies |
|
|
99
99
|
| API Contract Testing | Contract testing conventions if applicable |
|
|
100
100
|
|
|
101
|
+
**Fallback Handling:**
|
|
102
|
+
|
|
103
|
+
IF `conventions-system-test.md` not found:
|
|
104
|
+
1. Use default analysis dimensions defined in Step 4
|
|
105
|
+
2. Proceed without platform-specific testing conventions
|
|
106
|
+
3. Log a note: "Testing conventions file not found, using default analysis dimensions"
|
|
107
|
+
|
|
101
108
|
## Step 4: Analyze Test Dimensions
|
|
102
109
|
|
|
103
110
|
Systematically analyze test dimensions to ensure comprehensive coverage:
|
|
@@ -206,6 +213,16 @@ Each test case contains:
|
|
|
206
213
|
| P2-Medium | Standard functionality, moderate impact | Edge cases, secondary flows |
|
|
207
214
|
| P3-Low | Minor functionality, low impact | UI polish, rare edge cases |
|
|
208
215
|
|
|
216
|
+
**Priority Mapping from Feature Spec to Test Cases:**
|
|
217
|
+
|
|
218
|
+
| Feature Spec Priority | Test Case Priority | Mapping Rationale |
|
|
219
|
+
|-----------------------|-------------------|------------------|
|
|
220
|
+
| P0 (Critical) | P0 (Critical) | Core functionality must have critical test coverage |
|
|
221
|
+
| P1 (Important) | P1 (High) | Important features need high-priority test validation |
|
|
222
|
+
| P2 (Standard) | P2 (Medium) | Standard features receive medium-priority testing |
|
|
223
|
+
| P3 (Minor) | P3 (Low) | Minor features receive low-priority testing |
|
|
224
|
+
| Unspecified | P2 (Medium) | Default to medium priority if not specified |
|
|
225
|
+
|
|
209
226
|
## Step 6: Coverage Self-Check
|
|
210
227
|
|
|
211
228
|
### 6.1 Acceptance Criteria Coverage
|
|
@@ -50,7 +50,7 @@ Load platform testing conventions to understand the target test framework:
|
|
|
50
50
|
speccrew-workspace/knowledges/techs/{platform_id}/conventions-system-test.md
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
### 2.2
|
|
53
|
+
### 2.2 Unit Test Convention Path (Fallback)
|
|
54
54
|
|
|
55
55
|
If `conventions-system-test.md` does not exist or for unit test specifics, read:
|
|
56
56
|
|
|
@@ -58,7 +58,7 @@ If `conventions-system-test.md` does not exist or for unit test specifics, read:
|
|
|
58
58
|
speccrew-workspace/knowledges/techs/{platform_id}/conventions-unit-test.md
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
### 2.3
|
|
61
|
+
### 2.3 Generic Convention Path (Last Resort)
|
|
62
62
|
|
|
63
63
|
If neither conventions file exists, read `conventions-dev.md` and infer:
|
|
64
64
|
|
|
@@ -66,7 +66,7 @@ If neither conventions file exists, read `conventions-dev.md` and infer:
|
|
|
66
66
|
|-----------------|-------------------|
|
|
67
67
|
| conventions-dev.md | Extract framework from tech stack, infer unit test framework |
|
|
68
68
|
|
|
69
|
-
### 2.
|
|
69
|
+
### 2.4 Information to Extract
|
|
70
70
|
|
|
71
71
|
| Item | Purpose |
|
|
72
72
|
|------|---------|
|
|
@@ -109,6 +109,23 @@ For mocking strategy planning:
|
|
|
109
109
|
|
|
110
110
|
Create a comprehensive test code generation plan:
|
|
111
111
|
|
|
112
|
+
### 4.0 Determine File Grouping Strategy
|
|
113
|
+
|
|
114
|
+
Before organizing test files, determine the grouping strategy:
|
|
115
|
+
|
|
116
|
+
| Condition | Grouping Strategy |
|
|
117
|
+
|-----------|-------------------|
|
|
118
|
+
| Test cases share same module/component | Group into single test file |
|
|
119
|
+
| Test cases are independent | One test file per test case |
|
|
120
|
+
| Test cases span multiple modules | Create separate test files per module |
|
|
121
|
+
|
|
122
|
+
**File Grouping Rules:**
|
|
123
|
+
|
|
124
|
+
1. **IF test cases share same module/component THEN** group into single test file
|
|
125
|
+
2. **IF test cases are independent THEN** one test file per test case
|
|
126
|
+
3. **Maximum test cases per file:** 10 (split into multiple files if exceeded)
|
|
127
|
+
4. **Naming convention:** `{module-name}.test.{ext}` or `{module-name}.spec.{ext}`
|
|
128
|
+
|
|
112
129
|
### 4.1 Test File Structure Planning
|
|
113
130
|
|
|
114
131
|
Determine how test files are organized:
|
|
@@ -85,6 +85,12 @@ Determine if the system under test requires:
|
|
|
85
85
|
|
|
86
86
|
**Checkpoint A**: If any environment check fails, report specific missing items and stop execution.
|
|
87
87
|
|
|
88
|
+
✋ **STOP IF FAILED**: IF any pre-check fails THEN:
|
|
89
|
+
1. Stop workflow immediately
|
|
90
|
+
2. Report all failures to user
|
|
91
|
+
3. Do NOT proceed to test execution
|
|
92
|
+
4. Fix all environment issues before retry
|
|
93
|
+
|
|
88
94
|
## Step 3: Execute Tests
|
|
89
95
|
|
|
90
96
|
### 3.1 Determine Test Command
|
|
@@ -183,6 +189,8 @@ For each deviation, analyze:
|
|
|
183
189
|
- **Skip Reason**: Why test could not execute
|
|
184
190
|
- **Flaky Pattern**: Conditions causing intermittent failure
|
|
185
191
|
|
|
192
|
+
> 📋 **Output Requirement**: These root cause analysis results MUST be included in Step 6 Report under the "Recommendations" section. Each root cause should map to its corresponding test case ID for traceability.
|
|
193
|
+
|
|
186
194
|
## Step 6: Generate Test Report
|
|
187
195
|
|
|
188
196
|
### 6.1 Read Template
|