@atlashub/smartstack-cli 4.23.0 → 4.25.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 (27) hide show
  1. package/package.json +1 -1
  2. package/templates/skills/ba-generate-html/html/ba-interactive.html +950 -1055
  3. package/templates/skills/ba-generate-html/html/src/scripts/01-data-init.js +1 -2
  4. package/templates/skills/ba-generate-html/html/src/scripts/02-navigation.js +0 -1
  5. package/templates/skills/ba-generate-html/html/src/scripts/03-render-cadrage.js +0 -39
  6. package/templates/skills/ba-generate-html/html/src/scripts/05-render-specs.js +0 -1
  7. package/templates/skills/ba-generate-html/html/src/scripts/07-render-handoff.js +0 -1
  8. package/templates/skills/ba-generate-html/html/src/scripts/08-editing.js +133 -135
  9. package/templates/skills/ba-generate-html/html/src/scripts/10-comments.js +199 -199
  10. package/templates/skills/ba-generate-html/html/src/scripts/11-review-panel.js +165 -166
  11. package/templates/skills/ba-generate-html/html/src/styles/05-modules.css +444 -454
  12. package/templates/skills/ba-generate-html/html/src/template.html +0 -49
  13. package/templates/skills/ba-generate-html/references/data-build.md +176 -182
  14. package/templates/skills/ba-generate-html/references/data-mapping.md +295 -301
  15. package/templates/skills/ba-generate-html/steps/step-01-collect.md +1 -1
  16. package/templates/skills/ba-generate-html/steps/step-02-build-data.md +0 -9
  17. package/templates/skills/derive-prd/SKILL.md +9 -9
  18. package/templates/skills/derive-prd/references/acceptance-criteria.md +166 -116
  19. package/templates/skills/derive-prd/references/entity-domain-mapping.md +5 -5
  20. package/templates/skills/derive-prd/references/handoff-file-templates.md +12 -12
  21. package/templates/skills/derive-prd/references/handoff-mappings.md +13 -14
  22. package/templates/skills/derive-prd/references/handoff-seeddata-generation.md +1 -1
  23. package/templates/skills/derive-prd/references/readiness-scoring.md +41 -50
  24. package/templates/skills/derive-prd/schemas/handoff-schema.json +2 -2
  25. package/templates/skills/derive-prd/steps/step-00-validate.md +73 -52
  26. package/templates/skills/derive-prd/steps/step-01-transform.md +86 -43
  27. package/templates/skills/ba-generate-html/html/src/partials/cadrage-risks.html +0 -48
@@ -1,41 +1,35 @@
1
1
  # Readiness Scoring Algorithm
2
2
 
3
3
  > **Used by:** step-00-validate (section 4: Calculate Readiness Score)
4
- > **Purpose:** Evaluate module readiness for handoff based on acceptance criteria from validation-checklist.md.
4
+ > **Purpose:** Evaluate module readiness for handoff based on input acceptance criteria.
5
5
 
6
6
  ---
7
7
 
8
8
  ## Algorithm
9
9
 
10
- For each module, evaluate all acceptance criteria (AC-01 to AC-17) from `references/acceptance-criteria.md`.
10
+ For each module, evaluate **input** acceptance criteria (AC-01 to AC-07) from `references/acceptance-criteria.md`.
11
+
12
+ Output ACs (AC-08 to AC-11) are checked **after** step-01 transform, not here.
11
13
 
12
14
  ### Score Calculation
13
15
 
14
16
  ```javascript
15
- const blockingACs = ['AC-01', 'AC-02', 'AC-03', 'AC-04', 'AC-05', 'AC-06', 'AC-07',
16
- 'AC-08', 'AC-09', 'AC-10', 'AC-11', 'AC-12', 'AC-13',
17
- 'AC-15', 'AC-16', 'AC-17']; // 16 blocking
18
- const nonBlockingACs = ['AC-14']; // 1 non-blocking (warning only)
17
+ const inputACs = ['AC-01', 'AC-02', 'AC-03', 'AC-04', 'AC-05', 'AC-06', 'AC-07'];
19
18
 
20
19
  // Count passes
21
- const blockingPassed = blockingACs.filter(ac => results[ac] === 'PASS').length;
22
- const blockingTotal = blockingACs.length;
23
- const nonBlockingPassed = nonBlockingACs.filter(ac => results[ac] === 'PASS').length;
24
- const nonBlockingTotal = nonBlockingACs.length;
25
-
26
- // Scores
27
- const blockingScore = (blockingPassed / blockingTotal) * 100; // Must be 100%
28
- const nonBlockingScore = (nonBlockingPassed / nonBlockingTotal) * 100; // Warn if < 80%
20
+ const passed = inputACs.filter(ac => results[ac] === 'PASS').length;
21
+ const total = inputACs.length;
22
+
23
+ // Score
24
+ const score = (passed / total) * 100; // Must be 100%
29
25
  ```
