@atlashub/smartstack-cli 4.17.1 → 4.18.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 (34) hide show
  1. package/package.json +1 -1
  2. package/templates/agents/ba-reader.md +9 -9
  3. package/templates/agents/ba-writer.md +13 -8
  4. package/templates/skills/business-analyse/SKILL.md +4 -4
  5. package/templates/skills/business-analyse/_rules.md +142 -0
  6. package/templates/skills/business-analyse/questionnaire/10-documentation.md +22 -7
  7. package/templates/skills/business-analyse/references/acceptance-criteria.md +4 -4
  8. package/templates/skills/business-analyse/references/agent-module-prompt.md +13 -9
  9. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +2 -2
  10. package/templates/skills/business-analyse/references/deploy-data-build.md +3 -2
  11. package/templates/skills/business-analyse/references/prd-generation.md +15 -10
  12. package/templates/skills/business-analyse/references/robustness-checks.md +12 -9
  13. package/templates/skills/business-analyse/references/team-orchestration.md +77 -6
  14. package/templates/skills/business-analyse/references/validation-checklist.md +7 -4
  15. package/templates/skills/business-analyse/schemas/shared/common-defs.json +2 -1
  16. package/templates/skills/business-analyse/steps/step-00-init.md +31 -63
  17. package/templates/skills/business-analyse/steps/step-01-cadrage.md +97 -7
  18. package/templates/skills/business-analyse/steps/step-03a1-setup.md +3 -23
  19. package/templates/skills/business-analyse/steps/step-03a2-analysis.md +2 -3
  20. package/templates/skills/business-analyse/steps/step-03b-ui.md +2 -22
  21. package/templates/skills/business-analyse/steps/step-03c-compile.md +44 -139
  22. package/templates/skills/business-analyse/steps/step-03d-validate.md +198 -290
  23. package/templates/skills/business-analyse/steps/step-05a-handoff.md +117 -20
  24. package/templates/skills/ralph-loop/SKILL.md +8 -3
  25. package/templates/skills/ralph-loop/references/category-completeness.md +20 -4
  26. package/templates/skills/ralph-loop/references/compact-loop.md +80 -48
  27. package/templates/skills/ralph-loop/references/init-resume-recovery.md +3 -1
  28. package/templates/skills/ralph-loop/references/parallel-execution.md +27 -27
  29. package/templates/skills/ralph-loop/steps/step-00-init.md +19 -9
  30. package/templates/skills/ralph-loop/steps/step-01-task.md +10 -2
  31. package/templates/skills/ralph-loop/steps/step-02-execute.md +9 -4
  32. package/templates/skills/ralph-loop/steps/step-03-commit.md +1 -1
  33. package/templates/skills/ralph-loop/steps/step-04-check.md +5 -21
  34. package/templates/skills/ralph-loop/steps/step-05-report.md +6 -1
@@ -5,7 +5,7 @@ model: opus
5
5
  next_step: steps/step-03d-validate.md
6
6
  ---
7
7
 
8
- > **Context files:** `_shared.md` | `_module-loop.md`
8
+ > **Context files:** `_shared.md` | `_module-loop.md` | `_rules.md`
9
9
 
10
10
  # Step 3c: Specification Compilation
11
11
 
@@ -16,27 +16,7 @@ next_step: steps/step-03d-validate.md
16
16
  - ALWAYS validate specification completeness before writing
17
17
  - ALL communication in `{language}`
18
18
  - NEVER skip per-module validation
