@atlashub/smartstack-cli 3.18.0 → 3.20.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 (42) hide show
  1. package/dist/index.js +3 -0
  2. package/dist/index.js.map +1 -1
  3. package/package.json +1 -1
  4. package/templates/agents/gitflow/cleanup.md +5 -1
  5. package/templates/agents/gitflow/finish.md +2 -0
  6. package/templates/agents/gitflow/init-clone.md +13 -0
  7. package/templates/agents/gitflow/init-validate.md +14 -0
  8. package/templates/agents/gitflow/start.md +2 -2
  9. package/templates/agents/gitflow/status.md +6 -0
  10. package/templates/skills/business-analyse/SKILL.md +1 -1
  11. package/templates/skills/business-analyse/_shared.md +46 -20
  12. package/templates/skills/business-analyse/html/ba-interactive.html +57 -107
  13. package/templates/skills/business-analyse/html/src/scripts/01-data-init.js +13 -0
  14. package/templates/skills/business-analyse/html/src/scripts/02-navigation.js +1 -1
  15. package/templates/skills/business-analyse/html/src/scripts/03-render-cadrage.js +11 -20
  16. package/templates/skills/business-analyse/html/src/scripts/11-review-panel.js +1 -3
  17. package/templates/skills/business-analyse/html/src/template.html +31 -83
  18. package/templates/skills/business-analyse/patterns/suggestion-catalog.md +71 -3
  19. package/templates/skills/business-analyse/references/cadrage-pre-analysis.md +11 -8
  20. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +7 -5
  21. package/templates/skills/business-analyse/references/deploy-data-build.md +42 -14
  22. package/templates/skills/business-analyse/references/deploy-modes.md +1 -1
  23. package/templates/skills/business-analyse/references/entity-architecture-decision.md +218 -0
  24. package/templates/skills/business-analyse/references/robustness-checks.md +2 -1
  25. package/templates/skills/business-analyse/references/spec-auto-inference.md +70 -16
  26. package/templates/skills/business-analyse/references/ui-resource-cards.md +149 -0
  27. package/templates/skills/business-analyse/steps/step-01-cadrage.md +220 -32
  28. package/templates/skills/business-analyse/steps/step-02-decomposition.md +51 -29
  29. package/templates/skills/business-analyse/steps/step-03a1-setup.md +122 -32
  30. package/templates/skills/business-analyse/steps/step-03a2-analysis.md +8 -0
  31. package/templates/skills/business-analyse/steps/step-03b-ui.md +68 -5
  32. package/templates/skills/business-analyse/steps/step-05a-handoff.md +99 -2
  33. package/templates/skills/business-analyse/steps/step-05b-deploy.md +35 -1
  34. package/templates/skills/business-analyse/steps/step-05c-ralph-readiness.md +4 -1
  35. package/templates/skills/business-analyse/steps/step-06-review.md +2 -1
  36. package/templates/skills/business-analyse/templates/tpl-handoff.md +5 -4
  37. package/templates/skills/business-analyse/templates/tpl-launch-displays.md +4 -1
  38. package/templates/skills/business-analyse/templates-frd.md +5 -4
  39. package/templates/skills/gitflow/_shared.md +65 -17
  40. package/templates/skills/gitflow/phases/status.md +8 -3
  41. package/templates/skills/gitflow/references/start-local-config.md +6 -3
  42. package/templates/skills/gitflow/steps/step-start.md +5 -2
@@ -607,7 +607,10 @@ Next Steps:
607
607
 
608
608
  3. When ready, launch development:
609
609
 
610
- /ralph-loop -r
610
+ /ralph-loop
611
+
612
+ Note: Use /ralph-loop -r ONLY to resume an interrupted loop.
613
+ After a fresh /business-analyse, always use /ralph-loop (without -r).
611
614
 
612
615
  4. Ralph-loop will:
613
616
  - Process modules in topological order: [{module list}]
@@ -262,7 +262,8 @@ Artifacts regenerated:
262
262
 
263
263
  NEXT STEPS:
264
264
  1. Open the new ba-interactive.html to verify corrections
265
- 2. Run /ralph-loop -r to start development from the updated analysis
265
+ 2. Run /ralph-loop to start development from the updated analysis
266
+ (Use /ralph-loop -r ONLY to resume an interrupted loop)
266
267
  ═══════════════════════════════════════════════════════════════
