@atlashub/smartstack-cli 3.19.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.
- package/package.json +1 -1
- package/templates/agents/gitflow/cleanup.md +5 -1
- package/templates/agents/gitflow/finish.md +2 -0
- package/templates/agents/gitflow/init-clone.md +13 -0
- package/templates/agents/gitflow/init-validate.md +14 -0
- package/templates/agents/gitflow/status.md +6 -0
- package/templates/skills/business-analyse/steps/step-02-decomposition.md +16 -3
- package/templates/skills/gitflow/_shared.md +65 -17
- package/templates/skills/gitflow/phases/status.md +8 -3
- package/templates/skills/gitflow/steps/step-start.md +3 -0
package/package.json
CHANGED
|
@@ -51,7 +51,11 @@ fi
|
|
|
51
51
|
## Commandes
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
|
-
#
|
|
54
|
+
# Repair cross-platform paths before any operation (WSL ↔ Windows)
|
|
55
|
+
detect_platform
|
|
56
|
+
repair_worktree_paths "$(git rev-parse --git-common-dir 2>/dev/null || echo '.bare')"
|
|
57
|
+
|
|
58
|
+
# Lister worktrees (paths now normalized for current platform)
|
|
55
59
|
git worktree list --porcelain
|
|
56
60
|
|
|
57
61
|
# Verifier si branche existe
|
|
@@ -32,7 +32,9 @@ BRANCH=${1:-$(git rev-parse --abbrev-ref HEAD)}
|
|
|
32
32
|
BRANCH_TYPE=$(echo $BRANCH | cut -d'/' -f1)
|
|
33
33
|
|
|
34
34
|
# Worktree detection: if in a worktree, navigate to main repo
|
|
35
|
+
# Normalize path for cross-platform compatibility (WSL ↔ Windows)
|
|
35
36
|
WORKTREE_PATH=$(git worktree list --porcelain | grep -B2 "branch refs/heads/$BRANCH" | grep "^worktree " | sed 's/^worktree //')
|
|
37
|
+
WORKTREE_PATH=$(normalize_path_for_platform "$WORKTREE_PATH")
|
|
36
38
|
```
|
|
37
39
|
|
|
38
40
|
### 2. Verify PR Merged
|
|
@@ -96,6 +96,19 @@ if [ ! -d "$PROJECT_BASE/develop" ]; then
|
|
|
96
96
|
fi
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
+
### 5b. Fix Cross-Platform Worktree Paths
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
PROJECT_BASE="{PROJECT_BASE}"
|
|
103
|
+
|
|
104
|
+
# Detect current platform (needed for path normalization)
|
|
105
|
+
detect_platform
|
|
106
|
+
|
|
107
|
+
# Repair any cross-platform paths written by git worktree add
|
|
108
|
+
# (e.g., WSL paths /mnt/d/... when running on Windows, or vice versa)
|
|
109
|
+
repair_worktree_paths "$PROJECT_BASE/.bare"
|
|
110
|
+
```
|
|
111
|
+
|
|
99
112
|
### 6. Create Config Directory
|
|
100
113
|
|
|
101
114
|
```bash
|
|
@@ -134,6 +134,20 @@ for subdir in features releases hotfixes; do
|
|
|
134
134
|
done
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
+
### 2b. Worktree Path Integrity (Cross-Platform)
|
|
138
|
+
|
|
139
|
+
Repair worktree metadata files that contain paths from a different platform (e.g., WSL paths `/mnt/d/...` on Windows or Windows paths `D:/...` on WSL).
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
PROJECT_BASE="{PROJECT_BASE}"
|
|
143
|
+
|
|
144
|
+
# Source platform detection and path functions from _shared.md
|
|
145
|
+
detect_platform
|
|
146
|
+
|
|
147
|
+
# Repair cross-platform paths in .bare/worktrees/*/gitdir and worktree/.git files
|
|
148
|
+
repair_worktree_paths "$PROJECT_BASE/.bare"
|
|
149
|
+
```
|
|
150
|
+
|
|
137
151
|
### 3. Config Integrity
|
|
138
152
|
|
|
139
153
|
```bash
|
|
@@ -24,7 +24,13 @@ Expert GitFlow. Display COMPLETE repository state with accessible vocabulary.
|
|
|
24
24
|
# 1. BRANCHES
|
|
25
25
|
git fetch --all --quiet 2>/dev/null
|
|
26
26
|
git for-each-ref --sort=-committerdate --format='%(refname:short)|%(objectname:short)|%(committerdate:short)|%(subject)' refs/heads refs/remotes/origin
|
|
27
|
+
|
|
28
|
+
# Worktree list (normalize paths for cross-platform WSL/Windows compatibility)
|
|
29
|
+
# Before listing, repair any cross-platform paths in worktree metadata
|
|
30
|
+
detect_platform
|
|
31
|
+
repair_worktree_paths "$(git rev-parse --git-common-dir 2>/dev/null || echo '.bare')"
|
|
27
32
|
git worktree list
|
|
33
|
+
|
|
28
34
|
git branch -vv
|
|
29
35
|
|
|
30
36
|
# 2. TAGS
|
|
@@ -293,10 +293,12 @@ Create: docs/business/{app}/{module_code}/business-analyse/v1.0/
|
|
|
293
293
|
|
|
294
294
|
> Module feature.json files will be created by step-03 when each module is processed.
|
|
295
295
|
|
|
296
|
-
### 9. Display Summary
|
|
296
|
+
### 9. Display Summary & AUTOCHAIN
|
|
297
297
|
|
|
298
298
|
```
|
|
299
|
-
|
|
299
|
+
═══════════════════════════════════════════════════════════
|
|
300
|
+
DECOMPOSITION COMPLETE - {feature_id}
|
|
301
|
+
═══════════════════════════════════════════════════════════
|
|
300
302
|
|
|
301
303
|
| Aspect | Value |
|
|
302
304
|
|--------|-------|
|
|
@@ -309,8 +311,16 @@ Create: docs/business/{app}/{module_code}/business-analyse/v1.0/
|
|
|
309
311
|
{numbered list of modules}
|
|
310
312
|
|
|
311
313
|
→ Starting iterative specification with {first_module}...
|
|
314
|
+
═══════════════════════════════════════════════════════════
|
|
312
315
|
```
|
|
313
316
|
|
|
317
|
+
**AUTOCHAIN — DO NOT STOP HERE:**
|
|
318
|
+
- Do NOT ask "shall I continue?" or "voulez-vous que je continue?"
|
|
319
|
+
- Do NOT summarize what's coming next
|
|
320
|
+
- Do NOT wait for user input
|
|
321
|
+
- The user ALREADY validated at step 6 — that was the checkpoint
|
|
322
|
+
- IMMEDIATELY load step-03a1-setup.md
|
|
323
|
+
|
|
314
324
|
---
|
|
315
325
|
|
|
316
326
|
## SINGLE-MODULE MODE
|
|
@@ -325,6 +335,9 @@ When `workflow.mode = "module"` or only 1 scope item identified:
|
|
|
325
335
|
|
|
326
336
|
---
|
|
327
337
|
|
|
328
|
-
## NEXT STEP
|
|
338
|
+
## NEXT STEP (MANDATORY — NO PAUSE)
|
|
329
339
|
|
|
330
340
|
Load: `./step-03a1-setup.md`
|
|
341
|
+
|
|
342
|
+
> **FORBIDDEN:** Asking any question between decomposition summary and step-03 load.
|
|
343
|
+
> The client checkpoint was at step 6. Do NOT add another one.
|
|
@@ -57,32 +57,34 @@ normalize_path_for_platform() {
|
|
|
57
57
|
fi
|
|
58
58
|
;;
|
|
59
59
|
*)
|
|
60
|
-
#
|
|
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
|
-
|
|
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
|
-
|
|
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 "$
|
|
77
|
+
[ ! -d "$WT_PATH" ] && ORPHANED="$ORPHANED\n$WT_PATH ($BRANCH)"
|
|
73
78
|
done <<< "$WORKTREES"
|
|
74
79
|
```
|
|
75
80
|
|
|
@@ -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**
|