@atlashub/smartstack-cli 1.35.0 → 1.37.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 (27) hide show
  1. package/package.json +1 -1
  2. package/templates/skills/_shared.md +7 -7
  3. package/templates/skills/application/steps/step-01-navigation.md +226 -43
  4. package/templates/skills/application/steps/step-03-roles.md +160 -38
  5. package/templates/skills/application/steps/step-04-backend.md +126 -19
  6. package/templates/skills/application/steps/step-05-frontend.md +4 -1
  7. package/templates/skills/application/templates-backend.md +8 -8
  8. package/templates/skills/application/templates-frontend.md +8 -8
  9. package/templates/skills/application/templates-seed.md +200 -1
  10. package/templates/skills/gitflow/_shared.md +188 -53
  11. package/templates/skills/gitflow/phases/abort.md +28 -16
  12. package/templates/skills/gitflow/phases/cleanup.md +13 -9
  13. package/templates/skills/gitflow/phases/status.md +16 -17
  14. package/templates/skills/gitflow/steps/step-commit.md +11 -5
  15. package/templates/skills/gitflow/steps/step-finish.md +43 -33
  16. package/templates/skills/gitflow/steps/step-init.md +7 -2
  17. package/templates/skills/gitflow/steps/step-merge.md +24 -10
  18. package/templates/skills/gitflow/steps/step-pr.md +42 -28
  19. package/templates/skills/gitflow/steps/step-start.md +19 -13
  20. package/templates/skills/gitflow/templates/config.json +7 -4
  21. package/templates/skills/ralph-loop/SKILL.md +57 -11
  22. package/templates/skills/ralph-loop/steps/step-00-init.md +170 -30
  23. package/templates/skills/ralph-loop/steps/step-01-task.md +243 -40
  24. package/templates/skills/ralph-loop/steps/step-02-execute.md +142 -24
  25. package/templates/skills/ralph-loop/steps/step-03-commit.md +140 -36
  26. package/templates/skills/ralph-loop/steps/step-04-check.md +128 -44
  27. package/templates/skills/ralph-loop/steps/step-05-report.md +175 -88
@@ -45,12 +45,113 @@ normalize_branch_name() {
45
45
 
46
46
  ---
47
47
 
48
+ ## RESOLVE_CONFIG_PATH
49
+
50
+ Resolves the config.json path regardless of current working directory.
51
+ Searches in: pwd, develop worktree, then git root.
52
+
53
+ ```bash
54
+ resolve_gitflow_config_path() {
55
+ # 1. Try current directory
56
+ [ -f ".claude/gitflow/config.json" ] && { echo ".claude/gitflow/config.json"; return 0; }
57
+
58
+ # 2. Try to find develop worktree from git worktree list
59
+ local DEVELOP_PATH
60
+ DEVELOP_PATH=$(git worktree list --porcelain 2>/dev/null | grep -A1 "branch refs/heads/develop" | grep "^worktree " | sed 's/^worktree //')
61
+ [ -n "$DEVELOP_PATH" ] && [ -f "$DEVELOP_PATH/.claude/gitflow/config.json" ] && {
62
+ echo "$DEVELOP_PATH/.claude/gitflow/config.json"
63
+ return 0
64
+ }
65
+
66
+ # 3. Try git toplevel
67
+ local GIT_ROOT
68
+ GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
69
+ [ -n "$GIT_ROOT" ] && [ -f "$GIT_ROOT/.claude/gitflow/config.json" ] && {
70
+ echo "$GIT_ROOT/.claude/gitflow/config.json"
71
+ return 0
72
+ }
73
+
74
+ return 1
75
+ }
76
+ ```
77
+
78
+ ---
79
+
80
+ ## READ_GITFLOW_CONFIG
81
+
82
+ Reads GitFlow configuration from config.json. Exposes all variables needed by steps and phases.
83
+
84
+ ```bash
85
+ read_gitflow_config() {
86
+ local CONFIG_FILE
87
+ CONFIG_FILE=$(resolve_gitflow_config_path) || {
88
+ echo "❌ GitFlow config not found. Run /gitflow init first."
89
+ return 1
90
+ }
91
+
92
+ # Repository
93
+ GF_PROJECT_NAME=$(grep -oP '"name":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
94
+ GF_ROOT_FOLDER=$(grep -oP '"rootFolder":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
95
+ GF_REMOTE_URL=$(grep -oP '"remoteUrl":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
96
+
97
+ # Git provider and branches
98
+ GF_PROVIDER=$(grep -oP '"provider":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
99
+ GF_MAIN_BRANCH=$(grep -oP '"main":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
100
+ GF_DEVELOP_BRANCH=$(grep -oP '"develop":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
101
+
102
+ # Prefixes
103
+ GF_FEATURE_PREFIX=$(grep -oP '"feature":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
104
+ GF_RELEASE_PREFIX=$(grep -oP '"release":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
105
+ GF_HOTFIX_PREFIX=$(grep -oP '"hotfix":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
106
+
107
+ # Worktrees
108
+ GF_WORKTREE_MODE=$(grep -oP '"mode":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
109
+ GF_MAIN_PATH=$(grep -A1 '"structure"' "$CONFIG_FILE" | grep -oP '"main":\s*"\K[^"]+' | head -1)
110
+ GF_DEVELOP_PATH=$(grep -A2 '"structure"' "$CONFIG_FILE" | grep -oP '"develop":\s*"\K[^"]+' | head -1)
111
+ GF_FEATURES_PATH=$(grep -oP '"features":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
112
+ GF_RELEASES_PATH=$(grep -oP '"releases":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
113
+ GF_HOTFIXES_PATH=$(grep -oP '"hotfixes":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
114
+
115
+ # Language
116
+ GF_LANG=$(grep -oP '"code":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
117
+
118
+ # Versioning
119
+ GF_VERSION=$(grep -oP '"current":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
120
+ GF_TAG_PREFIX=$(grep -oP '"tagPrefix":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
121
+
122
+ # Defaults for missing values
123
+ GF_LANG=${GF_LANG:-en}
124
+ GF_WORKTREE_MODE=${GF_WORKTREE_MODE:-organized}
125
+ GF_MAIN_BRANCH=${GF_MAIN_BRANCH:-main}
126
+ GF_DEVELOP_BRANCH=${GF_DEVELOP_BRANCH:-develop}
127
+ GF_FEATURE_PREFIX=${GF_FEATURE_PREFIX:-feature/}
128
+ GF_RELEASE_PREFIX=${GF_RELEASE_PREFIX:-release/}
129
+ GF_HOTFIX_PREFIX=${GF_HOTFIX_PREFIX:-hotfix/}
130
+ GF_TAG_PREFIX=${GF_TAG_PREFIX:-v}
131
+ GF_VERSION=${GF_VERSION:-0.1.0}
132
+
133
+ # Export config file path for steps that need to update it
134
+ GF_CONFIG_FILE="$CONFIG_FILE"
135
+ }
136
+ ```
137
+
138
+ ---
139
+
48
140
  ## DETECT_WORKTREE_MODE
49
141
 
50
- Detects worktree mode (organized, adjacent, none).
142
+ Detects worktree mode. Reads config first, falls back to filesystem detection.
51
143
 
52
144
  ```bash
53
145
  detect_worktree_mode() {
146
+ # 1. Try config first (authoritative)
147
+ local CONFIG_FILE
148
+ CONFIG_FILE=$(resolve_gitflow_config_path 2>/dev/null)
149
+ if [ -n "$CONFIG_FILE" ] && [ -f "$CONFIG_FILE" ]; then
150
+ WORKTREE_MODE=$(grep -oP '"mode":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
151
+ [ -n "$WORKTREE_MODE" ] && return 0
152
+ fi
153
+
154
+ # 2. Fallback: filesystem detection
54
155
  if [ -d "../features" ] && [ -d "../releases" ] && [ -d "../hotfixes" ]; then
55
156
  WORKTREE_MODE="organized"
56
157
  elif [ -d "../01-Main" ] && [ -d "../02-Develop" ]; then
@@ -58,9 +159,7 @@ detect_worktree_mode() {
58
159
  elif [ -d "../worktrees" ]; then
59
160
  WORKTREE_MODE="adjacent"
60
161
  else
61
- CONFIG_FILE=".claude/gitflow/config.json"
62
- [ -f "$CONFIG_FILE" ] && WORKTREE_MODE=$(grep -oP '"mode":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
63
- WORKTREE_MODE=${WORKTREE_MODE:-adjacent}
162
+ WORKTREE_MODE="organized"
64
163
  fi
65
164
  }
66
165
  ```
@@ -69,26 +168,30 @@ detect_worktree_mode() {
69
168
 
70
169
  ## CLEANUP_WORKTREE
71
170
 
72
- Cleans up a worktree for a given branch.
171
+ Cleans up a worktree for a given branch. Uses config paths when available.
73
172
 
74
173
  ```bash
75
174
  cleanup_worktree_for_branch() {
76
- local BRANCH=$1 WORKTREE_BASE="../worktrees" WORKTREE_PATH=""
77
-
78
- case "$BRANCH" in
79
- feature/*) WORKTREE_PATH="$WORKTREE_BASE/features/${BRANCH#feature/}" ;;
80
- release/*) WORKTREE_PATH="$WORKTREE_BASE/releases/${BRANCH#release/}" ;;
81
- hotfix/*) WORKTREE_PATH="$WORKTREE_BASE/hotfixes/${BRANCH#hotfix/}" ;;
82
- esac
83
-
84
- # Organized mode
85
- [ -d "../features" ] && case "$BRANCH" in
86
- feature/*) WORKTREE_PATH="../features/${BRANCH#feature/}" ;;
87
- release/*) WORKTREE_PATH="../releases/${BRANCH#release/}" ;;
88
- hotfix/*) WORKTREE_PATH="../hotfixes/${BRANCH#hotfix/}" ;;
89
- esac
90
-
91
- [ -d "$WORKTREE_PATH" ] && {
175
+ local BRANCH=$1 WORKTREE_PATH=""
176
+
177
+ # Try config-based paths first (absolute, reliable)
178
+ read_gitflow_config 2>/dev/null
179
+ if [ -n "$GF_FEATURES_PATH" ]; then
180
+ case "$BRANCH" in
181
+ feature/*) WORKTREE_PATH="$GF_FEATURES_PATH/${BRANCH#feature/}" ;;
182
+ release/*) WORKTREE_PATH="$GF_RELEASES_PATH/${BRANCH#release/}" ;;
183
+ hotfix/*) WORKTREE_PATH="$GF_HOTFIXES_PATH/${BRANCH#hotfix/}" ;;
184
+ esac
185
+ else
186
+ # Fallback: relative paths
187
+ case "$BRANCH" in
188
+ feature/*) WORKTREE_PATH="../features/${BRANCH#feature/}" ;;
189
+ release/*) WORKTREE_PATH="../releases/${BRANCH#release/}" ;;
190
+ hotfix/*) WORKTREE_PATH="../hotfixes/${BRANCH#hotfix/}" ;;
191
+ esac
192
+ fi
193
+
194
+ [ -n "$WORKTREE_PATH" ] && [ -d "$WORKTREE_PATH" ] && {
92
195
  git worktree remove "$WORKTREE_PATH" --force 2>/dev/null || rm -rf "$WORKTREE_PATH"
93
196
  git worktree prune
94
197
  echo "✓ Worktree cleaned: $WORKTREE_PATH"
@@ -116,47 +219,79 @@ sync_with_remote() {
116
219
 
117
220
  ---
118
221
 
119
- ## READ_GITFLOW_CONFIG
120
-
121
- Reads GitFlow configuration.
122
-
123
- ```bash
124
- read_gitflow_config() {
125
- local CONFIG_FILE=".claude/gitflow/config.json"
126
- [ ! -f "$CONFIG_FILE" ] && return 1
127
-
128
- # Exported variables
129
- GF_LANG=$(grep -oP '"code":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
130
- GF_WORKTREE_MODE=$(grep -oP '"mode":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
131
- GF_MAIN_BRANCH=$(grep -oP '"main":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
132
- GF_DEVELOP_BRANCH=$(grep -oP '"develop":\s*"\K[^"]+' "$CONFIG_FILE" | head -1)
133
-
134
- GF_LANG=${GF_LANG:-en}
135
- GF_WORKTREE_MODE=${GF_WORKTREE_MODE:-adjacent}
136
- GF_MAIN_BRANCH=${GF_MAIN_BRANCH:-main}
137
- GF_DEVELOP_BRANCH=${GF_DEVELOP_BRANCH:-develop}
138
- }
139
- ```
140
-
141
- ---
142
-
143
222
  ## CONFIG_TEMPLATE
144
223
 
145
- GitFlow configuration JSON template (minimal version).
224
+ GitFlow configuration JSON template v2.0.0 (aligned with `templates/config.json`).
146
225
 
147
226
  ```json
148
227
  {
149
- "version": "1.3.0",
150
- "branches": { "main": "main", "develop": "develop" },
151
- "prefixes": { "feature": "feature/", "release": "release/", "hotfix": "hotfix/" },
152
- "worktrees": { "mode": "organized" },
153
- "language": { "code": "en" }
228
+ "version": "2.0.0",
229
+ "repository": {
230
+ "name": "",
231
+ "rootFolder": "",
232
+ "nameVariants": {
233
+ "pascalCaseDot": "",
234
+ "pascalCase": "",
235
+ "kebabCase": "",
236
+ "snakeCase": "",
237
+ "displayName": ""
238
+ },
239
+ "defaultBranch": "main",
240
+ "remoteUrl": ""
241
+ },
242
+ "git": {
243
+ "provider": "",
244
+ "branches": {
245
+ "main": "main",
246
+ "develop": "develop"
247
+ },
248
+ "prefixes": {
249
+ "feature": "feature/",
250
+ "release": "release/",
251
+ "hotfix": "hotfix/"
252
+ }
253
+ },
254
+ "worktrees": {
255
+ "enabled": true,
256
+ "mode": "organized",
257
+ "structure": {
258
+ "main": "",
259
+ "develop": "",
260
+ "features": "",
261
+ "releases": "",
262
+ "hotfixes": ""
263
+ }
264
+ },
265
+ "versioning": {
266
+ "strategy": "semver",
267
+ "current": "0.1.0",
268
+ "tagPrefix": "v",
269
+ "sources": ["csproj", "package.json", "VERSION"]
270
+ },
271
+ "efcore": {
272
+ "enabled": true,
273
+ "validateOnCommit": true,
274
+ "blockDestructive": true,
275
+ "migrationNaming": "{context}_v{version}_{sequence}_{Description}"
276
+ },
277
+ "workflow": {
278
+ "push": {
279
+ "afterCommit": "worktree"
280
+ },
281
+ "pr": {
282
+ "autoLabels": true,
283
+ "requireReview": true
284
+ }
285
+ },
286
+ "language": {
287
+ "code": "en"
288
+ }
154
289
  }
155
290
  ```
156
291
 
157
292
  **worktrees.mode options:**
158
- - `organized`: `../features/`, `../releases/`, `../hotfixes/`
159
- - `adjacent`: `../worktrees/{type}/`
293
+ - `organized`: Uses absolute paths from config (`structure.features`, etc.)
294
+ - `adjacent`: `{rootFolder}/worktrees/{type}/`
160
295
  - `disabled`: No worktrees
161
296
 
162
297
  ---
@@ -11,6 +11,13 @@ Provide rollback and recovery options for GitFlow operations.
11
11
 
12
12
  ---
13
13
 
14
+ ## PRE-CHECK:
15
+
16
+ ```bash
17
+ # Load GitFlow config (sets GF_* variables)
18
+ read_gitflow_config || { echo "❌ Run /gitflow init first."; exit 1; }
19
+ ```
20
+
14
21
  ## OPTIONS:
15
22
 
16
23
  ```yaml
@@ -23,7 +30,7 @@ AskUserQuestion:
23
30
  - label: "Abandon current branch"
24
31
  description: "Delete branch and worktree, return to develop"
25
32
  - label: "Restore from checkpoint"
26
- description: "Restore to a saved checkpoint"
33
+ description: "Restore to a saved checkpoint (not yet implemented)"
27
34
  - label: "Reset branch to remote"
28
35
  description: "Discard local changes, match remote"
29
36
  ```
@@ -69,7 +76,7 @@ git tag "$BACKUP_TAG" HEAD
69
76
  echo "✓ Backup created: $BACKUP_TAG"
70
77
 
71
78
  # Switch to develop
72
- git checkout develop
79
+ git checkout $GF_DEVELOP_BRANCH
73
80
 
74
81
  # Remove worktree
75
82
  [ -n "$WORKTREE" ] && {
@@ -87,30 +94,35 @@ echo " Backup: $BACKUP_TAG (use 'git checkout $BACKUP_TAG' to recover)"
87
94
 
88
95
  ### Option 3: Restore from Checkpoint
89
96
 
97
+ > **Note:** Checkpoint creation is not yet implemented. This option uses backup tags
98
+ > created by abort operations as a recovery mechanism. Full checkpoint support
99
+ > (automatic state snapshots during plan execution) is planned for a future release.
100
+
90
101
  ```bash
91
- # List available checkpoints
92
- CHECKPOINTS=$(ls -t .claude/gitflow/logs/checkpoint_*.json 2>/dev/null)
102
+ # List available backup tags (created by abandon operations)
103
+ BACKUPS=$(git tag -l "backup/*" --sort=-creatordate 2>/dev/null)
93
104
 
94
- if [ -z "$CHECKPOINTS" ]; then
95
- echo "No checkpoints found"
105
+ if [ -z "$BACKUPS" ]; then
106
+ echo "No backup tags found"
107
+ echo " Backup tags are created automatically when abandoning branches."
108
+ echo " Use 'Reset branch to remote' instead."
96
109
  exit 1
97
110
  fi
98
111
 
99
- echo "Available checkpoints:"
100
- for cp in $CHECKPOINTS; do
101
- TIMESTAMP=$(grep -oP '"timestamp":\s*"\K[^"]+' "$cp")
102
- BRANCH=$(grep -oP '"branch":\s*"\K[^"]+' "$cp")
103
- COMMIT=$(grep -oP '"commit":\s*"\K[^"]+' "$cp")
104
- echo " - $TIMESTAMP: $BRANCH @ $COMMIT"
112
+ echo "Available backups:"
113
+ for tag in $BACKUPS; do
114
+ COMMIT=$(git rev-parse --short "$tag")
115
+ DATE=$(git log -1 --format=%ci "$tag" 2>/dev/null)
116
+ echo " - $tag $COMMIT ($DATE)"
105
117
  done
106
118
 
107
- # Select checkpoint
119
+ # Select backup
108
120
  # ... user selection ...
109
121
 
110
122
  # Restore
111
- COMMIT=$(grep -oP '"commit":\s*"\K[^"]+' "$SELECTED_CHECKPOINT")
112
- git reset --hard "$COMMIT"
113
- echo "✓ Restored to $COMMIT"
123
+ git checkout "$SELECTED_TAG"
124
+ git checkout -b "recovered-$(date +%Y%m%d-%H%M%S)"
125
+ echo "✓ Restored from $SELECTED_TAG to new branch"
114
126
  ```
115
127
 
116
128
  ### Option 4: Reset to Remote
@@ -16,12 +16,15 @@ Audit worktrees and branches, remove orphaned/stale items.
16
16
  ## PRE-CHECK:
17
17
 
18
18
  ```bash
19
+ # Load GitFlow config (sets GF_* variables)
20
+ read_gitflow_config || { echo "❌ Run /gitflow init first."; exit 1; }
21
+
19
22
  CURRENT=$(git rev-parse --abbrev-ref HEAD)
20
23
 
21
- [[ "$CURRENT" != "main" ]] && [[ "$CURRENT" != "develop" ]] && {
22
- echo "❌ Cleanup must be run from main or develop"
24
+ [[ "$CURRENT" != "$GF_MAIN_BRANCH" ]] && [[ "$CURRENT" != "$GF_DEVELOP_BRANCH" ]] && {
25
+ echo "❌ Cleanup must be run from $GF_MAIN_BRANCH or $GF_DEVELOP_BRANCH"
23
26
  echo " Current branch: $CURRENT"
24
- echo "→ Run: git checkout develop"
27
+ echo "→ Run: git checkout $GF_DEVELOP_BRANCH"
25
28
  STOP
26
29
  }
27
30
  ```
@@ -35,7 +38,8 @@ CURRENT=$(git rev-parse --abbrev-ref HEAD)
35
38
  ```bash
36
39
  echo "Scanning worktrees..."
37
40
 
38
- git worktree list > /tmp/worktrees.txt
41
+ mkdir -p .claude/gitflow/cache
42
+ git worktree list > .claude/gitflow/cache/worktrees.txt
39
43
 
40
44
  ORPHANED=()
41
45
  STALE=()
@@ -54,13 +58,13 @@ while read -r line; do
54
58
 
55
59
  # Check if branch still exists on remote
56
60
  REMOTE_EXISTS=$(git branch -r --list "origin/$WT_BRANCH" | wc -l)
57
- if [ "$REMOTE_EXISTS" -eq 0 ] && [[ "$WT_BRANCH" != "main" ]] && [[ "$WT_BRANCH" != "develop" ]]; then
61
+ if [ "$REMOTE_EXISTS" -eq 0 ] && [[ "$WT_BRANCH" != "$GF_MAIN_BRANCH" ]] && [[ "$WT_BRANCH" != "$GF_DEVELOP_BRANCH" ]]; then
58
62
  STALE+=("$WT_PATH:$WT_BRANCH")
59
63
  continue
60
64
  fi
61
65
 
62
66
  VALID+=("$WT_PATH:$WT_BRANCH")
63
- done < /tmp/worktrees.txt
67
+ done < .claude/gitflow/cache/worktrees.txt
64
68
  ```
65
69
 
66
70
  ### 2. Audit Local Branches
@@ -72,17 +76,17 @@ MERGED_BRANCHES=()
72
76
  UNMERGED_BRANCHES=()
73
77
 
74
78
  # Find merged branches
75
- for branch in $(git branch --merged develop | grep -v "^\*" | grep -v "main" | grep -v "develop"); do
79
+ for branch in $(git branch --merged $GF_DEVELOP_BRANCH | grep -v "^\*" | grep -v "$GF_MAIN_BRANCH" | grep -v "$GF_DEVELOP_BRANCH"); do
76
80
  # Check if remote exists
77
81
  REMOTE_EXISTS=$(git branch -r --list "origin/$branch" | wc -l)
78
82
  [ "$REMOTE_EXISTS" -eq 0 ] && MERGED_BRANCHES+=("$branch")
79
83
  done
80
84
 
81
85
  # Find branches without remote
82
- for branch in $(git branch | grep -v "^\*" | grep -v "main" | grep -v "develop"); do
86
+ for branch in $(git branch | grep -v "^\*" | grep -v "$GF_MAIN_BRANCH" | grep -v "$GF_DEVELOP_BRANCH"); do
83
87
  REMOTE_EXISTS=$(git branch -r --list "origin/$branch" | wc -l)
84
88
  [ "$REMOTE_EXISTS" -eq 0 ] && {
85
- MERGED=$(git branch --merged develop | grep -c "$branch")
89
+ MERGED=$(git branch --merged $GF_DEVELOP_BRANCH | grep -c "$branch")
86
90
  [ "$MERGED" -eq 0 ] && UNMERGED_BRANCHES+=("$branch")
87
91
  }
88
92
  done
@@ -13,16 +13,15 @@ Display complete GitFlow state including branches, worktrees, remotes, and pendi
13
13
 
14
14
  ## EXECUTION:
15
15
 
16
- ### 1. Repository Info
16
+ ### 1. Load Config and Repository Info
17
17
 
18
18
  ```bash
19
- REPO_NAME=$(basename $(git rev-parse --show-toplevel))
20
- CURRENT=$(git rev-parse --abbrev-ref HEAD)
21
- REMOTE_URL=$(git remote get-url origin 2>/dev/null || echo "No remote")
19
+ # Load GitFlow config (sets GF_* variables)
20
+ read_gitflow_config || { echo "❌ Run /gitflow init first."; exit 1; }
22
21
 
23
- # Detect provider
24
- [[ "$REMOTE_URL" == *"github.com"* ]] && GIT_PROVIDER="GitHub"
25
- [[ "$REMOTE_URL" == *"dev.azure.com"* ]] && GIT_PROVIDER="Azure DevOps"
22
+ REPO_NAME="$GF_PROJECT_NAME"
23
+ CURRENT=$(git rev-parse --abbrev-ref HEAD)
24
+ GIT_PROVIDER="$GF_PROVIDER"
26
25
  ```
27
26
 
28
27
  ### 2. Branch Status
@@ -30,27 +29,27 @@ REMOTE_URL=$(git remote get-url origin 2>/dev/null || echo "No remote")
30
29
  ```bash
31
30
  git fetch origin --quiet
32
31
 
33
- # Main branches
34
- MAIN_LOCAL=$(git rev-parse --short main 2>/dev/null || echo "N/A")
35
- MAIN_REMOTE=$(git rev-parse --short origin/main 2>/dev/null || echo "N/A")
36
- DEVELOP_LOCAL=$(git rev-parse --short develop 2>/dev/null || echo "N/A")
37
- DEVELOP_REMOTE=$(git rev-parse --short origin/develop 2>/dev/null || echo "N/A")
32
+ # Main branches (from config)
33
+ MAIN_LOCAL=$(git rev-parse --short $GF_MAIN_BRANCH 2>/dev/null || echo "N/A")
34
+ MAIN_REMOTE=$(git rev-parse --short origin/$GF_MAIN_BRANCH 2>/dev/null || echo "N/A")
35
+ DEVELOP_LOCAL=$(git rev-parse --short $GF_DEVELOP_BRANCH 2>/dev/null || echo "N/A")
36
+ DEVELOP_REMOTE=$(git rev-parse --short origin/$GF_DEVELOP_BRANCH 2>/dev/null || echo "N/A")
38
37
 
39
38
  # Divergence
40
- DEVELOP_AHEAD=$(git rev-list --count origin/main..origin/develop 2>/dev/null || echo "0")
39
+ DEVELOP_AHEAD=$(git rev-list --count origin/$GF_MAIN_BRANCH..origin/$GF_DEVELOP_BRANCH 2>/dev/null || echo "0")
41
40
  ```
42
41
 
43
42
  ### 3. Active Branches
44
43
 
45
44
  ```bash
46
- # Feature branches
47
- FEATURES=$(git branch -r | grep "origin/feature/" | sed 's/origin\///')
45
+ # Feature branches (using prefixes from config)
46
+ FEATURES=$(git branch -r | grep "origin/${GF_FEATURE_PREFIX}" | sed 's/origin\///')
48
47
 
49
48
  # Release branches
50
- RELEASES=$(git branch -r | grep "origin/release/" | sed 's/origin\///')
49
+ RELEASES=$(git branch -r | grep "origin/${GF_RELEASE_PREFIX}" | sed 's/origin\///')
51
50
 
52
51
  # Hotfix branches
53
- HOTFIXES=$(git branch -r | grep "origin/hotfix/" | sed 's/origin\///')
52
+ HOTFIXES=$(git branch -r | grep "origin/${GF_HOTFIX_PREFIX}" | sed 's/origin\///')
54
53
  ```
55
54
 
56
55
  ### 4. Worktree Status
@@ -28,20 +28,26 @@ Validate changes, check EF Core migrations, and create commit with proper messag
28
28
 
29
29
  ### 0. Pre-commit Guards
30
30
 
31
+ **0.0 Load Config:**
32
+ ```bash
33
+ # Load GitFlow config (sets GF_* variables)
34
+ read_gitflow_config || { echo "❌ Run /gitflow init first."; exit 1; }
35
+ ```
36
+
31
37
  **0.1 Branch Protection:**
32
38
  ```bash
33
39
  CURRENT=$(git rev-parse --abbrev-ref HEAD)
34
40
 
35
41
  # BLOCK: main
36
- [[ "$CURRENT" == "main" ]] && {
37
- echo "⛔ COMMIT BLOCKED - main is protected"
42
+ [[ "$CURRENT" == "$GF_MAIN_BRANCH" ]] && {
43
+ echo "⛔ COMMIT BLOCKED - $GF_MAIN_BRANCH is protected"
38
44
  echo "→ Use: /gitflow start hotfix <name>"
39
45
  STOP
40
46
  }
41
47
 
42
48
  # WARNING: develop
43
- [[ "$CURRENT" == "develop" ]] && {
44
- echo "⚠️ Direct commits to develop are discouraged"
49
+ [[ "$CURRENT" == "$GF_DEVELOP_BRANCH" ]] && {
50
+ echo "⚠️ Direct commits to $GF_DEVELOP_BRANCH are discouraged"
45
51
  # Offer RESCUE TO FEATURE
46
52
  }
47
53
  ```
@@ -52,7 +58,7 @@ git fetch origin --quiet
52
58
  STAGED=$(git diff --cached --name-only | wc -l)
53
59
  MODIFIED=$(git diff --name-only | wc -l)
54
60
  UNTRACKED=$(git ls-files --others --exclude-standard | wc -l)
55
- LOCAL_COMMITS=$(git rev-list --count origin/develop..HEAD 2>/dev/null || echo "0")
61
+ LOCAL_COMMITS=$(git rev-list --count origin/$GF_DEVELOP_BRANCH..HEAD 2>/dev/null || echo "0")
56
62
 
57
63
  # If there are changes or commits, offer rescue
58
64
  [ "$STAGED" -gt 0 ] || [ "$MODIFIED" -gt 0 ] || [ "$LOCAL_COMMITS" -gt 0 ] && {