267
268
  ```
268
269
 
@@ -12,7 +12,7 @@
12
12
  > **Version:** {version}
13
13
  > **Validated Specs:** feature.json (validation.decision = APPROVED)
14
14
  > **Source:** `docs/business/{app}/{module}/business-analyse/v{version}/feature.json`
15
- > **Implementation:** `/ralph-loop -r`
15
+ > **Implementation:** `/ralph-loop`
16
16
 
17
17
  ## DEVELOPER INSTRUCTIONS
18
18
 
@@ -20,9 +20,10 @@ This document is a self-contained prompt for Claude Code.
20
20
 
21
21
  **Lancement:**
22
22
  ```
23
- /ralph-loop -r
23
+ /ralph-loop
24
24
  ```
25
- > Pre-generated `.ralph/prd.json` with atomic task breakdown.
25
+ > Ralph-loop auto-detects BA artifacts and derives PRD task breakdowns.
26
+ > Use `/ralph-loop -r` only to resume an interrupted loop.
26
27
 
27
28
  ---
28
29
 
@@ -178,6 +179,6 @@ From: `feature.specification.seedDataCore` (5 core files), `feature.specificatio
178
179
 
179
180
  **Lancement:**
180
181
  ```bash
181
- /ralph-loop -r
182
+ /ralph-loop
182
183
  ```
183
184
  ```
@@ -34,7 +34,10 @@ Effort: {total_days} days ({total_hours} hours)
34
34
  3. Si retours --> relancer /business-analyse pour une nouvelle itération
35
35
  4. Une fois validé, lancer le développement:
36
36
 
37
- /ralph-loop -r
37
+ /ralph-loop
38
+
39
+ Note: /ralph-loop -r sert UNIQUEMENT à reprendre une boucle interrompue.
40
+ Après un /business-analyse, toujours utiliser /ralph-loop (sans -r).
38
41
 
39
42
  ═══════════════════════════════════════════════════════════════
40
43
  ```
@@ -353,7 +353,7 @@ Feature: {FEAT-XXX} {Feature Name}
353
353
  > **Module:** business/{application}/{module}
354
354
  > **Version:** 1.0
355
355
  > **Validated Specs:** Specification v1.0 (validation.json)
356
- > **Implementation:** `/ralph-loop -r`
356
+ > **Implementation:** `/ralph-loop`
357
357
 
358
358
  ## DEVELOPER INSTRUCTIONS
359
359
 
@@ -361,9 +361,10 @@ This document is a self-contained prompt for Claude Code.
361
361
 
362
362
  **Lancement:**
363
363
  ```
364
- /ralph-loop -r
364
+ /ralph-loop
365
365
  ```
366
- > Pre-generated `.ralph/prd.json` with atomic task breakdown.
366
+ > Ralph-loop auto-detects BA artifacts and derives PRD task breakdowns.
367
+ > Use `/ralph-loop -r` only to resume an interrupted loop.
367
368
 
368
369
  ---
369
370
 
@@ -459,7 +460,7 @@ FRONTEND:
459
460
 
460
461
  **Lancement:**
461
462
  ```bash
462
- /ralph-loop -r
463
+ /ralph-loop
463
464
  ```
