@atlashub/smartstack-cli 2.0.0 → 2.2.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/.documentation/agents.html +147 -40
- package/.documentation/apex.html +1 -1
- package/.documentation/business-analyse.html +3 -3
- package/.documentation/cli-commands.html +2 -2
- package/.documentation/commands.html +14 -14
- package/.documentation/efcore.html +14 -14
- package/.documentation/gitflow.html +12 -12
- package/.documentation/hooks.html +41 -3
- package/.documentation/index.html +1 -1
- package/.documentation/init.html +2 -2
- package/.documentation/installation.html +11 -11
- package/.documentation/js/app.js +1 -1
- package/.documentation/ralph-loop.html +1 -1
- package/.documentation/test-web.html +4 -4
- package/dist/index.js +19 -11
- package/dist/index.js.map +1 -1
- package/dist/mcp-entry.mjs +57595 -4569
- package/dist/mcp-entry.mjs.map +1 -1
- package/package.json +1 -1
- package/templates/agents/ba-reader.md +250 -0
- package/templates/agents/ba-writer.md +210 -0
- package/templates/agents/docs-context-reader.md +51 -33
- package/templates/skills/_shared.md +2 -0
- package/templates/skills/business-analyse/SKILL.md +120 -108
- package/templates/skills/business-analyse/_shared.md +191 -160
- package/templates/skills/business-analyse/patterns/suggestion-catalog.md +478 -0
- package/templates/skills/business-analyse/questionnaire/01-context.md +3 -15
- package/templates/skills/business-analyse/questionnaire/08-performance.md +7 -21
- package/templates/skills/business-analyse/questionnaire/09-constraints.md +0 -13
- package/templates/skills/business-analyse/questionnaire/10-documentation.md +0 -13
- package/templates/skills/business-analyse/questionnaire.md +72 -76
- package/templates/skills/business-analyse/react/components.md +317 -154
- package/templates/skills/business-analyse/react/i18n-template.md +167 -106
- package/templates/skills/business-analyse/react/schema.md +325 -106
- package/templates/skills/business-analyse/schemas/feature-schema.json +690 -0
- package/templates/skills/business-analyse/steps/step-00-init.md +395 -285
- package/templates/skills/business-analyse/steps/step-01-analyse.md +505 -0
- package/templates/skills/business-analyse/steps/step-02-specify.md +833 -0
- package/templates/skills/business-analyse/steps/step-03-validate.md +862 -0
- package/templates/skills/business-analyse/steps/step-04-handoff.md +1593 -0
- package/templates/skills/business-analyse/templates/tpl-handoff.md +95 -43
- package/templates/skills/controller/templates.md +82 -0
- package/templates/skills/efcore/references/zero-downtime-patterns.md +227 -0
- package/templates/skills/efcore/steps/migration/step-03-validate.md +19 -0
- package/templates/skills/review-code/SKILL.md +4 -2
- package/templates/skills/review-code/references/owasp-api-top10.md +243 -0
- package/templates/skills/review-code/references/security-checklist.md +86 -1
- package/templates/skills/review-code/references/smartstack-conventions.md +166 -0
- package/templates/skills/workflow/SKILL.md +27 -0
- package/templates/skills/business-analyse/steps/step-01-discover.md +0 -737
- package/templates/skills/business-analyse/steps/step-02-analyse.md +0 -299
- package/templates/skills/business-analyse/steps/step-03-specify.md +0 -409
- package/templates/skills/business-analyse/steps/step-04-validate.md +0 -313
- package/templates/skills/business-analyse/steps/step-05-handoff.md +0 -658
- package/templates/skills/business-analyse/steps/step-06-doc-html.md +0 -320
- package/templates/skills/business-analyse/templates/00-context.md +0 -105
- package/templates/skills/business-analyse/templates/tpl-brd.md +0 -97
- package/templates/skills/business-analyse/templates/tpl-discovery.md +0 -78
- package/templates/skills/business-analyse/tracking/change-template.md +0 -30
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: step-02-analyse
|
|
3
|
-
description: Analysis phase - BRD formalization with business rules
|
|
4
|
-
next_step: steps/step-03-specify.md
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## YOUR TASK:
|
|
8
|
-
|
|
9
|
-
Transform discovery findings into a formal Business Requirements Document (BRD).
|
|
10
|
-
Identify and formalize all business rules with BR-XXX identifiers.
|
|
11
|
-
|
|
12
|
-
> **ULTRATHINK MODE:**
|
|
13
|
-
> - Extract IMPLICIT rules from discovery responses
|
|
14
|
-
> - Challenge completeness of each rule
|
|
15
|
-
> - Verify no rule contradicts another
|
|
16
|
-
> - Ensure rules are testable
|
|
17
|
-
|
|
18
|
-
## EXECUTION SEQUENCE:
|
|
19
|
-
|
|
20
|
-
### 1. Read Current State
|
|
21
|
-
|
|
22
|
-
Read `{output_dir}/00-context.md` to restore state variables.
|
|
23
|
-
Read `{output_dir}/1-discovery.md` for discovery findings.
|
|
24
|
-
|
|
25
|
-
Update progress: `02-analyse` -> "In Progress"
|
|
26
|
-
|
|
27
|
-
**Read digest from previous step:**
|
|
28
|
-
Read `{output_dir}/digest-01.md` for compressed context from previous step.
|
|
29
|
-
**DO NOT read full output files** unless in resume mode (`-r`).
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
### 2. Load BRD Template
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
Read: templates/tpl-brd.md # ~90 lines only (vs 477 lines full template)
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
This template contains ONLY the BRD structure, not FRD or Handoff.
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
### 3. Extract Business Objectives
|
|
44
|
-
|
|
45
|
-
From discovery section 1 (Contexte Business), formalize:
|
|
46
|
-
|
|
47
|
-
| ID | Objective | Metric | Target |
|
|
48
|
-
|----|----------|----------|-------|
|
|
49
|
-
| OBJ-001 | {objective} | {measurable KPI} | {target value} |
|
|
50
|
-
| OBJ-002 | ... | ... | ... |
|
|
51
|
-
|
|
52
|
-
**ULTRATHINK checkpoint:**
|
|
53
|
-
- Each objective is measurable?
|
|
54
|
-
- Target values are realistic?
|
|
55
|
-
- Objectives align with stakeholder needs?
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
### 4. Identify Business Rules
|
|
60
|
-
|
|
61
|
-
Scan discovery document for implicit and explicit rules:
|
|
62
|
-
|
|
63
|
-
**Sources to analyze:**
|
|
64
|
-
- Scope section (constraints)
|
|
65
|
-
- Stakeholder needs (role-specific rules)
|
|
66
|
-
- Data requirements (validation rules)
|
|
67
|
-
- Process flows (workflow rules)
|
|
68
|
-
|
|
69
|
-
**Rule categories:**
|
|
70
|
-
| Category | Example | BR-ID pattern |
|
|
71
|
-
|----------|---------|---------------|
|
|
72
|
-
| Validation | "Email must be unique" | BR-VAL-XXX |
|
|
73
|
-
| Calculation | "Total = sum of lines" | BR-CALC-XXX |
|
|
74
|
-
| Workflow | "Manager must approve > 1000$" | BR-WF-XXX |
|
|
75
|
-
| Security | "Only admin can delete" | BR-SEC-XXX |
|
|
76
|
-
| Data | "Created date is immutable" | BR-DATA-XXX |
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
### 5. Formalize Each Business Rule
|
|
81
|
-
|
|
82
|
-
For each identified rule, create detailed specification:
|
|
83
|
-
|
|
84
|
-
```markdown
|
|
85
|
-
#### BR-XXX: {Rule Name}
|
|
86
|
-
|
|
87
|
-
**Statement:** {Clear, unambiguous statement}
|
|
88
|
-
|
|
89
|
-
**Conditions:**
|
|
90
|
-
- IF {condition A}
|
|
91
|
-
- AND {condition B}
|
|
92
|
-
- THEN {result}
|
|
93
|
-
- ELSE {alternative result}
|
|
94
|
-
|
|
95
|
-
**Examples:**
|
|
96
|
-
| Input | Expected Output |
|
|
97
|
-
|-------|-----------------|
|
|
98
|
-
| {example input 1} | {expected output 1} |
|
|
99
|
-
| {example input 2} | {expected output 2} |
|
|
100
|
-
|
|
101
|
-
**Testability:** {How to verify this rule}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
### 6. Model Business Process
|
|
107
|
-
|
|
108
|
-
Create process diagram for main flow:
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
|
|
112
|
-
│ Step 1 │────►│ Step 2 │────►│ Step 3 │
|
|
113
|
-
│ {action} │ │ {action} │ │ {action} │
|
|
114
|
-
└─────────────┘ └─────────────┘ └─────────────┘
|
|
115
|
-
│ │ │
|
|
116
|
-
▼ ▼ ▼
|
|
117
|
-
{actor} {actor} {actor}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
Identify:
|
|
121
|
-
- Entry points
|
|
122
|
-
- Decision points (apply BR-WF rules)
|
|
123
|
-
- Exit points
|
|
124
|
-
- Alternative flows
|
|
125
|
-
|
|
126
|
-
---
|
|
127
|
-
|
|
128
|
-
### 7. Define Data Entities (Business View)
|
|
129
|
-
|
|
130
|
-
**IMPORTANT: Business attributes only - NO technical types!**
|
|
131
|
-
|
|
132
|
-
| Entity | Description | Cardinality |
|
|
133
|
-
|--------|-------------|-------------|
|
|
134
|
-
| {Entity} | {business description} | 1:N with {other} |
|
|
135
|
-
|
|
136
|
-
| Entity | Attribute | Description | Required |
|
|
137
|
-
|--------|-----------|-------------|----------|
|
|
138
|
-
| {Entity} | {attribute} | {business meaning} | Yes/No |
|
|
139
|
-
|
|
140
|
-
**ULTRATHINK checkpoint:**
|
|
141
|
-
- All entities from discovery captured?
|
|
142
|
-
- Relationships are complete?
|
|
143
|
-
- No orphan entities?
|
|
144
|
-
- **RBAC CHECK:** No role/permission/access-level modeled as entity attribute?
|
|
145
|
-
- `User.Role`, `User.AccessLevel`, `User.IsAdmin` = **FORBIDDEN**
|
|
146
|
-
- Roles are SmartStack RBAC permission sets, not data model concepts
|
|
147
|
-
- If stakeholders described roles, they belong in the Permission Matrix (step-03), not here
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
### 8. Identify Integrations
|
|
152
|
-
|
|
153
|
-
| System | Direction | Data | Frequency |
|
|
154
|
-
|--------|-----------|------|-----------|
|
|
155
|
-
| {system} | In/Out/Bi | {data} | Real-time/Batch |
|
|
156
|
-
|
|
157
|
-
For each integration, note:
|
|
158
|
-
- Data format expected
|
|
159
|
-
- Error handling strategy
|
|
160
|
-
- Fallback behavior
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
|
|
164
|
-
### 9. Compile BRD Document
|
|
165
|
-
|
|
166
|
-
Assemble using `templates/tpl-brd.md` structure:
|
|
167
|
-
|
|
168
|
-
```markdown
|
|
169
|
-
# BRD - {feature_id} {feature_description}
|
|
170
|
-
|
|
171
|
-
> **Module:** business/{application_name}/{module_name}
|
|
172
|
-
> **Version:** 1.0
|
|
173
|
-
> **Based on:** 1-discovery.md v1.0
|
|
174
|
-
|
|
175
|
-
## 1. Executive Summary
|
|
176
|
-
{3-5 sentence synthesis}
|
|
177
|
-
|
|
178
|
-
## 2. Business Objectives
|
|
179
|
-
{OBJ table}
|
|
180
|
-
|
|
181
|
-
## 3. Business Rules
|
|
182
|
-
{BR summary table}
|
|
183
|
-
|
|
184
|
-
### 3.1 Critical Rules Detail
|
|
185
|
-
{BR-XXX detailed specs}
|
|
186
|
-
|
|
187
|
-
## 4. Business Process
|
|
188
|
-
{Process diagrams}
|
|
189
|
-
|
|
190
|
-
## 5. Business Data
|
|
191
|
-
{Entity tables - business view}
|
|
192
|
-
|
|
193
|
-
## 6. Integrations
|
|
194
|
-
{Integration table}
|
|
195
|
-
|
|
196
|
-
---
|
|
197
|
-
|
|
198
|
-
## Version History
|
|
199
|
-
|
|
200
|
-
| Version | Date | Author | Changes |
|
|
201
|
-
|---------|------|--------|---------|
|
|
202
|
-
| 1.0 | {date} | BA | Initial creation |
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
### 9b. Generate Context Digest
|
|
208
|
-
|
|
209
|
-
**Write digest to:** `{output_dir}/digest-02.md`
|
|
210
|
-
|
|
211
|
-
```markdown
|
|
212
|
-
# Digest: Step 02 - Analyse
|
|
213
|
-
|
|
214
|
-
## Changes
|
|
215
|
-
- {output_dir}/2-business-requirements.md: BRD created
|
|
216
|
-
|
|
217
|
-
## Decisions
|
|
218
|
-
- {count} business objectives formalized
|
|
219
|
-
- {count} business rules identified (categories: VAL, CALC, WF, SEC, DATA)
|
|
220
|
-
|
|
221
|
-
## Findings
|
|
222
|
-
- {count} entities with {count} total attributes
|
|
223
|
-
- {count} integrations identified
|
|
224
|
-
- Process flow: {summary of main flow}
|
|
225
|
-
|
|
226
|
-
## State Updates
|
|
227
|
-
| Variable | New Value |
|
|
228
|
-
|----------|-----------|
|
|
229
|
-
| br_count | {count} |
|
|
230
|
-
| entity_count | {count} |
|
|
231
|
-
| integration_count | {count} |
|
|
232
|
-
|
|
233
|
-
## For Next Step
|
|
234
|
-
- BR-IDs to trace: {list of BR-IDs}
|
|
235
|
-
- Entities to specify: {list}
|
|
236
|
-
- Permission paths needed for: {list of entities}
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
---
|
|
240
|
-
|
|
241
|
-
### 10. Save Output
|
|
242
|
-
|
|
243
|
-
Write to: `{output_dir}/2-business-requirements.md`
|
|
244
|
-
|
|
245
|
-
Update `00-context.md`:
|
|
246
|
-
- Progress: `02-analyse` -> "Complete"
|
|
247
|
-
- Add BR count to state
|
|
248
|
-
|
|
249
|
-
---
|
|
250
|
-
|
|
251
|
-
### 11. Display Summary and Load Next Step
|
|
252
|
-
|
|
253
|
-
**Display:**
|
|
254
|
-
|
|
255
|
-
| Field | Value |
|
|
256
|
-
|-------|-------|
|
|
257
|
-
| Step | ANALYSE |
|
|
258
|
-
| Feature | {feature_id} |
|
|
259
|
-
| Status | Complete |
|
|
260
|
-
| Objectives | {OBJ count} |
|
|
261
|
-
| Business Rules | {BR count} |
|
|
262
|
-
| Entities | {entity count} |
|
|
263
|
-
| Integrations | {integration count} |
|
|
264
|
-
| Output | {output_dir}/2-business-requirements.md |
|
|
265
|
-
| Next | step-03-specify (FRD + Use Cases) |
|
|
266
|
-
|
|
267
|
-
**If NOT auto_mode:**
|
|
268
|
-
Ask: "Proceed with functional specification?"
|
|
269
|
-
|
|
270
|
-
**Load next step:**
|
|
271
|
-
```
|
|
272
|
-
Read and execute: steps/step-03-specify.md
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
---
|
|
276
|
-
|
|
277
|
-
## OUTPUT FORMAT:
|
|
278
|
-
|
|
279
|
-
This step produces:
|
|
280
|
-
- `{output_dir}/2-business-requirements.md` (created)
|
|
281
|
-
- `{output_dir}/00-context.md` (updated)
|
|
282
|
-
|
|
283
|
-
Template loaded: **~90 lines** (vs 477 lines full file)
|
|
284
|
-
|
|
285
|
-
## ERROR HANDLING:
|
|
286
|
-
|
|
287
|
-
**If discovery document is incomplete:**
|
|
288
|
-
1. List missing sections
|
|
289
|
-
2. Ask user: "Return to discovery to complete, or proceed with available data?"
|
|
290
|
-
3. If proceeding: mark BRD sections with "[INCOMPLETE - based on partial discovery]"
|
|
291
|
-
|
|
292
|
-
**If business rules contradict each other:**
|
|
293
|
-
1. Identify conflicting rules (BR-XXX vs BR-YYY)
|
|
294
|
-
2. Ask user to resolve contradiction via AskUserQuestion
|
|
295
|
-
3. Document resolution in BRD
|
|
296
|
-
|
|
297
|
-
## NEXT STEP:
|
|
298
|
-
|
|
299
|
-
After completion, proceed to `steps/step-03-specify.md`
|
|
@@ -1,409 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: step-03-specify
|
|
3
|
-
description: Specification phase - FRD with use cases, requirements, permissions
|
|
4
|
-
next_step: steps/step-04-validate.md
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## YOUR TASK:
|
|
8
|
-
|
|
9
|
-
Create comprehensive Functional Requirements Document (FRD) with:
|
|
10
|
-
- Use Cases (UC-XXX)
|
|
11
|
-
- Functional Requirements (FR-XXX)
|
|
12
|
-
- Permission matrix
|
|
13
|
-
- UI wireframes
|
|
14
|
-
- Gherkin scenarios
|
|
15
|
-
|
|
16
|
-
> **ULTRATHINK MODE:**
|
|
17
|
-
> - Each UC must be atomic and testable
|
|
18
|
-
> - FR must trace back to BR
|
|
19
|
-
> - Permissions must follow SmartStack convention
|
|
20
|
-
> - No ambiguity in scenarios
|
|
21
|
-
|
|
22
|
-
## EXECUTION SEQUENCE:
|
|
23
|
-
|
|
24
|
-
### 1. Read Current State
|
|
25
|
-
|
|
26
|
-
Read `{output_dir}/00-context.md` to restore state variables.
|
|
27
|
-
Read `{output_dir}/2-business-requirements.md` for business rules.
|
|
28
|
-
|
|
29
|
-
Update progress: `03-specify` -> "In Progress"
|
|
30
|
-
|
|
31
|
-
**Read digest from previous step:**
|
|
32
|
-
Read `{output_dir}/digest-02.md` for compressed context from previous step.
|
|
33
|
-
**DO NOT read full output files** unless in resume mode (`-r`).
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
### 2. Load FRD Template
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
Read: templates/tpl-frd.md # ~150 lines (UC + FR + permissions sections)
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
This template contains ONLY the FRD structure.
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
### 3. Define Actors and Permissions
|
|
48
|
-
|
|
49
|
-
From BRD stakeholders, map to system actors:
|
|
50
|
-
|
|
51
|
-
| Actor | Description | Permission base |
|
|
52
|
-
|-------|-------------|-----------------|
|
|
53
|
-
| Admin | Full access | `business.{app}.{module}.*` |
|
|
54
|
-
| Manager | Read + Create + Update | `business.{app}.{module}.read,create,update` |
|
|
55
|
-
| User | Read + Create | `business.{app}.{module}.read,create` |
|
|
56
|
-
| ReadOnly | View only | `business.{app}.{module}.read` |
|
|
57
|
-
|
|
58
|
-
**Permission format:** `business.{application_name}.{module_name}.{action}`
|
|
59
|
-
|
|
60
|
-
Actions:
|
|
61
|
-
- `.read` - View data
|
|
62
|
-
- `.create` - Create new entries
|
|
63
|
-
- `.update` - Modify existing
|
|
64
|
-
- `.delete` - Remove entries
|
|
65
|
-
- `.export` - Export data
|
|
66
|
-
- `.import` - Import data
|
|
67
|
-
- `.admin` - Administrative functions
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
### 4. Create Use Cases
|
|
72
|
-
|
|
73
|
-
For each major functionality, create UC:
|
|
74
|
-
|
|
75
|
-
```markdown
|
|
76
|
-
### UC-001: {Use Case Name}
|
|
77
|
-
|
|
78
|
-
| Attribute | Value |
|
|
79
|
-
|-----------|-------|
|
|
80
|
-
| **ID** | UC-001 |
|
|
81
|
-
| **Name** | {Name} |
|
|
82
|
-
| **Primary Actor** | {Role} |
|
|
83
|
-
| **Preconditions** | {required conditions} |
|
|
84
|
-
| **Postconditions** | {final state} |
|
|
85
|
-
| **Permission** | `business.{app}.{module}.{action}` |
|
|
86
|
-
|
|
87
|
-
**Main Scenario:**
|
|
88
|
-
1. The user {action}
|
|
89
|
-
2. The system {response}
|
|
90
|
-
3. The user {action}
|
|
91
|
-
4. The system {response}
|
|
92
|
-
|
|
93
|
-
**Alternative Scenarios:**
|
|
94
|
-
|
|
95
|
-
| # | Condition | Steps |
|
|
96
|
-
|---|-----------|-------|
|
|
97
|
-
| 3a | {condition} | 3a.1 {action}, 3a.2 {action} |
|
|
98
|
-
|
|
99
|
-
**Error Scenarios:**
|
|
100
|
-
|
|
101
|
-
| # | Error | Message | Action |
|
|
102
|
-
|---|-------|---------|--------|
|
|
103
|
-
| E1 | {error} | {user message} | {behavior} |
|
|
104
|
-
|
|
105
|
-
**Associated Rules:** BR-001, BR-002
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
**ULTRATHINK checkpoint:**
|
|
109
|
-
- Each UC maps to at least one BR?
|
|
110
|
-
- All actors from BRD have UCs?
|
|
111
|
-
- Error scenarios complete?
|
|
112
|
-
|
|
113
|
-
---
|
|
114
|
-
|
|
115
|
-
### 5. Define Functional Requirements
|
|
116
|
-
|
|
117
|
-
For each BR, create corresponding FR:
|
|
118
|
-
|
|
119
|
-
| ID | Requirement | Linked UC | Priority |
|
|
120
|
-
|----|-------------|-----------|----------|
|
|
121
|
-
| FR-001 | The system MUST... | UC-001 | Must |
|
|
122
|
-
| FR-002 | The system SHOULD... | UC-001 | Should |
|
|
123
|
-
| FR-003 | The system COULD... | UC-002 | Could |
|
|
124
|
-
|
|
125
|
-
**Detailed FR specification:**
|
|
126
|
-
|
|
127
|
-
```markdown
|
|
128
|
-
### FR-001: {Requirement Name}
|
|
129
|
-
|
|
130
|
-
**Statement:** The system MUST {specific action}
|
|
131
|
-
|
|
132
|
-
**Acceptance Criteria:**
|
|
133
|
-
- [ ] {Measurable criterion 1}
|
|
134
|
-
- [ ] {Measurable criterion 2}
|
|
135
|
-
- [ ] {Measurable criterion 3}
|
|
136
|
-
|
|
137
|
-
**Associated Rules:** BR-001, BR-002
|
|
138
|
-
**Use Cases:** UC-001
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
**Priority mapping:**
|
|
142
|
-
- Must = FR-0XX (000-099)
|
|
143
|
-
- Should = FR-1XX (100-199)
|
|
144
|
-
- Could = FR-2XX (200-299)
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
### 6. Design Permission Matrix
|
|
149
|
-
|
|
150
|
-
**Role-Permission Matrix:**
|
|
151
|
-
|
|
152
|
-
| Permission | Admin | Manager | User | ReadOnly |
|
|
153
|
-
|------------|-------|---------|------|----------|
|
|
154
|
-
| `business.{app}.{module}.read` | X | X | X | X |
|
|
155
|
-
| `business.{app}.{module}.create` | X | X | X | - |
|
|
156
|
-
| `business.{app}.{module}.update` | X | X | - | - |
|
|
157
|
-
| `business.{app}.{module}.delete` | X | - | - | - |
|
|
158
|
-
| `business.{app}.{module}.export` | X | X | - | - |
|
|
159
|
-
|
|
160
|
-
**Endpoint-Permission Mapping:**
|
|
161
|
-
|
|
162
|
-
| Endpoint | Method | Required Permission |
|
|
163
|
-
|----------|--------|-------------------|
|
|
164
|
-
| `/api/business/{module}` | GET | `.read` |
|
|
165
|
-
| `/api/business/{module}` | POST | `.create` |
|
|
166
|
-
| `/api/business/{module}/{id}` | GET | `.read` |
|
|
167
|
-
| `/api/business/{module}/{id}` | PUT | `.update` |
|
|
168
|
-
| `/api/business/{module}/{id}` | DELETE | `.delete` |
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
### 7. Create UI Wireframes
|
|
173
|
-
|
|
174
|
-
**Main screen wireframe:**
|
|
175
|
-
|
|
176
|
-
```
|
|
177
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
178
|
-
│ [Logo] {Module Name} [User] [Menu] │
|
|
179
|
-
├─────────────────────────────────────────────────────────────┤
|
|
180
|
-
│ │
|
|
181
|
-
│ ┌─────────────────────────────────────────────────────┐ │
|
|
182
|
-
│ │ FILTERS │ │
|
|
183
|
-
│ │ [Field 1 ▼] [Field 2 ▼] [Search] │ │
|
|
184
|
-
│ └─────────────────────────────────────────────────────┘ │
|
|
185
|
-
│ │
|
|
186
|
-
│ ┌─────────────────────────────────────────────────────┐ │
|
|
187
|
-
│ │ DATA TABLE │ │
|
|
188
|
-
│ │ ┌────────┬────────┬────────┬─────────┐ │ │
|
|
189
|
-
│ │ │ Col 1 │ Col 2 │ Col 3 │ Actions │ │ │
|
|
190
|
-
│ │ ├────────┼────────┼────────┼─────────┤ │ │
|
|
191
|
-
│ │ │ data │ data │ data │ [E] [D] │ │ │
|
|
192
|
-
│ │ └────────┴────────┴────────┴─────────┘ │ │
|
|
193
|
-
│ └─────────────────────────────────────────────────────┘ │
|
|
194
|
-
│ │
|
|
195
|
-
│ [+ New] (if .create) [< Prev] [Next >] │
|
|
196
|
-
└─────────────────────────────────────────────────────────────┘
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
**UI Elements description:**
|
|
200
|
-
|
|
201
|
-
| Element | Type | Behavior | Permission |
|
|
202
|
-
|---------|------|----------|------------|
|
|
203
|
-
| [+ New] | Button | Opens create modal | `.create` |
|
|
204
|
-
| [E] | Icon | Opens edit modal | `.update` |
|
|
205
|
-
| [D] | Icon | Confirm + delete | `.delete` |
|
|
206
|
-
|
|
207
|
-
---
|
|
208
|
-
|
|
209
|
-
### 8. Write Gherkin Scenarios
|
|
210
|
-
|
|
211
|
-
```gherkin
|
|
212
|
-
Feature: {feature_id} {feature_description}
|
|
213
|
-
|
|
214
|
-
Background:
|
|
215
|
-
Given the system is configured with test data
|
|
216
|
-
And the permission system is active
|
|
217
|
-
|
|
218
|
-
@permission @403
|
|
219
|
-
Scenario: User without permission cannot create
|
|
220
|
-
Given I am logged in as "user@test.com" with role "ReadOnly"
|
|
221
|
-
When I send POST to "/api/business/{module}"
|
|
222
|
-
Then the response status should be 403
|
|
223
|
-
And the response should contain "Permission denied"
|
|
224
|
-
|
|
225
|
-
@happy-path
|
|
226
|
-
Scenario: Admin creates new item
|
|
227
|
-
Given I am logged in as "admin@test.com" with role "Admin"
|
|
228
|
-
And I have permission "business.{app}.{module}.create"
|
|
229
|
-
When I send POST to "/api/business/{module}" with:
|
|
230
|
-
| field1 | value1 |
|
|
231
|
-
| field2 | value2 |
|
|
232
|
-
Then the response status should be 201
|
|
233
|
-
And the response should contain "id"
|
|
234
|
-
|
|
235
|
-
@validation
|
|
236
|
-
Scenario: Validation error on required field
|
|
237
|
-
Given I am logged in with permission "business.{app}.{module}.create"
|
|
238
|
-
When I send POST to "/api/business/{module}" with:
|
|
239
|
-
| field1 | |
|
|
240
|
-
Then the response status should be 400
|
|
241
|
-
And the response should contain "field1 is required"
|
|
242
|
-
|
|
243
|
-
@business-rule @BR-001
|
|
244
|
-
Scenario: {BR-001 scenario}
|
|
245
|
-
Given {precondition}
|
|
246
|
-
When {action}
|
|
247
|
-
Then {expected result per BR-001}
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
---
|
|
251
|
-
|
|
252
|
-
### 9. Define Validations and Messages
|
|
253
|
-
|
|
254
|
-
**Field validations:**
|
|
255
|
-
|
|
256
|
-
| Field | Rule | Error Message (i18n key) |
|
|
257
|
-
|-------|------|--------------------------|
|
|
258
|
-
| {field} | Required | `{module}.errors.{field}Required` |
|
|
259
|
-
| {field} | MaxLength(100) | `{module}.errors.{field}TooLong` |
|
|
260
|
-
| email | Email format | `{module}.errors.invalidEmail` |
|
|
261
|
-
|
|
262
|
-
**System messages:**
|
|
263
|
-
|
|
264
|
-
| Code | Type | Message (i18n key) |
|
|
265
|
-
|------|------|-------------------|
|
|
266
|
-
| MSG-001 | Success | `{module}.messages.created` |
|
|
267
|
-
| MSG-002 | Success | `{module}.messages.updated` |
|
|
268
|
-
| MSG-003 | Success | `{module}.messages.deleted` |
|
|
269
|
-
| MSG-004 | Error | `{module}.errors.notFound` |
|
|
270
|
-
| MSG-005 | Error | `{module}.errors.permissionDenied` |
|
|
271
|
-
|
|
272
|
-
---
|
|
273
|
-
|
|
274
|
-
### 9b. Data Lifecycle & Cross-Module Specification (CONDITIONAL)
|
|
275
|
-
|
|
276
|
-
**Load ONLY if categories 11-13 were collected in discovery.**
|
|
277
|
-
|
|
278
|
-
#### If data lifecycle data collected (category 11):
|
|
279
|
-
|
|
280
|
-
| Entity | Retention Period | Archive Strategy | GDPR Impact | Base Class |
|
|
281
|
-
|--------|-----------------|-----------------|-------------|------------|
|
|
282
|
-
| {entity} | {duration} | {Archive/Purge/Anonymize} | {Yes/No + detail} | {SoftDeletableEntity/AuditableEntity} |
|
|
283
|
-
|
|
284
|
-
**State transitions:**
|
|
285
|
-
|
|
286
|
-
| Entity | States | Immutable After |
|
|
287
|
-
|--------|--------|-----------------|
|
|
288
|
-
| {entity} | {Draft -> Active -> Archived -> Deleted} | {state or "None"} |
|
|
289
|
-
|
|
290
|
-
#### If migration data collected (category 12):
|
|
291
|
-
|
|
292
|
-
| Source | Format | Volume | Quality Issues | Strategy |
|
|
293
|
-
|--------|--------|--------|----------------|----------|
|
|
294
|
-
| {source} | {Excel/CSV/DB/API} | {volume} | {issues} | {Big-bang/Progressive/Parallel} |
|
|
295
|
-
|
|
296
|
-
**Rollback plan:** {strategy from Q12.8}
|
|
297
|
-
|
|
298
|
-
#### If cross-module impact collected (category 13):
|
|
299
|
-
|
|
300
|
-
| Existing Module | Interaction Type | Shared Data | Impact on Existing |
|
|
301
|
-
|-----------------|-----------------|-------------|-------------------|
|
|
302
|
-
| {module} | {FK/Event/Query/Navigation} | {entities/data} | {None/Minor/Major} |
|
|
303
|
-
|
|
304
|
-
**MediatR events to create:**
|
|
305
|
-
|
|
306
|
-
| Event | Trigger | Consumers |
|
|
307
|
-
|-------|---------|-----------|
|
|
308
|
-
| {Entity}CreatedNotification | After create | {list of consuming modules} |
|
|
309
|
-
|
|
310
|
-
---
|
|
311
|
-
|
|
312
|
-
### 10. Compile FRD Document
|
|
313
|
-
|
|
314
|
-
Assemble complete FRD using template structure.
|
|
315
|
-
|
|
316
|
-
---
|
|
317
|
-
|
|
318
|
-
### 10b. Generate Context Digest
|
|
319
|
-
|
|
320
|
-
**Write digest to:** `{output_dir}/digest-03.md`
|
|
321
|
-
|
|
322
|
-
```markdown
|
|
323
|
-
# Digest: Step 03 - Specify
|
|
324
|
-
|
|
325
|
-
## Changes
|
|
326
|
-
- {output_dir}/3-functional-specification.md: FRD created
|
|
327
|
-
|
|
328
|
-
## Decisions
|
|
329
|
-
- {count} use cases defined
|
|
330
|
-
- {count} functional requirements (Must: X, Should: Y, Could: Z)
|
|
331
|
-
- Permission matrix: {count} permissions for {count} roles
|
|
332
|
-
|
|
333
|
-
## Findings
|
|
334
|
-
- Gherkin scenarios: {count}
|
|
335
|
-
- i18n keys: {count}
|
|
336
|
-
- UI wireframes: {count}
|
|
337
|
-
|
|
338
|
-
## State Updates
|
|
339
|
-
| Variable | New Value |
|
|
340
|
-
|----------|-----------|
|
|
341
|
-
| uc_count | {count} |
|
|
342
|
-
| fr_count | {count} |
|
|
343
|
-
| permission_count | {count} |
|
|
344
|
-
| scenario_count | {count} |
|
|
345
|
-
|
|
346
|
-
## For Next Step
|
|
347
|
-
- Completeness checklist ready for validation
|
|
348
|
-
- All BR->FR traces established
|
|
349
|
-
- Permission matrix finalized
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
---
|
|
353
|
-
|
|
354
|
-
### 11. Save Output
|
|
355
|
-
|
|
356
|
-
Write to: `{output_dir}/3-functional-specification.md`
|
|
357
|
-
|
|
358
|
-
Update `00-context.md`:
|
|
359
|
-
- Progress: `03-specify` -> "Complete"
|
|
360
|
-
- Add UC count, FR count, permission count
|
|
361
|
-
|
|
362
|
-
---
|
|
363
|
-
|
|
364
|
-
### 12. Display Summary and Load Next Step
|
|
365
|
-
|
|
366
|
-
**Display:**
|
|
367
|
-
|
|
368
|
-
| Field | Value |
|
|
369
|
-
|-------|-------|
|
|
370
|
-
| Step | SPECIFICATION |
|
|
371
|
-
| Feature | {feature_id} |
|
|
372
|
-
| Status | Complete |
|
|
373
|
-
| Use Cases | {UC count} |
|
|
374
|
-
| Requirements | {FR count} (Must: X, Should: Y, Could: Z) |
|
|
375
|
-
| Permissions | {permission count} |
|
|
376
|
-
| Gherkin scenarios | {scenario count} |
|
|
377
|
-
| Output | {output_dir}/3-functional-specification.md |
|
|
378
|
-
| Next | step-04-validate (Validation Gate) |
|
|
379
|
-
|
|
380
|
-
**Load next step:**
|
|
381
|
-
```
|
|
382
|
-
Read and execute: steps/step-04-validate.md
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
---
|
|
386
|
-
|
|
387
|
-
## OUTPUT FORMAT:
|
|
388
|
-
|
|
389
|
-
This step produces:
|
|
390
|
-
- `{output_dir}/3-functional-specification.md` (created)
|
|
391
|
-
- `{output_dir}/00-context.md` (updated)
|
|
392
|
-
|
|
393
|
-
Template loaded: **~150 lines** (vs 477 lines full file)
|
|
394
|
-
|
|
395
|
-
## ERROR HANDLING:
|
|
396
|
-
|
|
397
|
-
**If permission path format is invalid:**
|
|
398
|
-
1. Validate with MCP: `mcp__smartstack__validate_conventions`
|
|
399
|
-
2. If MCP unavailable: validate manually against pattern `business.{app}.{module}.{action}`
|
|
400
|
-
3. Fix and re-generate permission matrix
|
|
401
|
-
|
|
402
|
-
**If BR has no corresponding FR:**
|
|
403
|
-
1. Flag unmapped BR-IDs
|
|
404
|
-
2. Create placeholder FR with "To be specified"
|
|
405
|
-
3. Add to validation checklist for step-04
|
|
406
|
-
|
|
407
|
-
## NEXT STEP:
|
|
408
|
-
|
|
409
|
-
After completion, proceed to `steps/step-04-validate.md`
|