@atlashub/smartstack-cli 3.7.0 → 3.9.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 (133) hide show
  1. package/dist/index.js +365 -2
  2. package/dist/index.js.map +1 -1
  3. package/package.json +4 -2
  4. package/templates/agents/action.md +1 -0
  5. package/templates/agents/ba-writer.md +33 -0
  6. package/templates/agents/explore-codebase.md +1 -0
  7. package/templates/agents/explore-docs.md +1 -0
  8. package/templates/agents/fix-grammar.md +1 -0
  9. package/templates/agents/snipper.md +1 -0
  10. package/templates/skills/admin/SKILL.md +6 -0
  11. package/templates/skills/ai-prompt/SKILL.md +32 -136
  12. package/templates/skills/ai-prompt/steps/step-01-implementation.md +122 -0
  13. package/templates/skills/apex/SKILL.md +120 -0
  14. package/templates/skills/apex/_shared.md +86 -0
  15. package/templates/skills/apex/references/agent-teams-protocol.md +164 -0
  16. package/templates/skills/apex/references/smartstack-layers.md +173 -0
  17. package/templates/skills/apex/steps/step-00-init.md +156 -0
  18. package/templates/skills/apex/steps/step-01-analyze.md +169 -0
  19. package/templates/skills/apex/steps/step-02-plan.md +160 -0
  20. package/templates/skills/apex/steps/step-03-execute.md +166 -0
  21. package/templates/skills/apex/steps/step-04-validate.md +138 -0
  22. package/templates/skills/apex/steps/step-05-examine.md +124 -0
  23. package/templates/skills/apex/steps/step-06-resolve.md +105 -0
  24. package/templates/skills/apex/steps/step-07-tests.md +130 -0
  25. package/templates/skills/apex/steps/step-08-run-tests.md +115 -0
  26. package/templates/skills/application/SKILL.md +10 -0
  27. package/templates/skills/application/references/backend-controller-hierarchy.md +58 -0
  28. package/templates/skills/application/references/backend-entity-seeding.md +72 -0
  29. package/templates/skills/application/references/backend-verification.md +88 -0
  30. package/templates/skills/application/references/frontend-verification.md +111 -0
  31. package/templates/skills/application/references/nav-fallback-procedure.md +200 -0
  32. package/templates/skills/application/references/provider-template.md +134 -0
  33. package/templates/skills/application/references/test-frontend.md +73 -0
  34. package/templates/skills/application/references/test-prerequisites.md +72 -0
  35. package/templates/skills/application/steps/step-01-navigation.md +7 -198
  36. package/templates/skills/application/steps/step-03b-provider.md +4 -128
  37. package/templates/skills/application/steps/step-04-backend.md +20 -350
  38. package/templates/skills/application/steps/step-05-frontend.md +12 -101
  39. package/templates/skills/application/steps/step-07-tests.md +12 -132
  40. package/templates/skills/business-analyse/SKILL.md +11 -2
  41. package/templates/skills/business-analyse/html/ba-interactive.html +3214 -2246
  42. package/templates/skills/business-analyse/html/build-html.js +77 -0
  43. package/templates/skills/business-analyse/html/src/scripts/01-data-init.js +130 -0
  44. package/templates/skills/business-analyse/html/src/scripts/02-navigation.js +22 -0
  45. package/templates/skills/business-analyse/html/src/scripts/03-render-cadrage.js +208 -0
  46. package/templates/skills/business-analyse/html/src/scripts/04-render-modules.js +211 -0
  47. package/templates/skills/business-analyse/html/src/scripts/05-render-specs.js +554 -0
  48. package/templates/skills/business-analyse/html/src/scripts/06-render-consolidation.js +110 -0
  49. package/templates/skills/business-analyse/html/src/scripts/07-render-handoff.js +90 -0
  50. package/templates/skills/business-analyse/html/src/scripts/08-editing.js +45 -0
  51. package/templates/skills/business-analyse/html/src/scripts/09-export.js +168 -0
  52. package/templates/skills/business-analyse/html/src/scripts/10-comments.js +171 -0
  53. package/templates/skills/business-analyse/html/src/scripts/11-review-panel.js +161 -0
  54. package/templates/skills/business-analyse/html/src/styles/01-variables.css +38 -0
  55. package/templates/skills/business-analyse/html/src/styles/02-layout.css +101 -0
  56. package/templates/skills/business-analyse/html/src/styles/03-navigation.css +62 -0
  57. package/templates/skills/business-analyse/html/src/styles/04-cards.css +196 -0
  58. package/templates/skills/business-analyse/html/src/styles/05-modules.css +325 -0
  59. package/templates/skills/business-analyse/html/src/styles/06-wireframes.css +230 -0
  60. package/templates/skills/business-analyse/html/src/styles/07-comments.css +184 -0
  61. package/templates/skills/business-analyse/html/src/styles/08-review-panel.css +241 -0
  62. package/templates/skills/business-analyse/html/src/template.html +623 -0
  63. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +78 -0
  64. package/templates/skills/business-analyse/references/cadrage-vibe-coding.md +97 -0
  65. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +92 -0
  66. package/templates/skills/business-analyse/references/deploy-data-build.md +121 -0
  67. package/templates/skills/business-analyse/references/deploy-modes.md +49 -0
  68. package/templates/skills/business-analyse/references/handoff-file-templates.md +119 -0
  69. package/templates/skills/business-analyse/references/handoff-mappings.md +81 -0
  70. package/templates/skills/business-analyse/references/html-data-mapping.md +10 -2
  71. package/templates/skills/business-analyse/references/init-schema-deployment.md +65 -0
  72. package/templates/skills/business-analyse/references/review-data-mapping.md +363 -0
  73. package/templates/skills/business-analyse/references/spec-auto-inference.md +57 -0
  74. package/templates/skills/business-analyse/references/ui-dashboard-spec.md +85 -0
  75. package/templates/skills/business-analyse/references/ui-resource-cards.md +110 -0
  76. package/templates/skills/business-analyse/references/validate-incremental-html.md +55 -0
  77. package/templates/skills/business-analyse/steps/step-00-init.md +35 -68
  78. package/templates/skills/business-analyse/steps/step-01-cadrage.md +5 -194
  79. package/templates/skills/business-analyse/steps/step-03a-data.md +6 -49
  80. package/templates/skills/business-analyse/steps/step-03b-ui.md +12 -178
  81. package/templates/skills/business-analyse/steps/step-03d-validate.md +3 -48
  82. package/templates/skills/business-analyse/steps/step-04-consolidation.md +9 -104
  83. package/templates/skills/business-analyse/steps/step-05a-handoff.md +25 -441
  84. package/templates/skills/business-analyse/steps/step-05b-deploy.md +19 -187
  85. package/templates/skills/business-analyse/steps/step-06-review.md +277 -0
  86. package/templates/skills/cc-agent/references/agent-behavior-patterns.md +95 -0
  87. package/templates/skills/cc-agent/steps/step-02-generate.md +5 -78
  88. package/templates/skills/check-version/SKILL.md +7 -0
  89. package/templates/skills/controller/references/controller-code-templates.md +159 -0
  90. package/templates/skills/controller/references/permission-sync-templates.md +152 -0
  91. package/templates/skills/controller/steps/step-03-generate.md +6 -158
  92. package/templates/skills/controller/steps/step-04-perms.md +5 -144
  93. package/templates/skills/debug/SKILL.md +7 -0
  94. package/templates/skills/explore/SKILL.md +6 -0
  95. package/templates/skills/feature-full/SKILL.md +39 -142
  96. package/templates/skills/feature-full/steps/step-01-implementation.md +120 -0
  97. package/templates/skills/gitflow/references/init-config-template.md +135 -0
  98. package/templates/skills/gitflow/references/init-name-normalization.md +103 -0
  99. package/templates/skills/gitflow/references/plan-template.md +69 -0
  100. package/templates/skills/gitflow/references/start-efcore-preflight.md +70 -0
  101. package/templates/skills/gitflow/references/start-local-config.md +110 -0
  102. package/templates/skills/gitflow/steps/step-init.md +18 -289
  103. package/templates/skills/gitflow/steps/step-plan.md +6 -63
  104. package/templates/skills/gitflow/steps/step-start.md +16 -126
  105. package/templates/skills/mcp/SKILL.md +9 -213
  106. package/templates/skills/mcp/steps/step-01-healthcheck.md +108 -0
  107. package/templates/skills/mcp/steps/step-02-tools.md +73 -0
  108. package/templates/skills/notification/SKILL.md +7 -0
  109. package/templates/skills/quick-search/SKILL.md +5 -0
  110. package/templates/skills/ralph-loop/SKILL.md +99 -381
  111. package/templates/skills/ralph-loop/references/category-rules.md +259 -0
  112. package/templates/skills/ralph-loop/references/compact-loop.md +182 -0
  113. package/templates/skills/ralph-loop/references/task-transform-legacy.md +259 -0
  114. package/templates/skills/ralph-loop/references/team-orchestration.md +189 -0
  115. package/templates/skills/ralph-loop/steps/step-00-init.md +111 -383
  116. package/templates/skills/ralph-loop/steps/step-01-task.md +79 -896
  117. package/templates/skills/ralph-loop/steps/step-02-execute.md +68 -680
  118. package/templates/skills/ralph-loop/steps/step-03-commit.md +47 -277
  119. package/templates/skills/ralph-loop/steps/step-04-check.md +124 -607
  120. package/templates/skills/ralph-loop/steps/step-05-report.md +68 -367
  121. package/templates/skills/refactor/SKILL.md +12 -176
  122. package/templates/skills/refactor/steps/step-01-discover.md +60 -0
  123. package/templates/skills/refactor/steps/step-02-execute.md +67 -0
  124. package/templates/skills/review-code/SKILL.md +19 -257
  125. package/templates/skills/review-code/steps/step-01-smartstack.md +96 -0
  126. package/templates/skills/review-code/steps/step-02-detailed-review.md +80 -0
  127. package/templates/skills/review-code/steps/step-03-react.md +44 -0
  128. package/templates/skills/ui-components/SKILL.md +7 -0
  129. package/templates/skills/utils/SKILL.md +6 -0
  130. package/templates/skills/validate/SKILL.md +6 -0
  131. package/templates/skills/validate-feature/SKILL.md +8 -0
  132. package/templates/skills/workflow/SKILL.md +40 -118
  133. package/templates/skills/workflow/steps/step-01-implementation.md +84 -0