30
26
 
31
27
  ### Gate Rules
32
28
 
33
29
  | Condition | Action |
34
30
  |-----------|--------|
35
- | Blocking score = 100% | PASS — module ready for handoff |
36
- | Blocking score < 100% | BLOCKING — list failed ACs, require fix |
37
- | Non-blocking score >= 80% | OK — proceed normally |
38
- | Non-blocking score < 80% | WARNING — suggest fixes but don't block |
31
+ | Score = 100% | PASS — module ready for transform |
32
+ | Score < 100% | BLOCKING — list failed ACs, require fix |
39
33
 
40
34
  ---
41
35
 
@@ -46,39 +40,43 @@ const nonBlockingScore = (nonBlockingPassed / nonBlockingTotal) * 100; // Warn
46
40
  ```javascript
47
41
  {
48
42
  moduleCode: "Employees",
49
- blockingScore: 100, // percentage
50
- blockingPassed: 16,
51
- blockingTotal: 16,
52
- nonBlockingScore: 100,
53
- nonBlockingPassed: 1,
54
- nonBlockingTotal: 1,
43
+ score: 100,
44
+ passed: 7,
45
+ total: 7,
55
46
  ready: true,
56
- failedACs: [], // empty if ready
57
- warnings: [] // non-blocking failures
47
+ failedACs: [],
48
+ details: {
49
+ entities: 2,
50
+ useCases: 6,
51
+ rules: 8,
52
+ screens: 4,
53
+ permissions: 5,
54
+ status: "specified"
55
+ }
58
56
  }
59
57
  ```
60
58
 
61
59
  ### Readiness Table
62
60
 
63
61
  ```
64
- ┌──────────────┬──────────┬────────────┬──────────────┬────────┐
65
- Module Status Blocking │ Non-blocking │ Ready │
66
- ├──────────────┼──────────┼────────────┼──────────────┼────────┤
67
- Employees consol. 16/16 100% │ 1/1 100% │ YES
68
- Absences consol. 14/16 88% │ 1/1 100% │ NO
69
- └──────────────┴──────────┴────────────┴──────────────┴────────┘
62
+ +--------------+----------+-----------+-------+
63
+ | Module | Status | Score | Ready |
64
+ +--------------+----------+-----------+-------+
65
+ | Employees | specif. | 7/7 100% | YES |
66
+ | Absences | specif. | 5/7 71% | NO |
67
+ +--------------+----------+-----------+-------+
70
68
  ```
71
69
 
72
70
  ### Failure Detail (when blocked)
73
71
 
74
72
  ```
75
- Module "Absences" 2 blocking ACs FAILED:
73
+ Module "Absences" -- 2 input ACs FAILED:
76
74
 
77
- FAIL AC-05: wireframes >= 1 = 0 (min: 1)
78
- Recovery: Re-run /business-analyse step-03 wireframe generation
75
+ FAIL AC-05: screens = 0 (min: 1)
76
+ Recovery: Re-run /business-analyse screen specification
79
77
 
80
- FAIL AC-09: seedDataCore 9 arrays = 7 (min: 9)
81
- Recovery: Re-run /business-analyse step-03 seedDataCore transform
78
+ FAIL AC-06: permissions = 0 (min: 1)
79
+ Recovery: Re-run /business-analyse permission specification
82
80
  ```
83
81
 
84
82
  ---
