@atlashub/smartstack-cli 1.32.0 → 1.34.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/.documentation/installation.html +5 -11
- package/README.md +43 -600
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/skills/gitflow/steps/step-init.md +141 -20
package/package.json
CHANGED
|
@@ -16,7 +16,8 @@ Set up GitFlow configuration with bare repository, worktrees, and branches.
|
|
|
16
16
|
|
|
17
17
|
## MANDATORY QUESTIONS
|
|
18
18
|
|
|
19
|
-
**⛔ ALWAYS ask these 3 questions, even if values can be auto-detected
|
|
19
|
+
**⛔ ALWAYS ask these 3 questions, even if values can be auto-detected.**
|
|
20
|
+
**⛔ ALWAYS detect workspace context (step 2) to show sibling projects.**
|
|
20
21
|
|
|
21
22
|
| Question | Variable | Auto-detect from |
|
|
22
23
|
|----------|----------|------------------|
|
|
@@ -24,6 +25,10 @@ Set up GitFlow configuration with bare repository, worktrees, and branches.
|
|
|
24
25
|
| Root folder | `{ROOT_FOLDER}` | Parent of current directory |
|
|
25
26
|
| Project name | `{PROJECT_NAME}` | Repo name from URL or folder |
|
|
26
27
|
|
|
28
|
+
**Multi-project principle:** Each repository has its OWN independent GitFlow config. Step 2 scans for sibling projects to provide context, not to share configuration.
|
|
29
|
+
|
|
30
|
+
**⛔ FOLLOW-UP RULE:** When a user selects a "Custom..." option (custom name, custom path, custom URL), that selection is just a CHOICE, not the actual value. You MUST immediately ask a follow-up question to capture the actual value. Never proceed with a blank or default value.
|
|
31
|
+
|
|
27
32
|
---
|
|
28
33
|
|
|
29
34
|
## EXECUTION SEQUENCE:
|
|
@@ -52,7 +57,51 @@ fi
|
|
|
52
57
|
ALREADY_INITIALIZED=$([ -f ".claude/gitflow/config.json" ] && echo "true" || echo "false")
|
|
53
58
|
```
|
|
54
59
|
|
|
55
|
-
### 2.
|
|
60
|
+
### 2. Detect Workspace (multi-project context)
|
|
61
|
+
|
|
62
|
+
**Scan the parent directory for sibling projects already using GitFlow:**
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
WORKSPACE_DIR=$(dirname "$(pwd)")
|
|
66
|
+
SIBLING_PROJECTS=()
|
|
67
|
+
|
|
68
|
+
for dir in "$WORKSPACE_DIR"/*/; do
|
|
69
|
+
[ -d "$dir/.bare" ] || [ -d "$dir/01-Main" ] || [ -d "$dir/02-Develop" ] && {
|
|
70
|
+
PROJECT_NAME_SIBLING=$(basename "$dir")
|
|
71
|
+
SIBLING_PROJECTS+=("$PROJECT_NAME_SIBLING")
|
|
72
|
+
}
|
|
73
|
+
done
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Display workspace context:**
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
80
|
+
│ WORKSPACE: {WORKSPACE_DIR} │
|
|
81
|
+
├─────────────────────────────────────────────────────────────┤
|
|
82
|
+
│ Each project has its OWN independent GitFlow configuration. │
|
|
83
|
+
│ This init configures only: {DETECTED_NAME} │
|
|
84
|
+
├─────────────────────────────────────────────────────────────┤
|
|
85
|
+
{if SIBLING_PROJECTS not empty}
|
|
86
|
+
│ Existing GitFlow projects: │
|
|
87
|
+
│ {for each SIBLING} ✅ {SIBLING_NAME}/ │
|
|
88
|
+
│ ├── .bare/ 01-Main/ 02-Develop/ │
|
|
89
|
+
│ └── features/ releases/ hotfixes/ │
|
|
90
|
+
│ {end for} │
|
|
91
|
+
│ │
|
|
92
|
+
│ New project to initialize: │
|
|
93
|
+
│ ⬜ {DETECTED_NAME}/ │
|
|
94
|
+
│ └── (same structure will be created) │
|
|
95
|
+
{else}
|
|
96
|
+
│ No existing GitFlow projects detected. │
|
|
97
|
+
│ This will be the first project in this workspace. │
|
|
98
|
+
{endif}
|
|
99
|
+
└─────────────────────────────────────────────────────────────┘
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Key principle:** GitFlow is **per-repository**. Each project has its own `config.json`, its own worktree structure, and its own version history. Projects do not share configuration.
|
|
103
|
+
|
|
104
|
+
### 3. Handle Existing Configuration
|
|
56
105
|
|
|
57
106
|
**If `ALREADY_INITIALIZED` = true:**
|
|
58
107
|
|
|
@@ -75,12 +124,12 @@ AskUserQuestion:
|
|
|
75
124
|
```
|
|
76
125
|
|
|
77
126
|
**Handle choices:**
|
|
78
|
-
- **Reconfigure**: Continue to step
|
|
127
|
+
- **Reconfigure**: Continue to step 4 (will ask all questions again)
|
|
79
128
|
- **Repair**: Check directories, fix missing ones, exit
|
|
80
129
|
- **View only**: Display config, exit
|
|
81
130
|
- **Cancel**: Exit immediately
|
|
82
131
|
|
|
83
|
-
###
|
|
132
|
+
### 4. MANDATORY: Ask Repository URL
|
|
84
133
|
|
|
85
134
|
**⛔ ALWAYS ask, even if URL was detected:**
|
|
86
135
|
|
|
@@ -100,34 +149,83 @@ AskUserQuestion:
|
|
|
100
149
|
multiSelect: false
|
|
101
150
|
```
|
|
102
151
|
|
|
103
|
-
|
|
104
|
-
|
|
152
|
+
**⛔ FOLLOW-UP: If user selects "Enter GitHub URL" or "Enter Azure DevOps URL":**
|
|
153
|
+
|
|
154
|
+
The selected option is just a choice, NOT the actual URL. You MUST ask a follow-up question:
|
|
155
|
+
|
|
156
|
+
```yaml
|
|
157
|
+
AskUserQuestion:
|
|
158
|
+
- header: "URL"
|
|
159
|
+
question: "Enter the repository URL:"
|
|
160
|
+
options:
|
|
161
|
+
- label: "https://github.com/org/repo.git"
|
|
162
|
+
description: "Example GitHub format"
|
|
163
|
+
- label: "https://dev.azure.com/org/project/_git/repo"
|
|
164
|
+
description: "Example Azure DevOps format"
|
|
165
|
+
multiSelect: false
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
The user will type the actual URL via "Other". Then:
|
|
105
169
|
- Validate format
|
|
106
170
|
- Update `{REPO_URL}` and `{GIT_PROVIDER}`
|
|
107
171
|
|
|
108
|
-
###
|
|
172
|
+
### 5. MANDATORY: Ask Root Folder
|
|
173
|
+
|
|
174
|
+
**⛔ ALWAYS ask where to create THIS project's structure:**
|
|
109
175
|
|
|
110
|
-
|
|
176
|
+
**If sibling projects exist, show where it fits:**
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
{WORKSPACE_DIR}/
|
|
180
|
+
├── SmartStack.app/ ✅ (gitflow)
|
|
181
|
+
├── SmartStack.mcp/ ✅ (gitflow)
|
|
182
|
+
├── SmartStack.cli/ ✅ (gitflow)
|
|
183
|
+
└── NewProject/ ← THIS PROJECT
|
|
184
|
+
├── .bare/
|
|
185
|
+
├── 01-Main/
|
|
186
|
+
├── 02-Develop/
|
|
187
|
+
├── features/
|
|
188
|
+
├── releases/
|
|
189
|
+
└── hotfixes/
|
|
190
|
+
```
|
|
111
191
|
|
|
112
192
|
```yaml
|
|
113
193
|
AskUserQuestion:
|
|
114
194
|
- header: "Location"
|
|
115
|
-
question: "Root folder for project? (
|
|
195
|
+
question: "Root folder for THIS project? (worktrees will be created here)"
|
|
116
196
|
options:
|
|
117
197
|
- label: "Use parent folder (Recommended)"
|
|
118
|
-
description: "{DETECTED_FOLDER}/"
|
|
198
|
+
description: "{DETECTED_FOLDER}/ - consistent with {#SIBLING_PROJECTS} sibling project(s)"
|
|
119
199
|
- label: "Use current folder"
|
|
120
200
|
description: "$(pwd)/ - Will create subfolders here"
|
|
121
|
-
- label: "
|
|
201
|
+
- label: "Custom path"
|
|
122
202
|
description: "Specify a different location"
|
|
123
203
|
multiSelect: false
|
|
124
204
|
```
|
|
125
205
|
|
|
126
|
-
|
|
206
|
+
**⛔ FOLLOW-UP: If user selects "Custom path":**
|
|
207
|
+
|
|
208
|
+
You MUST ask a follow-up question to get the actual path:
|
|
209
|
+
|
|
210
|
+
```yaml
|
|
211
|
+
AskUserQuestion:
|
|
212
|
+
- header: "Path"
|
|
213
|
+
question: "Enter the full path for the project root folder:"
|
|
214
|
+
options:
|
|
215
|
+
- label: "{DETECTED_FOLDER}/"
|
|
216
|
+
description: "Parent of current directory"
|
|
217
|
+
- label: "{WORKSPACE_DIR}/"
|
|
218
|
+
description: "Workspace root"
|
|
219
|
+
multiSelect: false
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
The user will type the actual path via "Other". Validate the path exists or can be created.
|
|
223
|
+
|
|
224
|
+
**Explain the structure that will be created for this project:**
|
|
127
225
|
|
|
128
226
|
```
|
|
129
227
|
{ROOT_FOLDER}/
|
|
130
|
-
├── .bare/ # Git bare repository
|
|
228
|
+
├── .bare/ # Git bare repository (this repo only)
|
|
131
229
|
├── 01-Main/ # Worktree: main branch
|
|
132
230
|
├── 02-Develop/ # Worktree: develop branch
|
|
133
231
|
├── features/ # Feature branch worktrees
|
|
@@ -135,7 +233,7 @@ AskUserQuestion:
|
|
|
135
233
|
└── hotfixes/ # Hotfix branch worktrees
|
|
136
234
|
```
|
|
137
235
|
|
|
138
|
-
###
|
|
236
|
+
### 6. MANDATORY: Ask Project Name
|
|
139
237
|
|
|
140
238
|
**⛔ ALWAYS ask to confirm project name:**
|
|
141
239
|
|
|
@@ -146,12 +244,30 @@ AskUserQuestion:
|
|
|
146
244
|
options:
|
|
147
245
|
- label: "Use detected name (Recommended)"
|
|
148
246
|
description: "Project: {DETECTED_NAME}"
|
|
149
|
-
- label: "
|
|
247
|
+
- label: "Custom name"
|
|
150
248
|
description: "Specify a different project name"
|
|
151
249
|
multiSelect: false
|
|
152
250
|
```
|
|
153
251
|
|
|
154
|
-
|
|
252
|
+
**⛔ FOLLOW-UP: If user selects "Custom name":**
|
|
253
|
+
|
|
254
|
+
You MUST ask a follow-up question to get the actual name:
|
|
255
|
+
|
|
256
|
+
```yaml
|
|
257
|
+
AskUserQuestion:
|
|
258
|
+
- header: "Name"
|
|
259
|
+
question: "Enter the project name:"
|
|
260
|
+
options:
|
|
261
|
+
- label: "{DETECTED_NAME}"
|
|
262
|
+
description: "Detected from repository"
|
|
263
|
+
- label: "{DETECTED_NAME}-v2"
|
|
264
|
+
description: "Variant of detected name"
|
|
265
|
+
multiSelect: false
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
The user will type the actual name via "Other". Use it as `{PROJECT_NAME}`.
|
|
269
|
+
|
|
270
|
+
### 7. Ask Worktree Mode
|
|
155
271
|
|
|
156
272
|
```yaml
|
|
157
273
|
AskUserQuestion:
|
|
@@ -167,7 +283,7 @@ AskUserQuestion:
|
|
|
167
283
|
multiSelect: false
|
|
168
284
|
```
|
|
169
285
|
|
|
170
|
-
###
|
|
286
|
+
### 8. Create Directory Structure
|
|
171
287
|
|
|
172
288
|
**⛔ Create the COMPLETE structure:**
|
|
173
289
|
|
|
@@ -207,7 +323,7 @@ DEVELOP_PATH=$([ "$WORKTREE_MODE" = "organized" ] && echo "02-Develop" || echo "
|
|
|
207
323
|
mkdir -p "$DEVELOP_PATH/.claude/gitflow/{plans,logs,cache,backup}"
|
|
208
324
|
```
|
|
209
325
|
|
|
210
|
-
###
|
|
326
|
+
### 9. Create Configuration
|
|
211
327
|
|
|
212
328
|
**Write `.claude/gitflow/config.json` in develop worktree:**
|
|
213
329
|
|
|
@@ -265,7 +381,7 @@ mkdir -p "$DEVELOP_PATH/.claude/gitflow/{plans,logs,cache,backup}"
|
|
|
265
381
|
}
|
|
266
382
|
```
|
|
267
383
|
|
|
268
|
-
###
|
|
384
|
+
### 10. Detect Version
|
|
269
385
|
|
|
270
386
|
```bash
|
|
271
387
|
# In develop worktree
|
|
@@ -280,7 +396,7 @@ VERSION=$(grep -oP '<Version>\K[^<]+' *.csproj 2>/dev/null | head -1)
|
|
|
280
396
|
[ -z "$VERSION" ] && VERSION="0.1.0"
|
|
281
397
|
```
|
|
282
398
|
|
|
283
|
-
###
|
|
399
|
+
### 11. Summary
|
|
284
400
|
|
|
285
401
|
```
|
|
286
402
|
╔══════════════════════════════════════════════════════════════════╗
|
|
@@ -300,6 +416,11 @@ VERSION=$(grep -oP '<Version>\K[^<]+' *.csproj 2>/dev/null | head -1)
|
|
|
300
416
|
║ ├── releases/ (release worktrees) ✅ ║
|
|
301
417
|
║ └── hotfixes/ (hotfix worktrees) ✅ ║
|
|
302
418
|
╠══════════════════════════════════════════════════════════════════╣
|
|
419
|
+
{if SIBLING_PROJECTS not empty}
|
|
420
|
+
║ Workspace: {WORKSPACE_DIR} ║
|
|
421
|
+
║ GitFlow projects: {#SIBLING_PROJECTS + 1} (including this one) ║
|
|
422
|
+
╠══════════════════════════════════════════════════════════════════╣
|
|
423
|
+
{endif}
|
|
303
424
|
║ Config: 02-Develop/.claude/gitflow/config.json ║
|
|
304
425
|
╠══════════════════════════════════════════════════════════════════╣
|
|
305
426
|
║ NEXT: cd 02-Develop && /gitflow -f <feature-name> ║
|