464
465
  ```
465
466
 
@@ -57,32 +57,34 @@ normalize_path_for_platform() {
57
57
  fi
58
58
  ;;
59
59
  *)
60
- # Normalize backslashes to forward slashes
61
- echo "${input_path//\\//}"
62
- ;;
63
- esac
64
- }
65
-
66
- # Translates a path to storage-neutral format for config.json (forward slashes, drive letter)
67
- normalize_path_for_storage() {
68
- local input_path="$1"
69
- case "$GF_PLATFORM" in
70
- wsl)
71
- # WSL path → Windows-style for config: /mnt/d/foo/bar → D:/foo/bar
60
+ # WSL path Windows path: /mnt/d/foo → D:/foo
72
61
  if [[ "$input_path" =~ ^/mnt/([a-z])/(.*) ]]; then
73
62
  local drive=$(echo "${BASH_REMATCH[1]}" | tr '[:lower:]' '[:upper:]')
74
63
  echo "${drive}:/${BASH_REMATCH[2]}"
75
64
  else
76
- echo "$input_path"
65
+ # Normalize backslashes to forward slashes
66
+ echo "${input_path//\\//}"
77
67
  fi
78
68
  ;;
79
- *)
80
- # Normalize backslashes to forward slashes
81
- echo "${input_path//\\//}"
82
- ;;
83
69
  esac
84
70
  }
85
71
 
72
+ # Translates a path to storage-neutral format for config.json (forward slashes, drive letter)
73
+ # Always converts WSL paths to Windows-style, regardless of current platform
74
+ normalize_path_for_storage() {
75
+ local input_path="$1"
76
+ # WSL path → Windows-style: /mnt/d/foo → D:/foo (always, regardless of platform)
77
+ if [[ "$input_path" =~ ^/mnt/([a-z])/(.*) ]]; then
78
+ local drive=$(echo "${BASH_REMATCH[1]}" | tr '[:lower:]' '[:upper:]')
79
+ echo "${drive}:/${BASH_REMATCH[2]}"
80
+ elif [[ "$input_path" =~ ^[A-Za-z]:[\\/] ]]; then
81
+ # Normalize backslashes only
82
+ echo "${input_path//\\//}"
83
+ else
84
+ echo "$input_path"
85
+ fi
86
+ }
87
+
86
88
  # Returns current directory in platform-appropriate format
87
89
  get_current_dir() {
88
90
  local raw_pwd
@@ -314,6 +316,52 @@ cleanup_worktree_for_branch() {
314
316
 
315
317
  ---
316
318
 
319
+ ## REPAIR_WORKTREE_PATHS
320
+
321
+ Repairs worktree metadata files that contain paths from a different platform (e.g., WSL paths `/mnt/d/...` on Windows, or Windows paths `D:/...` on WSL). Scans `.bare/worktrees/*/gitdir` and the corresponding `{worktree}/.git` files.
322
+
323
+ ```bash
324
+ repair_worktree_paths() {
325
+ local BARE_DIR="$1" # Path to .bare directory
326
+ local WORKTREES_DIR="$BARE_DIR/worktrees"
327
+ [ ! -d "$WORKTREES_DIR" ] && return 0
328
+
329
+ local REPAIRED=0
330
+ for wt_dir in "$WORKTREES_DIR"/*/; do
331
+ [ ! -d "$wt_dir" ] && continue
332
+ local wt_name=$(basename "$wt_dir")
333
+ local gitdir_file="$wt_dir/gitdir"
334
+ [ ! -f "$gitdir_file" ] && continue
335
+
336
+ # Fix .bare/worktrees/{name}/gitdir
337
+ local stored_path=$(cat "$gitdir_file" | tr -d '\n\r')
338
+ local fixed_path=$(normalize_path_for_platform "$stored_path")
339
+ if [ "$stored_path" != "$fixed_path" ]; then
340
+ echo "$fixed_path" > "$gitdir_file"
341
+ echo "REPAIRED: $wt_name/gitdir → $fixed_path"
342
+ REPAIRED=$((REPAIRED + 1))
343
+ fi
344
+
345
+ # Fix the worktree's .git file
346
+ local wt_real_dir=$(dirname "$fixed_path")
347
+ if [ -f "$wt_real_dir/.git" ]; then
348
+ local git_content=$(cat "$wt_real_dir/.git" | tr -d '\n\r')
349
+ local git_path="${git_content#gitdir: }"
350
+ local fixed_git_path=$(normalize_path_for_platform "$git_path")
351
+ if [ "$git_path" != "$fixed_git_path" ]; then
352
+ echo "gitdir: $fixed_git_path" > "$wt_real_dir/.git"
353
+ echo "REPAIRED: $wt_name/.git → $fixed_git_path"
354
+ REPAIRED=$((REPAIRED + 1))
355
+ fi
356
+ fi
357
+ done
358
+
359
+ [ "$REPAIRED" -gt 0 ] && echo "Worktree paths: $REPAIRED file(s) repaired"
360
+ }
361
+ ```
362
+
363
+ ---
364
+
317
365
  ## RESOLVE_WORKSPACE
318
366
 
319
367
  Resolves the workspace JSON file by walking up the directory tree.
@@ -61,15 +61,20 @@ HOTFIXES=$(git branch -r | grep "origin/${GF_HOTFIX_PREFIX}" | sed 's/origin\///
61
61
  ### 4. Worktree Status
62
62
 
63
63
  ```bash
64
+ # Repair cross-platform paths before listing (WSL ↔ Windows)
65
+ detect_platform
66
+ repair_worktree_paths "$(git rev-parse --git-common-dir 2>/dev/null || echo '.bare')"
67
+
64
68
  WORKTREES=$(git worktree list)