@@ -89,16 +87,9 @@ Each failed AC has a specific recovery action (from `references/acceptance-crite
89
87
 
90
88
  | AC | Recovery |
91
89
  |----|----------|
92
- | AC-01/02 | Re-run step-03 entity specification |
93
- | AC-03/04 | Re-run step-03 use case / functional requirements |
94
- | AC-05/06/07 | Re-run step-03 wireframe generation |
95
- | AC-08 | Re-run step-03 section definition |
96
- | AC-09 | Re-run step-03 seedDataCore transform |
97
- | AC-10 | Auto-fix: wrap in array |
98
- | AC-11 | Re-run step-03 API endpoints |
99
- | AC-12 | Re-run step-03 messages |
100
- | AC-13 | Re-run step-03 validations |
101
- | AC-14 | Auto-fix: rename fields (non-blocking) |
102
- | AC-15 | Auto-fix: wrap string in array |
103
- | AC-16 | Auto-fix: copy description to message |
104
- | AC-17 | Re-run step-03 gherkin |
90
+ | AC-01/02 | Re-run /business-analyse entity specification |
91
+ | AC-03 | Re-run /business-analyse use case specification |
92
+ | AC-04 | Re-run /business-analyse business rules |
93
+ | AC-05 | Re-run /business-analyse screen specification |
94
+ | AC-06 | Re-run /business-analyse permission specification |
95
+ | AC-07 | Run /business-analyse step-04 consolidation |
@@ -27,7 +27,7 @@
27
27
  "type": "object",
28
28
  "required": ["ruleId", "implementationPoints"],
29
29
  "properties": {
30
- "ruleId": { "type": "string", "description": "BR-XXX identifier from analysis.businessRules" },
30
+ "ruleId": { "type": "string", "description": "BR-XXX identifier from rules.json > rules[]" },
31
31
  "title": { "type": "string" },
32
32
  "implementationPoints": {
33
33
  "type": "array",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "apiEndpointSummary": {
49
49
  "type": "array",
50
- "description": "Subset of specification.apiEndpoints enriched with linkedUC. MUST use EXACT same routes as specification.",
50
+ "description": "API endpoints generated from usecases.json + entities.json during step-01 transform.",
51
51
  "items": {
52
52
  "type": "object",
53
53
  "properties": {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: step-00-validate
3
- description: Detect input, validate BA readiness, acceptance criteria gate
3
+ description: Detect input, validate BA readiness with flat-file support, AC gate
4
4
  model: sonnet
5
5
  next_step: steps/step-01-transform.md
6
6
  ---
@@ -11,14 +11,16 @@ next_step: steps/step-01-transform.md
11
11
 
12
12
  ## MANDATORY EXECUTION RULES
13
13
 
14
- - **ALWAYS** verify status = "consolidated" for all modules before proceeding
15
- - **ALWAYS** validate acceptance criteria (AC-01 to AC-17) per module
16
- - **BLOCKING** if any module has readiness score < 100% on blocking ACs
14
+ - **ALWAYS** verify status = "consolidated" or "specified" for all modules before proceeding
15
+ - **ALWAYS** validate **input** acceptance criteria (AC-01 to AC-07) per module
16
+ - **ALWAYS** load flat files (entities.json, usecases.json, etc.) from module directories
17
+ - **BLOCKING** if any module has readiness score < 100% on input ACs
17
18
  - **NEVER** proceed to transform if any module fails readiness gate
19
+ - **NEVER** check output ACs (AC-08+) here — those are checked after step-01 transform
18
20
 
19
21
  ## YOUR TASK
20
22
 
21
- Detect the BA feature input, verify all modules are consolidated, validate acceptance criteria as a pre-gate, calculate readiness scores, and display the readiness table.
23
+ Detect the BA feature input, verify all modules are consolidated/specified, validate input acceptance criteria as a pre-gate, calculate readiness scores, and display the readiness table.
22
24
 
23
25
  ---
24
26
 
@@ -42,85 +44,104 @@ ELSE:
42
44
  STOP
43
45
  ```
44
46
 
45
- ### 2. Load Feature & Verify Consolidation
47
+ ### 2. Load Feature & Resolve Module Paths
46
48
 
47
49
  ```
48
- // Determine workflow mode
49
- IF project-level index.json exists:
50
- projectFeature = ba-reader.findProjectFeature()
51
- FOR each app in projectFeature.applications:
52
- appFeature = ba-reader.findFeature(app.featureJsonPath)
53
- IF appFeature.status !== "consolidated":
54
- BLOCKING ERROR: "Application {app.code} not consolidated (status: {appFeature.status})"
55
- Run /business-analyse step-04 first
56
- feature = projectFeature
57
- modules = projectFeature.applications.flatMap(app => app.modules)
58
- ELSE:
59
- feature = ba-reader.findFeature(featurePath)
60
- IF feature.status !== "consolidated":
61
- BLOCKING ERROR: "Feature status: {feature.status}, expected consolidated"
62
- → Run /business-analyse step-04 first
63
- modules = feature.modules
50
+ // Read application-level index.json
51
+ appIndex = READ(featurePath/index.json)
52
+
53
+ // Resolve module directories
54
+ // Modules are stored in: docs/{AppCode}/{ModuleCode}/business-analyse/v{X.Y}/
55
+ FOR each module in appIndex.modules:
56
+ moduleDir = docs/{appIndex.metadata.applicationCode}/{module.code}/business-analyse/v{version}/
57
+ IF moduleDir/index.json exists:
58
+ module.baDir = moduleDir
59
+ ELSE:
60
+ BLOCKING ERROR: "Module {module.code} directory not found at {moduleDir}"
61
+ ```
62
+
63
+ ### 3. Verify Module Status
64
+
65
+ ```
66
+ FOR each module:
67
+ moduleIndex = READ(module.baDir/index.json)
68
+ IF moduleIndex.metadata.status NOT IN ["consolidated", "specified"]:
69
+ BLOCKING ERROR: "Module {module.code} status: {status}, expected consolidated or specified"
70
+ -> Run /business-analyse to complete specification first
64
71
  ```
65
72
 
66
- ### 3. Validate Acceptance Criteria Per Module
73
+ ### 4. Load Flat Files Per Module
67
74
 
68
- For **EACH module**, run the acceptance criteria bash script from `references/acceptance-criteria.md`:
75
+ For each module, load the separate JSON files referenced in `index.json > files`:
76
+
77
+ ```javascript
78
+ // Module index.json contains file references:
79
+ // { "files": { "entities": { "path": "entities.json" }, "usecases": { "path": "usecases.json" }, ... } }
80
+
81
+ const moduleData = {
82
+ index: READ(moduleDir + '/index.json'),
83
+ entities: READ(moduleDir + '/entities.json').entities || [],
84
+ useCases: READ(moduleDir + '/usecases.json').useCases || [],
85
+ rules: READ(moduleDir + '/rules.json').rules || [],
86
+ permissions: READ(moduleDir + '/permissions.json'),
87
+ screens: READ(moduleDir + '/screens.json').screens || []
88
+ };
89
+ ```
90
+
91
+ ### 5. Validate Input Acceptance Criteria Per Module
92
+
93
+ For **EACH module**, run the **input** AC bash script from `references/acceptance-criteria.md`:
69
94
 
70
95
  ```bash
71
- MODULE_JSON="{module_feature_json_path}"
96
+ MODULE_DIR="{module_ba_dir}"
72
97
  node -e "
73
98
  const fs = require('fs');
74
- const data = JSON.parse(fs.readFileSync(process.argv[1], 'utf-8'));
75
- // ... (full AC-01 to AC-17 script from references/acceptance-criteria.md)
76
- " "$MODULE_JSON"
99
+ const path = require('path');
100
+ const dir = process.argv[1];
101
+ // ... (full input AC script from references/acceptance-criteria.md)
102
+ " "$MODULE_DIR"
77
103
  ```
78
104
 
79
- Collect results per module: PASS count, FAIL count, WARNING count.
105
+ Collect results per module: PASS count, FAIL count.
80
106
 
81
- ### 4. Calculate Readiness Score
107
+ ### 6. Calculate Readiness Score
82
108
 
83
109
  > **Reference:** Read `references/readiness-scoring.md` for the full algorithm.
84
110
 
85
111
  For each module:
86
- - Count blocking ACs passed vs total blocking ACs
87
- - Score = (blocking passed / blocking total) x 100
88
- - Non-blocking score = (non-blocking passed / non-blocking total) x 100
112
+ - Count input ACs passed vs total (7 input ACs)
113
+ - Score = (passed / 7) x 100
89
114
 
90
- ### 5. Apply Readiness Gate
115
+ ### 7. Apply Readiness Gate
91
116
 
92
117
  ```
93
118
  FOR each module:
94
119
  IF readiness_score < 100%:
95
- BLOCKING ERROR: "Module {moduleCode} readiness: {score}% {failed_count} blocking ACs failed"
120
+ BLOCKING ERROR: "Module {moduleCode} readiness: {score}% -- {failed_count} input ACs failed"
96
121
  Display failed ACs with recovery actions
97
- Run /business-analyse to fix, then retry /derive-prd
122
+ -> Run /business-analyse to fix, then retry /derive-prd
98
123
  STOP
99
-
100
- IF non_blocking_score < 80%:
101
- WARNING: "Module {moduleCode} non-blocking score: {score}% — consider fixing before handoff"
102
124
  ```
103
125
 
104
- ### 6. Display Readiness Table
126
+ ### 8. Display Readiness Table
105
127
 
106
128
  ```
107
- ══════════════════════════════════════════════════════════════
108
- DERIVE-PRD BA READINESS VALIDATION
109
- ══════════════════════════════════════════════════════════════
129
+ ================================================================
130
+ DERIVE-PRD -- BA READINESS VALIDATION
131
+ ================================================================
110
132
 
111
133
  Feature: {feature_name}
112
- Applications: {app_count} (project mode only)
113
134
  Modules: {module_count}
114
135
 
115
- ┌──────────────┬──────────┬────────────┬──────────────┬────────┐
116
- Module Status Blocking │ Non-blocking Ready │
117
- ├──────────────┼──────────┼────────────┼──────────────┼────────┤
118
- {module1} consol. 16/16 100% 1/1 100% │ YES │
119
- {module2} consol. 16/16 100% 1/1 100% │ YES │
120
- └──────────────┴──────────┴────────────┴──────────────┴────────┘
136
+ +--------------+----------+-----------+-------+---------+
137
+ | Module | Status | Score | Ready | Details |
138
+ +--------------+----------+-----------+-------+---------+
139
+ | {module1} | specif. | 7/7 100% | YES | E:2 UC:6 BR:8 S:4 P:5 |
140
+ | {module2} | specif. | 7/7 100% | YES | E:3 UC:8 BR:10 S:6 P:6 |
141
+ +--------------+----------+-----------+-------+---------+
121
142
 
122
- All modules READY proceeding to transform...
123
- ══════════════════════════════════════════════════════════════
143
+ -> All modules READY -- proceeding to transform...
144
+ ================================================================
124
145
  ```
125
146
 
126
147
  ---
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: step-01-transform
3
- description: Build handoff data per module - 8 categories with all gap fixes
3
+ description: Build handoff data per module - 8 categories from flat BA files
4
4
  model: sonnet
5
5
  next_step: steps/step-02-export.md
6
6
  ---
@@ -12,17 +12,45 @@ next_step: steps/step-02-export.md
12
12
  ## MANDATORY EXECUTION RULES
13
13
 
14
14
  - **ALWAYS** process modules in topological order (dependencies first)
15
+ - **ALWAYS** load data from **flat files** (entities.json, usecases.json, rules.json, screens.json, permissions.json)
15
16
  - **ALWAYS** map to 8 categories (including "documentation")
16
- - **ALWAYS** propagate personRoleConfig verbatim from analysis.entities[]
17
+ - **ALWAYS** propagate personRoleConfig verbatim from entities
17
18
  - **ALWAYS** separate seedData into core/business categories
18
19
  - **ALWAYS** map entity to domain file path (1:1)
19
20
  - **ALWAYS** include dependencies[] per file entry
20
- - **NEVER** invent entities/FRs/BRs not in module JSON files
21
- - **ALL** API routes from specification.apiEndpoints (exact copy)
21
+ - **NEVER** invent entities/BRs not in module JSON files
22
+ - **ALWAYS** generate API endpoints from use cases + entities (BA does not produce apiEndpoints)
22
23
 
23
24
  ## YOUR TASK
24
25
 
25
- For each module in topological order, build the complete handoff data with 8 file categories, BR-to-code mapping, API endpoint summary, and write to feature.json via ba-writer.
26
+ For each module in topological order, load flat BA files, build the complete handoff data with 8 file categories, BR-to-code mapping, API endpoint summary, and write to feature.json via ba-writer.
27
+
28
+ ---
29
+
30
+ ## DATA LOADING (Flat-File Architecture)
31
+
32
+ For each module, load data from separate files:
33
+
34
+ ```javascript
35
+ // Module BA directory: docs/{AppCode}/{ModuleCode}/business-analyse/v{X.Y}/
36
+ const moduleDir = module.baDir; // resolved in step-00
37
+
38
+ const entities = READ(moduleDir + '/entities.json').entities || [];
39
+ const useCases = READ(moduleDir + '/usecases.json').useCases || [];
40
+ const rules = READ(moduleDir + '/rules.json').rules || [];
41
+ const permissions = READ(moduleDir + '/permissions.json');
42
+ const screens = READ(moduleDir + '/screens.json').screens || [];
43
+ ```
44
+
45
+ **Source mapping (flat files -> handoff categories):**
46
+
47
+ | Handoff needs | Source file | Root key |
48
+ |---------------|------------|----------|
49
+ | Entities, ValueObjects, Enums | `entities.json` | `entities[]` |
50
+ | Use cases | `usecases.json` | `useCases[]` |
51
+ | Business rules | `rules.json` | `rules[]` |
52
+ | Roles, permissions | `permissions.json` | `roles[]`, `matrix[]`, `permissionPaths[]` |
53
+ | Screens, sections, wireframes | `screens.json` | `screens[]` |
26
54
 
27
55
  ---
28
56
 
@@ -52,25 +80,40 @@ For **EACH module** in topological order:
52
80
 
53
81
  **Global complexity** = highest across all modules.
54
82
 
55
- ### 2. Map Specification to Files (8 Categories)
83
+ ### 2. Generate API Endpoints from Use Cases
84
+
85
+ Since `/business-analyse` does not produce `apiEndpoints`, generate them from use cases + entities:
86
+
87
+ ```javascript
88
+ // For each use case, derive the API endpoint:
89
+ // UC "Create Employee" -> POST /api/{app}/{module}
90
+ // UC "List Employees" -> GET /api/{app}/{module}
91
+ // UC "Update Employee" -> PUT /api/{app}/{module}/{id}
92
+ // UC "Delete Employee" -> DELETE /api/{app}/{module}/{id}
93
+ // UC "Get Employee" -> GET /api/{app}/{module}/{id}
94
+
95
+ // Use permission paths from permissions.json to determine operations
96
+ // Map CRUD operations to HTTP methods
97
+ ```
98
+
99
+ ### 3. Map Specification to Files (8 Categories)
56
100
 
57
101
  > **Reference:** Read `references/handoff-file-templates.md` for complete JSON templates.
58
102
  > All backend paths MUST include `{ApplicationName}/` hierarchy.
59
103
 
60
104
  | Category | Source | Key rules |
61
105
  |----------|--------|-----------|
62
- | **Domain** | `analysis.entities[]` | Entities, ValueObjects, Enums |
63
- | **Application** | `analysis.useCases[]` | Services, DTOs, Validators |
64
- | **Infrastructure** | `analysis.entities[]` | EF Configurations, DbSet |
65
- | **API** | `specification.apiEndpoints[]` | Controllers (exact copy) |
66
- | **Frontend** | `specification.uiWireframes[]` | Pages, Components, Hooks; split by file (NOT monolithic) |
67
- | **SeedData** | `specification.seedDataCore` | CORE (2 app-level + per-module) + business |
106
+ | **Domain** | `entities.json > entities[]` | Entities, ValueObjects, Enums |
107
+ | **Application** | `usecases.json > useCases[]` | Services, DTOs, Validators |
108
+ | **Infrastructure** | `entities.json > entities[]` | EF Configurations, DbSet |
109
+ | **API** | Generated from useCases + entities | Controllers |
110
+ | **Frontend** | `screens.json > screens[]` | Pages, Components, Hooks; split by file (NOT monolithic) |
111
+ | **SeedData** | Generated from entities + permissions | CORE (2 app-level + per-module) + business |
68
112
  | **Tests** | All layers | Unit, Integration, Security tests |
69
113
  | **Documentation** | All layers | Technical docs, user guides, API specs (can be empty `[]`) |
70
114
 
71
115
  **Frontend Task Splitting (MANDATORY):**
72
116
  - Each page as separate entry (not bundled mega-task)
73
- - Include `linkedWireframes[]` + `wireframeAcceptanceCriteria`
74
117
  - FK fields: `"fkFields": ["EmployeeId->Employee", "DepartmentId->Department"]`
75
118
  - ALL pages use `/ui-components` skill
76
119
  - Route wiring: separate entry in `filesToCreate.frontend`
@@ -81,27 +124,25 @@ For **EACH module** in topological order:
81
124
 
82
125
  **Documentation Category:**
83
126
  - Include `doc-data.ts` for documentation data export
84
- - Include API specification files if applicable
85
127
  - Can be empty `[]` if no documentation is planned at this stage
86
- - Will be populated later by `/documentation` skill after `/ralph-loop`
87
128
 
88
- ### 3. Map Business Rules to Code
129
+ ### 4. Map Business Rules to Code
89
130
 
90
- > **Reference:** Read `references/handoff-mappings.md` Section "Business Rules to Code Mapping"
131
+ > **Reference:** Read `references/handoff-mappings.md` -- Section "Business Rules to Code Mapping"
91
132
 
92
- For each BR in `analysis.businessRules[]` of EACH module:
93
- - ruleId, title, module, severity (critical/high/medium/low)
133
+ For each rule in `rules.json > rules[]` of EACH module:
134
+ - ruleId, title, module, severity (from `rule.severity`)
94
135
  - implementationPoints: Array of {layer, component, method, implementation} across all layers
95
136
 
96
- ### 4. Propagate personRoleConfig (GAP #2 Fix)
137
+ ### 5. Propagate personRoleConfig (GAP #2 Fix)
97
138
 
98
- For each entity in `analysis.entities[]`:
139
+ For each entity in `entities.json > entities[]`:
99
140
  - IF entity has `personRoleConfig` property:
100
141
  - Copy verbatim into handoff entity data
101
- - Ensures `/apex` and `/ralph-loop` receive person extension configuration
102
- - See `references/handoff-mappings.md` — Section "Person Extension Mapping"
103
142
 
104
- ### 5. Separate SeedData Core/Business (GAP #3 Fix)
143
+ ### 6. Generate SeedData Core/Business (GAP #3 Fix)
144
+
145
+ Generate seed data from entities and permissions:
105
146
 
106
147
  Each seedData entry MUST include a `category` field:
107
148
 
@@ -114,12 +155,12 @@ Each seedData entry MUST include a `category` field:
114
155
  }
