@atlashub/smartstack-cli 3.51.0 → 3.53.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
|
@@ -10,12 +10,17 @@ tools: Bash, Read, Write, Glob, AskUserQuestion
|
|
|
10
10
|
|
|
11
11
|
You initialize a GitFlow project by orchestrating 3 specialized sub-agents.
|
|
12
12
|
|
|
13
|
+
**IMPORTANT: User questions (root folder, project name, worktree mode) are normally
|
|
14
|
+
handled by the main conversation BEFORE this agent is spawned. If you receive
|
|
15
|
+
pre-confirmed values in your prompt, use them directly. If values are NOT provided,
|
|
16
|
+
you MUST call AskUserQuestion for each missing value before proceeding.**
|
|
17
|
+
|
|
13
18
|
## ARCHITECTURE
|
|
14
19
|
|
|
15
20
|
```
|
|
16
21
|
gitflow-init (you - orchestrator)
|
|
17
22
|
├── Task(gitflow-init-detect) → Environment report
|
|
18
|
-
├── AskUserQuestion →
|
|
23
|
+
├── AskUserQuestion → ONLY if values not pre-confirmed by caller
|
|
19
24
|
├── Task(gitflow-init-clone) → Create structure (skip if disabled)
|
|
20
25
|
├── Write config.json → v2.1.0 with platform & workspace
|
|
21
26
|
└── Task(gitflow-init-validate) → Verify & repair (skip if disabled)
|
|
@@ -95,188 +100,104 @@ Parse the report to extract:
|
|
|
95
100
|
|
|
96
101
|
---
|
|
97
102
|
|
|
98
|
-
## STEP 2: ASK USER
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
## STEP 2: ASK USER — MANDATORY INTERACTIVE QUESTIONS
|
|
104
|
+
|
|
105
|
+
╔══════════════════════════════════════════════════════════════════════════╗
|
|
106
|
+
║ MANDATORY TOOL CALL REQUIREMENT ║
|
|
107
|
+
║ ║
|
|
108
|
+
║ You MUST call the AskUserQuestion tool AT LEAST 3 TIMES in this step. ║
|
|
109
|
+
║ (4 times if URL was not provided in the command.) ║
|
|
110
|
+
║ ║
|
|
111
|
+
║ Each call = ONE question. Wait for the user's response before asking ║
|
|
112
|
+
║ the next question. ║
|
|
113
|
+
║ ║
|
|
114
|
+
║ You are FORBIDDEN from: ║
|
|
115
|
+
║ - Deriving values from the URL or environment instead of asking ║
|
|
116
|
+
║ - Deciding what the user "would probably choose" ║
|
|
117
|
+
║ - Proceeding to step 3 without having received user responses ║
|
|
118
|
+
║ - Using detected/inferred values as final values without user confirm ║
|
|
119
|
+
║ ║
|
|
120
|
+
║ Auto-detected values from step 1 are SUGGESTIONS for the options, ║
|
|
121
|
+
║ NOT answers. The user MUST confirm or override each one. ║
|
|
122
|
+
╚══════════════════════════════════════════════════════════════════════════╝
|
|
123
|
+
|
|
124
|
+
> **Reconfigure mode:** When `EXISTING_GITFLOW=true` and user chose "Reconfigure", show existing values as "(Current)" recommended options in each question.
|
|
107
125
|
|
|
108
126
|
### 2a. Repository URL
|
|
109
127
|
|
|
110
|
-
**If user provided a URL in the command (starts with `https://` or `git@`), use it directly.**
|
|
128
|
+
**If user provided a URL in the command (starts with `https://` or `git@`), use it directly. Skip to 2b.**
|
|
111
129
|
|
|
112
|
-
Otherwise
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
"question": "Repository URL? (detected: {DETECTED_URL})",
|
|
119
|
-
"header": "Repository",
|
|
120
|
-
"options": [
|
|
121
|
-
{"label": "Use detected URL (Recommended)", "description": "{DETECTED_URL}"},
|
|
122
|
-
{"label": "Enter GitHub URL", "description": "https://github.com/org/repo.git"},
|
|
123
|
-
{"label": "Enter Azure DevOps URL", "description": "https://dev.azure.com/org/project/_git/repo"},
|
|
124
|
-
{"label": "Local only (no remote)", "description": "Initialize without remote"}
|
|
125
|
-
],
|
|
126
|
-
"multiSelect": false
|
|
127
|
-
}]
|
|
128
|
-
}
|
|
129
|
-
```
|
|
130
|
+
Otherwise, CALL the AskUserQuestion tool NOW with:
|
|
131
|
+
- header: "Repository"
|
|
132
|
+
- question: "Repository URL? (detected: {DETECTED_URL})"
|
|
133
|
+
- options: Use detected URL (Recommended) / Enter GitHub URL / Enter Azure DevOps URL / Local only
|
|
134
|
+
- **If user selects a custom option, CALL AskUserQuestion again for the actual URL.**
|
|
135
|
+
- Store the result as `{REPO_URL}`.
|
|
130
136
|
|
|
131
|
-
|
|
132
|
-
```json
|
|
133
|
-
{
|
|
134
|
-
"questions": [{
|
|
135
|
-
"question": "Repository URL? (current: {EXISTING_URL})",
|
|
136
|
-
"header": "Repository",
|
|
137
|
-
"options": [
|
|
138
|
-
{"label": "Keep current (Recommended)", "description": "{EXISTING_URL}"},
|
|
139
|
-
{"label": "Enter GitHub URL", "description": "https://github.com/org/repo.git"},
|
|
140
|
-
{"label": "Enter Azure DevOps URL", "description": "https://dev.azure.com/org/project/_git/repo"},
|
|
141
|
-
{"label": "Local only (no remote)", "description": "Initialize without remote"}
|
|
142
|
-
],
|
|
143
|
-
"multiSelect": false
|
|
144
|
-
}]
|
|
145
|
-
}
|
|
146
|
-
```
|
|
137
|
+
### 2b. Root Folder — CALL AskUserQuestion NOW
|
|
147
138
|
|
|
148
|
-
|
|
139
|
+
DO NOT SKIP THIS. DO NOT auto-derive from the URL.
|
|
149
140
|
|
|
150
|
-
|
|
141
|
+
CALL the AskUserQuestion tool with:
|
|
142
|
+
- header: "Location"
|
|
143
|
+
- question: "Root folder for this project? (worktrees will be created here)"
|
|
144
|
+
- options: Use parent folder (Recommended): "{PARENT_DIR}/" / Use current folder: "{CURRENT_DIR}/" / Custom path
|
|
145
|
+
- In reconfigure mode: add "Keep current" option with `{EXISTING_ROOT}`
|
|
146
|
+
- **If user selects "Custom path", CALL AskUserQuestion again for the actual path.**
|
|
151
147
|
|
|
152
|
-
|
|
148
|
+
WAIT for the user's response. Store as `{PROJECT_BASE}`.
|
|
153
149
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
"questions": [{
|
|
158
|
-
"question": "Root folder for this project? (worktrees will be created here)",
|
|
159
|
-
"header": "Location",
|
|
160
|
-
"options": [
|
|
161
|
-
{"label": "Use parent folder (Recommended)", "description": "{PARENT_DIR}/ - consistent with {SIBLING_COUNT} sibling project(s)"},
|
|
162
|
-
{"label": "Use current folder", "description": "{CURRENT_DIR}/ - will create subfolders here"},
|
|
163
|
-
{"label": "Custom path", "description": "Specify a different location"}
|
|
164
|
-
],
|
|
165
|
-
"multiSelect": false
|
|
166
|
-
}]
|
|
167
|
-
}
|
|
168
|
-
```
|
|
150
|
+
After getting the response, normalize the path:
|
|
151
|
+
- On WSL: translate Windows paths to /mnt/ format
|
|
152
|
+
- On Windows: ensure forward slashes
|
|
169
153
|
|
|
170
|
-
|
|
171
|
-
```json
|
|
172
|
-
{
|
|
173
|
-
"questions": [{
|
|
174
|
-
"question": "Root folder? (current: {EXISTING_ROOT})",
|
|
175
|
-
"header": "Location",
|
|
176
|
-
"options": [
|
|
177
|
-
{"label": "Keep current (Recommended)", "description": "{EXISTING_ROOT}"},
|
|
178
|
-
{"label": "Use parent folder", "description": "{PARENT_DIR}/"},
|
|
179
|
-
{"label": "Custom path", "description": "Specify a different location"}
|
|
180
|
-
],
|
|
181
|
-
"multiSelect": false
|
|
182
|
-
}]
|
|
183
|
-
}
|
|
184
|
-
```
|
|
154
|
+
### 2c. Project Name — CALL AskUserQuestion NOW
|
|
185
155
|
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
# On WSL: translate Windows paths to /mnt/ format
|
|
189
|
-
# On Windows: ensure forward slashes
|
|
190
|
-
# Store the platform-normalized path as PROJECT_BASE
|
|
191
|
-
```
|
|
156
|
+
DO NOT SKIP THIS. DO NOT auto-derive from the URL.
|
|
192
157
|
|
|
193
|
-
|
|
158
|
+
CALL the AskUserQuestion tool with:
|
|
159
|
+
- header: "Project"
|
|
160
|
+
- question: "Project name? (detected: {DETECTED_NAME})"
|
|
161
|
+
- options: Use detected name (Recommended): "{DETECTED_NAME}" / Custom name
|
|
162
|
+
- In reconfigure mode: add "Keep current" option with `{EXISTING_NAME}`
|
|
163
|
+
- **If user selects "Custom name", CALL AskUserQuestion again for the actual name.**
|
|
194
164
|
|
|
195
|
-
|
|
196
|
-
```json
|
|
197
|
-
{
|
|
198
|
-
"questions": [{
|
|
199
|
-
"question": "Project name? (detected: {DETECTED_NAME})",
|
|
200
|
-
"header": "Project",
|
|
201
|
-
"options": [
|
|
202
|
-
{"label": "Use detected name (Recommended)", "description": "{DETECTED_NAME}"},
|
|
203
|
-
{"label": "Custom name", "description": "Specify a different project name"}
|
|
204
|
-
],
|
|
205
|
-
"multiSelect": false
|
|
206
|
-
}]
|
|
207
|
-
}
|
|
208
|
-
```
|
|
165
|
+
WAIT for the user's response. Store as `{PROJECT_NAME}`.
|
|
209
166
|
|
|
210
|
-
|
|
211
|
-
```json
|
|
212
|
-
{
|
|
213
|
-
"questions": [{
|
|
214
|
-
"question": "Project name? (current: {EXISTING_NAME})",
|
|
215
|
-
"header": "Project",
|
|
216
|
-
"options": [
|
|
217
|
-
{"label": "Keep current (Recommended)", "description": "{EXISTING_NAME}"},
|
|
218
|
-
{"label": "Custom name", "description": "Specify a different project name"}
|
|
219
|
-
],
|
|
220
|
-
"multiSelect": false
|
|
221
|
-
}]
|
|
222
|
-
}
|
|
223
|
-
```
|
|
167
|
+
Then normalize name into variants (PascalCase.Dot, PascalCase, kebab-case, snake_case, Display Name).
|
|
224
168
|
|
|
225
|
-
|
|
169
|
+
### 2d. Worktree Mode — CALL AskUserQuestion NOW
|
|
226
170
|
|
|
227
|
-
|
|
171
|
+
DO NOT SKIP THIS. This question has been skipped in past sessions causing incorrect defaults.
|
|
228
172
|
|
|
229
|
-
|
|
173
|
+
CALL the AskUserQuestion tool with:
|
|
174
|
+
- header: "Worktrees"
|
|
175
|
+
- question: "How should worktrees be organized?"
|
|
176
|
+
- options: Organized (Recommended): "01-Main, 02-Develop, ..." / Simple: "main/, develop/, ..." / Disabled: "No worktrees, use git checkout"
|
|
177
|
+
- In reconfigure mode: add "Keep current: {EXISTING_MODE}" option
|
|
230
178
|
|
|
231
|
-
|
|
232
|
-
```json
|
|
233
|
-
{
|
|
234
|
-
"questions": [{
|
|
235
|
-
"question": "How should worktrees be organized?",
|
|
236
|
-
"header": "Worktrees",
|
|
237
|
-
"options": [
|
|
238
|
-
{"label": "Organized (Recommended)", "description": "01-Main, 02-Develop, features/, releases/, hotfixes/"},
|
|
239
|
-
{"label": "Simple", "description": "main/, develop/, features/, releases/, hotfixes/"},
|
|
240
|
-
{"label": "Disabled", "description": "No worktrees, use git checkout (not recommended)"}
|
|
241
|
-
],
|
|
242
|
-
"multiSelect": false
|
|
243
|
-
}]
|
|
244
|
-
}
|
|
245
|
-
```
|
|
179
|
+
WAIT for the user's response. Store as `{WORKTREE_MODE}` ("organized", "simple", or "disabled").
|
|
246
180
|
|
|
247
|
-
|
|
248
|
-
```json
|
|
249
|
-
{
|
|
250
|
-
"questions": [{
|
|
251
|
-
"question": "How should worktrees be organized? (current: {EXISTING_MODE})",
|
|
252
|
-
"header": "Worktrees",
|
|
253
|
-
"options": [
|
|
254
|
-
{"label": "Keep current: {EXISTING_MODE} (Recommended)", "description": "No change to worktree structure"},
|
|
255
|
-
{"label": "Organized", "description": "01-Main, 02-Develop, features/, releases/, hotfixes/"},
|
|
256
|
-
{"label": "Simple", "description": "main/, develop/, features/, releases/, hotfixes/"},
|
|
257
|
-
{"label": "Disabled", "description": "No worktrees, use git checkout (not recommended)"}
|
|
258
|
-
],
|
|
259
|
-
"multiSelect": false
|
|
260
|
-
}]
|
|
261
|
-
}
|
|
262
|
-
```
|
|
181
|
+
---
|
|
263
182
|
|
|
264
|
-
|
|
183
|
+
## GATE CHECK — SELF-VERIFICATION BEFORE STEP 3
|
|
265
184
|
|
|
266
|
-
|
|
185
|
+
Before proceeding, verify your tool call history for this step:
|
|
267
186
|
|
|
268
|
-
|
|
187
|
+
**Count your AskUserQuestion calls in step 2. The minimum is:**
|
|
188
|
+
- 3 calls if URL was provided in the command (2b + 2c + 2d)
|
|
189
|
+
- 4 calls if URL was NOT provided (2a + 2b + 2c + 2d)
|
|
269
190
|
|
|
270
|
-
|
|
191
|
+
**If your count is less than the minimum, STOP. You have skipped a question. Go back and ask it.**
|
|
271
192
|
|
|
272
|
-
|
|
273
|
-
|----------|----------|--------|
|
|
274
|
-
| {REPO_URL} | ✅ | From command arg OR question 2a |
|
|
275
|
-
| {PROJECT_BASE} | ✅ | From question 2b |
|
|
276
|
-
| {PROJECT_NAME} | ✅ | From question 2c |
|
|
277
|
-
| {WORKTREE_MODE} | ✅ | From question 2d — MUST be "organized", "simple", or "disabled" |
|
|
193
|
+
All 4 variables MUST have been confirmed by the user (not auto-derived):
|
|
278
194
|
|
|
279
|
-
|
|
195
|
+
| Variable | Required | How to verify |
|
|
196
|
+
|----------|----------|---------------|
|
|
197
|
+
| {REPO_URL} | ✅ | From command arg OR user answered question 2a |
|
|
198
|
+
| {PROJECT_BASE} | ✅ | User answered question 2b (NEVER auto-derived) |
|
|
199
|
+
| {PROJECT_NAME} | ✅ | User answered question 2c (NEVER auto-derived) |
|
|
200
|
+
| {WORKTREE_MODE} | ✅ | User answered question 2d (NEVER defaulted to "organized") |
|
|
280
201
|
|
|
281
202
|
---
|
|
282
203
|
|
|
@@ -185,7 +185,7 @@ start ──► commit* ──► sync ──► pr ──► merge ──► fi
|
|
|
185
185
|
|
|
186
186
|
| Input Pattern | Step File | Task Agent (`subagent_type`) |
|
|
187
187
|
|---------------|-----------|----------------------------|
|
|
188
|
-
| `init` | `steps/step-init.md` |
|
|
188
|
+
| `init` | `steps/step-init.md` | **ALWAYS INLINE** (see below) |
|
|
189
189
|
| `start`, `-f`, `-r`, `-h` | `steps/step-start.md` | `gitflow-start` |
|
|
190
190
|
| `commit [msg]` | `steps/step-commit.md` | `gitflow-commit` |
|
|
191
191
|
| `sync` | `steps/step-sync.md` | — |
|
|
@@ -206,6 +206,16 @@ start ──► commit* ──► sync ──► pr ──► merge ──► fi
|
|
|
206
206
|
| **Auto mode** (`-a`) | Use `Task` tool with the matching `subagent_type` for each step sequentially |
|
|
207
207
|
| **Standalone phases** | Always delegate to Task agent (fast, isolated) |
|
|
208
208
|
|
|
209
|
+
**⚠️ SPECIAL RULE FOR `init`:**
|
|
210
|
+
`init` is **ALWAYS executed inline** — NEVER delegate to a Task agent.
|
|
211
|
+
Read `steps/step-init.md` and execute it directly in the main conversation.
|
|
212
|
+
This is mandatory because `init` requires AskUserQuestion calls that MUST
|
|
213
|
+
happen in the main conversation (sub-agents skip questions).
|
|
214
|
+
After the user answers all questions, delegate heavy work to:
|
|
215
|
+
- `Task(gitflow-init-detect)` for environment detection
|
|
216
|
+
- `Task(gitflow-init-clone)` for structure creation
|
|
217
|
+
- `Task(gitflow-init-validate)` for post-init verification
|
|
218
|
+
|
|
209
219
|
</entry_point>
|
|
210
220
|
|
|
211
221
|
<step_files>
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
# MANDATORY User Questions for Init
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
╔══════════════════════════════════════════════════════════════════════════╗
|
|
4
|
+
║ Every question below REQUIRES a call to the AskUserQuestion tool. ║
|
|
5
|
+
║ The YAML blocks are the EXACT parameters to pass to the tool. ║
|
|
6
|
+
║ NEVER substitute a tool call with auto-derived values. ║
|
|
7
|
+
║ NEVER combine questions — one AskUserQuestion call per question. ║
|
|
8
|
+
╚══════════════════════════════════════════════════════════════════════════╝
|
|
4
9
|
|
|
5
10
|
## Question 1: Repository URL
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
**CALL AskUserQuestion with these parameters (skip only if URL provided in command args):**
|
|
8
13
|
|
|
9
14
|
```yaml
|
|
10
15
|
AskUserQuestion:
|
|
@@ -44,7 +49,7 @@ The user will type the actual URL via "Other". Then:
|
|
|
44
49
|
|
|
45
50
|
## Question 2: Root Folder
|
|
46
51
|
|
|
47
|
-
|
|
52
|
+
**CALL AskUserQuestion NOW — do NOT auto-derive from URL:**
|
|
48
53
|
|
|
49
54
|
**If sibling projects exist, show where it fits:**
|
|
50
55
|
|
|
@@ -108,7 +113,7 @@ The user will type the actual path via "Other". Validate the path exists or can
|
|
|
108
113
|
|
|
109
114
|
## Question 3: Project Name
|
|
110
115
|
|
|
111
|
-
|
|
116
|
+
**CALL AskUserQuestion NOW — do NOT auto-derive from URL:**
|
|
112
117
|
|
|
113
118
|
```yaml
|
|
114
119
|
AskUserQuestion:
|
|
@@ -170,8 +175,8 @@ AskUserQuestion:
|
|
|
170
175
|
|
|
171
176
|
## Question 5: Worktree Mode
|
|
172
177
|
|
|
173
|
-
|
|
174
|
-
|
|
178
|
+
CALL AskUserQuestion NOW. This is the MOST FREQUENTLY SKIPPED question.
|
|
179
|
+
Do NOT default to "organized". The user MUST explicitly choose.
|
|
175
180
|
|
|
176
181
|
```yaml
|
|
177
182
|
AskUserQuestion:
|
|
@@ -10,129 +10,106 @@ next_step: null
|
|
|
10
10
|
|
|
11
11
|
Set up GitFlow configuration with bare repository, worktrees, and branches.
|
|
12
12
|
|
|
13
|
-
**
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## MANDATORY QUESTIONS
|
|
18
|
-
|
|
19
|
-
**⛔ ALWAYS ask these 4 questions, even if values can be auto-detected.**
|
|
20
|
-
**⛔ ALWAYS detect workspace context (step 2) to show sibling projects.**
|
|
21
|
-
|
|
22
|
-
| Question | Variable | Auto-detect from |
|
|
23
|
-
|----------|----------|------------------|
|
|
24
|
-
| Repository URL | `{REPO_URL}` | `git remote get-url origin` |
|
|
25
|
-
| Root folder | `{ROOT_FOLDER}` | Parent of current directory |
|
|
26
|
-
| Project name | `{PROJECT_NAME}` | Repo name from URL or folder |
|
|
27
|
-
| Worktree mode | `{WORKTREE_MODE}` | Default: organized |
|
|
28
|
-
|
|
29
|
-
**Multi-project principle:** Each repository has its OWN independent GitFlow config. Step 2 scans for sibling projects to provide context, not to share configuration.
|
|
30
|
-
|
|
31
|
-
**⛔ 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.
|
|
13
|
+
**This step runs INLINE in the main conversation. All AskUserQuestion calls
|
|
14
|
+
happen here (NOT in a sub-agent). Only clone/validate are delegated.**
|
|
32
15
|
|
|
33
16
|
---
|
|
34
17
|
|
|
35
18
|
## EXECUTION SEQUENCE:
|
|
36
19
|
|
|
37
|
-
### 1. Detect Environment (
|
|
38
|
-
|
|
39
|
-
See [references/init-environment-detection.md](../references/init-environment-detection.md) for:
|
|
40
|
-
- Platform detection (WSL/Windows/macOS/Linux)
|
|
41
|
-
- Git provider detection
|
|
42
|
-
- Auto-detect defaults (URL, folder, project name)
|
|
43
|
-
|
|
44
|
-
### 2. Detect Workspace (multi-project context)
|
|
45
|
-
|
|
46
|
-
See [references/init-workspace-detection.md](../references/init-workspace-detection.md) for:
|
|
47
|
-
- Sibling project scanning
|
|
48
|
-
- Workspace context display
|
|
49
|
-
- Per-repository GitFlow principle
|
|
20
|
+
### 1. Detect Environment (delegate to sub-agent)
|
|
50
21
|
|
|
51
|
-
|
|
22
|
+
Spawn `Task(gitflow-init-detect)` (haiku) to detect platform, git state, workspace siblings, provider.
|
|
23
|
+
Parse the report to extract: PLATFORM, SHELL_TYPE, DETECTED_URL, DETECTED_NAME, GIT_PROVIDER, SIBLING_COUNT.
|
|
52
24
|
|
|
53
|
-
|
|
25
|
+
### 2. Check Existing Configuration
|
|
54
26
|
|
|
55
|
-
|
|
27
|
+
If `.claude/gitflow/config.json` exists, ask user: Reconfigure / Repair / View / Cancel.
|
|
28
|
+
If Cancel or View → EXIT. If Repair → delegate to `Task(gitflow-init-validate)` → EXIT.
|
|
56
29
|
|
|
57
|
-
###
|
|
30
|
+
### 3. Question: Repository URL
|
|
58
31
|
|
|
59
|
-
|
|
32
|
+
If URL was provided in command args (starts with `https://` or `git@`), use it directly → skip to step 4.
|
|
60
33
|
|
|
61
|
-
|
|
34
|
+
Otherwise, call AskUserQuestion:
|
|
35
|
+
- header: "Repository"
|
|
36
|
+
- question: "Repository URL? (detected: {DETECTED_URL})"
|
|
37
|
+
- options: Use detected URL (Recommended) / Enter GitHub URL / Enter Azure DevOps URL / Local only
|
|
38
|
+
- If user selects custom option → ask follow-up for actual URL
|
|
62
39
|
|
|
63
|
-
|
|
40
|
+
Store as `{REPO_URL}`.
|
|
64
41
|
|
|
65
|
-
|
|
42
|
+
### 4. Question: Root Folder
|
|
66
43
|
|
|
67
|
-
|
|
44
|
+
Call AskUserQuestion:
|
|
45
|
+
- header: "Location"
|
|
46
|
+
- question: "Root folder for this project? (worktrees will be created here)"
|
|
47
|
+
- options:
|
|
48
|
+
- "Use parent folder (Recommended)" — "{PARENT_DIR}/ - consistent with {SIBLING_COUNT} sibling project(s)"
|
|
49
|
+
- "Use current folder" — "{CURRENT_DIR}/"
|
|
50
|
+
- "Custom path" — "Specify a different location"
|
|
51
|
+
- If user selects "Custom path" → ask follow-up for actual path
|
|
68
52
|
|
|
69
|
-
|
|
53
|
+
Store as `{PROJECT_BASE}`. Normalize for platform (WSL: /mnt/ format, Windows: forward slashes).
|
|
70
54
|
|
|
71
|
-
|
|
55
|
+
### 5. Question: Project Name
|
|
72
56
|
|
|
73
|
-
|
|
57
|
+
Call AskUserQuestion:
|
|
58
|
+
- header: "Project"
|
|
59
|
+
- question: "Project name? (detected: {DETECTED_NAME})"
|
|
60
|
+
- options:
|
|
61
|
+
- "Use detected name (Recommended)" — "{DETECTED_NAME}"
|
|
62
|
+
- "Custom name" — "Specify a different project name"
|
|
63
|
+
- If user selects "Custom name" → ask follow-up for actual name
|
|
74
64
|
|
|
75
|
-
|
|
65
|
+
Store as `{PROJECT_NAME}`.
|
|
76
66
|
|
|
77
|
-
|
|
67
|
+
Then normalize into variants: PascalCase.Dot, PascalCase, kebab-case, snake_case, Display Name.
|
|
68
|
+
See [references/init-name-normalization.md](../references/init-name-normalization.md).
|
|
78
69
|
|
|
79
|
-
|
|
80
|
-
1. Parse input into words (split on separators + camelCase)
|
|
81
|
-
2. Language detection and spell check (ask user if typos found)
|
|
82
|
-
3. Generate all name variants (PascalCase.Dot, PascalCase, kebab-case, snake_case)
|
|
83
|
-
4. Ask user to choose PRIMARY format
|
|
84
|
-
5. Store all derived names in `PROJECT_VARIANTS`
|
|
70
|
+
### 6. Question: Worktree Mode
|
|
85
71
|
|
|
86
|
-
|
|
72
|
+
Call AskUserQuestion:
|
|
73
|
+
- header: "Worktrees"
|
|
74
|
+
- question: "How should worktrees be organized?"
|
|
75
|
+
- options:
|
|
76
|
+
- "Organized (Recommended)" — "Numbered folders: 01-Main/, 02-Develop/, features/, releases/, hotfixes/"
|
|
77
|
+
- "Simple" — "Plain folders: main/, develop/, features/, releases/, hotfixes/"
|
|
78
|
+
- "Disabled" — "No worktrees, use git checkout (not recommended)"
|
|
87
79
|
|
|
88
|
-
|
|
80
|
+
Store as `{WORKTREE_MODE}` ("organized", "simple", or "disabled").
|
|
89
81
|
|
|
90
|
-
|
|
91
|
-
and received an explicit user answer, STOP and ask it NOW.
|
|
82
|
+
### 7. Confirm all values
|
|
92
83
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
See [references/init-structure-creation.md](../references/init-structure-creation.md) for:
|
|
102
|
-
- Path normalization for WSL
|
|
103
|
-
- Complete directory structure creation with absolute paths
|
|
104
|
-
- Bare repository setup
|
|
105
|
-
- Worktree creation (organized and simple modes)
|
|
106
|
-
- GitFlow config directory creation
|
|
107
|
-
|
|
108
|
-
### 9. Detect Version
|
|
109
|
-
|
|
110
|
-
**⛔ MUST run BEFORE creating config.json (step 10) — the detected `{VERSION}` is needed in the config template.**
|
|
111
|
-
|
|
112
|
-
See [references/init-version-detection.md](../references/init-version-detection.md) for:
|
|
113
|
-
- Version detection with priority (csproj, package.json, tags, etc.)
|
|
114
|
-
- Platform-agnostic path handling
|
|
115
|
-
- Fallback: `0.0.0` if no version source found
|
|
116
|
-
|
|
117
|
-
**⛔ WARNING:** Do NOT confuse the config schema version (`"version": "2.1.0"` at line 1 of config.json) with the project version (`"versioning.current": "{VERSION}"`). They are completely different values.
|
|
84
|
+
Display a summary to the user before proceeding:
|
|
85
|
+
```
|
|
86
|
+
Ready to initialize:
|
|
87
|
+
URL: {REPO_URL}
|
|
88
|
+
Folder: {PROJECT_BASE}
|
|
89
|
+
Name: {PROJECT_NAME}
|
|
90
|
+
Mode: {WORKTREE_MODE}
|
|
91
|
+
```
|
|
118
92
|
|
|
119
|
-
###
|
|
93
|
+
### 8. Create Directory Structure (delegate to sub-agent)
|
|
120
94
|
|
|
121
|
-
**
|
|
95
|
+
**Skip if `{WORKTREE_MODE}` is "disabled".**
|
|
122
96
|
|
|
123
|
-
|
|
124
|
-
-
|
|
125
|
-
- Path storage convention (`normalize_path_for_storage()` format)
|
|
97
|
+
Spawn `Task(gitflow-init-clone)` (sonnet) with the user-confirmed values:
|
|
98
|
+
- REPO_URL, PROJECT_BASE, PROJECT_NAME, WORKTREE_MODE, PLATFORM
|
|
126
99
|
|
|
127
|
-
|
|
100
|
+
See [references/init-structure-creation.md](../references/init-structure-creation.md) for details.
|
|
128
101
|
|
|
129
|
-
###
|
|
102
|
+
### 9. Detect Version + Create Configuration
|
|
130
103
|
|
|
131
|
-
|
|
104
|
+
Detect version (csproj > package.json > tags > fallback `0.0.0`).
|
|
105
|
+
Write `.claude/gitflow/config.json` in develop worktree.
|
|
106
|
+
See [references/init-config-template.md](../references/init-config-template.md) for template.
|
|
107
|
+
Store paths as `D:/path/to/folder` format.
|
|
132
108
|
|
|
133
|
-
|
|
109
|
+
### 10. Post-Init Validation (delegate to sub-agent)
|
|
134
110
|
|
|
135
|
-
|
|
111
|
+
Spawn `Task(gitflow-init-validate)` (haiku) to verify structure.
|
|
112
|
+
Checks: .bare/HEAD, worktree branches, directories, config file.
|
|
136
113
|
|
|
137
114
|
### 11. Summary
|
|
138
115
|
|
|
@@ -200,7 +177,7 @@ Before completing init, verify:
|
|
|
200
177
|
|
|
201
178
|
## SUCCESS CRITERIA:
|
|
202
179
|
|
|
203
|
-
- ✅
|
|
180
|
+
- ✅ AskUserQuestion called for root folder, project name, AND worktree mode
|
|
204
181
|
- ✅ Complete folder structure created
|
|
205
182
|
- ✅ Both main and develop worktrees functional
|
|
206
183
|
- ✅ Configuration file created
|