@atlashub/smartstack-cli 3.0.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/.documentation/agents.html +1 -371
  2. package/.documentation/cli-commands.html +1 -1
  3. package/.documentation/commands.html +1 -1
  4. package/.documentation/efcore.html +1 -1
  5. package/.documentation/gitflow.html +1 -1
  6. package/.documentation/hooks.html +27 -66
  7. package/.documentation/index.html +166 -166
  8. package/.documentation/init.html +6 -7
  9. package/.documentation/installation.html +1 -1
  10. package/.documentation/prd-json-v2.0.0.md +396 -0
  11. package/.documentation/ralph-loop.html +1 -9
  12. package/.documentation/test-web.html +15 -39
  13. package/.documentation/testing-ba-e2e.md +462 -0
  14. package/dist/index.js +23 -16
  15. package/dist/index.js.map +1 -1
  16. package/package.json +6 -2
  17. package/templates/agents/gitflow/merge.md +56 -6
  18. package/templates/agents/gitflow/pr.md +70 -9
  19. package/templates/project/appsettings.json.template +8 -2
  20. package/templates/skills/business-analyse/SKILL.md +34 -17
  21. package/templates/skills/business-analyse/html/ba-interactive.html +147 -84
  22. package/templates/skills/business-analyse/questionnaire.md +20 -15
  23. package/templates/skills/business-analyse/steps/step-00-init.md +80 -57
  24. package/templates/skills/business-analyse/steps/step-03-specify.md +57 -0
  25. package/templates/skills/business-analyse/steps/step-05-handoff.md +480 -14
  26. package/templates/skills/business-analyse/steps/step-06-extract.md +131 -3
  27. package/templates/skills/gitflow/steps/step-pr.md +17 -5
  28. package/templates/skills/ralph-loop/SKILL.md +158 -33
  29. package/templates/skills/ralph-loop/steps/step-01-task.md +160 -18
  30. package/templates/skills/ralph-loop/steps/step-02-execute.md +408 -23
  31. package/templates/skills/ralph-loop/steps/step-03-commit.md +82 -0
  32. package/templates/skills/ralph-loop/steps/step-04-check.md +305 -9
  33. package/templates/skills/ralph-loop/steps/step-05-report.md +115 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlashub/smartstack-cli",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "SmartStack Claude Code automation toolkit - GitFlow, EF Core migrations, prompts and more",
5
5
  "author": {
6
6
  "name": "SmartStack",
@@ -72,7 +72,11 @@
72
72
  "health": "node dist/index.js doctor --json",
73
73
  "test:mcp": "vitest run --config vitest.mcp.config.ts",
74
74
  "test:mcp:watch": "vitest --config vitest.mcp.config.ts",
75
- "test:mcp:coverage": "vitest run --config vitest.mcp.config.ts --coverage"
75
+ "test:mcp:coverage": "vitest run --config vitest.mcp.config.ts --coverage",
76
+ "test:ba": "vitest run --config vitest.ba.config.ts",
77
+ "test:ba:watch": "vitest --config vitest.ba.config.ts",
78
+ "test:ba:coverage": "vitest run --config vitest.ba.config.ts --coverage",
79
+ "test:all": "npm run test:mcp && npm run test:ba"
76
80
  },