115
156
  ```
116
157
 
117
- - `category: "core"` Navigation, Permissions, Roles (mandatory infrastructure)
118
- - `category: "business"` Domain-specific reference/lookup data
158
+ - `category: "core"` -- Navigation, Permissions, Roles (mandatory infrastructure)
159
+ - `category: "business"` -- Domain-specific reference/lookup data
119
160
 
120
161
  > **Reference:** Read `references/handoff-seeddata-generation.md` for complete core seed generation.
121
162
 
122
- ### 6. Map Entity to Domain File (GAP #4 Fix)
163
+ ### 7. Map Entity to Domain File (GAP #4 Fix)
123
164
 
124
165
  > **Reference:** Read `references/entity-domain-mapping.md` for complete mapping rules.
125
166
 
@@ -131,7 +172,7 @@ Each seedData entry MUST include a `category` field:
131
172
  | ValueObject | `src/Domain/{Module}/ValueObjects/{VOName}.cs` |
132
173
  | Enum | `src/Domain/{Module}/Enums/{EnumName}.cs` |
133
174
 
134
- ### 7. Add Dependencies per File Entry (GAP #7 Fix)
175
+ ### 8. Add Dependencies per File Entry (GAP #7 Fix)
135
176
 
136
177
  Each file entry includes `dependencies[]` ordered by layer:
137
178
 
@@ -146,33 +187,35 @@ Each file entry includes `dependencies[]` ordered by layer:
146
187
  | tests | `["domain", "application", "infrastructure", "api"]` |
147
188
  | documentation | `[]` |
148
189
 
149
- ### 8. API Endpoint Summary
150
-
151
- > **ABSOLUTE RULE:** Copy **EXACTLY** from `specification.apiEndpoints[]`. **NEVER** reinvent routes.
152
-
153
- For each endpoint: operation, method, route, linkedUC, linkedFR, permissions, requestSchema, responseSchema, errorCodes, module.
154
-
155
190
  ### 9. Write Handoff to Feature.json
156
191
 
157
192
  ```
