speccrew 0.3.5 → 0.3.7
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 +91 -130
- package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +36 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +64 -57
- package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/BIZS-MODELING-TEMPLATE.md +6 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/PRD-TEMPLATE.md +31 -4
- package/package.json +1 -1
|
@@ -13,6 +13,29 @@ You are in the **second stage** of the complete engineering closed loop:
|
|
|
13
13
|
|
|
14
14
|
Your core task is to **bridge requirements and implementation**: based on the user scenarios described in the PRD, design the system's UI prototypes, interaction flows, backend processing logic, and data access schemes, without delving into specific technical implementation details.
|
|
15
15
|
|
|
16
|
+
# Quick Reference — Execution Flow
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
Phase 0: Stage Gate
|
|
20
|
+
└── Verify PRD confirmed → Check resume state
|
|
21
|
+
↓
|
|
22
|
+
Phase 1: Preparation
|
|
23
|
+
└── Identify PRD documents → Check existing specs
|
|
24
|
+
↓
|
|
25
|
+
Phase 2: Knowledge Loading
|
|
26
|
+
└── Read PRDs → Discover platforms → Extract Features
|
|
27
|
+
└── Write .checkpoints.json → HARD STOP (user confirms Feature Registry)
|
|
28
|
+
↓
|
|
29
|
+
Phase 3: Worker Dispatch
|
|
30
|
+
└── 1 Feature? → Direct skill invocation
|
|
31
|
+
└── 2+ Features? → Init DISPATCH-PROGRESS → Batch dispatch workers (6/batch)
|
|
32
|
+
└── Error handling → Retry/skip/abort
|
|
33
|
+
↓
|
|
34
|
+
Phase 4: API Contract Generation
|
|
35
|
+
└── Dispatch API Contract workers (same batch pattern)
|
|
36
|
+
└── Joint Confirmation (HARD STOP) → Finalize stage
|
|
37
|
+
```
|
|
38
|
+
|
|
16
39
|
# Workflow
|
|
17
40
|
|
|
18
41
|
## Phase 0: Workflow Progress Management
|
|
@@ -27,7 +50,7 @@ Before starting any feature design work:
|
|
|
27
50
|
```bash
|
|
28
51
|
node speccrew-workspace/scripts/update-progress.js read --file speccrew-workspace/iterations/{iteration-id}/WORKFLOW-PROGRESS.json --overview
|
|
29
52
|
```
|
|
30
|
-
- If the file does not exist → Skip to Phase 1
|
|
53
|
+
- If the file does not exist → Skip to Phase 1
|
|
31
54
|
|
|
32
55
|
2. **Verify PRD Stage Status**:
|
|
33
56
|
- Check: `stages.01_prd.status == "confirmed"` in the output
|
|
@@ -100,29 +123,6 @@ If the iteration involves multiple Features:
|
|
|
100
123
|
|
|
101
124
|
4. **User Confirmation**: Ask "Resume dispatch for pending/failed Features?"
|
|
102
125
|
|
|
103
|
-
### 0.4 Backward Compatibility Note
|
|
104
|
-
|
|
105
|
-
**Dispatch Mode Detection**:
|
|
106
|
-
|
|
107
|
-
The agent automatically detects the appropriate dispatch mode based on PRD content:
|
|
108
|
-
|
|
109
|
-
- **Feature Breakdown present** → Feature-granular dispatch (new behavior)
|
|
110
|
-
- Each Feature in the breakdown table gets its own Feature Spec and API Contract
|
|
111
|
-
- File naming: `{feature-id}-{feature-name}-feature-spec.md`
|
|
112
|
-
|
|
113
|
-
- **Feature Breakdown missing** → Module-granular dispatch (legacy behavior)
|
|
114
|
-
- Each Sub-PRD gets one Feature Spec and API Contract
|
|
115
|
-
- File naming: `{module-name}-feature-spec.md`
|
|
116
|
-
|
|
117
|
-
This ensures backward compatibility with PRDs created before the Feature Breakdown feature was introduced.
|
|
118
|
-
|
|
119
|
-
### 0.5 Backward Compatibility
|
|
120
|
-
|
|
121
|
-
If `WORKFLOW-PROGRESS.json` does not exist:
|
|
122
|
-
- Log: "⚠️ No workflow progress file found. Running in legacy mode."
|
|
123
|
-
- Proceed with Phase 1 normally without stage gate checks
|
|
124
|
-
- This ensures compatibility with projects started before the workflow system was introduced
|
|
125
|
-
|
|
126
126
|
---
|
|
127
127
|
|
|
128
128
|
## Phase 1: Preparation
|
|
@@ -160,6 +160,14 @@ Read all confirmed PRD documents specified by the user. PRD documents contain:
|
|
|
160
160
|
- Business process flows
|
|
161
161
|
- Acceptance criteria
|
|
162
162
|
|
|
163
|
+
### Discover Frontend Platforms
|
|
164
|
+
|
|
165
|
+
Read `speccrew-workspace/knowledges/techs/techs-manifest.json` to identify all frontend platforms:
|
|
166
|
+
- Look for platform entries with type starting with `web-` or `mobile-`
|
|
167
|
+
- If multiple frontend platforms exist (e.g., web-vue + mobile-uniapp), frontend design MUST cover each platform separately
|
|
168
|
+
- If only one frontend platform exists, design for that single platform
|
|
169
|
+
- Store discovered platform list for use in Phase 3 worker dispatch
|
|
170
|
+
|
|
163
171
|
### Extract Feature Breakdown (Section 3.4)
|
|
164
172
|
|
|
165
173
|
After reading PRD documents, extract Feature Breakdown from each Sub-PRD:
|
|
@@ -170,6 +178,8 @@ After reading PRD documents, extract Feature Breakdown from each Sub-PRD:
|
|
|
170
178
|
- `Feature ID`: Unique identifier (e.g., `F-CRM-01`, `F-CRM-02`)
|
|
171
179
|
- `Feature Name`: Descriptive name (e.g., `Customer List Management`)
|
|
172
180
|
- `Type`: Either `Page+API` or `API-only`
|
|
181
|
+
- `Module`: Module identifier the feature belongs to (e.g., `M1-System`, `M2-Member`). Derive from the Sub-PRD's module classification.
|
|
182
|
+
- `Source PRD`: The Sub-PRD filename this feature was extracted from (e.g., `crm-system-sub-member.md`)
|
|
173
183
|
- `Dependencies`: List of prerequisite Feature IDs (if any)
|
|
174
184
|
|
|
175
185
|
3. **Build Feature Registry**: Consolidate all features across Sub-PRDs into a unified list.
|
|
@@ -263,19 +273,6 @@ After reading PRD documents, extract Feature Breakdown from each Sub-PRD:
|
|
|
263
273
|
Then proceed to Phase 3.
|
|
264
274
|
```
|
|
265
275
|
|
|
266
|
-
6. **Backward Compatibility Check**:
|
|
267
|
-
- If **Feature Breakdown exists**: Proceed with Feature-granular dispatch (new behavior)
|
|
268
|
-
- If **Feature Breakdown missing**: Fall back to Sub-PRD-granular dispatch (legacy behavior)
|
|
269
|
-
- Log the dispatch mode: "📋 Dispatch mode: Feature-granular" or "📋 Dispatch mode: Module-granular (legacy)"
|
|
270
|
-
|
|
271
|
-
### Discover Frontend Platforms
|
|
272
|
-
|
|
273
|
-
Read `speccrew-workspace/knowledges/techs/techs-manifest.json` to identify all frontend platforms:
|
|
274
|
-
- Look for platform entries with type starting with `web-` or `mobile-`
|
|
275
|
-
- If multiple frontend platforms exist (e.g., web-vue + mobile-uniapp), frontend design MUST cover each platform separately
|
|
276
|
-
- If only one frontend platform exists, design for that single platform
|
|
277
|
-
- Pass discovered platform list to the design phase
|
|
278
|
-
|
|
279
276
|
### Read on Demand
|
|
280
277
|
When involving related business domains, read `speccrew-workspace/knowledges/bizs/system-overview.md` first, then follow the links within it to navigate to:
|
|
281
278
|
- Related module business knowledge documents
|
|
@@ -300,15 +297,11 @@ Based on Phase 2 Feature Breakdown extraction:
|
|
|
300
297
|
|
|
301
298
|
| Condition | Dispatch Mode | Behavior |
|
|
302
299
|
|-----------|---------------|----------|
|
|
303
|
-
|
|
|
304
|
-
| Feature
|
|
305
|
-
| No Feature Breakdown (legacy PRD) | Module-granular (worker dispatch) | Each Sub-PRD gets one worker (backward compatible) |
|
|
300
|
+
| 2+ Features in registry | Worker dispatch | Each Feature gets its own worker |
|
|
301
|
+
| 1 Feature in registry | Direct skill invocation | Invoke skill directly |
|
|
306
302
|
|
|
307
|
-
### 3.2 Feature
|
|
303
|
+
### 3.2 Single Feature (Direct Skill Invocation)
|
|
308
304
|
|
|
309
|
-
When Feature Breakdown is present and has 2+ Features:
|
|
310
|
-
|
|
311
|
-
#### Single Feature (Direct Skill Invocation)
|
|
312
305
|
If the entire iteration has only **one Feature** in the registry:
|
|
313
306
|
|
|
314
307
|
Invoke Skill directly with parameters:
|
|
@@ -321,11 +314,32 @@ Invoke Skill directly with parameters:
|
|
|
321
314
|
- `output_path`: `speccrew-workspace/iterations/{iteration}/02.feature-design/{feature_id}-{feature-name-slug}-feature-spec.md`
|
|
322
315
|
- `frontend_platforms`: List of frontend platforms from techs-manifest
|
|
323
316
|
|
|
324
|
-
|
|
317
|
+
### 3.3 Multiple Features (Parallel Worker Dispatch)
|
|
318
|
+
|
|
325
319
|
If the iteration has **2+ Features** in the registry:
|
|
326
320
|
|
|
327
321
|
⚠️ **YOU MUST dispatch `speccrew-task-worker` agents. DO NOT invoke the skill yourself.**
|
|
328
322
|
|
|
323
|
+
#### Step 1: Initialize Dispatch Progress Tracking
|
|
324
|
+
|
|
325
|
+
Before dispatching workers, initialize `DISPATCH-PROGRESS.json`:
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
node speccrew-workspace/scripts/update-progress.js init-dispatch \
|
|
329
|
+
--file speccrew-workspace/iterations/{iteration}/02.feature-design/DISPATCH-PROGRESS.json \
|
|
330
|
+
--tasks "F-CRM-01,F-CRM-02,F-CRM-03"
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Each task entry records:
|
|
334
|
+
- `feature_id`: Feature identifier
|
|
335
|
+
- `feature_name`: Feature name
|
|
336
|
+
- `feature_type`: `Page+API` or `API-only`
|
|
337
|
+
- `source_prd`: Path to the source PRD document
|
|
338
|
+
- `status`: `pending` | `in_progress` | `completed` | `failed`
|
|
339
|
+
- `output_path`: Path to the generated Feature Spec
|
|
340
|
+
|
|
341
|
+
#### Step 2: Dispatch Workers
|
|
342
|
+
|
|
329
343
|
Invoke `speccrew-task-worker` agents in parallel, **one worker per Feature** (NOT per module):
|
|
330
344
|
- Each worker receives:
|
|
331
345
|
- `skill_path`: `speccrew-fd-feature-design/SKILL.md`
|
|
@@ -372,49 +386,34 @@ Invoke `speccrew-task-worker` agents in parallel, **one worker per Feature** (NO
|
|
|
372
386
|
- Example: `F-CRM-01-customer-list-feature-spec.md`
|
|
373
387
|
- Slug: lowercase, hyphens for spaces, no special characters
|
|
374
388
|
|
|
375
|
-
### 3.
|
|
389
|
+
### 3.4 Error Handling
|
|
376
390
|
|
|
377
|
-
|
|
391
|
+
When a worker reports failure:
|
|
378
392
|
|
|
379
|
-
|
|
380
|
-
Invoke Skill directly with parameters:
|
|
381
|
-
- Skill path: `speccrew-fd-feature-design/SKILL.md`
|
|
382
|
-
- Parameters:
|
|
383
|
-
- `prd_path`: Path to the PRD document
|
|
384
|
-
- `output_path`: `speccrew-workspace/iterations/{iteration}/02.feature-design/{module-name}-feature-spec.md`
|
|
385
|
-
- `frontend_platforms`: List of frontend platforms from techs-manifest
|
|
393
|
+
1. **Update status**: Set the failed feature's `feature_spec_status` to `failed` in `.checkpoints.json`
|
|
386
394
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
- `sub_prd_path`: Path to one Sub PRD document
|
|
394
|
-
- `output_path`: `speccrew-workspace/iterations/{iteration}/02.feature-design/{module-name}-feature-spec.md`
|
|
395
|
-
- `frontend_platforms`: List of frontend platforms from techs-manifest
|
|
396
|
-
- Parallel execution pattern:
|
|
397
|
-
- Worker 1: Master PRD + Sub PRD 1 → Sub Feature Spec 1
|
|
398
|
-
- Worker 2: Master PRD + Sub PRD 2 → Sub Feature Spec 2
|
|
399
|
-
- Worker N: Master PRD + Sub PRD N → Sub Feature Spec N
|
|
395
|
+
2. **Log error**: Record the error message in `DISPATCH-PROGRESS.json` via:
|
|
396
|
+
```bash
|
|
397
|
+
node speccrew-workspace/scripts/update-progress.js update-task \
|
|
398
|
+
--file speccrew-workspace/iterations/{iteration}/02.feature-design/DISPATCH-PROGRESS.json \
|
|
399
|
+
--task {feature_id} --status failed --error "{error_message}"
|
|
400
|
+
```
|
|
400
401
|
|
|
401
|
-
|
|
402
|
+
3. **Continue batch**: Do NOT stop the entire batch for a single failure. Complete remaining workers in the current batch.
|
|
402
403
|
|
|
403
|
-
|
|
404
|
+
4. **Report to user**: After each batch completes, report failures:
|
|
405
|
+
```
|
|
406
|
+
📊 Batch 1 complete: 5/6 succeeded, 1 failed
|
|
407
|
+
├── ✅ F-SYS-01, F-SYS-02, F-SYS-03, F-SYS-04, F-MEMBER-01
|
|
408
|
+
└── ❌ F-MEMBER-02: [error description]
|
|
409
|
+
|
|
410
|
+
Retry failed features? (yes/skip/abort)
|
|
411
|
+
```
|
|
404
412
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
Each task entry records:
|
|
412
|
-
- `feature_id`: Feature identifier
|
|
413
|
-
- `feature_name`: Feature name
|
|
414
|
-
- `feature_type`: `Page+API` or `API-only`
|
|
415
|
-
- `source_prd`: Path to the source PRD document
|
|
416
|
-
- `status`: `pending` | `in_progress` | `completed` | `failed`
|
|
417
|
-
- `output_path`: Path to the generated Feature Spec
|
|
413
|
+
5. **Retry strategy**:
|
|
414
|
+
- If user says "yes" → Re-dispatch failed features in the next batch
|
|
415
|
+
- If user says "skip" → Mark as `skipped`, continue with remaining features
|
|
416
|
+
- If user says "abort" → Stop dispatch, present partial results
|
|
418
417
|
|
|
419
418
|
## Phase 4: API Contract Generation
|
|
420
419
|
|
|
@@ -424,14 +423,13 @@ After Feature Spec documents are confirmed by user, generate API Contract docume
|
|
|
424
423
|
|
|
425
424
|
Follow the same dispatch mode as Phase 3:
|
|
426
425
|
|
|
427
|
-
|
|
|
428
|
-
|
|
429
|
-
| Feature
|
|
430
|
-
|
|
|
426
|
+
| Condition | API Contract Strategy |
|
|
427
|
+
|-----------|----------------------|
|
|
428
|
+
| 2+ Feature Specs | Worker dispatch — one worker per Feature Spec |
|
|
429
|
+
| 1 Feature Spec | Direct skill invocation |
|
|
431
430
|
|
|
432
|
-
### 4.2 Feature
|
|
431
|
+
### 4.2 Single Feature Spec (Direct Skill Invocation)
|
|
433
432
|
|
|
434
|
-
#### Single Feature Spec
|
|
435
433
|
Invoke API Contract skill directly:
|
|
436
434
|
- Skill path: `speccrew-fd-api-contract/SKILL.md`
|
|
437
435
|
- Parameters:
|
|
@@ -442,7 +440,8 @@ Invoke API Contract skill directly:
|
|
|
442
440
|
|
|
443
441
|
**Note**: Both `Page+API` and `API-only` Features require API Contract documents.
|
|
444
442
|
|
|
445
|
-
|
|
443
|
+
### 4.3 Multiple Feature Specs (Parallel Worker Dispatch)
|
|
444
|
+
|
|
446
445
|
Invoke `speccrew-task-worker` agents in parallel:
|
|
447
446
|
- Each worker receives:
|
|
448
447
|
- `skill_path`: `speccrew-fd-api-contract/SKILL.md`
|
|
@@ -457,25 +456,6 @@ Invoke `speccrew-task-worker` agents in parallel:
|
|
|
457
456
|
- Format: `{feature-id}-{feature-name-slug}-api-contract.md`
|
|
458
457
|
- Example: `F-CRM-01-customer-list-api-contract.md`
|
|
459
458
|
|
|
460
|
-
### 4.3 Module-Granular API Contract (Legacy Behavior)
|
|
461
|
-
|
|
462
|
-
If dispatch was done at module granularity (legacy PRD without Feature Breakdown):
|
|
463
|
-
|
|
464
|
-
#### Single Feature Spec
|
|
465
|
-
Invoke API Contract skill directly:
|
|
466
|
-
- Skill path: `speccrew-fd-api-contract/SKILL.md`
|
|
467
|
-
- Input: The Feature Spec document generated in Phase 3
|
|
468
|
-
- Output path: `speccrew-workspace/iterations/{iteration}/02.feature-design/{module-name}-api-contract.md`
|
|
469
|
-
|
|
470
|
-
#### Multiple Feature Specs (Master + Sub)
|
|
471
|
-
Invoke `speccrew-task-worker` agents in parallel:
|
|
472
|
-
- Each worker receives:
|
|
473
|
-
- `skill_path`: `speccrew-fd-api-contract/SKILL.md`
|
|
474
|
-
- `context`:
|
|
475
|
-
- `feature_spec_path`: Path to one Feature Spec document
|
|
476
|
-
- `output_path`: Path for the API Contract document
|
|
477
|
-
- Parallel execution: one worker per Feature Spec document
|
|
478
|
-
|
|
479
459
|
### 4.4 Joint Confirmation
|
|
480
460
|
|
|
481
461
|
After both Feature Spec and API Contract documents are ready, present summary to user:
|
|
@@ -504,17 +484,11 @@ After user confirms Joint Confirmation:
|
|
|
504
484
|
|
|
505
485
|
| Deliverable | Path | Notes |
|
|
506
486
|
|-------------|------|-------|
|
|
507
|
-
| Feature
|
|
508
|
-
|
|
|
509
|
-
| API Contract Document | `speccrew-workspace/iterations/{iteration}/02.feature-design/{feature-id}-{feature-name}-api-contract.md` | New naming convention (Feature-granular) |
|
|
510
|
-
| API Contract Document (Legacy) | `speccrew-workspace/iterations/{iteration}/02.feature-design/{module-name}-api-contract.md` | Legacy naming convention (Module-granular, for backward compatibility) |
|
|
487
|
+
| Feature Spec | `speccrew-workspace/iterations/{iteration}/02.feature-design/{feature-id}-{feature-name}-feature-spec.md` | One document per Feature |
|
|
488
|
+
| API Contract | `speccrew-workspace/iterations/{iteration}/02.feature-design/{feature-id}-{feature-name}-api-contract.md` | One document per Feature |
|
|
511
489
|
|
|
512
490
|
## Naming Convention
|
|
513
491
|
|
|
514
|
-
### Feature-Granular Naming (New)
|
|
515
|
-
|
|
516
|
-
When Feature Breakdown is present in PRD:
|
|
517
|
-
|
|
518
492
|
**Format**: `{feature-id}-{feature-name-slug}-{document-type}.md`
|
|
519
493
|
|
|
520
494
|
- `feature-id`: From Feature Breakdown table (e.g., `F-CRM-01`)
|
|
@@ -528,22 +502,9 @@ When Feature Breakdown is present in PRD:
|
|
|
528
502
|
- `F-CRM-02-customer-detail-feature-spec.md`
|
|
529
503
|
- `F-ORD-01-order-create-feature-spec.md`
|
|
530
504
|
|
|
531
|
-
### Module-Granular Naming (Legacy)
|
|
532
|
-
|
|
533
|
-
When Feature Breakdown is NOT present in PRD:
|
|
534
|
-
|
|
535
|
-
**Format**: `{module-name}-{document-type}.md`
|
|
536
|
-
|
|
537
|
-
- `module-name`: Derived from Sub-PRD filename or module identifier
|
|
538
|
-
- `document-type`: Either `feature-spec` or `api-contract`
|
|
539
|
-
|
|
540
|
-
**Examples**:
|
|
541
|
-
- `customer-feature-spec.md`
|
|
542
|
-
- `order-feature-spec.md`
|
|
543
|
-
|
|
544
505
|
# Deliverable Content Structure
|
|
545
506
|
|
|
546
|
-
|
|
507
|
+
Each Feature Spec document should include the following sections:
|
|
547
508
|
|
|
548
509
|
## 1. Content Overview
|
|
549
510
|
- Basic feature information (name, module, core function, target users)
|
|
@@ -4,6 +4,18 @@ description: Feature Design SOP. Guide Feature Designer Agent to transform PRD r
|
|
|
4
4
|
tools: Read, Write, Glob, Grep
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
# Methodology Foundation
|
|
8
|
+
|
|
9
|
+
This skill applies the ISA-95 six-stage methodology (Stages 4-6) as an internal thinking framework:
|
|
10
|
+
|
|
11
|
+
| ISA-95 Stage | Integrated Into | Purpose |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| Stage 4: Information Flows | Feature Spec Section 3 (Interaction Flow) | Map cross-module data flows, identify API endpoints |
|
|
14
|
+
| Stage 5: Categories of Information | Feature Spec Section 4 (Data Field Definition) | Classify data entities, build data dictionary |
|
|
15
|
+
| Stage 6: Information Descriptions | Feature Spec Section 5 (Business Rules) + API Contract | Define validation rules, output standards, traceability |
|
|
16
|
+
|
|
17
|
+
> ⚠️ **No separate modeling documents.** The methodology guides thinking quality, not document quantity.
|
|
18
|
+
|
|
7
19
|
# Trigger Scenarios
|
|
8
20
|
|
|
9
21
|
- PRD has been confirmed, user requests to start feature design
|
|
@@ -336,6 +348,14 @@ Document user actions and system responses:
|
|
|
336
348
|
User Action → Frontend Response → Backend API Call
|
|
337
349
|
```
|
|
338
350
|
|
|
351
|
+
> **ISA-95 Stage 4 Thinking — Information Flows of Interest**
|
|
352
|
+
> When designing interaction flows:
|
|
353
|
+
> - **Cross-module Information Flow**: Map all data flows between this feature and other modules/systems. Identify data source, destination, format, and frequency.
|
|
354
|
+
> - **Sequence Diagram Coverage**: The sequence diagram must cover the complete interaction chain — user action → frontend → backend → database → external systems.
|
|
355
|
+
> - **Interface Identification**: Every data exchange point becomes a potential API endpoint. List all interface interactions with direction, format, and core fields.
|
|
356
|
+
> - **Exception Flows**: Identify and document alternative/exception paths, not just the happy path.
|
|
357
|
+
> These elements flow into Feature Spec Section 3 (Interaction Flow) — no separate DFD document needed.
|
|
358
|
+
|
|
339
359
|
**Example:**
|
|
340
360
|
```
|
|
341
361
|
1. User clicks "New User" button
|
|
@@ -424,6 +444,14 @@ For each new entity:
|
|
|
424
444
|
|-------|------|-------------|-------------|
|
|
425
445
|
| {field name} | {data type} | {required/unique/etc} | {purpose} |
|
|
426
446
|
|
|
447
|
+
> **ISA-95 Stage 5 Thinking — Categories of Information**
|
|
448
|
+
> When defining data fields:
|
|
449
|
+
> - **Information Classification**: Categorize data entities (master data, transactional data, reference data, computed data). This determines storage strategy and update frequency.
|
|
450
|
+
> - **Data Dictionary Rigor**: Every field must have: name, type, constraints, semantic description, and data source.
|
|
451
|
+
> - **Semantic Consistency**: Field names and definitions must align with the domain glossary established in the PRD clarification phase. No "同物异名" (same thing, different names).
|
|
452
|
+
> - **Entity Relationships**: Identify core entity relationships (1:1, 1:N, N:N) that will drive database design downstream.
|
|
453
|
+
> These elements flow into Feature Spec Section 4 (Data Field Definition) — no separate data dictionary document needed.
|
|
454
|
+
|
|
427
455
|
### 7.2 Modifications to Existing Data Structures
|
|
428
456
|
|
|
429
457
|
| Entity | Change Type | Details | Impact |
|
|
@@ -451,6 +479,14 @@ EntityA --N:1--> EntityC
|
|
|
451
479
|
|
|
452
480
|
## Step 8: Business Rules and Constraints
|
|
453
481
|
|
|
482
|
+
> **ISA-95 Stage 6 Thinking — Information Descriptions**
|
|
483
|
+
> When defining business rules and constraints:
|
|
484
|
+
> - **Validation Rules**: Define field-level validation (format, range, required), cross-field validation, and business logic validation.
|
|
485
|
+
> - **Output Format Standards**: Specify information output format (JSON for API, specific encoding), ensuring consistency with downstream API Contract.
|
|
486
|
+
> - **Permission Rules**: Define data access permissions that will map to API authorization logic.
|
|
487
|
+
> - **Traceability**: Every business rule should trace back to a PRD requirement. Every data field should trace to a user story.
|
|
488
|
+
> These elements flow into Feature Spec Section 5 (Business Rules) and prepare the foundation for API Contract generation.
|
|
489
|
+
|
|
454
490
|
### 8.1 Permission Rules
|
|
455
491
|
|
|
456
492
|
| Function | Required Permission | Scope |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: speccrew-pm-requirement-analysis
|
|
3
|
-
description: PRD Writing SOP with ISA-95
|
|
3
|
+
description: PRD Writing SOP with ISA-95 methodology integration. Guide PM Agent through requirements clarification, business domain analysis, and PRD document generation. Applies ISA-95 Stages 1-3 as internal thinking framework for clarification, functional decomposition, and prioritization — no separate modeling documents. Use when PM needs to write PRD, organize requirements, or create structured requirement documents.
|
|
4
4
|
tools: Read, Write, Glob, Grep
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -8,9 +8,20 @@ tools: Read, Write, Glob, Grep
|
|
|
8
8
|
|
|
9
9
|
- PM Agent receives user requirement description
|
|
10
10
|
- User requests "Write a PRD" or "Help organize requirements" or "New feature requirements"
|
|
11
|
-
- User requests "Create business model" or "Model business requirements"
|
|
12
11
|
- User needs structured requirement document with UML diagrams
|
|
13
12
|
|
|
13
|
+
## Methodology Foundation
|
|
14
|
+
|
|
15
|
+
This skill applies the ISA-95 six-stage methodology (Stages 1-3) as an internal thinking framework:
|
|
16
|
+
|
|
17
|
+
| ISA-95 Stage | Integrated Into | Purpose |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| Stage 1: Domain Description | Clarification process | Define domain boundary, participants, glossary |
|
|
20
|
+
| Stage 2: Functions in Domain | PRD Section 3 (Functional Requirements) | WBS decomposition, capability mapping |
|
|
21
|
+
| Stage 3: Functions of Interest | PRD Section 3.4 (Feature Breakdown) | MoSCoW prioritization, MVP scoping |
|
|
22
|
+
|
|
23
|
+
> ⚠️ **No separate modeling documents.** The methodology guides thinking quality, not document quantity.
|
|
24
|
+
|
|
14
25
|
# Workflow
|
|
15
26
|
|
|
16
27
|
## Absolute Constraints
|
|
@@ -37,6 +48,13 @@ IF user provided incomplete input:
|
|
|
37
48
|
|
|
38
49
|
Use progressive questioning to clarify requirements. Do NOT ask all questions at once.
|
|
39
50
|
|
|
51
|
+
> **ISA-95 Stage 1 Thinking — Domain Description**
|
|
52
|
+
> During clarification, apply domain description methodology:
|
|
53
|
+
> - **Domain Boundary**: Explicitly define what is in-scope and out-of-scope. Record in clarification summary.
|
|
54
|
+
> - **External Participants**: Identify all user roles, external systems, and integration points.
|
|
55
|
+
> - **Domain Glossary**: Unify key business terms to eliminate ambiguity across stakeholders.
|
|
56
|
+
> These elements should naturally flow into the clarification summary, NOT as a separate document.
|
|
57
|
+
|
|
40
58
|
### Round 1: Core Understanding
|
|
41
59
|
|
|
42
60
|
Ask these first (2-3 questions max per round):
|
|
@@ -198,94 +216,68 @@ Evaluate requirement complexity to determine the appropriate workflow path:
|
|
|
198
216
|
| Modules involved | 1 module | 2+ modules or new domain |
|
|
199
217
|
| Domain clarity | Well-understood domain | New/unclear domain |
|
|
200
218
|
| Cross-module deps | None or minimal | Significant |
|
|
201
|
-
| Template | PRD-TEMPLATE.md only |
|
|
219
|
+
| Template | PRD-TEMPLATE.md only | PRD-TEMPLATE.md (with deeper analysis) |
|
|
202
220
|
|
|
203
221
|
**Workflow Path:**
|
|
204
222
|
- **Simple path**: Skip to Step 7 (Read PRD Template)
|
|
205
223
|
- **Complex path**: Proceed to Step 5 (ISA-95 Business Modeling) → Step 6 (Module Decomposition)
|
|
206
224
|
|
|
207
|
-
## Step 5: ISA-95 Business Modeling (Complex Requirements Only)
|
|
225
|
+
## Step 5: ISA-95 Business Modeling Thinking (Complex Requirements Only)
|
|
208
226
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
speccrew-pm-requirement-analysis/templates/BIZS-MODELING-TEMPLATE.md
|
|
212
|
-
```
|
|
227
|
+
> ⚠️ **This step is a THINKING PROCESS, not a document generation step.**
|
|
228
|
+
> Apply ISA-95 methodology internally to deepen your analysis. Results flow into the PRD.
|
|
213
229
|
|
|
214
|
-
|
|
230
|
+
Apply ISA-95 six stages as internal thinking framework:
|
|
215
231
|
|
|
216
|
-
### 5.1 Stage 1 - Domain Description
|
|
232
|
+
### 5.1 Stage 1 - Domain Description (Thinking)
|
|
217
233
|
- Define domain boundary (in-scope, out-of-scope)
|
|
218
234
|
- Identify external participants (users, systems, agents)
|
|
219
235
|
- Create domain glossary
|
|
220
|
-
-
|
|
236
|
+
- Visualize system context (mental model or rough sketch)
|
|
221
237
|
|
|
222
238
|
**Checkpoint A: Briefly confirm domain boundary with user before proceeding.**
|
|
223
239
|
Ask: "Here is the domain boundary and key participants. Does this match your understanding?"
|
|
224
240
|
|
|
225
|
-
### 5.2 Stage 2 - Functions in Domain
|
|
226
|
-
- Create WBS decomposition (
|
|
241
|
+
### 5.2 Stage 2 - Functions in Domain (Thinking)
|
|
242
|
+
- Create WBS decomposition (mental or rough sketch)
|
|
227
243
|
- Map functions to business capabilities
|
|
228
|
-
-
|
|
244
|
+
- Identify module boundaries
|
|
229
245
|
|
|
230
|
-
### 5.3 Stage 3 - Functions of Interest
|
|
246
|
+
### 5.3 Stage 3 - Functions of Interest (Thinking)
|
|
231
247
|
- Apply MoSCoW prioritization
|
|
232
|
-
-
|
|
248
|
+
- Identify core vs non-core functions
|
|
233
249
|
- Document non-core functions and their iteration plan
|
|
234
250
|
|
|
235
251
|
**Checkpoint B: Confirm MVP scope with user before proceeding.**
|
|
236
252
|
Ask: "Here are the core functions (Must have) and deferred functions. Is the MVP scope correct?"
|
|
237
253
|
|
|
238
|
-
### 5.4 Stage 4 - Information Flows
|
|
254
|
+
### 5.4 Stage 4 - Information Flows (Thinking)
|
|
239
255
|
- Document core information flows
|
|
240
|
-
-
|
|
241
|
-
-
|
|
242
|
-
- List interface interactions
|
|
256
|
+
- Identify key interfaces
|
|
257
|
+
- Understand data movement patterns
|
|
243
258
|
|
|
244
|
-
### 5.5 Stage 5 - Categories of Information
|
|
259
|
+
### 5.5 Stage 5 - Categories of Information (Thinking)
|
|
245
260
|
- Define information categories
|
|
246
|
-
-
|
|
247
|
-
-
|
|
261
|
+
- Identify core entities
|
|
262
|
+
- Understand data relationships
|
|
263
|
+
|
|
264
|
+
### 5.6 Stage 6 - Information Descriptions (Thinking)
|
|
265
|
+
- Consider technical implications
|
|
266
|
+
- Identify component boundaries
|
|
267
|
+
- Note implementation considerations
|
|
248
268
|
|
|
249
|
-
|
|
250
|
-
- Create design class diagram with technical details
|
|
251
|
-
- Create component diagram (graph TB)
|
|
252
|
-
- Document implementation standards
|
|
269
|
+
**Checkpoint C: Present analysis summary to user for final confirmation.**
|
|
253
270
|
|
|
254
|
-
|
|
271
|
+
> All ISA-95 thinking results will be reflected in the PRD document, NOT as a separate modeling file.
|
|
255
272
|
|
|
256
273
|
**Key rules for this step:**
|
|
257
274
|
- Use 3 checkpoints (A/B/C) for progressive confirmation, not all-at-once
|
|
258
|
-
-
|
|
259
|
-
|
|
260
|
-
- No nested subgraphs
|
|
261
|
-
- No `direction` keyword
|
|
262
|
-
- No `style` definitions
|
|
263
|
-
- No special characters in node text
|
|
264
|
-
- **Write modeling document using template-fill workflow:**
|
|
265
|
-
|
|
266
|
-
**5.7a Copy Template to Document Path:**
|
|
267
|
-
1. Read `templates/BIZS-MODELING-TEMPLATE.md`
|
|
268
|
-
2. Replace top-level placeholders (feature name, domain name, etc.)
|
|
269
|
-
3. Create document using `create_file` at: `iterations/{number}-{type}-{name}/01.product-requirement/{feature-name}-bizs-modeling.md`
|
|
270
|
-
|
|
271
|
-
**5.7b Fill Each Section Using search_replace:**
|
|
272
|
-
Fill each modeling stage section with results from Stages 1-6 above, using `search_replace` per section.
|
|
273
|
-
> ⚠️ FORBIDDEN: `create_file` to rewrite entire document. MUST use `search_replace` per section.
|
|
274
|
-
|
|
275
|
-
**ISA-95 Quick Reference:**
|
|
276
|
-
|
|
277
|
-
| Stage | Focus | Key Output | UML Type |
|
|
278
|
-
|-------|-------|------------|----------|
|
|
279
|
-
| 1. Domain Description | Boundary, terminology | System context diagram | graph TD |
|
|
280
|
-
| 2. Functions in Domain | All functions | WBS, use case diagram | graph TD, graph TB |
|
|
281
|
-
| 3. Functions of Interest | Core functions (MVP) | MoSCoW table | graph TB |
|
|
282
|
-
| 4. Information Flows | Interactions, interfaces | Sequence diagram, DFD | sequenceDiagram, graph TD |
|
|
283
|
-
| 5. Categories of Information | Entities, data dictionary | Conceptual class diagram | classDiagram |
|
|
284
|
-
| 6. Information Descriptions | Design details | Design class diagram | classDiagram, graph TB |
|
|
275
|
+
- This is an analysis phase — focus on understanding, not documentation
|
|
276
|
+
- Results integrate into PRD Sections 3-7 during Step 9
|
|
285
277
|
|
|
286
278
|
## Step 6: Module Decomposition & Ordering (Complex Requirements Only)
|
|
287
279
|
|
|
288
|
-
|
|
280
|
+
Based on ISA-95 analysis from Step 5, map identified modules into independent units. For each module:
|
|
289
281
|
|
|
290
282
|
### 6.1 Define Module List
|
|
291
283
|
|
|
@@ -295,7 +287,7 @@ Map WBS Level-1 nodes from Stage 2 into independent modules. For each module:
|
|
|
295
287
|
|
|
296
288
|
### 6.2 Cross-Module Dependency Matrix
|
|
297
289
|
|
|
298
|
-
|
|
290
|
+
Based on information flow analysis from Step 5, identify dependencies:
|
|
299
291
|
|
|
300
292
|
| Module | Depends On | Dependency Type | Shared Entities |
|
|
301
293
|
|--------|-----------|-----------------|-----------------|
|
|
@@ -381,6 +373,14 @@ Fill in according to the template structure, requirements:
|
|
|
381
373
|
- **Background & Goals**: Explain why we're doing this and what success looks like
|
|
382
374
|
- **User Stories**: `As a [user role], I want [to do something], so that [I can achieve some goal]`
|
|
383
375
|
- **Functional Requirements**: Group by priority (P0 Core / P1 Important / P2 Optional)
|
|
376
|
+
|
|
377
|
+
> **ISA-95 Stage 2 Thinking — Functions in Domain**
|
|
378
|
+
> When decomposing functional requirements:
|
|
379
|
+
> - **WBS Decomposition**: Break down the system into functional modules using Work Breakdown Structure logic. Each module should map to a clear business capability.
|
|
380
|
+
> - **Function-Capability Mapping**: Every function must answer "what business capability does this deliver?"
|
|
381
|
+
> - **Module Boundaries**: Ensure modules have clear boundaries with minimal coupling.
|
|
382
|
+
> This thinking drives PRD Section 3 content quality — no separate WBS document needed.
|
|
383
|
+
|
|
384
384
|
- **Feature Breakdown**: Extract business operation units for downstream Feature Design (see Step 9.1)
|
|
385
385
|
- **Non-functional Requirements**: Performance, security, compatibility, etc.
|
|
386
386
|
- **Acceptance Criteria**: Quantifiable, verifiable definition of done
|
|
@@ -391,6 +391,13 @@ Fill in according to the template structure, requirements:
|
|
|
391
391
|
|
|
392
392
|
For both simple and complex requirements, extract Feature Breakdown to guide downstream Feature Design:
|
|
393
393
|
|
|
394
|
+
> **ISA-95 Stage 3 Thinking — Functions of Interest**
|
|
395
|
+
> When creating the Feature Breakdown table:
|
|
396
|
+
> - **MoSCoW Prioritization**: Classify each feature as Must-have (P0), Should-have (P1), Could-have (P2), or Won't-have (deferred).
|
|
397
|
+
> - **MVP Focus**: The Feature Breakdown table IS the MVP definition. Features marked P0 form the core scope.
|
|
398
|
+
> - **Non-core Exclusion**: Explicitly note deferred features in Section 6 (Boundary & Constraints) with planned iteration.
|
|
399
|
+
> The Feature Breakdown table in Section 3.4 serves as the core function selection — no separate priority matrix needed.
|
|
400
|
+
|
|
394
401
|
**Analysis Steps:**
|
|
395
402
|
1. **Analyze user stories and functional requirements** for this module/feature
|
|
396
403
|
2. **Identify business operation units** - each unit should represent:
|
package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/BIZS-MODELING-TEMPLATE.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
INTERNAL REFERENCE ONLY — This template is NOT used to generate standalone documents.
|
|
3
|
+
ISA-95 methodology is internalized into the PRD generation process.
|
|
4
|
+
All modeling insights should flow into PRD-TEMPLATE.md sections.
|
|
5
|
+
See SKILL.md "Methodology Foundation" section for the integration mapping.
|
|
6
|
+
-->
|
|
1
7
|
# Business Modeling - [Feature/Skill Name]
|
|
2
8
|
|
|
3
9
|
## Document Info
|
|
@@ -8,6 +8,31 @@
|
|
|
8
8
|
### 1.2 Goals
|
|
9
9
|
[Describe the business objectives to be achieved]
|
|
10
10
|
|
|
11
|
+
### 1.3 Domain Boundary
|
|
12
|
+
|
|
13
|
+
**In-Scope Domains:**
|
|
14
|
+
- {Domain 1: brief description}
|
|
15
|
+
- {Domain 2: brief description}
|
|
16
|
+
|
|
17
|
+
**Out-of-Scope Domains:**
|
|
18
|
+
- {Domain 1: reason for exclusion}
|
|
19
|
+
|
|
20
|
+
**External Participants:**
|
|
21
|
+
|
|
22
|
+
| Participant Type | Name | Description |
|
|
23
|
+
|------------------|------|-------------|
|
|
24
|
+
| User | {Role name} | {Role description} |
|
|
25
|
+
| System | {System name} | {Integration description} |
|
|
26
|
+
|
|
27
|
+
### 1.4 Domain Glossary
|
|
28
|
+
|
|
29
|
+
> Unify key business terms to eliminate cross-stakeholder ambiguity.
|
|
30
|
+
|
|
31
|
+
| Term | Definition | Related Concepts |
|
|
32
|
+
|------|------------|------------------|
|
|
33
|
+
| {Term 1} | {Precise definition} | {Related terms or modules} |
|
|
34
|
+
| {Term 2} | {Precise definition} | {Related terms or modules} |
|
|
35
|
+
|
|
11
36
|
## 2. User Stories
|
|
12
37
|
|
|
13
38
|
### 2.1 Target Users
|
|
@@ -107,10 +132,12 @@ graph TB
|
|
|
107
132
|
|
|
108
133
|
> 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
134
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
|
113
|
-
|
|
135
|
+
> Priority follows MoSCoW method: P0 = Must have (MVP core), P1 = Should have, P2 = Could have, Deferred = Won't have this iteration.
|
|
136
|
+
|
|
137
|
+
| Feature ID | Feature Name | Type | Priority | Pages/Endpoints | Description |
|
|
138
|
+
|------------|-------------|------|----------|-----------------|-------------|
|
|
139
|
+
| F-{MODULE}-01 | {Feature name} | Page+API / API-only | P0 (Must) / P1 (Should) / P2 (Could) | {count} | {Brief description} |
|
|
140
|
+
| F-{MODULE}-02 | {Feature name} | Page+API / API-only | P0 (Must) / P1 (Should) / P2 (Could) | {count} | {Brief description} |
|
|
114
141
|
|
|
115
142
|
#### Feature Dependencies
|
|
116
143
|
|