77
81
  "dependencies": {
78
82
  "@modelcontextprotocol/sdk": "^1.0.0",
@@ -12,9 +12,48 @@ Safe PR merge with review checklist. Supports GitHub and Azure DevOps.
12
12
 
13
13
  ## EXECUTION SEQUENCE
14
14
 
15
- ### 1. Detect Provider and Load PR Context
15
+ ### 1. Load GitFlow Config (MANDATORY)
16
16
 
17
17
  ```bash
18
+ # Find and verify config exists
19
+ CONFIG_FILE=""
20
+ if [ -f ".claude/gitflow/config.json" ]; then
21
+ CONFIG_FILE=".claude/gitflow/config.json"
22
+ elif [ -f ".gitflow/config.json" ]; then
23
+ CONFIG_FILE=".gitflow/config.json"
24
+ else
25
+ # Try develop worktree
26
+ DEVELOP_PATH=$(git worktree list --porcelain 2>/dev/null | grep -A1 "branch refs/heads/develop" | grep "^worktree " | sed 's/^worktree //')
27
+ if [ -n "$DEVELOP_PATH" ] && [ -f "$DEVELOP_PATH/.claude/gitflow/config.json" ]; then
28
+ CONFIG_FILE="$DEVELOP_PATH/.claude/gitflow/config.json"
29
+ elif [ -n "$DEVELOP_PATH" ] && [ -f "$DEVELOP_PATH/.gitflow/config.json" ]; then
30
+ CONFIG_FILE="$DEVELOP_PATH/.gitflow/config.json"
31
+ fi
32
+ fi
33
+
34
+ # CRITICAL: Block if no config
35
+ if [ -z "$CONFIG_FILE" ] || [ ! -f "$CONFIG_FILE" ]; then
36
+ echo "❌ GitFlow config not found"
37
+ echo "→ Run: /gitflow init"
38
+ exit 1
39
+ fi
40
+
41
+ # Extract config values
42
+ GF_PROVIDER=$(grep -oP '"provider":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
43
+ GF_MAIN_BRANCH=$(grep -oP '"main":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
44
+ GF_DEVELOP_BRANCH=$(grep -oP '"develop":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
45
+
46
+ # Validate required values
47
+ if [ -z "$GF_MAIN_BRANCH" ] || [ -z "$GF_DEVELOP_BRANCH" ]; then
48
+ echo "❌ Invalid GitFlow config (missing branches)"
49
+ exit 1
50
+ fi
51
+ ```
52
+
53
+ ### 2. Detect Provider and Load PR Context
54
+
55
+ ```bash
56
+ # Detect provider
18
57
  REMOTE_URL=$(git remote get-url origin 2>/dev/null)
19
58
  if [[ "$REMOTE_URL" == *"dev.azure.com"* ]]; then
20
59
  GIT_PROVIDER="azuredevops"
@@ -25,12 +64,23 @@ fi
25
64
  CURRENT=$(git rev-parse --abbrev-ref HEAD)
26
65
  BRANCH_TYPE=$(echo $CURRENT | cut -d'/' -f1)
27
66
 
67
+ # Determine target branch (using config values)
68
+ case "$BRANCH_TYPE" in
69
+ feature) TARGET="$GF_DEVELOP_BRANCH" ;;
70
+ release) TARGET="$GF_MAIN_BRANCH" ;;
71
+ hotfix) TARGET="$GF_MAIN_BRANCH" ;;
72
+ *) TARGET="$GF_DEVELOP_BRANCH" ;;
73
+ esac
74
+
75
+ echo "✓ Config loaded: $CONFIG_FILE"
76
+ echo "✓ Branch: $CURRENT → Target: $TARGET"
77
+
28
78
  # Find PR for current branch
29
79
  # GitHub: gh pr list --head "$CURRENT"
30
80
  # Azure DevOps: az repos pr list --source-branch "$CURRENT"
31
81
  ```
32
82
 
33
- ### 2. Determine Merge Strategy
83
+ ### 3. Determine Merge Strategy
34
84
 
35
85
  | Type | Strategy | Delete Branch |
36
86
  |------|----------|---------------|
@@ -38,7 +88,7 @@ BRANCH_TYPE=$(echo $CURRENT | cut -d'/' -f1)
38
88
  | Release | merge --no-ff | yes |
39
89
  | Hotfix | merge --no-ff | yes |
40
90
 
41
- ### 3. Review Checklist
91
+ ### 4. Review Checklist
42
92
 
43
93
  Display review checklist:
44
94
  - Build status (pass/fail)
@@ -47,7 +97,7 @@ Display review checklist:
47
97
  - Conflicts (none/detected)
48
98
  - CI status (if available)
49
99
 
50
- ### 4. Execute Merge
100
+ ### 5. Execute Merge
51
101
 
52
102
  **GitHub:**
53
103
  ```bash
@@ -67,7 +117,7 @@ az repos pr update --id $PR_ID --status completed --squash true --delete-source-
67
117
  az repos pr update --id $PR_ID --status completed --squash false --delete-source-branch true
68
118
  ```
69
119
 
70
- ### 5. Verify Merge
120
+ ### 6. Verify Merge
71
121
 
72
122
  ```bash
73
123
  # Force update tracking refs
@@ -78,7 +128,7 @@ git fetch origin --prune --quiet
78
128
  MERGED=$(git branch -r --merged origin/$TARGET | grep "$CURRENT" | wc -l)
79
129
  ```
80
130
 
81
- ### 6. Summary
131
+ ### 7. Summary
82
132
 
83
133
  ```
84
134
  PR MERGED
@@ -14,21 +14,68 @@ Create PR with auto-generated description, Azure DevOps and GitHub support.
14
14
 
15
15
  ## EXECUTION SEQUENCE
16
16
 
17
- ### 1. Detect Provider and Branch Context
17
+ ### 1. Load GitFlow Config (MANDATORY)
18
18
 
19
19
  ```bash
20
- # Detect provider from remote URL
21
- REMOTE_URL=$(git remote get-url origin 2>/dev/null)
22
- if [[ "$REMOTE_URL" == *"dev.azure.com"* ]] || [[ "$REMOTE_URL" == *"visualstudio.com"* ]]; then
23
- GIT_PROVIDER="azuredevops"
24
- # Extract Azure DevOps details
20
+ # Find and verify config exists
21
+ CONFIG_FILE=""
22
+ if [ -f ".claude/gitflow/config.json" ]; then
23
+ CONFIG_FILE=".claude/gitflow/config.json"
24
+ elif [ -f ".gitflow/config.json" ]; then
25
+ CONFIG_FILE=".gitflow/config.json"
26
+ else
27
+ # Try develop worktree
28
+ DEVELOP_PATH=$(git worktree list --porcelain 2>/dev/null | grep -A1 "branch refs/heads/develop" | grep "^worktree " | sed 's/^worktree //')
29
+ if [ -n "$DEVELOP_PATH" ] && [ -f "$DEVELOP_PATH/.claude/gitflow/config.json" ]; then
30
+ CONFIG_FILE="$DEVELOP_PATH/.claude/gitflow/config.json"
31
+ elif [ -n "$DEVELOP_PATH" ] && [ -f "$DEVELOP_PATH/.gitflow/config.json" ]; then
32
+ CONFIG_FILE="$DEVELOP_PATH/.gitflow/config.json"
33
+ fi
34
+ fi
35
+
36
+ # CRITICAL: Block if no config
37
+ if [ -z "$CONFIG_FILE" ] || [ ! -f "$CONFIG_FILE" ]; then
38
+ echo "❌ GitFlow config not found"
39
+ echo "→ Run: /gitflow init"
40
+ exit 1
41
+ fi
42
+
43
+ # Extract config values
44
+ GF_PROVIDER=$(grep -oP '"provider":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
45
+ GF_MAIN_BRANCH=$(grep -oP '"main":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
46
+ GF_DEVELOP_BRANCH=$(grep -oP '"develop":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
47
+ GF_REMOTE_URL=$(grep -oP '"remoteUrl":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
48
+
49
+ # Validate required values
50
+ if [ -z "$GF_MAIN_BRANCH" ] || [ -z "$GF_DEVELOP_BRANCH" ]; then
51
+ echo "❌ Invalid GitFlow config (missing branches)"
52
+ exit 1
53
+ fi
54
+ ```
55
+
56
+ ### 2. Detect Provider and Branch Context
57
+
58
+ ```bash
59
+ # Detect provider from config or remote URL
60
+ if [ -z "$GF_PROVIDER" ]; then
61
+ REMOTE_URL=$(git remote get-url origin 2>/dev/null)
62
+ if [[ "$REMOTE_URL" == *"dev.azure.com"* ]] || [[ "$REMOTE_URL" == *"visualstudio.com"* ]]; then
63
+ GIT_PROVIDER="azuredevops"
64
+ else
65
+ GIT_PROVIDER="github"
66
+ fi
67
+ else
68
+ GIT_PROVIDER="$GF_PROVIDER"
69
+ fi
70
+
71
+ # Extract Azure DevOps details if needed
72
+ if [ "$GIT_PROVIDER" = "azuredevops" ]; then
73
+ REMOTE_URL="${GF_REMOTE_URL:-$(git remote get-url origin 2>/dev/null)}"
25
74
  [[ "$REMOTE_URL" =~ dev\.azure\.com/([^/]+)/([^/]+)/_git/([^/]+) ]] && {
26
75
  AZURE_ORG="${BASH_REMATCH[1]}"
27
76
  AZURE_PROJECT="${BASH_REMATCH[2]}"
28
77
  AZURE_REPO="${BASH_REMATCH[3]}"
29
78
  }
30
- else
31
- GIT_PROVIDER="github"
32
79
  fi
33
80
 
34
81
  # Get current branch (worktree-compatible)
@@ -37,7 +84,21 @@ BRANCH_TYPE=$(echo $CURRENT | cut -d'/' -f1)
37
84
  BRANCH_NAME=$(echo $CURRENT | sed 's/.*\///')
38
85
  ```
39
86
 
40
- ### 2. Determine Target Branch
87
+ ### 3. Determine Target Branch
88
+
89
+ ```bash
90
+ # Map branch type to target branch (using config values)
91
+ case "$BRANCH_TYPE" in
92
+ feature) TARGET="$GF_DEVELOP_BRANCH" ;;
93
+ release) TARGET="$GF_MAIN_BRANCH" ;;
94
+ hotfix) TARGET="$GF_MAIN_BRANCH" ;;
95
+ *) TARGET="$GF_DEVELOP_BRANCH" ;;
96
+ esac
97
+
98
+ echo "✓ Config loaded: $CONFIG_FILE"
99
+ echo "✓ Branch: $CURRENT (type: $BRANCH_TYPE)"
100
+ echo "✓ Target: $TARGET"
101
+ ```
41
102
 
42
103
  | Type | Target | Reason |
43
104
  |------|--------|--------|
@@ -8,7 +8,6 @@
8
8
  "EnableDevSeeding": false
9
9
  },
10
10
  "Jwt": {
11
- "Secret": "{{GenerateRandomSecret}}",
12
11
  "Issuer": "{{ProjectName}}",
13
12
  "Audience": "{{ProjectName}}",
14
13
  "AccessTokenExpirationMinutes": 60,
@@ -132,6 +131,10 @@
132
131
  "SenderAddress": ""
133
132
  }
134
133
  },
134
+ "Zefix": {
135
+ "Username": "",
136
+ "Password": ""
137
+ },
135
138
  "Entra": {
136
139
  "TenantId": "",
137
140
  "ClientId": "",
@@ -140,10 +143,13 @@
140
143
  "SyncIntervalMinutes": 60,
141
144
  "UseDeltaSync": true,
142
145
  "DefaultConflictResolution": "ManualReview",
143
- "AutoCreateReferences": true
146
+ "AutoCreateReferences": true,
147
+ "BackgroundSyncEnabled": false,
148
+ "BackgroundSyncIntervalMinutes": 60
144
149
  },
145
150
  "MultiTenant": {
146
151
  "Enabled": true,
152
+ "EnableB2B": true,
147
153
  "EnableB2C": true,
148
154
  "SystemTenantSlug": "default",
149
155
  "SystemTenantName": "Default Workspace",
@@ -1,11 +1,17 @@
1
1
  ---
2
2
  name: business-analyse
3
- description: Business Analysis v5.0 - Iterative multi-module workflow with 5-level navigation hierarchy, client checkpoints, interactive HTML documentation, and extraction pipeline.
3
+ description: Business Analysis v6.1 - Iterative multi-module workflow with optimized performance (schema caching), automatic skill launch transition, and streamlined execution.
4
4
  argument-hint: "[-a] [-e] [-q <FEAT-ID> \"question\"] [-r <FEAT-ID> \"change\"] [-m] [-x <json-path>] <feature description>"
5
5
  ---
6
6
 
7
7
  <objective>
8
8
  Execute VibeCoding-focused business analysis workflows. This skill produces a single feature.json progressively enriched at each step, published to docs/business/ for web app rendering. Supports 5 use cases: new feature analysis, questions about existing features, feature refactoring, one-shot micro-features, and extraction from interactive HTML documentation.
9
+
10
+ **New in v6.1:**
11
+ - ⚡ **Performance:** Schema deployment caching (~75% faster subsequent runs)
12
+ - 🚀 **Seamless transition:** Automatic launch of chosen development approach (Ralph Loop / Feature Full)
13
+ - 🎯 **Simplified:** Removed interactive mode (-i flag), streamlined execution
14
+ - 📂 **Modern only:** Legacy `.business-analyse/` structure no longer supported
9
15
  </objective>
10
16
 
11
17
  <quick_start>
@@ -50,7 +56,6 @@ See `<parameters>` for complete flag list.
50
56
  | `-m` | `--micro` | Micro-feature mode: minimal questions, direct handoff |
51
57
  | `-x` | `--extract` | Extract mode: import from interactive HTML export JSON (requires json-path) |
52
58
  | `-app` | `--application` | Application mode: multi-module analysis with module decomposition |
53
- | `-i` | `--interactive` | Interactive mode: configure flags via AskUserQuestion |
54
59
 
55
60
  **Disable flags (turn OFF):**
56
61
  | Short | Long | Description |
@@ -178,6 +183,10 @@ When provided, step-00 will:
178
183
  - Per-module validation + client confirmation
179
184
  - **Step 04:** Cross-module consolidation (consolidated)
180
185
  - **Step 05:** Handoff with per-module prd.json (handed-off)
186
+ - **NEW v6.1:** User chooses development approach (AskUserQuestion)
187
+ - **If "Ralph Loop":** Automatic launch → `/ralph-loop` (seamless transition)
188
+ - **If "Feature Full":** Automatic launch → `/feature-full` (parallel generation)
189
+ - **If "Terminer":** BA ends, manual development
181
190
 
182
191
  **Single module workflow (same phases, simplified):**
183
192
  - **Step 00:** Parse flags, create master feature.json (draft)
@@ -186,10 +195,12 @@ When provided, step-00 will:
186
195
  - **Step 03:** Specification: single iteration (specified)
187
196
  - **Step 04:** Consolidation: auto-pass (consolidated)
188
197
  - **Step 05:** Handoff (handed-off)
198
+ - **NEW v6.1:** Automatic skill launch based on user choice
189
199
 
190
200
  **Micro workflow:**
191
201
  - **Step 00:** Create minimal feature.json
192
202
  - **Step 05:** Direct handoff (skip 01-04)
203
+ - **NEW v6.1:** Automatic skill launch
193
204
 
194
205
  **Extract workflow (from interactive HTML):**
195
206
  - **Step 00:** Parse `-x` flag, validate JSON file
@@ -244,21 +255,27 @@ Load ONLY relevant categories based on feature type:
244
255
 
245
256
  | Categorie | Fichier | Questions | Quand charger |
246
257
  | --------- | ------------------------------------- | --------- | ------------- |
247
- | 00 | `questionnaire/00-application.md` | 8 | Si mode application |
248
- | 01 | `questionnaire/01-context.md` | 12 | Toujours |
249
- | 02 | `questionnaire/02-stakeholders.md` | 14 | Toujours |
250
- | 03 | `questionnaire/03-scope.md` | 12 | Toujours |
251
- | 04 | `questionnaire/04-data.md` | 8 | Si module oriente donnees |
252
- | 05 | `questionnaire/05-integrations.md` | 8 | Si integrations |
253
- | 06 | `questionnaire/06-security.md` | 8 | Si securite mentionnee |
254
- | 07 | `questionnaire/07-ui.md` | 12 | Si module oriente interface |
255
- | 08 | `questionnaire/08-performance.md` | 4 | Si performance critique |
256
- | 09 | `questionnaire/09-constraints.md` | 4 | Si contraintes |
257
- | 10 | `questionnaire/10-documentation.md` | 4 | Si documentation requise |
258
- | 14 | `questionnaire/14-risk-assumptions.md`| 8 | Toujours |
259
- | 15 | `questionnaire/15-success-metrics.md` | 8 | Toujours |
260
-
261
- **Total noyau : ~86 questions (en profondeur, langage business)**
258
+ | 00 | `questionnaire/00-application.md` | 18 | Si mode application |
259
+ | 01 | `questionnaire/01-context.md` | 32 | Toujours |
260
+ | 02 | `questionnaire/02-stakeholders.md` | 33 | Toujours |
261
+ | 03 | `questionnaire/03-scope.md` | 32 | Toujours |
262
+ | 04 | `questionnaire/04-data.md` | 15 | Si module oriente donnees |
263
+ | 05 | `questionnaire/05-integrations.md` | 14 | Si integrations |
264
+ | 06 | `questionnaire/06-security.md` | 13 | Si securite mentionnee |
265
+ | 07 | `questionnaire/07-ui.md` | 19 | Si module oriente interface |
266
+ | 08 | `questionnaire/08-performance.md` | 8 | Si performance critique |
267
+ | 09 | `questionnaire/09-constraints.md` | 6 | Si contraintes |
268
+ | 10 | `questionnaire/10-documentation.md` | 7 | Si documentation requise |
269
+ | 11 | `questionnaire/11-data-lifecycle.md` | 14 | Si lifecycle requis (retention, archivage, RGPD) |
270
+ | 12 | `questionnaire/12-migration.md` | 14 | Si nouveau module (migration donnees existantes) |
271
+ | 13 | `questionnaire/13-cross-module.md` | 14 | Si nouveau module OU references autres modules |
272
+ | 14 | `questionnaire/14-risk-assumptions.md`| 16 | Toujours |
273
+ | 15 | `questionnaire/15-success-metrics.md` | 17 | Toujours |
274
+
275
+ **Total noyau (toujours chargés) : 130 questions** (contexte, acteurs, périmètre, risques, métriques)
276
+ **Total avec application : 148 questions** (+ identité application si mode multi-module)
277
+ **Total conditionnel : 124 questions** (data, intégrations, sécurité, UI, performance, contraintes, doc, lifecycle, migration, cross-module)
278
+ **Total maximum possible : 272 questions** (noyau + application + tous conditionnels chargés)
262
279
 
263
280
  </questionnaire_files>
264
281
 
@@ -374,6 +374,95 @@
374
374
  min-height: 200px;
375
375
  }
376
376
 
377
+ /* Wireframe rendering */
378
+ .ascii-wireframe {
379
+ font-family: 'Courier New', 'Consolas', monospace;
380
+ font-size: 0.7rem;
381
+ line-height: 1.3;
382
+ color: var(--primary-light);
383
+ background: var(--bg-dark);
384
+ padding: 1rem;
385
+ border-radius: 6px;
386
+ overflow-x: auto;
387
+ white-space: pre;
388
+ margin: 0;
389
+ }
390
+
391
+ .svg-wireframe {
392
+ background: var(--bg-dark);
393
+ padding: 1rem;
394
+ border-radius: 6px;
395
+ overflow-x: auto;
396
+ }
397
+
398
+ .svg-wireframe svg {
399
+ max-width: 100%;
400
+ height: auto;
401
+ }
402
+
403
+ .wireframe-description {
404
+ padding: 0.75rem 1rem;
405
+ font-size: 0.85rem;
406
+ color: var(--text);
407
+ border-top: 1px solid var(--border);
408
+ background: var(--bg-input);
409
+ }
410
+
411
+ .wireframe-metadata {
412
+ padding: 0.75rem 1rem;
413
+ font-size: 0.8rem;
414
+ color: var(--text-muted);
415
+ border-top: 1px solid var(--border);
416
+ }
417
+
418
+ .wireframe-details {
419
+ padding: 0.75rem 1rem;
420
+ border-top: 1px solid var(--border);
421
+ background: var(--bg-input);
422
+ }
423
+
424
+ .wireframe-details summary {
425
+ cursor: pointer;
426
+ font-size: 0.85rem;
427
+ color: var(--primary-light);
428
+ font-weight: 500;
429
+ user-select: none;
430
+ }
431
+
432
+ .wireframe-details summary:hover {
433
+ color: var(--primary);
434
+ }
435
+
436
+ .mapping-table {
437
+ width: 100%;
438
+ margin-top: 0.75rem;
439
+ border-collapse: collapse;
440
+ font-size: 0.8rem;
441
+ }
442
+
443
+ .mapping-table th {
444
+ background: var(--bg-hover);
445
+ padding: 0.5rem;
446
+ text-align: left;
447
+ font-weight: 500;
448
+ color: var(--text-bright);
449
+ border: 1px solid var(--border);
450
+ }
451
+
452
+ .mapping-table td {
453
+ padding: 0.5rem;
454
+ border: 1px solid var(--border);
455
+ color: var(--text);
456
+ }
457
+
458
+ .mapping-table code {
459
+ background: var(--bg-dark);
460
+ padding: 0.2rem 0.4rem;
461
+ border-radius: 3px;
462
+ font-size: 0.75rem;
463
+ color: var(--accent);
464
+ }
465
+
377
466
  /* Mockup components */
378
467
  .mock-header {
379
468
  display: flex;
@@ -1406,33 +1495,8 @@
1406
1495
  DATA STORE
1407
1496
  ============================================ */
1408
1497
  const APP_KEY = 'ba-{{APPLICATION_ID}}';
1409
- let data = {
1410
- metadata: {
1411
- applicationName: '{{APPLICATION_NAME}}',
1412
- applicationId: '{{APPLICATION_ID}}',
1413
- version: '{{VERSION}}',
1414
- createdAt: '{{CREATED_AT}}',
1415
- lastModified: new Date().toISOString()
1416
- },
1417
- cadrage: {
1418
- problem: {},
1419
- current: {},
1420
- vision: {},
1421
- stakeholders: [],
1422
- scope: { vital: [], important: [], optional: [], excluded: [] },
1423
- risks: [],
1424
- assumptions: '',
1425
- success: {}
1426
- },
1427
- modules: [],
1428
- dependencies: [],
1429
- moduleSpecs: {},
1430
- consolidation: {
1431
- interactions: [],
1432
- e2eFlows: []
1433
- },
1434
- handoff: {}
1435
- };
1498
+ let data = {{FEATURE_DATA}};
1499
+ const EMBEDDED_ARTIFACTS = {{EMBEDDED_ARTIFACTS}};
1436
1500
 
1437
1501
  /* ============================================
1438
1502
  INITIALIZATION
@@ -1708,7 +1772,8 @@
1708
1772
  modules: data.modules,
1709
1773
  dependencies: data.dependencies,
1710
1774
  moduleSpecifications: {},
1711
- consolidation: data.consolidation
1775
+ consolidation: data.consolidation,
1776
+ artifacts: EMBEDDED_ARTIFACTS // NEW: Include visual artifacts
1712
1777
  };
1713
1778
 
1714
1779
  // Structure module specs for export
@@ -1726,8 +1791,8 @@
1726
1791
  })),
1727
1792
  entities: spec.entities || [],
1728
1793
  permissions: spec.permissions || [],
1729
- notes: spec.notes || '',
1730
- mockupNotes: spec.mockupNotes || ''
1794
+ notes: spec.notes || ''
1795
+ // mockupNotes removed: wireframes now in artifacts
1731
1796
  };
1732
1797
  });
1733
1798
 
@@ -2158,60 +2223,9 @@
2158
2223
 
2159
2224
  <!-- TAB: Maquettes -->
2160
2225
  <div class="tab-panel" id="tab-${code}-mock">
2161
- <p style="font-size:0.85rem;color:var(--text-muted);margin-bottom:1rem;">Exemples visuels des ecrans principaux de ce domaine. Ces maquettes montrent la disposition generale, pas le design final.</p>
2162
-
2163
- <div class="mockup-frame">
2164
- <div class="mockup-toolbar">
2165
- <div class="mockup-dot mockup-dot-red"></div>
2166
- <div class="mockup-dot mockup-dot-yellow"></div>
2167
- <div class="mockup-dot mockup-dot-green"></div>
2168
- <span class="mockup-title">${mod.name} - Liste</span>
2169
- </div>
2170
- <div class="mockup-content">
2171
- <div class="mock-header">
2172
- <div class="mock-title">${mod.name}</div>
2173
- <div class="mock-btn">+ Nouveau</div>
2174
- </div>
2175
- <div class="mock-search">Rechercher...</div>
2176
- <table class="mock-table">
2177
- <thead><tr>
2178
- ${(mod.entities || []).slice(0, 1).length > 0 ? '<th>Identifiant</th><th>Nom</th><th>Statut</th><th>Date</th><th>Actions</th>' : '<th>Colonne 1</th><th>Colonne 2</th><th>Statut</th><th>Actions</th>'}
2179
- </tr></thead>
2180
- <tbody>
2181
- <tr><td style="color:var(--primary-light);">001</td><td>Exemple 1</td><td><span class="mock-status mock-status-active">Actif</span></td><td>Aujourd'hui</td><td style="color:var(--text-muted);">Voir | Modifier</td></tr>
2182
- <tr><td style="color:var(--primary-light);">002</td><td>Exemple 2</td><td><span class="mock-status mock-status-pending">En attente</span></td><td>Hier</td><td style="color:var(--text-muted);">Voir | Modifier</td></tr>
2183
- <tr><td style="color:var(--primary-light);">003</td><td>Exemple 3</td><td><span class="mock-status mock-status-draft">Brouillon</span></td><td>Il y a 3 jours</td><td style="color:var(--text-muted);">Voir | Modifier</td></tr>
2184
- </tbody>
2185
- </table>
2186
- </div>
2187
- </div>
2188
-
2189
- <div class="mockup-frame" style="margin-top:1rem;">
2190
- <div class="mockup-toolbar">
2191
- <div class="mockup-dot mockup-dot-red"></div>
2192
- <div class="mockup-dot mockup-dot-yellow"></div>
2193
- <div class="mockup-dot mockup-dot-green"></div>
2194
- <span class="mockup-title">${mod.name} - Formulaire de creation</span>
2195
- </div>
2196
- <div class="mockup-content">
2197
- <div class="mock-header">
2198
- <div class="mock-title">Nouveau ${(mod.entities || [])[0] || 'enregistrement'}</div>
2199
- </div>
2200
- <div class="mock-form-row">
2201
- <div class="mock-form-group"><div class="mock-label">Identifiant</div><div class="mock-input" style="color:var(--text-muted);">Genere automatiquement</div></div>
2202
- <div class="mock-form-group"><div class="mock-label">Nom</div><div class="mock-input"></div></div>
2203
- </div>
2204
- <div class="mock-form-group"><div class="mock-label">Description</div><div class="mock-input" style="height:60px;"></div></div>
2205
- <div class="mock-form-actions">
2206
- <div class="mock-btn" style="background:var(--bg-hover);color:var(--text);">Annuler</div>
2207
- <div class="mock-btn">Enregistrer</div>
2208
- </div>
2209
- </div>
2210
- </div>
2211
-
2212
- <div class="card" style="margin-top:1rem;">
2213
- <div class="card-label">Notes sur les maquettes</div>
2214
- <div class="editable" contenteditable="true" data-module-code="${code}" data-module-field="mockupNotes" data-placeholder="Ajoutez vos remarques sur les maquettes : elements manquants, disposition souhaitee, comportements particuliers...">${spec.mockupNotes || ''}</div>
2226
+ <p style="font-size:0.85rem;color:var(--text-muted);margin-bottom:1rem;">Maquettes validees lors de l'analyse. Ces wireframes montrent la structure exacte des ecrans de ce domaine.</p>
2227
+ <div id="mockupContainer-${code}">
2228
+ ${renderModuleMockups(code)}
2215
2229
  </div>
2216
2230
  </div>
2217
2231
 
@@ -2354,6 +2368,55 @@
2354
2368
  autoSave();
2355
2369
  }
2356
2370
 
2371
+ function renderModuleMockups(code) {
2372
+ // Get embedded wireframes for this module
2373
+ const wireframes = EMBEDDED_ARTIFACTS?.wireframes?.[code] || [];
2374
+
2375
+ if (wireframes.length === 0) {
2376
+ return `
2377
+ <div class="card" style="text-align:center;padding:2rem;color:var(--text-muted);">
2378
+ <p>Aucune maquette disponible pour ce module.</p>
2379
+ <p style="font-size:0.85rem;margin-top:0.5rem;">Les maquettes seront generees lors de la specification detaillee.</p>
2380
+ </div>`;
2381
+ }
2382
+
2383
+ return wireframes.map((wf, i) => `
2384
+ <div class="mockup-frame" style="${i > 0 ? 'margin-top:1.5rem;' : ''}">
2385
+ <div class="mockup-toolbar">
2386
+ <div class="mockup-dot mockup-dot-red"></div>
2387
+ <div class="mockup-dot mockup-dot-yellow"></div>
2388
+ <div class="mockup-dot mockup-dot-green"></div>
2389
+ <span class="mockup-title">${wf.screen || wf.section}</span>
2390
+ </div>
2391
+ <div class="mockup-content">
2392
+ ${wf.format === 'ascii'
2393
+ ? `<pre class="ascii-wireframe">${wf.content || ''}</pre>`
2394
+ : `<div class="svg-wireframe">${wf.content || ''}</div>`}
2395
+ </div>
2396
+ ${wf.description ? `
2397
+ <div class="wireframe-description">
2398
+ <strong>Description:</strong> ${wf.description}
2399
+ </div>` : ''}
2400
+ ${(wf.elements || []).length > 0 ? `
2401
+ <div class="wireframe-metadata">
2402
+ <div><strong>Elements:</strong> ${wf.elements.join(', ')}</div>
2403
+ </div>` : ''}
2404
+ ${(wf.componentMapping || []).length > 0 ? `
2405
+ <details class="wireframe-details">
2406
+ <summary>Mapping composants SmartStack</summary>
2407
+ <table class="mapping-table">
2408
+ <thead><tr><th>Element maquette</th><th>Composant React</th></tr></thead>
2409
+ <tbody>
2410
+ ${wf.componentMapping.map(m =>
2411
+ `<tr><td>${m.wireframeElement}</td><td><code>${m.reactComponent}</code></td></tr>`
2412
+ ).join('')}
2413
+ </tbody>
2414
+ </table>
2415
+ </details>` : ''}
2416
+ </div>
2417
+ `).join('');
2418
+ }
2419
+
2357
2420
  function renderPermissionGrid(code) {
2358
2421
  const roles = data.cadrage.stakeholders.length > 0
2359
2422
  ? data.cadrage.stakeholders.map(s => s.role)