158
193
  FOR i = 0 to modules.length-1:
159
194
  1. moduleCode = modules[i].code
160
- 2. moduleFeature = ba-reader.findFeature(modules[i].featureJsonPath)
161
- 3. Build handoff payload:
195
+ 2. Build handoff payload:
162
196
  - complexity (from step 1)
163
197
  - filesToCreate (full 8-category structure, filtered for this module)
164
- - brToCodeMapping (from step 3)
165
- - apiEndpointSummary (from step 8)
198
+ - brToCodeMapping (from step 4)
199
+ - apiEndpointSummary (from step 2)
166
200
  - prdFile: ".ralph/prd-{moduleCode}.json"
167
201
  - totalFiles: count from filesToCreate
168
202
  - totalTasks: estimated from complexity
169
203
  - handedOffAt: ISO timestamp
170
- 4. Write via ba-writer.enrichModuleHandoff({ moduleFeatureId, handoffData })
171
- 5. Display: "handoff {i+1}/{N}: {moduleCode} ({fileCount} files)"
204
+ 3. Write via ba-writer.enrichModuleHandoff({ moduleFeatureId, handoffData })
205
+ 4. Display: "handoff {i+1}/{N}: {moduleCode} ({fileCount} files)"
172
206
  ```
173
207
 
174
208
  ### 10. POST-CHECK Per Module (BLOCKING)
175
209
 
210
+ Run the **output** AC script from `references/acceptance-criteria.md`:
211
+
212
+ ```bash
213
+ MODULE_JSON="{module_index_json_path}"
214
+ node -e "
215
+ // ... (output AC script from references/acceptance-criteria.md)
216
+ " "$MODULE_JSON"
217
+ ```
218
+
176
219
  For each module, verify:
177
220
 
178
221
  ```javascript