65
69
  WORKTREE_COUNT=$(echo "$WORKTREES" | wc -l)
66
70
 
67
- # Check for orphaned worktrees
71
+ # Check for orphaned worktrees (normalize paths for cross-platform compatibility)
68
72
  ORPHANED=""
69
73
  while read -r line; do
70
- PATH=$(echo "$line" | awk '{print $1}')
74
+ WT_PATH=$(echo "$line" | awk '{print $1}')
75
+ WT_PATH=$(normalize_path_for_platform "$WT_PATH")
71
76
  BRANCH=$(echo "$line" | awk '{print $3}' | tr -d '[]')
72
- [ ! -d "$PATH" ] && ORPHANED="$ORPHANED\n$PATH ($BRANCH)"
77
+ [ ! -d "$WT_PATH" ] && ORPHANED="$ORPHANED\n$WT_PATH ($BRANCH)"
73
78
  done <<< "$WORKTREES"
74
79
  ```
75
80
 
@@ -50,11 +50,14 @@ EOF
50
50
  }
51
51
  ```
52
52
 
53
- ## 7b. Frontend: .env.local + npm script
53
+ ## 7b. Frontend: .env.standalone + npm script
54
+
55
+ > **IMPORTANT**: Vite 7+ forbids `"local"` as a mode name (conflicts with `.env.local` suffix).
56
+ > The Vite mode is `standalone`, but the npm script stays `local` for user convenience.
54
57
 
55
58
  ```bash
56
59
  [ -n "$WEB_DIR" ] && [ -f "$WEB_DIR/package.json" ] && {
57
- cat > "$WEB_DIR/.env.local" << EOF
60
+ cat > "$WEB_DIR/.env.standalone" << EOF
58
61
  VITE_API_URL=http://localhost:${API_PORT}
59
62
  VITE_APP_ENV=local
60
63
  VITE_DEBUG=true
@@ -66,7 +69,7 @@ EOF
66
69
  const fs = require('fs');
67
70
  const pkg = JSON.parse(fs.readFileSync('$WEB_DIR/package.json', 'utf8'));
68
71
  if (!pkg.scripts.local) {
69
- pkg.scripts.local = 'vite --mode local --port ${WEB_PORT}';
72
+ pkg.scripts.local = 'vite --mode standalone --port ${WEB_PORT}';
70
73
  fs.writeFileSync('$WEB_DIR/package.json', JSON.stringify(pkg, null, 2) + '\n');
71
74
  }
72
75
  "
@@ -158,6 +158,9 @@ esac
158
158
 
159
159
  mkdir -p "$(dirname $WORKTREE_PATH)"
160
160
  git worktree add -b "$FULL_BRANCH" "$WORKTREE_PATH" "origin/$BASE_BRANCH"
161
+
162
+ # Fix cross-platform paths in worktree metadata (if created from different platform)
163
+ repair_worktree_paths "$(git rev-parse --git-common-dir)"
161
164
  ```
162
165
 
163
166
  **Mode: --no-worktree**
@@ -190,7 +193,7 @@ fi
190
193
  See [references/start-local-config.md](../references/start-local-config.md) for the full configuration:
191
194
  - **Port generation:** Unique ports per branch (API: 5200+, Web: 5300+) based on branch name hash
192
195
  - **7a. Backend:** `appsettings.Local.json` (DB connection, SmartStack config, Kestrel port)
193
- - **7b. Frontend:** `.env.local` + `npm run local` script
196
+ - **7b. Frontend:** `.env.standalone` + `npm run local` script (Vite mode=standalone, not "local" which conflicts with .env.local in Vite 7+)
194
197
  - **7c. Backend:** `launchSettings.json` Local profile with unique port
195
198
  - **7d. Summary:** Display configured DB name, API port, Web port
196
199
 
@@ -276,7 +279,7 @@ See [references/start-local-config.md](../references/start-local-config.md) for
276
279
  - Worktree set up (if enabled)
277
280
  - Backend local config created: `appsettings.Local.json` (if .NET API detected)
278
281
  - Backend launch profile created: `launchSettings.json` Local profile with unique port (if .NET API detected)
279
- - Frontend local config created: `.env.local` + `npm run local` script (if web project detected)
282
+ - Frontend local config created: `.env.standalone` + `npm run local` script (if web project detected)
280
283
  - Ports synchronized between backend and frontend (unique per branch)
281
284
  - State stored for subsequent steps
282
285