@atlashub/smartstack-cli 2.1.0 → 2.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.
Files changed (38) hide show
  1. package/.documentation/business-analyse.html +1503 -1058
  2. package/dist/index.js +92 -55
  3. package/dist/index.js.map +1 -1
  4. package/package.json +10 -7
  5. package/templates/agents/ba-reader.md +250 -0
  6. package/templates/agents/ba-writer.md +210 -0
  7. package/templates/agents/docs-context-reader.md +51 -33
  8. package/templates/skills/_shared.md +2 -0
  9. package/templates/skills/business-analyse/SKILL.md +120 -108
  10. package/templates/skills/business-analyse/_shared.md +136 -146
  11. package/templates/skills/business-analyse/patterns/suggestion-catalog.md +478 -0
  12. package/templates/skills/business-analyse/questionnaire/01-context.md +3 -15
  13. package/templates/skills/business-analyse/questionnaire/03-scope.md +7 -7
  14. package/templates/skills/business-analyse/questionnaire/08-performance.md +7 -21
  15. package/templates/skills/business-analyse/questionnaire/09-constraints.md +0 -13
  16. package/templates/skills/business-analyse/questionnaire/10-documentation.md +0 -13
  17. package/templates/skills/business-analyse/questionnaire/12-migration.md +1 -1
  18. package/templates/skills/business-analyse/questionnaire.md +72 -76
  19. package/templates/skills/business-analyse/react/components.md +317 -154
  20. package/templates/skills/business-analyse/react/i18n-template.md +167 -106
  21. package/templates/skills/business-analyse/react/schema.md +474 -107
  22. package/templates/skills/business-analyse/schemas/feature-schema.json +860 -0
  23. package/templates/skills/business-analyse/steps/step-00-init.md +395 -285
  24. package/templates/skills/business-analyse/steps/step-01-analyse.md +523 -0
  25. package/templates/skills/business-analyse/steps/step-02-specify.md +899 -0
  26. package/templates/skills/business-analyse/steps/step-03-validate.md +1009 -0
  27. package/templates/skills/business-analyse/steps/step-04-handoff.md +1802 -0
  28. package/templates/skills/business-analyse/templates/tpl-handoff.md +49 -64
  29. package/templates/skills/business-analyse/steps/step-01-discover.md +0 -737
  30. package/templates/skills/business-analyse/steps/step-02-analyse.md +0 -299
  31. package/templates/skills/business-analyse/steps/step-03-specify.md +0 -472
  32. package/templates/skills/business-analyse/steps/step-04-validate.md +0 -335
  33. package/templates/skills/business-analyse/steps/step-05-handoff.md +0 -741
  34. package/templates/skills/business-analyse/steps/step-06-doc-html.md +0 -320
  35. package/templates/skills/business-analyse/templates/00-context.md +0 -105
  36. package/templates/skills/business-analyse/templates/tpl-brd.md +0 -97
  37. package/templates/skills/business-analyse/templates/tpl-discovery.md +0 -78
  38. package/templates/skills/business-analyse/tracking/change-template.md +0 -30