@@ -183,20 +226,20 @@ if (!handoff || Object.keys(handoff).length === 0) {
183
226
  BLOCKING_ERROR("Module {moduleCode}: handoff is empty");
184
227
  }
185
228
 
186
- // 2. All 8 categories present
229
+ // 2. All 8 categories present (AC-08)
187
230
  const categories = ['domain', 'application', 'infrastructure', 'api', 'frontend', 'seedData', 'tests', 'documentation'];
188
231
  const missing = categories.filter(cat => !handoff.filesToCreate[cat]);
189
232
  if (missing.length > 0) {
190
233
  BLOCKING_ERROR("Module {moduleCode}: missing categories: " + missing.join(', '));
191
234
  }
192
235
 
193
- // 3. BR-to-code mapping non-empty
236
+ // 3. BR-to-code mapping non-empty (AC-09)
194
237
  if (!handoff.brToCodeMapping || handoff.brToCodeMapping.length === 0) {
195
238
  BLOCKING_ERROR("Module {moduleCode}: brToCodeMapping is empty");
196
239
  }
197
240
 
198
241
  // 4. Display pass
199
- console.log("POST-CHECK PASS: {moduleCode} 8 categories, {brCount} BRs mapped");
242
+ console.log("POST-CHECK PASS: {moduleCode} -- 8 categories, {brCount} BRs mapped");
200
243
  ```
201
244
 
202
245
  ---
@@ -1,48 +0,0 @@
1
- <!-- SECTION: Risques et hypotheses -->
2
- <div class="section" id="cadrage-risks" style="display:none;" data-vibe-hide>
3
- <h2 class="section-title">Risques et hypotheses</h2>
4
- <p class="section-subtitle">Ce qui pourrait mal tourner et les certitudes non verifiees.</p>
5
-
6
- <h3 style="color: var(--text-bright); font-size: 1rem; margin-bottom: 0.75rem;">Risques identifies</h3>
7
- <div id="risksList"></div>
8
- <button class="add-btn" onclick="toggleForm('addRiskForm')">+ Ajouter un risque</button>
9
-
10
- <div class="inline-form" id="addRiskForm">
11
- <div class="inline-form-title">Nouveau risque</div>
12
- <div class="form-group">
13
- <label class="form-label">Description du risque</label>
14
- <input type="text" class="form-input" id="risk-desc" placeholder="Qu'est-ce qui pourrait mal tourner ?">
15
- </div>
16
- <div class="form-row">
17
- <div class="form-group">
18
- <label class="form-label">Probabilite</label>
19
- <select class="form-select" id="risk-probability">
20
- <option value="high">Forte</option>
21
- <option value="medium">Moyenne</option>
22
- <option value="low">Faible</option>
23
- </select>
24
- </div>
25
- <div class="form-group">
26
- <label class="form-label">Impact</label>
27
- <select class="form-select" id="risk-impact">
28
- <option value="high">Grave</option>
29
- <option value="medium">Moyen</option>
30
- <option value="low">Faible</option>
31
- </select>
32
- </div>
33
- </div>
34
- <div class="form-group">
35
- <label class="form-label">Mesure de prevention ou de reduction</label>
36
- <textarea class="form-textarea" id="risk-mitigation" placeholder="Comment prevenir ou reduire ce risque ?"></textarea>
37
- </div>
38
- <div class="form-actions">
39
- <button class="btn" onclick="toggleForm('addRiskForm')">Annuler</button>
40
- <button class="btn btn-primary" onclick="addRisk()">Ajouter ce risque</button>
41
- </div>
42
- </div>
43
-
44
- <h3 style="color: var(--text-bright); font-size: 1rem; margin: 2rem 0 0.75rem;">Hypotheses a verifier</h3>
45
- <div class="card">
46
- <div class="editable" contenteditable="true" data-field="risks.assumptions" data-placeholder="Quelles hypotheses faites-vous sur ce projet sans les avoir verifiees ? (une par ligne)"></div>
47
- </div>
48
- </div>