@@ -0,0 +1,78 @@
1
+ # Cadrage Structure Cards
2
+
3
+ > Reference for step-01-cadrage.md — exact JSON formats for cadrage section fields.
4
+
5
+ ## stakeholders[]
6
+
7
+ ```json
8
+ {
9
+ "role": "Fleet Manager",
10
+ "function": "Manages daily fleet operations",
11
+ "involvement": "decision-maker",
12
+ "tasks": ["Monitor vehicles", "Approve repairs", "Export reports"],
13
+ "frequency": "Daily",
14
+ "painPoints": ["Manual tracking in spreadsheets", "No real-time visibility"]
15
+ }
16
+ ```
17
+ **MANDATORY fields:** `role`, `function`, `involvement`, `tasks`
18
+ **involvement values:** `approver`, `decision-maker`, `consulted`, `informed`, `end-user`
19
+ **FORBIDDEN fields:** Do NOT use `expertise`, `systemRole`, `description` (use `function` instead).
20
+
21
+ ## applicationRoles[]
22
+
23
+ ```json
24
+ {
25
+ "role": "{App} Admin",
26
+ "description": "Full access to all modules",
27
+ "level": "admin",
28
+ "permissionPattern": "business.{app}.*"
29
+ }
30
+ ```
31
+ **MANDATORY fields:** `role`, `level`, `permissionPattern`
32
+ **level values:** `admin`, `manager`, `contributor`, `viewer`
33
+ **FORBIDDEN fields:** Do NOT use `permissions` (use `permissionPattern`), `isDefault`.
34
+
35
+ ## risks[]
36
+
37
+ ```json
38
+ {
39
+ "id": "RISK-001",
40
+ "type": "business|technical|organizational",
41
+ "description": "CSV data may contain duplicates and errors",
42
+ "probability": "high|medium|low",
43
+ "impact": "high|medium|low",
44
+ "priority": "critical|medium|low",
45
+ "mitigation": "Data cleaning phase before import, detailed error reports"
46
+ }
47
+ ```
48
+ **MANDATORY fields:** `id` (pattern: RISK-NNN), `type`, `description`, `mitigation`
49
+ **FORBIDDEN fields:** Do NOT use `risk` (name), `severity`. Use `id` + `description` + `priority`.
50
+
51
+ ## acceptanceCriteria[]
52
+
53
+ ```json
54
+ { "id": "AC-001", "criterion": "All must-have features delivered and tested", "validated": false }
55
+ ```
56
+ **MANDATORY:** This section must NOT be omitted.
57
+
58
+ ## coverageMatrix[]
59
+
60
+ ```json
61
+ {
62
+ "item": "User management with CRUD",
63
+ "category": "mustHave|shouldHave|couldHave|outOfScope|implicit",
64
+ "module": "Users",
65
+ "ucRef": "UC-UM-001",
66
+ "notes": "Foundation module, must be implemented first"
67
+ }
68
+ ```
69
+ **MANDATORY fields:** `item`, `category`, `module`
70
+ **category values:** `mustHave`, `shouldHave`, `couldHave`, `outOfScope`, `implicit` (camelCase)
71
+ **FORBIDDEN fields:** Do NOT use `id`, `feature`, `priority`. Use `item` + `category`.
72
+
73
+ ## codebaseContext
74
+
75
+ Must be a string, NOT an object:
76
+ ```json
77
+ "codebaseContext": "Greenfield project, no existing entities. SmartStack 2.1.0 with Extensions DbContext."
78
+ ```
@@ -0,0 +1,97 @@
1
+ # Cadrage: Vibe Coding Flow
2
+
3
+ > Reference for step-01-cadrage.md — accelerated 3-lot questionnaire for vibe coding mode.
4
+
5
+ ## Lot 1: Problem & Scope
6
+
7
+ Ask 2 questions:
8
+
9
+ ```
10
+ question: "Quel est le besoin principal de cette application ?"
11
+ header: "Besoin"
12
+ options:
13
+ - label: "Automatiser un processus manuel"
14
+ description: "Remplacer des taches repetitives par une application"
15
+ - label: "Creer un outil manquant"
16
+ description: "Construire quelque chose qui n'existe pas encore"
17
+ - label: "Remplacer un outil existant"
18
+ description: "Remplacer un logiciel ou tableur qui ne convient plus"
19
+ - label: "Centraliser des donnees"
20
+ description: "Rassembler des informations dispersees en un seul endroit"
21
+ ```
22
+
23
+ ```
24
+ question: "Quelles fonctionnalites sont indispensables pour la V1 ?"
25
+ header: "Indispensable"
26
+ multiSelect: true
27
+ options:
28
+ → Generate 4 options dynamically from {feature_description}
29
+ → Each option = one functional area detected in the description
30
+ ```
31
+
32
+ **Store:** `problem_type` (from Q1), `must_have_features[]` (from Q2)
33
+
34
+ ## Lot 2: Users & Permissions
35
+
36
+ ```
37
+ question: "Qui va utiliser cette application ?"
38
+ header: "Utilisateurs"
39
+ options:
40
+ - label: "Moi seul"
41
+ description: "Application mono-utilisateur, je suis l'unique admin"
42
+ - label: "Quelques utilisateurs (2-10)"
43
+ description: "Petite equipe avec des roles differents"
44
+ - label: "Organisation (10+)"
45
+ description: "Deploiement a l'echelle d'une equipe ou entreprise"
46
+ ```
47
+
48
+ **Auto-set rules:**
49
+ - "Moi seul" → 1 admin role, 1 stakeholder, SKIP role question
50
+ - "Quelques utilisateurs" → standard 4-tier roles, ask confirmation, 2 stakeholders (Admin + User)
51
+ - "Organisation" → standard 4-tier roles, ask confirmation, 3 stakeholders (Admin + Manager + User)
52
+
53
+ ## Lot 3: Technical Challenges
54
+
55
+ ```
56
+ question: "Quels defis techniques anticipez-vous ?"
57
+ header: "Defis"
58
+ multiSelect: true
59
+ options:
60
+ - label: "Regles metier complexes"
61
+ description: "Calculs, validations ou workflows difficiles a specifier"
62
+ - label: "Volume de donnees"
63
+ description: "Grandes quantites de donnees a gerer ou migrer"
64
+ - label: "Integrations externes"
65
+ description: "APIs, services tiers ou synchronisation avec d'autres systemes"
66
+ - label: "Interface riche"
67
+ description: "Ecrans avec beaucoup d'interactions, graphiques ou visualisations"
68
+ ```
69
+
70
+ ## Auto-Inferred Cadrage Data
71
+
72
+ DO NOT ask these — derive from answers:
73
+
74
+ ```yaml
75
+ cadrage.problem: "{feature_description} — {problem_type}"
76
+ cadrage.asIs: "Aucun systeme en place" | "Processus manuel existant" | "Outil existant a remplacer"
77
+ → Derived from Lot 1 problem_type
78
+ cadrage.toBe: "Application {application_name} couvrant: {must_have_features joined}"
79
+ cadrage.trigger: "Projet vibe coding initie par le developpeur"
80
+ cadrage.risks:
81
+ → Map each selected technical challenge to a RISK entry:
82
+ - "Regles metier complexes" → RISK-001, type: "technical", probability: "medium", impact: "high"
83
+ - "Volume de donnees" → RISK-002, type: "technical", probability: "low", impact: "medium"
84
+ - "Integrations externes" → RISK-003, type: "technical", probability: "medium", impact: "medium"
85
+ - "Interface riche" → RISK-004, type: "technical", probability: "low", impact: "low"
86
+ → Add mitigation for each: "Specification detaillee dans step-03 + generation iterative"
87
+ cadrage.acceptanceCriteria:
88
+ - { id: "AC-001", criterion: "Toutes les fonctionnalites must-have implementees et fonctionnelles", validated: false }
89
+ - { id: "AC-002", criterion: "Application deployable et utilisable", validated: false }
90
+ cadrage.globalScope:
91
+ mustHave: {must_have_features}
92
+ shouldHave: [] → Determined later in coverage matrix
93
+ couldHave: [] → Determined later in coverage matrix
94
+ outOfScope: []
95
+ ```
96
+
97
+ After Lot 3: Go directly to **section 9 (Coverage Matrix)**.
@@ -0,0 +1,92 @@
1
+ # Consolidation Structural Schema Conformity Checks
2
+
3
+ > Post-generation validation. After semantic checks, verify ALL module feature.json files conform to JSON schema.
4
+
5
+ ## A. Required Sections Presence
6
+
7
+ | Section | Required | Check |
8
+ |---------|----------|-------|
9
+ | `metadata` | YES | Must have: app, module, language, featureDescription, featureType |
10
+ | `discovery` | YES | Must exist (even if minimal) |
11
+ | `analysis.entities[]` | YES | Must have >=1 entity |
12
+ | `analysis.businessRules[]` | YES | Must have >=1 BR |
13
+ | `analysis.objectives[]` | YES | Must have >=1 objective |
14
+ | `analysis.processFlow` | YES | Must have entryPoints, mainFlow, decisionPoints |
15
+ | `analysis.dataLifecycle` | YES | Must have retention, archival, deletion, gdprRelevant |
16
+ | `specification.useCases[]` | YES | Must have >=1 UC |
17
+ | `specification.functionalRequirements[]` | YES | Must have >=1 FR |
18
+ | `specification.permissionMatrix` | YES | Must be `{permissions[], roleAssignments[]}` (NOT flat array) |
19
+ | `specification.sections[]` | YES | Must have >=1 section with resources |
20
+ | `specification.uiWireframes[]` | YES | Must have >=1 wireframe with `layout` object |
21
+ | `specification.lifeCycles[]` | IF entities have status | States must be objects (NOT strings) |
22
+ | `specification.seedDataCore` | YES | Must have 5 arrays: navigationModules, navigationTranslations, permissions, rolePermissions, permissionConstants |
23
+ | `specification.gherkinScenarios` | YES | Must be `{feature, scenarios[]}` (NOT flat array) |
24
+ | `specification.navigation` | YES | Must have entries[] |
25
+ | `specification.i18nKeys[]` | YES | Must have >=1 key with fr, en, nl, de |
26
+ | `validation` | YES | Must have completenessChecks, consistencyChecks, semanticChecks, decision |
27
+
28
+ ## B. Field Name Conformity
29
+
30
+ | Section | FORBIDDEN fields | Correct fields |
31
+ |---------|-----------------|----------------|
32
+ | `entities[].attributes[]` | `type`, `values`, `rules` | `description`, `unique`, `validation` |
33
+ | `businessRules[]` | `rule`, `condition` (singular) | `name`, `statement`, `conditions[]` |
34
+ | `useCases[]` | `actor`, `linkedBRs`, `linkedFRs` | `primaryActor`, `linkedRules` |
35
+ | `functionalRequirements[]` | `name`, `description`, `linkedUCs`, `linkedBRs` | `statement`, `linkedUseCases`, `linkedRules` |
36
+ | `permissionMatrix` | flat array with `resource`/`roles` | `{permissions[], roleAssignments[]}` |
37
+ | `lifeCycles[].states[]` | string values like `"Active"` | objects with `{id, displayName, color, isTerminal}` |
38
+ | `seedDataCore` | flat object, string values | 5 typed arrays |
39
+ | `gherkinScenarios` | flat scenario array | `{feature, scenarios[]}` nested |
40
+
41
+ ## C. ID Pattern Conformity
42
+
43
+ | ID Type | Pattern | Example |
44
+ |---------|---------|---------|
45
+ | BR | `BR-(VAL\|CALC\|WF\|SEC\|DATA)-{PREFIX}-\d{3}` | BR-VAL-RM-001 |
46
+ | UC | `UC-{PREFIX}-\d{3}` | UC-RM-001 |
47
+ | FR | `FR-{PREFIX}-\d{3}` | FR-RM-001 |
48
+ | Permissions | `business.{app}.{module}.{resource}.{action}` | business.freebike.repairs.create |
49
+
50
+ ## D. Cross-Module ID Uniqueness
51
+
52
+ ```
53
+ SET all_ids = {}
54
+ FOR each module:
55
+ FOR each BR, UC, FR id:
56
+ IF id IN all_ids -> ERROR: "Duplicate {id} in {module1} and {module2}"
57
+ ADD id to all_ids
58
+ ```
59
+
60
+ ## E. Wireframe Layout Completeness
61
+
62
+ ```
63
+ IF missing componentMapping[] -> ERROR
64
+ IF missing layout object -> ERROR
65
+ IF missing layout.regions[] -> ERROR
66
+ FOR each region: IF missing position or components[] -> ERROR
67
+ ```
68
+
69
+ ## F. SeedDataCore Translation Coverage
70
+
71
+ ```
72
+ FOR each navigationModules[].code:
73
+ FOR each language in [fr, en, nl, de]:
74
+ IF NOT EXISTS navigationTranslations[] with moduleCode AND language -> ERROR
75
+ ```
76
+
77
+ ## Result Aggregation
78
+
79
+ ```json
80
+ {
81
+ "structuralChecks": [
82
+ { "check": "required-sections", "module": "...", "status": "PASS|ERROR", "details": "..." },
83
+ { "check": "field-names", "module": "...", "status": "PASS|ERROR", "details": "..." },
84
+ { "check": "id-patterns", "module": "...", "status": "PASS|ERROR", "details": "..." },
85
+ { "check": "id-uniqueness", "module": "...", "status": "PASS|ERROR", "details": "..." },
86
+ { "check": "wireframe-layout", "module": "...", "status": "PASS|ERROR", "details": "..." },
87
+ { "check": "seeddata-translations", "module": "...", "status": "PASS|ERROR", "details": "..." }
88
+ ]
89
+ }
90
+ ```
91
+
92
+ **Blocking rule:** 0 ERROR -> PASS. >=1 ERROR -> BLOCK (attempt auto-fix, re-write, re-check).
@@ -0,0 +1,121 @@
1
+ # FEATURE_DATA & EMBEDDED_ARTIFACTS Build Reference
2
+
3
+ > Reference for step-05b-deploy.md — complete mapping specification for the interactive HTML.
4
+
5
+ ## FEATURE_DATA Object
6
+
7
+ ```javascript
8
+ const FEATURE_DATA = {
9
+ metadata: {
10
+ applicationName: master.application_name,
11
+ applicationId: master.feature_id,
12
+ version: master.version,
13
+ createdAt: ISO_TIMESTAMP,
14
+ vibeCoding: master.metadata.vibeCoding // "enabled" or "disabled" — controls UI section visibility
15
+ },
16
+ cadrage: {
17
+ goal: master.cadrage.goal,
18
+ vision: master.cadrage.vision,
19
+ success_criteria: master.cadrage.success_criteria,
20
+ scope: {
21
+ // CONVERT feature.json keys to HTML keys:
22
+ // mustHave → vital, shouldHave → important, couldHave → optional, outOfScope → excluded
23
+ vital: master.globalScope.mustHave || [],
24
+ important: master.globalScope.shouldHave || [],
25
+ optional: master.globalScope.couldHave || [],
26
+ excluded: master.globalScope.outOfScope || []
27
+ },
28
+ constraints: master.cadrage.constraints || [],
29
+ risks: master.cadrage.risks || [],
30
+ stakeholders: master.stakeholders || []
31
+ },
32
+ modules: [
33
+ {
34
+ moduleCode: module.code,
35
+ moduleName: module.name,
36
+ moduleDescription: module.description || "",
37
+ // ... per-module fields from feature.json
38
+ }
39
+ ],
40
+ moduleSpecs: {
41
+ // CRITICAL: Must have ONE entry per module with ALL module data
42
+ "{moduleCode}": {
43
+ useCases: module.specification.useCases || [],
44
+ businessRules: module.analysis.businessRules || [],
45
+ entities: module.analysis.entities || [],
46
+ permissions: module.specification.permissions || [],
47
+ apiEndpoints: module.specification.apiEndpoints || []
48
+ }
49
+ },
50
+ consolidation: {
51
+ integrations: master.consolidation.integrations || [],
52
+ sharedEntities: master.consolidation.sharedEntities || [],
53
+ sequenceDiagrams: master.consolidation.e2eFlows || []
54
+ },
55
+ handoff: {
56
+ complexity: master.handoff.complexity,
57
+ implementationStrategy: master.handoff.implementationStrategy,
58
+ moduleOrder: master.handoff.moduleOrder,
59
+ filesToCreate: master.handoff.filesToCreate,
60
+ brToCodeMapping: master.handoff.brToCodeMapping,
61
+ apiEndpointSummary: master.handoff.apiEndpointSummary
62
+ }
63
+ };
64
+ ```
65
+
66
+ ### Build Process
67
+
68
+ 1. Extract metadata from master feature.json
69
+ 2. Extract cadrage from master feature.json (CONVERT scope keys)
70
+ 3. Extract stakeholders from master.stakeholders
71
+ 4. Iterate ALL modules and populate moduleSpecs (THIS IS CRITICAL — empty moduleSpecs = BUG)
72
+ 5. For EACH module, extract: useCases, businessRules, entities, permissions, apiEndpoints
73
+ 6. Extract consolidation data (integrations, shared entities, E2E flows)
74
+ 7. Extract handoff section (complexity, strategy, module order, file counts)
75
+
76
+ ## EMBEDDED_ARTIFACTS Object
77
+
78
+ ```javascript
79
+ const EMBEDDED_ARTIFACTS = {
80
+ wireframes: [
81
+ // Extract from each module's specification.uiWireframes
82
+ {
83
+ moduleCode: "{moduleCode}",
84
+ screen: wireframe.screen,
85
+ description: wireframe.description,
86
+ layout: wireframe.layout || "responsive",
87
+ components: wireframe.components || []
88
+ }
89
+ ],
90
+ e2eFlows: [
91
+ // Extract from master consolidation.e2eFlows
92
+ {
93
+ flowName: flow.name,
94
+ description: flow.description,
95
+ sequence: flow.sequence || [],
96
+ modules: flow.modules || []
97
+ }
98
+ ],
99
+ dependencyGraph: {
100
+ // From master consolidation.dependencyGraph
101
+ nodes: master.consolidation.dependencyGraph?.nodes || [],
102
+ edges: master.consolidation.dependencyGraph?.edges || []
103
+ }
104
+ };
105
+ ```
106
+
107
+ ### Artifact Gathering
108
+
109
+ 1. Read each module's `specification.uiWireframes[]` and add to wireframes array
110
+ 2. Read master's `consolidation.e2eFlows[]` and add to e2eFlows array
111
+ 3. Read master's `consolidation.dependencyGraph` and include as-is
112
+ 4. Serialize as JSON with 2-space indentation
113
+
114
+ ## Placeholder Replacement
115
+
116
+ 1. Serialize FEATURE_DATA as JSON (2-space indent)
117
+ 2. Serialize EMBEDDED_ARTIFACTS as JSON (2-space indent)
118
+ 3. Replace `{{FEATURE_DATA}}` with serialized FEATURE_DATA
119
+ 4. Replace `{{EMBEDDED_ARTIFACTS}}` with serialized EMBEDDED_ARTIFACTS
120
+ 5. Replace `{{APPLICATION_NAME}}`, `{{APPLICATION_ID}}`, `{{VERSION}}`, `{{CREATED_AT}}`
121
+ 6. Verify: grep for `{{` to confirm all placeholders replaced
@@ -0,0 +1,49 @@
1
+ # Deploy Mode Support & Troubleshooting
2
+
3
+ > Reference for step-05b-deploy.md — mode variations and common issues.
4
+
5
+ ## Mode Support
6
+
7
+ ### Standard Mode
8
+
9
+ Full handoff with all implementation details:
10
+ - All 7 file categories
11
+ - Complete BR-to-code mapping
12
+ - Full API endpoint summary
13
+ - Detailed prd.json
14
+ - Comprehensive progress tracker
15
+
16
+ ### Micro Mode (use_case = micro)
17
+
18
+ Simplified handoff with minimal scope:
19
+ - Only essential CRUD entity + controller
20
+ - 3 core SeedData entries (omit some optional ones)
21
+ - Basic prd.json with simplified sections
22
+ - Lightweight progress.txt
23
+ - Display `/ralph-loop -r` command for later use
24
+
25
+ ### Delta Mode (use_case = refactoring)
26
+
27
+ Focused handoff for changes:
28
+ - Only affected modules listed
29
+ - Reuse existing implementation patterns
30
+ - Highlight what changed vs baseline
31
+ - Update only affected prd.json sections
32
+ - Progress tracker shows only delta tasks
33
+
34
+ ## Troubleshooting
35
+
36
+ | Issue | Resolution |
37
+ |-------|-----------|
38
+ | All modules missing handoff data | Return to step-05a-handoff.md. Handoff MUST be written to each module feature.json. |
39
+ | prd.json generation failed | Verify ss derive-prd command is installed and feature.json path is correct. |
40
+ | progress.txt incomplete | Ensure all 5 CORE SeedData entries are present per module. Check topological order. |
41
+ | BA manifest not found | Create docs/business/index.json if missing. Use schema provided in section 3. |
42
+ | Manifest entries incorrect | Verify appCode, moduleCode, and version match feature.json metadata exactly. |
43
+ | ba-interactive.html is too small (< 100KB) | FEATURE_DATA not serialized correctly. Verify JSON structure. Re-run FEATURE_DATA build. |
44
+ | moduleSpecs missing from HTML | FEATURE_DATA.moduleSpecs is empty or not included in JSON. Verify each module is iterated and populated. |
45
+ | Scope keys still show "mustHave" instead of "vital" | Conversion from feature.json keys to HTML keys failed. Check cadrage.scope conversion logic. |
46
+ | Wireframes array is empty | Verify each module has specification.uiWireframes. If missing, add wireframe stubs. |
47
+ | dependencyGraph missing | Verify master feature.json has consolidation.dependencyGraph. If missing, create empty nodes/edges arrays. |
48
+ | HTML opens but data blank (localStorage issue) | Clear browser localStorage. HTML will load pre-populated FEATURE_DATA on first load. |
49
+ | Export/re-import fails | Verify exported JSON matches original feature.json schema. Validate with `/business-analyse -x --validate`. |
@@ -0,0 +1,119 @@
1
+ # Handoff File Templates (7 Categories)
2
+
3
+ > **PATH HIERARCHY CONVENTION:** All backend file paths MUST include the context and application hierarchy.
4
+ > - `{ContextPascal}` = PascalCase of `metadata.context` (e.g., `"business"` -> `"Business"`)
5
+ > - `{ApplicationName}` = `metadata.application` (e.g., `"HumanResources"`)
6
+ > - `{ModuleName}` = `metadata.module` (e.g., `"Projects"`)
7
+ >
8
+ > **Controller context-to-folder mapping (`{ContextShort}`):**
9
+ > | metadata.context | Controller Folder |
10
+ > |-----------------|-------------------|
11
+ > | `business` | `Business` |
12
+ > | `platform` | `Admin` |
13
+ > | `personal` | `User` |
14
+
15
+ ## 4.1 Domain Files
16
+
17
+ From `analysis.entities[]`:
18
+
19
+ ```json
20
+ "domain": [
21
+ { "path": "src/Domain/Entities/{ContextPascal}/{ApplicationName}/{ModuleName}/{EntityName}.cs", "type": "Entity", "linkedFRs": [], "linkedUCs": [], "module": "{moduleCode}" }
22
+ ]
23
+ ```
24
+
25
+ Include: Value objects, Enums (`src/Domain/Enums/...`), Domain exceptions (`src/Domain/Exceptions/...`)
26
+
27
+ ## 4.2 Application Files
28
+
29
+ From `analysis.useCases[]`:
30
+
31
+ ```json
32
+ "application": [
33
+ { "path": "src/Application/Services/{ContextPascal}/{ApplicationName}/{ModuleName}/{ServiceName}Service.cs", "type": "Service", "linkedFRs": [], "linkedUCs": [], "module": "{moduleCode}" },
34
+ { "path": "src/Application/DTOs/{ContextPascal}/{ApplicationName}/{ModuleName}/{DtoName}Dto.cs", "type": "Dto", "linkedUCs": [], "module": "{moduleCode}" },
35
+ { "path": "src/Application/Validators/{ContextPascal}/{ApplicationName}/{ModuleName}/{ValidatorName}Validator.cs", "type": "Validator", "linkedFRs": [], "module": "{moduleCode}" }
36
+ ]
37
+ ```
38
+
39
+ Include: Service per UC cluster, DTOs for API contracts, Validators (FluentValidation), Query handlers
40
+
41
+ ## 4.3 Infrastructure Files
42
+
43
+ From `analysis.entities[]`:
44
+
45
+ ```json
46
+ "infrastructure": [
47
+ { "path": "src/Infrastructure/Persistence/Configurations/{ContextPascal}/{ApplicationName}/{ModuleName}/{EntityName}Configuration.cs", "type": "EFConfiguration", "linkedFRs": [], "module": "{moduleCode}" }
48
+ ]
49
+ ```
50
+
51
+ Include: EF Core config per entity, DbSet in IExtensionsDbContext, DI registration, Specifications
52
+
53
+ ## 4.4 API Files
54
+
55
+ From `specification.apiEndpoints[]`:
56
+
57
+ ```json
58
+ "api": [
59
+ { "path": "src/API/Controllers/{ContextShort}/{ApplicationName}/{EntityName}Controller.cs", "type": "ApiController", "linkedUCs": [], "linkedFRs": [], "module": "{moduleCode}" }
60
+ ]
61
+ ```
62
+
63
+ Include: One controller per aggregate root, all HTTP methods, error handling
64
+
65
+ ## 4.5 Frontend Files
66
+
67
+ From `specification.uiWireframes[]`, `specification.dashboards[]` and `analysis.useCases[]`:
68
+
69
+ > **WIREFRAME TRACEABILITY:** Every frontend file MUST include `linkedWireframes[]` referencing wireframe `screen` identifiers.
70
+
71
+ ```json
72
+ "frontend": [
73
+ { "path": "src/pages/{ModuleName}/{PageName}Page.tsx", "type": "Page", "linkedUCs": [], "linkedWireframes": ["{module}-list"], "module": "{moduleCode}", "wireframeAcceptanceCriteria": "Layout MUST match wireframe..." },
74
+ { "path": "src/pages/{ModuleName}/{PageName}DetailPage.tsx", "type": "Page", "linkedUCs": [], "linkedWireframes": ["{module}-detail"], "module": "{moduleCode}" },
75
+ { "path": "src/pages/{ModuleName}/{DashboardName}DashboardPage.tsx", "type": "DashboardPage", "linkedUCs": [], "linkedWireframes": ["{module}-dashboard"], "module": "{moduleCode}", "dashboardRef": "{module}-dashboard", "instructions": "Use Recharts library..." },
76
+ { "path": "src/components/{ModuleName}/{ComponentName}.tsx", "type": "Component", "linkedUCs": [], "linkedWireframes": [], "module": "{moduleCode}" },
77
+ { "path": "src/hooks/use{ModuleName}{Hook}.ts", "type": "Hook", "linkedUCs": [], "module": "{moduleCode}" }
78
+ ]
79
+ ```
80
+
81
+ **Dashboard acceptance criteria:** Chart library (Recharts), chart types matching spec, KPI cards, filters, CSS variables, responsive layout, wireframe-matching positions.
82
+
83
+ ## 4.6 SeedData Files
84
+
85
+ **OBLIGATORY: 5 CORE + business per module:**
86
+
87
+ ```json
88
+ "seedData": [
89
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/NavigationModuleSeedData.cs", "type": "SeedData", "category": "core", "source": "specification.seedDataCore.navigationModules", "module": "{moduleCode}" },
90
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/PermissionsSeedData.cs", "type": "SeedData", "category": "core", "source": "specification.seedDataCore.permissions", "module": "{moduleCode}" },
91
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/RolesSeedData.cs", "type": "SeedData", "category": "core", "source": "specification.seedDataCore.roles", "module": "{moduleCode}" },
92
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/TenantSeedData.cs", "type": "SeedData", "category": "core", "source": "specification.seedDataCore.tenants", "module": "{moduleCode}" },
93
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/UserSeedData.cs", "type": "SeedData", "category": "core", "source": "specification.seedDataCore.users", "module": "{moduleCode}" },
94
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/{Entity}SeedData.cs", "type": "SeedData", "category": "business", "source": "specification.seedDataBusiness.{module}", "module": "{moduleCode}" }
95
+ ]
96
+ ```
97
+
98
+ **For client projects (ExtensionsDbContext), add MANDATORY infrastructure files:**
99
+
100
+ ```json
101
+ [
102
+ { "path": "src/Infrastructure/Persistence/Seeding/{AppPascalName}SeedDataProvider.cs", "type": "IClientSeedDataProvider", "category": "infrastructure", "description": "Runtime provider that injects core seed data into Core schema" },
103
+ { "path": "src/Infrastructure/Persistence/Seeding/DevDataSeeder.cs", "type": "DevDataSeeder", "category": "infrastructure" },
104
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/SeedConstants.cs", "type": "SeedConstants", "category": "infrastructure" }
105
+ ]
106
+ ```
107
+
108
+ **Path convention:** All seed data under `Persistence/Seeding/Data/`. NEVER use `Data/SeedData/`.
109
+
110
+ ## 4.7 Test Files
111
+
112
+ ```json
113
+ "tests": [
114
+ { "path": "src/Tests/Unit/Domain/{ContextPascal}/{ApplicationName}/{ModuleName}/{Entity}Tests.cs", "type": "UnitTests", "linkedFRs": [], "module": "{moduleCode}" },
115
+ { "path": "src/Tests/Unit/Application/{ContextPascal}/{ApplicationName}/{ModuleName}/{ServiceName}ServiceTests.cs", "type": "UnitTests", "linkedFRs": [], "linkedUCs": [], "module": "{moduleCode}" },
116
+ { "path": "src/Tests/Integration/{ContextPascal}/{ApplicationName}/{ModuleName}/{ApiControllerName}ControllerTests.cs", "type": "IntegrationTests", "linkedUCs": [], "module": "{moduleCode}" },
117
+ { "path": "src/Tests/Security/{ContextPascal}/{ApplicationName}/{ModuleName}/{ModuleName}SecurityTests.cs", "type": "SecurityTests", "linkedFRs": [], "module": "{moduleCode}" }
118
+ ]
119
+ ```
@@ -0,0 +1,81 @@
1
+ # Handoff Mappings: BR-to-Code & API Summary
2
+
3
+ ## Business Rules to Code Mapping
4
+
5
+ Derive from `analysis.businessRules[]` of **EACH module**.
6
+
7
+ Generate complete mapping for each BR:
8
+
9
+ ```json
10
+ {
11
+ "brToCodeMapping": [
12
+ {
13
+ "ruleId": "BR-VAL-001",
14
+ "title": "Order total must equal sum of item prices",
15
+ "module": "{moduleCode}",
16
+ "severity": "critical",
17
+ "implementationPoints": [
18
+ { "layer": "Domain", "component": "Order.cs", "method": "CalculateTotal()", "implementation": "Validate sum equals sum of OrderItems.Price" },
19
+ { "layer": "Application", "component": "CreateOrderService.cs", "method": "Handle()", "implementation": "Calculate total before persisting" },
20
+ { "layer": "API", "component": "OrdersController.cs", "method": "CreateOrder()", "implementation": "Return validation error if total mismatch" },
21
+ { "layer": "Frontend", "component": "OrderForm.tsx", "method": "calculateTotal()", "implementation": "Real-time calculation on item change" }
22
+ ]
23
+ }
24
+ ]
25
+ }
26
+ ```
27
+
28
+ For each BR include:
29
+ - **ruleId**: Reference to analysis.businessRules[].id
30
+ - **title**: The rule statement
31
+ - **module**: Which module it belongs to
32
+ - **severity**: "critical", "high", "medium", "low"
33
+ - **implementationPoints**: Array of {layer, component, method, implementation}
34
+
35
+ Layers: Domain, Application, Infrastructure, API, Frontend
36
+
37
+ ## API Endpoint Summary
38
+
39
+ > **ABSOLUTE RULE:** Copy **EXACTLY** from `specification.apiEndpoints[]`. **NEVER** reinvent routes.
40
+
41
+ ```json
42
+ {
43
+ "apiEndpointSummary": [
44
+ {
45
+ "operation": "ListOrders",
46
+ "method": "GET",
47
+ "route": "/api/business/orders",
48
+ "linkedUC": "UC-001",
49
+ "linkedFR": "FR-001",
50
+ "permissions": ["business.orders.read"],
51
+ "requestSchema": { "type": "query", "params": ["pageNumber", "pageSize", "status"] },
52
+ "responseSchema": { "type": "PaginatedOrderDto[]" },
53
+ "errorCodes": [401, 403, 400, 500],
54
+ "module": "{moduleCode}"
55
+ },
56
+ {
57
+ "operation": "CreateOrder",
58
+ "method": "POST",
59
+ "route": "/api/business/orders",
60
+ "linkedUC": "UC-002",
61
+ "linkedFR": "FR-002",
62
+ "permissions": ["business.orders.create"],
63
+ "requestSchema": { "type": "body", "schema": "CreateOrderDto" },
64
+ "responseSchema": { "type": "OrderDto" },
65
+ "errorCodes": [400, 401, 403, 422, 500],
66
+ "module": "{moduleCode}"
67
+ }
68
+ ]
69
+ }
70
+ ```
71
+
72
+ For each endpoint:
73
+ - **operation**: Use case name
74
+ - **method**: HTTP method (GET, POST, PUT, DELETE, PATCH)
75
+ - **route**: Full API path from specification
76
+ - **linkedUC/linkedFR**: Use case and feature requirement IDs
77
+ - **permissions**: Array of exact permission paths
78
+ - **requestSchema**: Input contract (query params or body)
79
+ - **responseSchema**: Output contract
80
+ - **errorCodes**: Expected HTTP error codes
81
+ - **module**: Which module
@@ -161,8 +161,16 @@ function buildPermissionKeys(moduleFeature) {
161
161
  (matrix.roleAssignments || []).forEach(ra => {
162
162
  (ra.permissions || []).forEach(permPath => {
163
163
  const action = permPath.split(".").pop(); // last segment = action
164
- const uiAction = actionMap[action] || action;
165
- keys.push(ra.role + "|" + uiAction);
164
+ if (action === "*") {
165
+ // Wildcard: expand to all standard actions
166
+ Object.values(actionMap).forEach(uiAction => {
167
+ const key = ra.role + "|" + uiAction;
168
+ if (!keys.includes(key)) keys.push(key);
169
+ });
170
+ } else {
171
+ const uiAction = actionMap[action] || action;
172
+ keys.push(ra.role + "|" + uiAction);
173
+ }
166
174
  });
167
175
  });
168
176
  return keys;