@@ -1,741 +0,0 @@
1
- ---
2
- name: step-05-handoff
3
- description: Handoff phase - Generate autonomous development prompt
4
- next_step: steps/step-06-doc-html.md
5
- ---
6
-
7
- ## YOUR TASK:
8
-
9
- Generate a complete, autonomous development prompt with Ralph Loop task breakdown for iterative implementation.
10
- The handoff must be zero-ambiguity: a developer (or Claude) can implement without questions.
11
-
12
- > **ULTRATHINK MODE:**
13
- > - Every implementation detail must be explicit
14
- > - File paths must be exact
15
- > - Patterns must reference existing code
16
- > - No assumptions about "obvious" behavior
17
-
18
- ## EXECUTION SEQUENCE:
19
-
20
- ### 1. Read Current State
21
-
22
- Read `{output_dir}/00-context.md` for state variables.
23
- Read validation: `{output_dir}/validation.json`
24
- Read specs: `{output_dir}/3-functional-specification.md`
25
-
26
- Update progress: `05-handoff` -> "In Progress"
27
-
28
- **Read digest from previous step:**
29
- Read `{output_dir}/digest-04.md` for compressed context from previous step.
30
- **DO NOT read full output files** unless in resume mode (`-r`).
31
-
32
- ---
33
-
34
- ### 2. Verify Validation Passed
35
-
36
- ```
37
- IF validation.decision != "APPROVED" THEN
38
- DISPLAY ERROR: "Validation must pass before handoff"
39
- EXIT to step-04-validate
40
- END IF
41
- ```
42
-
43
- ---
44
-
45
- ### 3. Load Handoff Template
46
-
47
- ```
48
- Read: templates/tpl-handoff.md # ~100 lines
49
- ```
50
-
51
- ---
52
-
53
- ### 4. Explore Existing Patterns
54
-
55
- **CRITICAL: Handoff must reference ACTUAL code patterns!**
56
-
57
- > **NOTE:** Use `{project_namespace}` (from 00-context.md) instead of hardcoded "SmartStack".
58
- > For client projects, namespace is typically `{ProjectName}` (e.g., `demo_multitenant`).
59
-
60
- If `{economy_mode}` = false, launch parallel agents:
61
-
62
- ```
63
- Agent 1: Backend patterns
64
- "Explore src/{project_namespace}.Domain/Business/ and
65
- src/{project_namespace}.Application/Business/ to document:
66
- - Entity naming pattern and folder hierarchy (Domain/{Context}/{App}/{Module}/)
67
- - Service interface pattern (Application/Common/Interfaces/)
68
- - DTO pattern (Application/{Context}/{App}/{Module}/DTOs/)
69
- - Validation pattern"
70
-
71
- Agent 2: Frontend patterns
72
- "Explore web/src/pages/business/ to document:
73
- - Page component structure
74
- - API service pattern
75
- - i18n usage pattern
76
- - Form handling pattern"
77
-
78
- Agent 3: Infrastructure patterns
79
- "Explore src/{project_namespace}.Infrastructure/ to document:
80
- - EF Core configuration pattern (Persistence/Configurations/{Module}/)
81
- - Service implementation pattern (Services/{Module}/)
82
- - SeedData pattern (Persistence/Seeding/Data/{Module}/)
83
- - Navigation/Permission/RolePermission seed files
84
- - DbContext registration
85
- - Migration naming convention"
86
- ```
87
-
88
- If `{economy_mode}` = true:
89
- - Use Glob/Grep to find similar modules
90
- - Read 2-3 reference files directly
91
-
92
- ---
93
-
94
- ### 5. Map Specifications to Files
95
-
96
- > **IMPORTANT:** Replace `{project_namespace}` with the actual project namespace (from 00-context.md).
97
- > Use the folder hierarchy `{Context}/{Application}/{Module}/` — NEVER put files at the root of a layer.
98
-
99
- **Backend files to create:**
100
-
101
- | Layer | File | Template/Pattern |
102
- |-------|------|------------------|
103
- | Domain | `src/{project_namespace}.Domain/Business/{Application}/{Module}/{Entity}.cs` | BaseEntity + IAuditableEntity |
104
- | Application/DTOs | `src/{project_namespace}.Application/Business/{Application}/{Module}/DTOs/{Entity}Dto.cs` | Record DTOs (Response, Create, Update) |
105
- | Application/DTOs | `src/{project_namespace}.Application/Business/{Application}/{Module}/DTOs/{Entity}MappingExtensions.cs` | Entity ↔ DTO mapping |
106
- | Application/Interface | `src/{project_namespace}.Application/Common/Interfaces/I{Entity}Service.cs` | Service interface |
107
- | Application/Permissions | `src/{project_namespace}.Application/Business/{Application}/{Module}/Permissions.cs` | Static permission constants |
108
- | Infrastructure/Config | `src/{project_namespace}.Infrastructure/Persistence/Configurations/{Module}/{Entity}Configuration.cs` | EF Core config + HasData |
109
- | Infrastructure/Service | `src/{project_namespace}.Infrastructure/Services/{Module}/{Entity}Service.cs` | Service implementation |
110
- | API | `src/{project_namespace}.Api/Controllers/Business/{Application}/{Module}Controller.cs` | NavRoute + RequirePermission |
111
-
112
- **SeedData files to create/modify (CRITICAL — without these, module is invisible and returns 403):**
113
-
114
- | Layer | File | Content |
115
- |-------|------|---------|
116
- > **5 mandatory seed files** for every new module. 4 are EF Core Configurations (HasData → migrations), 1 is Application layer code.
117
-
118
- | # | Layer | File | Type | Content |
119
- |---|-------|------|------|---------|
120
- | 1 | Infrastructure | `Persistence/Configurations/Navigation/NavigationModuleConfiguration.cs` | HasData (migration) | Module entry in `nav_Modules` |
121
- | 2 | Infrastructure | `Persistence/Configurations/Navigation/NavigationTranslationConfiguration.cs` | HasData (migration) | 4 translations (fr, en, it, de) per new nav entity |
122
- | 3 | Infrastructure | `Persistence/Configurations/Navigation/PermissionConfiguration.cs` | HasData (migration) | Wildcard + CRUD permissions in `nav_Permissions` |
123
- | 4 | Application | `Application/Business/{Application}/{Module}/Permissions.cs` | Code (compile-time) | Static constants for `[RequirePermission]` |
124
- | 5 | Infrastructure | `Persistence/Configurations/Authorization/RolePermissionConfiguration.cs` | HasData (migration) | Role→Permission for {App} Admin, {App} Manager, {App} Contributor, {App} Viewer |
125
-
126
- **Optional :** `Persistence/Seeding/Data/{Module}/{Entity}SeedData.cs` — Demo data for development (runtime, not migration)
127
-
128
- **Frontend files to create:**
129
-
130
- | Layer | File | Pattern |
131
- |-------|------|---------|
132
- | Pages | `web/src/pages/business/{app}/{module}/page.tsx` | Page component (list + actions) |
133
- | Components | `web/src/components/business/{module}/` | Entity-specific components |
134
- | Services | `web/src/services/api/{module}Api.ts` | Axios service (typed) |
135
- | i18n | `web/src/i18n/locales/{lang}/{module}.json` | 4 languages (fr, en, it, de) |
136
-
137
- ---
138
-
139
- ### 6. Generate Implementation Instructions
140
-
141
- For each file, provide explicit instructions:
142
-
143
- ```markdown
144
- ### Backend: {Entity}.cs
145
-
146
- **Path:** `src/{project_namespace}.Domain/Business/{Application}/{Module}/{Entity}.cs`
147
-
148
- **Reference:** Copy pattern from existing entity in same layer (use Explore agent to find)
149
-
150
- **Base class:** `BaseEntity` + `IAuditableEntity` (provides Id, TenantId, CreatedAt, UpdatedAt, CreatedBy, UpdatedBy)
151
-
152
- **Properties to add (business properties ONLY — base class fields are automatic):**
153
- | Property | Type | Attributes | From BR |
154
- |----------|------|------------|---------|
155
- | {attr1} | string | [Required, MaxLength(100)] | BR-001 |
156
- | {attr2} | decimal | [Precision(18,2)] | BR-002 |
157
- | Code | string | [Required, MaxLength(50)] | Unique per tenant |
158
-
159
- > **DO NOT add:** Id, TenantId, CreatedAt, UpdatedAt, CreatedBy, UpdatedBy — these are automatic via BaseEntity/IAuditableEntity.
160
-
161
- **Business rules to implement:**
162
- - BR-001: {rule} -> Implement in Validator
163
- - BR-002: {rule} -> Implement in Entity method
164
- ```
165
-
166
- ```markdown
167
- ### SeedData: Navigation + Permissions + Roles
168
-
169
- **CRITICAL: These seeds make the module visible and accessible. Without them → 403 errors.**
170
-
171
- **Step 1 — Navigation seeds:**
172
- - Add module entry in `NavigationModuleConfiguration.cs` (HasData)
173
- - Add 4 translations per nav entity in `NavigationTranslationConfiguration.cs`
174
- - Use deterministic GUIDs (SHA256 of full_path or sequential pattern)
175
-
176
- **Step 2 — Permission seeds:**
177
- - Add CRUD permissions + wildcard in `PermissionConfiguration.cs` (HasData)
178
- - Add compile-time constants in `Permissions.cs` (Application layer)
179
-
180
- **Step 3 — Role-Permission seeds:**
181
- - Add associations in `RolePermissionConfiguration.cs` (HasData)
182
- - Default: Admin=wildcard, Manager=read+create+update, Contributor=read+create+update, Viewer=read
183
-
184
- **Step 4 — Migration:**
185
- - Run MCP `suggest_migration` for naming
186
- - Create migration with `dotnet ef migrations add`
187
- ```
188
-
189
- ---
190
-
191
- ### 7. Map Business Rules to Code
192
-
193
- | BR-ID | Rule | Implementation Location | Code Pattern |
194
- |-------|------|------------------------|--------------|
195
- | BR-001 | {rule} | `{Entity}Validator.cs` | `.RuleFor(x => x.Field).NotEmpty()` |
196
- | BR-002 | {rule} | `{Entity}.cs` method | `public bool CanXXX() { ... }` |
197
- | BR-003 | {rule} | `{Handler}.cs` | `if (!entity.CanXXX()) throw` |
198
-
199
- ---
200
-
201
- ### 8. Define API Endpoints
202
-
203
- | Endpoint | Method | Handler | Permission | Request DTO | Response DTO |
204
- |----------|--------|---------|------------|-------------|--------------|
205
- | `/api/business/{module}` | GET | `GetAll{Entity}Query` | `.read` | - | `{Entity}ListResponse` |
206
- | `/api/business/{module}` | POST | `Create{Entity}Command` | `.create` | `Create{Entity}Request` | `{Entity}Response` |
207
- | `/api/business/{module}/{id}` | GET | `Get{Entity}ByIdQuery` | `.read` | - | `{Entity}Response` |
208
- | `/api/business/{module}/{id}` | PUT | `Update{Entity}Command` | `.update` | `Update{Entity}Request` | `{Entity}Response` |
209
- | `/api/business/{module}/{id}` | DELETE | `Delete{Entity}Command` | `.delete` | - | `204` |
210
-
211
- ---
212
-
213
- ### 9. Generate Test Requirements
214
-
215
- **Unit tests:**
216
- - [ ] `{Entity}ValidatorTests.cs` - Validation rules
217
- - [ ] `{Entity}Tests.cs` - Entity methods
218
-
219
- **Integration tests:**
220
- - [ ] `{Module}ControllerTests.cs` - All endpoints
221
- - [ ] Permission tests - 403 for unauthorized
222
- - [ ] Validation tests - 400 for invalid data
223
-
224
- **Gherkin reference:** Copy scenarios from FRD section 7
225
-
226
- ---
227
-
228
- ### 10. Generate i18n Keys
229
-
230
- **Keys to create:**
231
-
232
- ```json
233
- {
234
- "{module}": {
235
- "title": "{Module display name}",
236
- "fields": {
237
- "{field1}": "{Label}",
238
- "{field2}": "{Label}"
239
- },
240
- "messages": {
241
- "created": "{Entity} created successfully",
242
- "updated": "{Entity} updated successfully",
243
- "deleted": "{Entity} deleted successfully"
244
- },
245
- "errors": {
246
- "{field1}Required": "{Field1} is required",
247
- "notFound": "{Entity} not found",
248
- "permissionDenied": "You don't have permission to perform this action"
249
- },
250
- "buttons": {
251
- "create": "Create {Entity}",
252
- "edit": "Edit",
253
- "delete": "Delete",
254
- "save": "Save",
255
- "cancel": "Cancel"
256
- }
257
- }
258
- }
259
- ```
260
-
261
- ---
262
-
263
- ### 11. Compile Handoff Document
264
-
265
- ```markdown
266
- # Development Handoff - {feature_id} {feature_description}
267
-
268
- > **Module:** business/{application_name}/{module_name}
269
- > **Version:** 1.0
270
- > **Validated Specs:** FRD v1.0 (validation.json: APPROVED)
271
- > **Implementation:** `/ralph-loop -r` (iterative) | `/feature-full business/{application_name}/{module_name}` (one-shot)
272
-
273
- ## DEVELOPER INSTRUCTIONS
274
-
275
- Ce document est un prompt autonome pour Claude Code.
276
-
277
- **Option 1 - Itératif (recommandé) :**
278
- ```
279
- /ralph-loop -r
280
- ```
281
- > Le fichier `.ralph/prd.json` a été pré-généré avec le découpage en tâches atomiques.
282
- > Ralph Loop exécute chaque tâche avec validation MCP entre chaque itération.
283
-
284
- **Option 2 - One-shot :**
285
- ```
286
- /feature-full business/{application_name}/{module_name}
287
- ```
288
- > Génère l'implémentation full-stack complète en une seule passe
289
- > (Domain → Application → Infrastructure → API → Web + Notifications + Workflows + AI).
290
-
291
- ---
292
-
293
- ## 1. QUICK CONTEXT
294
-
295
- | Attribute | Value |
296
- |-----------|-------|
297
- | Feature ID | {feature_id} |
298
- | Module | business/{application_name}/{module_name} |
299
- | Permission base | `business.{app}.{module}` |
300
- | Complexity | {Simple/Medium/Complex} |
301
- | Entities | {entity count} |
302
- | Endpoints | {endpoint count} |
303
-
304
- ## 2. [EXPLORE] EXISTING PATTERNS
305
-
306
- {Patterns discovered in step 4}
307
-
308
- ## 3. FILES TO CREATE
309
-
310
- {File mapping table}
311
-
312
- ## 4. DETAILED SPECIFICATIONS
313
-
314
- {Per-file instructions}
315
-
316
- ## 5. BUSINESS RULES → CODE
317
-
318
- {BR to code mapping}
319
-
320
- ## 6. REQUIRED TESTS
321
-
322
- {Test checklist}
323
-
324
- ## 7. POST-IMPLEMENTATION CHECKLIST
325
-
326
- **Build & Tests:**
327
- - [ ] Backend build OK (`dotnet build`)
328
- - [ ] Frontend build OK (`pnpm build`)
329
- - [ ] Tests pass (`dotnet test`)
330
-
331
- **Folder Conventions:**
332
- - [ ] Domain entities in `Domain/Business/{Application}/{Module}/` (not flat)
333
- - [ ] Application DTOs in `Application/Business/{Application}/{Module}/DTOs/`
334
- - [ ] Infrastructure configs in `Configurations/{Module}/` (subfolder)
335
- - [ ] Infrastructure services in `Services/{Module}/` (subfolder)
336
- - [ ] Controller in `Controllers/Business/{Application}/`
337
-
338
- **SeedData Core (CRITICAL):**
339
- - [ ] Navigation module entry in `NavigationModuleConfiguration.cs` (HasData)
340
- - [ ] Navigation translations in `NavigationTranslationConfiguration.cs` (4 langues)
341
- - [ ] Permissions in `PermissionConfiguration.cs` (HasData: CRUD + wildcard)
342
- - [ ] Permission constants in `Permissions.cs` (Application layer)
343
- - [ ] Role-Permission assignments in `RolePermissionConfiguration.cs` (HasData: 4 roles)
344
- - [ ] EF Core migration created (includes all HasData seeds)
345
-
346
- **Frontend & i18n:**
347
- - [ ] i18n complete (FR, EN, IT, DE)
348
- - [ ] Nested routes (NOT flat routes)
349
- - [ ] Pages in `pages/business/{app}/{module}/`
350
-
351
- **Documentation:**
352
- - [ ] Documentation: `/business-analyse:6-doc-html {feature_id}`
353
- - [ ] Documentation manifest updated: `docs-manifest.json`
354
-
355
- ---
356
-
357
- ## EXECUTION
358
-
359
- **Itératif (recommandé) :**
360
- ```bash
361
- /ralph-loop -r
362
- ```
363
-
364
- **One-shot :**
365
- ```bash
366
- /feature-full business/{application_name}/{module_name}
367
- ```
368
- ```
369
-
370
- ---
371
-
372
- ### 12. Generate Context Digest
373
-
374
- **Write digest to:** `{output_dir}/digest-05.md`
375
-
376
- ```markdown
377
- # Digest: Step 05 - Handoff
378
-
379
- ## Changes
380
- - {output_dir}/4-development-handoff.md: Handoff document created
381
- - .ralph/prd.json: Ralph Loop task breakdown created
382
- - .ralph/progress.txt: Progress file initialized
383
-
384
- ## Decisions
385
- - Implementation mode: iterative (Ralph Loop) or one-shot (feature-full)
386
- - Task count: {tasks_total} atomic tasks
387
- - Complexity: {Simple/Medium/Complex}
388
-
389
- ## Findings
390
- - Backend files to create: {count}
391
- - Frontend files to create: {count}
392
- - Test files to create: {count}
393
-
394
- ## State Updates
395
- | Variable | New Value |
396
- |----------|-----------|
397
- | tasks_total | {count} |
398
- | ralph_prd_created | true |
399
- | handoff_ready | true |
400
-
401
- ## For Next Step
402
- - Documentation generation ready (step-06)
403
- - FRD data extraction needed for React components
404
- - i18n: 4 languages to create
405
- ```
406
-
407
- ---
408
-
409
- ### 12a. Save Output
410
-
411
- Write to: `{output_dir}/4-development-handoff.md`
412
-
413
- Update `00-context.md`:
414
- - Progress: `05-handoff` -> "Complete"
415
-
416
- ---
417
-
418
- ### 12b. Generate Ralph Loop Task Breakdown
419
-
420
- **Purpose:** Generate `.ralph/prd.json` and `.ralph/progress.txt` so the implementation can be executed via `/ralph-loop -r`.
421
-
422
- #### 12bis.1 Create .ralph/ directory structure
423
-
424
- ```bash
425
- mkdir -p .ralph/logs
426
- mkdir -p .ralph/reports
427
- ```
428
-
429
- #### 12bis.2 Derive Task List from Handoff
430
-
431
- **ULTRATHINK about task decomposition:**
432
- - Each task must be atomic (implementable in one Ralph iteration)
433
- - Tasks follow the SmartStack layer order: Domain → Application → Infrastructure → API → Frontend → i18n → Tests → Validation
434
- - Conditionally include tasks based on feature scope (skip layers not present in the handoff document)
435
- - Each task MUST include `category`, `dependencies`, and `acceptance_criteria` (schema v2)
436
-
437
- **Granularity Rules:**
438
- - 1 task per entity (domain, EF config, unit tests)
439
- - 1 task per entity for CQRS (commands + queries + DTOs grouped per entity)
440
- - 1 task per controller (API)
441
- - 1 task per page (frontend)
442
- - Max 1 entity per task — do NOT group multiple entities into a single task
443
- - Enums and shared value objects can be grouped in 1 task if they belong to the same module
444
-
445
- **Conditional Task Generation Rules (v2 schema):**
446
-
447
- For each layer, generate tasks ONLY if the handoff document contains specifications for that layer.
448
- Each task must have: `id`, `description`, `status: "pending"`, `category`, `dependencies`, `acceptance_criteria`.
449
-
450
- ```
451
- LAYER 1 - DOMAIN (if entities defined in handoff section 3/4):
452
- Task per entity:
453
- description: "Create {Entity} entity in Domain/Business/{Application}/{Module}/{Entity}.cs with properties: {property_list}. Use BaseEntity + IAuditableEntity."
454
- category: "domain"
455
- dependencies: []
456
- acceptance_criteria: "Entity compiles, properties match handoff spec, correct base class (BaseEntity + IAuditableEntity), correct namespace and folder hierarchy"
457
- Task (if enums needed):
458
- description: "Create domain enums for {Module}: {EnumList} in Domain/Enums/{Module}/"
459
- category: "domain"
460
- dependencies: []
461
- acceptance_criteria: "Enums compile, values match handoff spec"
462
-
463
- LAYER 1.5 - SEED DATA (ALWAYS included for new modules):
464
- Task 1 (navigation seeds):
465
- description: "Create navigation seed data: add module entry in NavigationModuleConfiguration.cs (HasData) + 4-language translations in NavigationTranslationConfiguration.cs. Use deterministic GUIDs."
466
- category: "seed-data"
467
- dependencies: []
468
- acceptance_criteria: "HasData entries compile, module visible in nav_Modules, translations in 4 languages (fr, en, it, de)"
469
- Task 2 (permission seeds):
470
- description: "Create permission seeds: add CRUD + wildcard permissions in PermissionConfiguration.cs (HasData) + compile-time constants in Permissions.cs (Application layer) for business.{app}.{module}"
471
- category: "seed-data"
472
- dependencies: [ID of navigation seed task]
473
- acceptance_criteria: "HasData entries compile, Permissions.cs constants usable in [RequirePermission], wildcard + read/create/update/delete permissions present"
474
- Task 3 (role-permission seeds):
475
- description: "Create role-permission seed data: assign permissions to 4 default roles (Admin=wildcard, Manager=read+create+update, Contributor=read+create+update, Viewer=read) in RolePermissionConfiguration.cs (HasData)"
476
- category: "seed-data"
477
- dependencies: [ID of permission seed task]
478
- acceptance_criteria: "HasData entries compile, 4 role levels assigned, Admin has wildcard access"
479
-
480
- LAYER 2 - APPLICATION (if service interfaces/DTOs defined in handoff section 3/4):
481
- Task per entity:
482
- description: "Create Application layer for {Entity}: Service interface (I{Entity}Service.cs), DTOs ({Entity}Dto, Create{Entity}Request, Update{Entity}Request in DTOs/), MappingExtensions"
483
- category: "application"
484
- dependencies: [ID of corresponding DOMAIN task for this entity]
485
- acceptance_criteria: "Interface compiles, DTOs match handoff properties, mapping extensions cover all properties"
486
-
487
- LAYER 3 - INFRASTRUCTURE (if EF Core config or services in handoff):
488
- Task per entity:
489
- description: "Create EF Core configuration in Configurations/{Module}/{Entity}Configuration.cs with table prefix, indexes, relationships, and schema (core or extensions)"
490
- category: "infrastructure"
491
- dependencies: [ID of corresponding DOMAIN task for this entity]
492
- acceptance_criteria: "Configuration compiles, DbSet registered in DbContext, table uses {prefix}_{Entity}s naming, indexes match handoff"
493
- Task (once per module):
494
- description: "Create EF Core migration for {Module} entities (includes navigation, permission, and role-permission seed data from HasData)"
495
- category: "infrastructure"
496
- dependencies: [IDs of ALL EF Core configuration tasks + ALL seed-data tasks]
497
- acceptance_criteria: "Migration applies without errors, 3 files present (Migration.cs, Designer.cs, ModelSnapshot.cs), HasData seeds included in migration"
498
- Task per service (if services needed):
499
- description: "Create {Service} implementing I{Service} with DI registration"
500
- category: "infrastructure"
501
- dependencies: [IDs of relevant DOMAIN + APPLICATION tasks]
502
- acceptance_criteria: "Service compiles, registered in DI, follows existing patterns"
503
-
504
- LAYER 4 - API (if endpoints defined in handoff section 8):
505
- Task per controller:
506
- description: "Create {Entity}Controller in Controllers/Business/{Application}/ with endpoints: {endpoint list}, [NavRoute('business.{app}.{module}')] + [Authorize] + [RequirePermission(Permissions.{Module}.Read)] attributes"
507
- category: "api"
508
- dependencies: [IDs of APPLICATION tasks for this entity + INFRASTRUCTURE migration task + seed-data permission task]
509
- acceptance_criteria: "Controller compiles, endpoints respond, Swagger displays all routes, [RequirePermission] uses Permissions.cs constants (not string literals)"
510
-
511
- LAYER 5 - FRONTEND (if frontend files in handoff section 5):
512
- Task (API service):
513
- description: "Create web/src/services/api/{module}Api.ts API service with Axios calls for all endpoints"
514
- category: "frontend"
515
- dependencies: [IDs of ALL API controller tasks]
516
- acceptance_criteria: "API service compiles, all endpoints covered, types match DTOs"
517
- Task per page:
518
- description: "Create web/src/pages/business/{app}/{module}/page.tsx with {description of page content}"
519
- category: "frontend"
520
- dependencies: [ID of frontend API service task]
521
- acceptance_criteria: "Page renders, API calls work, navigation functional"
522
- Task (routes):
523
- description: "Add NESTED routes (NOT flat) in App.tsx for business/{app}/{module} and register in navigation"
524
- category: "frontend"
525
- dependencies: [IDs of ALL frontend page tasks]
526
- acceptance_criteria: "Nested routes resolve, navigation links appear in menu, no redirect to Home"
527
-
528
- LAYER 6 - I18N (if i18n keys in handoff section 10):
529
- Task:
530
- description: "Create i18n translation files for {module} in 4 languages (fr, en, it, de)"
531
- category: "i18n"
532
- dependencies: [IDs of frontend page tasks]
533
- acceptance_criteria: "4 language files created, all keys from handoff present, no missing translations"
534
-
535
- LAYER 7 - TESTS (always included):
536
- Task per entity:
537
- description: "Create unit tests for {Entity}: {Entity}ValidatorTests + {Entity}Tests (entity methods)"
538
- category: "test"
539
- dependencies: [ID of APPLICATION task for this entity]
540
- acceptance_criteria: "Tests pass, validator rules covered, entity methods tested"
541
- Task per controller:
542
- description: "Create integration tests for {Entity}Controller: 200, 201, 400, 403, 404 scenarios"
543
- category: "test"
544
- dependencies: [ID of API task for this controller]
545
- acceptance_criteria: "Tests pass, all status codes covered, permission denial tested"
546
-
547
- LAYER 8 - VALIDATION (always included):
548
- Task 1:
549
- description: "Run dotnet build + dotnet test - fix any build errors or test failures"
550
- category: "validation"
551
- dependencies: [IDs of ALL test tasks]
552
- acceptance_criteria: "Build succeeds, all tests pass"
553
- Task 2:
554
- description: "Run MCP validate_conventions to verify all naming and structural conventions"
555
- category: "validation"
556
- dependencies: [ID of validation task 1]
557
- acceptance_criteria: "MCP validation clean, no convention violations"
558
- ```
559
-
560
- **Sizing rules:**
561
- - Simple feature (1 entity, CRUD only): ~10-15 tasks
562
- - Medium feature (2-3 entities, business rules): ~18-25 tasks
563
- - Complex feature (multiple entities, integrations): ~25-35 tasks
564
-
565
- #### 12bis.3 Write prd.json
566
-
567
- Write to: `.ralph/prd.json`
568
-
569
- ```json
570
- {
571
- "$version": "2.0.0",
572
- "feature": "{feature_id} - {feature_description}",
573
- "status": "pending",
574
- "created": "{ISO 8601 timestamp}",
575
- "updated_at": "{ISO 8601 timestamp}",
576
- "metadata": {
577
- "cli_version": "{version from package.json}",
578
- "branch": "{current git branch}",
579
- "project_path": "{cwd}",
580
- "mcp_servers": { "smartstack": true, "context7": true }
581
- },
582
- "config": {
583
- "max_iterations": 30,
584
- "completion_promise": "IMPLEMENTATION COMPLETE",
585
- "current_iteration": 1
586
- },
587
- "source": {
588
- "type": "ba-handoff",
589
- "handoff_path": "{output_dir}/4-development-handoff.md",
590
- "frd_path": "{output_dir}/3-functional-specification.md",
591
- "brd_path": "{output_dir}/2-business-requirements.md"
592
- },
593
- "tasks": [
594
- {
595
- "id": 1,
596
- "description": "Create {Entity} entity in Domain/Business/{Application}/{Module}/{Entity}.cs with properties: {list}",
597
- "status": "pending",
598
- "category": "domain",
599
- "dependencies": [],
600
- "acceptance_criteria": "Entity compiles, properties match handoff spec",
601
- "started_at": null,
602
- "completed_at": null,
603
- "iteration": null,
604
- "commit_hash": null,
605
- "files_changed": { "created": [], "modified": [] },
606
- "validation": null,
607
- "error": null
608
- }
609
- ],
610
- "history": []
611
- }
612
- ```
613
-
614
- > **Schema v2.0.0** — Compatible avec ralph-loop step-01 sans migration. Chaque tache inclut `category`, `dependencies` et `acceptance_criteria` pour un pilotage precis de l'execution.
615
-
616
- #### 12bis.4 Initialize progress.txt
617
-
618
- Write to: `.ralph/progress.txt`
619
-
620
- ```markdown
621
- # Ralph Loop Progress
622
-
623
- ## Task: {feature_id} - {feature_description}
624
- ## Source: {output_dir}/4-development-handoff.md
625
- ## Started: {timestamp}
626
- ## Generated by: Business Analysis skill (step-05-handoff)
627
-
628
- ---
629
-
630
- ## Handoff Reference
631
-
632
- The detailed specifications for this implementation are in:
633
- - **Handoff document:** `{output_dir}/4-development-handoff.md`
634
- - **Functional Specification:** `{output_dir}/3-functional-specification.md`
635
- - **Business Requirements:** `{output_dir}/2-business-requirements.md`
636
- - **Validation:** `{output_dir}/validation.json`
637
-
638
- Consult these documents for entity properties, business rules, API endpoints, and test requirements.
639
-
640
- ---
641
-
642
- ## Iteration 1
643
-
644
- ### Context
645
- Starting fresh implementation from BA handoff.
646
- Task breakdown generated from business analysis with {tasks_total} tasks.
647
-
648
- ### Learnings
649
- (To be updated after each iteration)
650
- ```
651
-
652
- ---
653
-
654
- ### 12c. Display Summary and Offer Next Step
655
-
656
- **Display:**
657
-
658
- | Field | Value |
659
- |-------|-------|
660
- | Step | HANDOFF |
661
- | Feature | {feature_id} |
662
- | Status | Complete |
663
- | Files to create | {file count} |
664
- | Tests to write | {test count} |
665
- | Output | {output_dir}/4-development-handoff.md |
666
- | Ralph Loop | .ralph/prd.json ({tasks_total} tasks) |
667
- | Execute (iterative) | /ralph-loop -r |
668
- | Execute (one-shot) | /feature-full business/{application_name}/{module_name} |
669
- | Optional | step-06-doc-html (React documentation) |
670
-
671
- **Ask user:**
672
- ```json
673
- {
674
- "questions": [
675
- {
676
- "question": "What would you like to do now?",
677
- "header": "Next",
678
- "options": [
679
- {"label": "Ralph Loop (itératif)", "description": "Exécuter /ralph-loop -r — recommandé pour les features complexes ({tasks_total} tâches atomiques)"},
680
- {"label": "Feature Full (one-shot)", "description": "Exécuter /feature-full business/{application_name}/{module_name} — pour les features simples"},
681
- {"label": "Generate HTML documentation", "description": "Créer la page de documentation React d'abord"},
682
- {"label": "End BA", "description": "Terminer ici, implémenter plus tard"}
683
- ],
684
- "multiSelect": false
685
- }
686
- ]
687
- }
688
- ```
689
-
690
- If "Ralph Loop (itératif)":
691
- ```
692
- DISPLAY: "Execute: /ralph-loop -r"
693
- DISPLAY: "Le prd.json a été pré-généré avec {tasks_total} tâches."
694
- ```
695
-
696
- If "Feature Full (one-shot)":
697
- ```
698
- DISPLAY: "Execute: /feature-full business/{application_name}/{module_name}"
699
- ```
700
-
701
- If "Generate HTML documentation":
702
- ```
703
- Read and execute: steps/step-06-doc-html.md
704
- ```
705
-
706
- If "End BA":
707
- ```
708
- DISPLAY: "BA terminé. Pour implémenter plus tard :"
709
- DISPLAY: " Itératif : /ralph-loop -r"
710
- DISPLAY: " One-shot : /feature-full business/{application_name}/{module_name}"
711
- ```
712
-
713
- ---
714
-
715
- ## OUTPUT FORMAT:
716
-
717
- This step produces:
718
- - `{output_dir}/4-development-handoff.md` (created)
719
- - `{output_dir}/00-context.md` (updated)
720
- - `.ralph/prd.json` (created - Ralph Loop task breakdown)
721
- - `.ralph/progress.txt` (created - with BA references)
722
-
723
- Handoff is ready for:
724
- - **Iterative:** `/ralph-loop -r`
725
- - **One-shot:** `/feature-full business/{application_name}/{module_name}`
726
-
727
- ## ERROR HANDLING:
728
-
729
- **If pattern exploration fails:**
730
- 1. Use minimal handoff template without code references
731
- 2. Mark as "Patterns not validated - manual review required"
732
- 3. Reduce task count in prd.json (simpler breakdown)
733
-
734
- **If .ralph/ directory already exists:**
735
- 1. Warn user: "Existing Ralph Loop data found"
736
- 2. Ask: "Overwrite / Append / Cancel"
737
- 3. If append: add new tasks after existing ones
738
-
739
- ## NEXT STEP:
740
-
741
- After completion, proceed to `steps/step-06-doc-html.md`