19
- - **ID NAMING RULE (MANDATORY, NO EXCEPTION):**
20
- All IDs MUST include a module prefix to guarantee application-wide uniqueness.
21
- The prefix is derived from the module code initials (2-4 chars):
22
- UserManagement → UM | VehicleManagement → VM | PartsInventory → PI
23
- RepairManagement → RM | MaintenanceSchedule → MS | DataSync → DS
24
- Notifications → NT | Dashboard → DB | Orders → OR | Customers → CU
25
-
26
- Patterns:
27
- UC-{PREFIX}-{NNN} → UC-RM-001, UC-PI-003
28
- BR-{CAT}-{PREFIX}-{NNN} → BR-VAL-RM-001, BR-CALC-PI-002
29
- FR-{PREFIX}-{NNN} → FR-RM-001
30
- OBJ-{PREFIX}-{NNN} → OBJ-RM-001
31
- AC-{PREFIX}-{NNN} → AC-RM-001
32
- RISK-{PREFIX}-{NNN} → RISK-RM-001
33
-
34
- NEVER use bare IDs (UC-001, BR-VAL-001) in multi-module mode.
35
- - **SCHEMA CONFORMITY RULE:**
36
- ALL data MUST fit within the defined feature-schema.json structure.
37
- NEVER create custom top-level fields (KPIDefinitions, ChartConfigurations, etc.)
38
- Dashboard modules MUST use specification.dashboards[] (it exists in the schema).
39
- If truly needed, use specification.extensions: {} (additionalProperties: true).
19
+ - **Rules:** See `_rules.md` § "ID Naming Convention" and § "Schema Conformity" (MANDATORY, NO EXCEPTION)
40
20
 
41
21
  ## YOUR TASK
42
22
 
@@ -195,35 +175,15 @@ Module → Sections → Resources (levels 2-3-4 of the hierarchy).
195
175
 
196
176
  > **CRITICAL:** `specification.navigation.entries[]` is MANDATORY. If absent, auto-generate from sections.
197
177
 
198
- ```javascript
199
- const nav = specification.navigation;
200
- if (!nav || !nav.entries || nav.entries.length === 0) {
201
- console.warn('AUTO-FIX: navigation.entries is empty generating from sections');
202
- const sections = specification.sections || [];
203
- const entries = [
204
- { level: "module", code: "{module}", labels: {fr: "{ModuleName}", en: "{ModuleName}", it: "{ModuleName}", de: "{ModuleName}"}, route: "/{app}/{module}", icon: "list" }
205
- ];
206
- for (const section of sections) {
207
- entries.push({
208
- level: "section",
209
- code: section.code,
210
- labels: {fr: section.name || section.code, en: section.name || section.code, it: section.name || section.code, de: section.name || section.code},
211
- route: section.route || `/{app}/{module}/${section.code}`,
212
- icon: section.icon || "file-text"
213
- });
214
- }
215
- specification.navigation = { entries };
216
- }
217
- // Verify ALL entries have 4 languages
218
- for (const entry of specification.navigation.entries) {
219
- for (const lang of ['fr', 'en', 'it', 'de']) {
220
- if (!entry.labels[lang]) {
221
- entry.labels[lang] = entry.labels['en'] || entry.labels['fr'] || entry.code;
222
- console.warn(`AUTO-FIX: navigation entry "${entry.code}" missing ${lang} label — copied from fallback`);
223
- }
224
- }
225
- }
226
- ```
178
+ **Auto-generation rule:** If `specification.navigation.entries[]` is empty or absent, generate it from `specification.sections[]`:
179
+
180
+ 1. Create a module-level entry: `level: "module"`, `code: {module}`, labels in 4 languages, `route: /{app}/{module}`, `icon: "list"`
181
+ 2. For each section in `specification.sections[]`, create a section-level entry:
182
+ - `code` = section.code
183
+ - `labels` = section.name (or section.code) in all 4 languages
184
+ - `route` = section.route (or `/{app}/{module}/{section.code}`)
185
+ - `icon` = section.icon (or `"file-text"` default)
186
+ 3. **Language completeness:** For every entry, verify all 4 languages (fr, en, it, de) exist in `labels`. If missing, copy from `en` → `fr` → first available value.
227
187
 
228
188
  #### 8f. SeedData Core
229
189
 
