@atlashub/smartstack-cli 3.52.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)
|
|
@@ -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>
|
|
@@ -10,134 +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 INTERACTIVE QUESTIONS
|
|
18
|
-
|
|
19
|
-
╔══════════════════════════════════════════════════════════════════════════╗
|
|
20
|
-
║ You MUST call AskUserQuestion for EACH question below. ║
|
|
21
|
-
║ Auto-detected values are SUGGESTIONS for option labels, NOT answers. ║
|
|
22
|
-
║ NEVER use a detected value as the final value without user confirm. ║
|
|
23
|
-
║ Minimum AskUserQuestion calls: 3 (if URL provided) or 4 (if not). ║
|
|
24
|
-
╚══════════════════════════════════════════════════════════════════════════╝
|
|
25
|
-
|
|
26
|
-
| Question | Variable | Suggested from | MUST ASK? |
|
|
27
|
-
|----------|----------|----------------|-----------|
|
|
28
|
-
| Repository URL | `{REPO_URL}` | `git remote get-url origin` | YES (skip only if URL in command args) |
|
|
29
|
-
| Root folder | `{ROOT_FOLDER}` | Parent of current directory | **ALWAYS YES** |
|
|
30
|
-
| Project name | `{PROJECT_NAME}` | Repo name from URL or folder | **ALWAYS YES** |
|
|
31
|
-
| Worktree mode | `{WORKTREE_MODE}` | None — no default | **ALWAYS YES** |
|
|
32
|
-
|
|
33
|
-
**Multi-project principle:** Each repository has its OWN independent GitFlow config. Step 2 scans for sibling projects to provide context, not to share configuration.
|
|
34
|
-
|
|
35
|
-
**⛔ 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.**
|
|
36
15
|
|
|
37
16
|
---
|
|
38
17
|
|
|
39
18
|
## EXECUTION SEQUENCE:
|
|
40
19
|
|
|
41
|
-
### 1. Detect Environment (
|
|
42
|
-
|
|
43
|
-
See [references/init-environment-detection.md](../references/init-environment-detection.md) for:
|
|
44
|
-
- Platform detection (WSL/Windows/macOS/Linux)
|
|
45
|
-
- Git provider detection
|
|
46
|
-
- Auto-detect defaults (URL, folder, project name)
|
|
47
|
-
|
|
48
|
-
### 2. Detect Workspace (multi-project context)
|
|
49
|
-
|
|
50
|
-
See [references/init-workspace-detection.md](../references/init-workspace-detection.md) for:
|
|
51
|
-
- Sibling project scanning
|
|
52
|
-
- Workspace context display
|
|
53
|
-
- Per-repository GitFlow principle
|
|
20
|
+
### 1. Detect Environment (delegate to sub-agent)
|
|
54
21
|
|
|
55
|
-
|
|
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.
|
|
56
24
|
|
|
57
|
-
|
|
25
|
+
### 2. Check Existing Configuration
|
|
58
26
|
|
|
59
|
-
|
|
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.
|
|
60
29
|
|
|
61
|
-
###
|
|
30
|
+
### 3. Question: Repository URL
|
|
62
31
|
|
|
63
|
-
|
|
32
|
+
If URL was provided in command args (starts with `https://` or `git@`), use it directly → skip to step 4.
|
|
64
33
|
|
|
65
|
-
|
|
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
|
|
66
39
|
|
|
67
|
-
|
|
40
|
+
Store as `{REPO_URL}`.
|
|
68
41
|
|
|
69
|
-
|
|
42
|
+
### 4. Question: Root Folder
|
|
70
43
|
|
|
71
|
-
|
|
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
|
|
72
52
|
|
|
73
|
-
|
|
53
|
+
Store as `{PROJECT_BASE}`. Normalize for platform (WSL: /mnt/ format, Windows: forward slashes).
|
|
74
54
|
|
|
75
|
-
|
|
55
|
+
### 5. Question: Project Name
|
|
76
56
|
|
|
77
|
-
|
|
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
|
|
78
64
|
|
|
79
|
-
|
|
65
|
+
Store as `{PROJECT_NAME}`.
|
|
80
66
|
|
|
81
|
-
|
|
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).
|
|
82
69
|
|
|
83
|
-
|
|
84
|
-
1. Parse input into words (split on separators + camelCase)
|
|
85
|
-
2. Language detection and spell check (ask user if typos found)
|
|
86
|
-
3. Generate all name variants (PascalCase.Dot, PascalCase, kebab-case, snake_case)
|
|
87
|
-
4. Ask user to choose PRIMARY format
|
|
88
|
-
5. Store all derived names in `PROJECT_VARIANTS`
|
|
70
|
+
### 6. Question: Worktree Mode
|
|
89
71
|
|
|
90
|
-
|
|
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)"
|
|
91
79
|
|
|
92
|
-
|
|
80
|
+
Store as `{WORKTREE_MODE}` ("organized", "simple", or "disabled").
|
|
93
81
|
|
|
94
|
-
|
|
95
|
-
worktree mode and received an explicit user answer, STOP and ask it NOW.
|
|
96
|
-
Do NOT default to "organized". The user MUST choose.
|
|
82
|
+
### 7. Confirm all values
|
|
97
83
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
See [references/init-structure-creation.md](../references/init-structure-creation.md) for:
|
|
107
|
-
- Path normalization for WSL
|
|
108
|
-
- Complete directory structure creation with absolute paths
|
|
109
|
-
- Bare repository setup
|
|
110
|
-
- Worktree creation (organized and simple modes)
|
|
111
|
-
- GitFlow config directory creation
|
|
112
|
-
|
|
113
|
-
### 9. Detect Version
|
|
114
|
-
|
|
115
|
-
**⛔ MUST run BEFORE creating config.json (step 10) — the detected `{VERSION}` is needed in the config template.**
|
|
116
|
-
|
|
117
|
-
See [references/init-version-detection.md](../references/init-version-detection.md) for:
|
|
118
|
-
- Version detection with priority (csproj, package.json, tags, etc.)
|
|
119
|
-
- Platform-agnostic path handling
|
|
120
|
-
- Fallback: `0.0.0` if no version source found
|
|
121
|
-
|
|
122
|
-
**⛔ 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
|
+
```
|
|
123
92
|
|
|
124
|
-
###
|
|
93
|
+
### 8. Create Directory Structure (delegate to sub-agent)
|
|
125
94
|
|
|
126
|
-
**
|
|
95
|
+
**Skip if `{WORKTREE_MODE}` is "disabled".**
|
|
127
96
|
|
|
128
|
-
|
|
129
|
-
-
|
|
130
|
-
- 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
|
|
131
99
|
|
|
132
|
-
|
|
100
|
+
See [references/init-structure-creation.md](../references/init-structure-creation.md) for details.
|
|
133
101
|
|
|
134
|
-
###
|
|
102
|
+
### 9. Detect Version + Create Configuration
|
|
135
103
|
|
|
136
|
-
|
|
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.
|
|
137
108
|
|
|
138
|
-
|
|
109
|
+
### 10. Post-Init Validation (delegate to sub-agent)
|
|
139
110
|
|
|
140
|
-
|
|
111
|
+
Spawn `Task(gitflow-init-validate)` (haiku) to verify structure.
|
|
112
|
+
Checks: .bare/HEAD, worktree branches, directories, config file.
|
|
141
113
|
|
|
142
114
|
### 11. Summary
|
|
143
115
|
|
|
@@ -205,7 +177,7 @@ Before completing init, verify:
|
|
|
205
177
|
|
|
206
178
|
## SUCCESS CRITERIA:
|
|
207
179
|
|
|
208
|
-
- ✅ AskUserQuestion
|
|
180
|
+
- ✅ AskUserQuestion called for root folder, project name, AND worktree mode
|
|
209
181
|
- ✅ Complete folder structure created
|
|
210
182
|
- ✅ Both main and develop worktrees functional
|
|
211
183
|
- ✅ Configuration file created
|