@atlashub/smartstack-cli 1.20.0 → 1.22.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlashub/smartstack-cli",
3
- "version": "1.20.0",
3
+ "version": "1.22.0",
4
4
  "description": "SmartStack Claude Code automation toolkit - GitFlow, APEX, EF Core migrations, prompts and more",
5
5
  "author": {
6
6
  "name": "SmartStack",
@@ -9,34 +9,27 @@ Execute GitFlow workflows with automatic versioning, worktree management, and EF
9
9
  </objective>
10
10
 
11
11
  <quick_start>
12
- **Start a feature:**
12
+ **Manual workflow (step-by-step, recommended):**
13
13
  ```bash
14
- /gitflow start feature user-auth
15
- /gitflow -f user-auth # Shorthand
14
+ /gitflow -f user-auth # Start feature → STOPS
15
+ # ... code ...
16
+ /gitflow commit # Commit → STOPS
17
+ /gitflow pr # Create PR → STOPS (wait review)
18
+ /gitflow merge # Merge → STOPS
19
+ /gitflow finish # Cleanup → DONE
16
20
  ```
17
21
 
18
- **Commit with EF Core validation:**
22
+ **Automatic workflow (all-in-one):**
19
23
  ```bash
20
- /gitflow commit # Interactive
21
- /gitflow -a commit "Add login" # Auto mode
22
- ```
23
-
24
- **Create PR and merge:**
25
- ```bash
26
- /gitflow pr # Create PR
27
- /gitflow merge # Merge after approval
28
- ```
29
-
30
- **Complete workflow (feature):**
31
- ```bash
32
- /gitflow -a -f my-feature # Auto + feature mode
24
+ /gitflow -a -f my-feature # Full auto: all steps
25
+ /gitflow -a -r 1.20.0 # Full auto: release
33
26
  ```
34
27
 
35
28
  **Flags:**
36
- - `-a` (auto): Skip confirmations
37
- - `-f` (feature): Feature workflow
38
- - `-r` (release): Release workflow
39
- - `-h` (hotfix): Hotfix workflow
29
+ - `-a` (auto): **Execute ALL steps automatically** (without = one step then stop)
30
+ - `-f` (feature): Feature workflow (target: develop)
31
+ - `-r` (release): Release workflow (target: main)
32
+ - `-h` (hotfix): Hotfix workflow (target: main)
40
33
  - `-s` (status): Show status only
41
34
  </quick_start>
42
35
 
@@ -53,11 +46,13 @@ Execute GitFlow workflows with automatic versioning, worktree management, and EF
53
46
  **Behavior flags:**
54
47
  | Short | Long | Description |
55
48
  |-------|------|-------------|
56
- | `-a` | `--auto` | Autonomous mode: skip confirmations |
49
+ | `-a` | `--auto` | **Full automatic mode**: execute ALL steps without stopping |
57
50
  | `-s` | `--status` | Status mode: show state only, no actions |
58
51
  | `-v` | `--verbose` | Verbose output |
59
52
  | `--dry-run` | | Preview actions without executing |
60
53
 
54
+ **⚠️ CRITICAL: Without `-a`, each command executes ONLY its own step then STOPS.**
55
+
61
56
  **Disable flags:**
62
57
  | Short | Long | Description |
63
58
  |-------|------|-------------|
@@ -87,48 +82,42 @@ Execute GitFlow workflows with automatic versioning, worktree management, and EF
87
82
 
88
83
  <examples>
89
84
  ```bash
90
- # Initialize GitFlow
91
- /gitflow init
92
-
93
- # Start feature with worktree
94
- /gitflow start feature payment-integration
95
- /gitflow -f payment-integration # Shorthand
96
-
97
- # Start release
98
- /gitflow start release 2.0.0
99
- /gitflow -r 2.0.0 # Shorthand
100
-
101
- # Start hotfix
102
- /gitflow start hotfix critical-fix
103
- /gitflow -h critical-fix # Shorthand
104
-
105
- # Commit (with EF Core validation)
106
- /gitflow commit
107
- /gitflow -a commit "Fix bug" # Auto mode
108
-
109
- # Sync with remote
110
- /gitflow sync
111
-
112
- # Create PR
113
- /gitflow pr
114
-
115
- # Merge after review
116
- /gitflow merge
117
-
118
- # Finalize branch
119
- /gitflow finish
120
-
121
- # Status check
122
- /gitflow status
123
- /gitflow -s # Shorthand
124
-
125
- # Abort/rollback
126
- /gitflow abort
127
- /gitflow abort --checkpoint # Restore from checkpoint
128
-
129
- # Cleanup worktrees
130
- /gitflow cleanup
131
- /gitflow cleanup --dry-run # Preview only
85
+ # ══════════════════════════════════════════════════════════════
86
+ # STEP-BY-STEP MODE (default - recommended)
87
+ # Each command executes ONE step, then waits for user
88
+ # ══════════════════════════════════════════════════════════════
89
+
90
+ # Feature workflow (manual steps)
91
+ /gitflow -f my-feature # 1. Creates branch → STOPS
92
+ # ... user codes ...
93
+ /gitflow commit # 2. Commits changes → STOPS
94
+ /gitflow pr # 3. Creates PR → STOPS (wait for review)
95
+ /gitflow merge # 4. Merges PR → STOPS
96
+ /gitflow finish # 5. Cleanup → DONE
97
+
98
+ # Release workflow (manual steps)
99
+ /gitflow -r 1.20.0 # 1. Creates branch + bump version → STOPS
100
+ /gitflow pr # 2. Creates PR to main → STOPS (wait for review)
101
+ /gitflow merge # 3. Merges PR → STOPS
102
+ /gitflow finish # 4. Tag + merge-back + cleanup DONE
103
+
104
+ # ══════════════════════════════════════════════════════════════
105
+ # AUTOMATIC MODE (-a flag)
106
+ # Executes ALL steps without stopping
107
+ # ══════════════════════════════════════════════════════════════
108
+
109
+ /gitflow -a -f my-feature # Full auto: branch → commit → pr → merge → finish
110
+ /gitflow -a -r 1.20.0 # Full auto: branch → bump → pr → merge → tag → cleanup
111
+ /gitflow -a -h fix-bug # Full auto: hotfix complete cycle
112
+
113
+ # ══════════════════════════════════════════════════════════════
114
+ # UTILITY COMMANDS
115
+ # ══════════════════════════════════════════════════════════════
116
+
117
+ /gitflow status # Show current state
118
+ /gitflow -s # Shorthand for status
119
+ /gitflow abort # Rollback current operation
120
+ /gitflow cleanup # Audit and remove orphan worktrees
132
121
  ```
133
122
  </examples>
134
123
 
@@ -264,6 +253,24 @@ start ──► commit* ──► sync ──► pr ──► merge ──► fi
264
253
  - **Follow next_step directive** at end of each step
265
254
  - **NEVER skip EF Core validation** - migrations are critical
266
255
  - **Safety > Correctness > Speed**
256
+
257
+ **⚠️ CRITICAL - STEP EXECUTION POLICY:**
258
+
259
+ | Mode | Behavior |
260
+ |------|----------|
261
+ | **Without `-a`** | Execute ONLY the requested step, then **STOP and wait for user** |
262
+ | **With `-a`** | Execute ALL steps automatically (start → commit → pr → merge → finish) |
263
+
264
+ **Examples:**
265
+ ```bash
266
+ /gitflow -r 1.20.0 # Creates branch + bump version → STOPS (user runs /gitflow pr next)
267
+ /gitflow -r -a 1.20.0 # Full automatic: branch → bump → PR → merge → tag → cleanup
268
+ /gitflow -f my-feature # Creates branch → STOPS (user codes, then runs /gitflow commit)
269
+ /gitflow -f -a feature # Full automatic: branch → commit → PR → merge → finish
270
+ ```
271
+
272
+ **NEVER chain steps automatically without `-a` flag. The user decides the pace.**
273
+
267
274
  </execution_rules>
268
275
 
269
276
  <success_criteria>
@@ -19,6 +19,9 @@ Set up GitFlow configuration, create main/develop branches, and configure worktr
19
19
  ### 1. Detect Environment
20
20
 
21
21
  ```bash
22
+ # Check if we're in a git repository
23
+ IS_GIT_REPO=$(git rev-parse --git-dir 2>/dev/null && echo "true" || echo "false")
24
+
22
25
  # Check if already initialized
23
26
  [ -f ".claude/gitflow/config.json" ] && {
24
27
  echo "GitFlow already initialized"
@@ -35,6 +38,15 @@ else
35
38
  GIT_PROVIDER="unknown"
36
39
  fi
37
40
 
41
+ # Auto-detect project name from remote URL or folder name
42
+ if [[ -n "$REMOTE_URL" ]]; then
43
+ # Extract repo name from URL (works for github and azure devops)
44
+ PROJECT_NAME=$(basename -s .git "$REMOTE_URL")
45
+ else
46
+ # Use current folder name
47
+ PROJECT_NAME=$(basename "$(pwd)")
48
+ fi
49
+
38
50
  # Detect existing branches
39
51
  HAS_MAIN=$(git branch -r --list "origin/main" | wc -l)
40
52
  HAS_DEVELOP=$(git branch -r --list "origin/develop" | wc -l)
@@ -42,6 +54,36 @@ HAS_DEVELOP=$(git branch -r --list "origin/develop" | wc -l)
42
54
 
43
55
  ### 2. Configuration Questions
44
56
 
57
+ **If NOT in a git repository (`IS_GIT_REPO` = false):**
58
+
59
+ ```yaml
60
+ AskUserQuestion:
61
+ - header: "Folder"
62
+ question: "Where should the project be initialized?"
63
+ options:
64
+ - label: "Current directory (Recommended)"
65
+ description: "Initialize GitFlow in {pwd}"
66
+ - label: "Create new folder"
67
+ description: "Create a new folder and initialize there"
68
+ - label: "Choose existing folder"
69
+ description: "Navigate to an existing folder"
70
+ ```
71
+
72
+ **Always ask (Custom Setup only, or if auto-detected name is wrong):**
73
+
74
+ ```yaml
75
+ AskUserQuestion:
76
+ - header: "Project"
77
+ question: "What is the project name? (detected: {PROJECT_NAME})"
78
+ options:
79
+ - label: "Use detected name (Recommended)"
80
+ description: "Use '{PROJECT_NAME}' as project name"
81
+ - label: "Enter custom name"
82
+ description: "Specify a different project name"
83
+ ```
84
+
85
+ **Setup mode:**
86
+
45
87
  ```yaml
46
88
  AskUserQuestion:
47
89
  - header: "Mode"
@@ -65,6 +107,31 @@ AskUserQuestion:
65
107
  description: "No worktrees, use git checkout"
66
108
  ```
67
109
 
110
+ **Question flow logic:**
111
+ - Quick Setup: Skip project name question (use auto-detected)
112
+ - Custom Setup: Ask all questions including project name
113
+ - Not in git repo: Ask folder question first, then `git init`
114
+
115
+ ### 2.5 Initialize Git Repository (if needed)
116
+
117
+ **If `IS_GIT_REPO` = false:**
118
+
119
+ ```bash
120
+ # Navigate to chosen folder if user selected "Create new folder" or "Choose existing folder"
121
+ [ -n "$TARGET_FOLDER" ] && {
122
+ mkdir -p "$TARGET_FOLDER"
123
+ cd "$TARGET_FOLDER"
124
+ }
125
+
126
+ # Initialize git repository
127
+ git init
128
+
129
+ # Update PROJECT_NAME if user provided custom name
130
+ [ -n "$CUSTOM_PROJECT_NAME" ] && PROJECT_NAME="$CUSTOM_PROJECT_NAME"
131
+
132
+ echo "Git repository initialized in $(pwd)"
133
+ ```
134
+
68
135
  ### 3. Create Branches (if needed)
69
136
 
70
137
  ```bash
@@ -106,7 +173,7 @@ esac
106
173
  {
107
174
  "version": "2.0.0",
108
175
  "repository": {
109
- "name": "{repo_name}",
176
+ "name": "{PROJECT_NAME}",
110
177
  "defaultBranch": "main",
111
178
  "remoteUrl": "{remote_url}"
112
179
  },
@@ -176,7 +243,7 @@ VERSION=$(grep -oP '<Version>\K[^<]+' *.csproj 2>/dev/null | head -1)
176
243
  ╔══════════════════════════════════════════════════════════════════╗
177
244
  ║ GITFLOW INITIALIZED ║
178
245
  ╠══════════════════════════════════════════════════════════════════╣
179
- Repository: {repo_name}
246
+ Project: {PROJECT_NAME}
180
247
  ║ Provider: {github|azuredevops} ║
181
248
  ║ Version: {X.Y.Z} ║
182
249
  ╠══════════════════════════════════════════════════════════════════╣