@@ -290,31 +250,29 @@ for (const entry of specification.navigation.entries) {
290
250
  > **CRITICAL:** `navigationSections` and `navigationResources` must be generated from `specification.sections[]`.
291
251
  > This ensures the navigation hierarchy (Module → Section → Resource) is complete in the database.
292
252
 
293
- **Transform algorithm:**
294
-
295
- ```javascript
296
- // 1. Transform specification.sections[] into navigationSections
297
- const navigationSections = specification.sections.map((section, index) => ({
298
- code: section.code, // e.g., "list", "detail", "dashboard"
299
- label: section.labels.fr, // Default language (fr)
300
- icon: section.icon, // Lucide icon name
301
- route: section.route, // Full route path
302
- parentCode: metadata.module, // Module code (parent)
303
- permission: section.permission, // Required permission
304
- sort: index + 1 // Display order (1-based)
305
- }));
306
-
307
- // 2. Transform specification.sections[].resources[] into navigationResources
308
- const navigationResources = specification.sections.flatMap(section =>
309
- section.resources.map(resource => ({
310
- code: resource.code, // e.g., "employees-grid"
311
- type: resource.type, // e.g., "SmartTable", "SmartForm"
312
- entity: resource.entity, // e.g., "Employee"
313
- parentCode: section.code, // Section code (parent)
314
- permission: resource.permission // Optional (can inherit from section)
315
- }))
316
- );
317
- ```
253
+ **Transform algorithm (2 steps):**
254
+
255
+ **Step 1 — Sections → navigationSections:** For each section in `specification.sections[]` (indexed from 0), create one entry:
256
+
257
+ | Field | Source |
258
+ |---|---|
259
+ | `code` | `section.code` (e.g., "list", "detail", "dashboard") |
260
+ | `label` | `section.labels.fr` (default language) |
261
+ | `icon` | `section.icon` (Lucide icon name) |
262
+ | `route` | `section.route` (full route path) |
263
+ | `parentCode` | `metadata.module` (module code) |
264
+ | `permission` | `section.permission` |
265
+ | `sort` | index + 1 (1-based display order) |
266
+
267
+ **Step 2 Resources → navigationResources:** For each resource in each section's `resources[]`, create one entry:
268
+
269
+ | Field | Source |
270
+ |---|---|
271
+ | `code` | `resource.code` (e.g., "employees-grid") |
272
+ | `type` | `resource.type` (e.g., "SmartTable", "SmartForm") |
273
+ | `entity` | `resource.entity` (e.g., "Employee") |
274
+ | `parentCode` | `section.code` (parent section code) |
275
+ | `permission` | `resource.permission` (optional, can inherit from section) |
318
276
 
319
277
  **Write seedDataCore to specification:**
320
278
 
@@ -489,35 +447,12 @@ Translation keys for all UI text (4 languages: fr, en, it, de).
489
447
  > **CRITICAL:** i18n keys with missing IT/DE translations are a recurring issue.
490
448
  > This POST-CHECK walks ALL leaf keys and auto-fills missing translations.
491
449
 
492
- ```javascript
493
- const i18n = specification.i18nKeys || {};
494
- const REQUIRED_LANGS = ['fr', 'en', 'it', 'de'];
495
- let missingCount = 0;
496
-
497
- function walkI18n(obj, path) {
498
- if (typeof obj !== 'object' || obj === null) return;
499
- // Leaf node: has at least 'fr' or 'en' as direct string properties
500
- const hasLangKey = REQUIRED_LANGS.some(l => typeof obj[l] === 'string');
501
- if (hasLangKey) {
502
- for (const lang of REQUIRED_LANGS) {
503
- if (!obj[lang] || typeof obj[lang] !== 'string') {
504
- // Fallback: copy from en > fr > first available
505
- obj[lang] = obj['en'] || obj['fr'] || Object.values(obj).find(v => typeof v === 'string') || path;
506
- missingCount++;
507
- }
508
- }
509
- } else {
510
- // Branch node: recurse
511
- for (const key of Object.keys(obj)) {
512
- walkI18n(obj[key], `${path}.${key}`);
513
- }
514
- }
515
- }
516
- walkI18n(i18n, 'i18nKeys');
517
- if (missingCount > 0) {
518
- console.warn(`AUTO-FIX: filled ${missingCount} missing i18n translations (IT/DE fallbacks from EN/FR)`);
519
- }
520
- ```
450
+ **Auto-fill rule:** Traverse all nodes in `specification.i18nKeys` recursively.
451
+
452
+ - A **leaf node** is any object that has at least one key among `fr`, `en`, `it`, `de` whose value is a string.
453
+ - For each leaf node, ensure all 4 language keys exist as strings.
454
+ - **Fallback order** for missing languages: copy from `en` → `fr` → first available string value in the node.
455
+ - Log the count of auto-filled translations as a warning.
521
456
 
522
457
  ---
523
458
 
@@ -530,7 +465,7 @@ Before loading step-03d-validate, verify all 12 subsections (8a-8l) are populate
530
465
  3. **8c. Functional Requirements** - At least 4 FRs with linked UCs and BRs
531
466
  4. **8d. Permission Matrix** - Resources and role assignments defined
532
467
  5. **8e. Navigation** - Module, sections, and resource routes specified
533
- 6. **8f. SeedData Core** - All 7 arrays populated with structured objects (navigationModules, navigationSections, navigationResources, navigationTranslations, permissions, rolePermissions, permissionConstants)
468
+ 6. **8f. SeedData Core** - All 9 arrays populated with structured objects (navigationApplications, applicationRoles, navigationModules, navigationSections, navigationResources, navigationTranslations, permissions, rolePermissions, permissionConstants)
534
469
  7. **8g. Gherkin Scenarios** - BDD scenarios for each major UC
535
470
  8. **8h. Validations** - Field rules with error message keys
536
471
  9. **8i. Business Messages** - Minimum 4 messages (success, error CRUD, validation, permission)
@@ -558,39 +493,9 @@ Before loading step-03d-validate, verify all 12 subsections (8a-8l) are populate
558
493
  > They run BEFORE the SCHEMA UNIFORMITY comparative check, ensuring the first module has the
559
494
  > correct format before being used as baseline for subsequent modules.
560
495
 
561
- ```javascript
562
- // Gherkin MUST be array (not single object)
563
- if (!Array.isArray(specification.gherkinScenarios)) {
564
- console.warn('AUTO-FIX: gherkinScenarios is object, wrapping in array');
565
- specification.gherkinScenarios = [specification.gherkinScenarios];
566
- }
567
-
568
- // Validations[].rules MUST be array (not singular rule string)
569
- for (const v of specification.validations || []) {
570
- if (typeof v.rules === 'string') { v.rules = [v.rules]; }
571
- if (v.rule && !v.rules) {
572
- v.rules = Array.isArray(v.rule) ? v.rule : [v.rule];
573
- delete v.rule;
574
- }
575
- }
576
-
577
- // Messages MUST have "message" field (not only "description")
578
- for (const m of specification.messages || []) {
579
- if (!m.message && m.description) { m.message = m.description; }
580
- }
581
-
582
- // Wireframes MUST use canonical field names
583
- const wireframes = specification.uiWireframes || specification.wireframes || [];
584
- for (const wf of wireframes) {
585
- if (wf.title && !wf.screen) { wf.screen = wf.title; delete wf.title; }
586
- if (wf.ascii && !wf.mockup) { wf.mockup = wf.ascii; delete wf.ascii; }
587
- if (wf.content && !wf.mockup) { wf.mockup = wf.content; delete wf.content; }
588
- if (wf.name && !wf.screen) { wf.screen = wf.name; delete wf.name; }
589
- }
590
- specification.uiWireframes = wireframes;
591
-
592
- // Entity attributes MUST have "type" field (already checked in ENTITY ATTRIBUTE FORMAT POST-CHECK above)
593
- ```
496
+ > **Rules:** Apply `_rules.md` § "Format Checks" and § "Auto-Fix: Wireframe Field Names" to all specification data before proceeding.
497
+ >
498
+ > Specifically: wrap gherkin in array if needed, normalize validation rules to arrays, ensure messages have `message` field, normalize wireframe field names, verify entity attribute types.
594
499
 
595
500
  **SCHEMA UNIFORMITY CHECK (multi-module mode):**
596
501
  IF this is NOT the first module in moduleOrder: