@atlashub/smartstack-cli 1.22.0 → 1.24.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 (35) hide show
  1. package/dist/index.js +13 -0
  2. package/dist/index.js.map +1 -1
  3. package/package.json +1 -1
  4. package/templates/agents/gitflow/init.md +42 -0
  5. package/templates/skills/check-version/SKILL.md +183 -0
  6. package/templates/skills/debug/SKILL.md +161 -0
  7. package/templates/skills/explore/SKILL.md +96 -0
  8. package/templates/skills/gitflow/steps/step-init.md +202 -131
  9. package/templates/skills/quick-search/SKILL.md +87 -0
  10. package/templates/skills/refactor/SKILL.md +219 -0
  11. package/templates/skills/review-code/SKILL.md +72 -44
  12. package/templates/skills/review-code/references/smartstack-conventions.md +93 -33
  13. package/templates/skills/ui-components/responsive-guidelines.md +278 -0
  14. package/templates/skills/utils/SKILL.md +37 -0
  15. package/templates/{commands/utils → skills/utils/subcommands}/test-web-config.md +35 -43
  16. package/templates/{commands/utils → skills/utils/subcommands}/test-web.md +25 -53
  17. package/templates/{commands/validate.md → skills/validate/SKILL.md} +80 -139
  18. package/templates/commands/check-version.md +0 -267
  19. package/templates/commands/debug.md +0 -95
  20. package/templates/commands/efcore/_env-check.md +0 -153
  21. package/templates/commands/efcore/_shared.md +0 -352
  22. package/templates/commands/efcore/conflicts.md +0 -90
  23. package/templates/commands/efcore/db-deploy.md +0 -109
  24. package/templates/commands/efcore/db-reset.md +0 -180
  25. package/templates/commands/efcore/db-seed.md +0 -103
  26. package/templates/commands/efcore/db-status.md +0 -102
  27. package/templates/commands/efcore/migration.md +0 -186
  28. package/templates/commands/efcore/rebase-snapshot.md +0 -172
  29. package/templates/commands/efcore/scan.md +0 -94
  30. package/templates/commands/efcore/squash.md +0 -329
  31. package/templates/commands/efcore.md +0 -96
  32. package/templates/commands/explore.md +0 -45
  33. package/templates/commands/quick-search.md +0 -72
  34. package/templates/commands/refactor.md +0 -164
  35. /package/templates/{commands → skills}/_resources/formatting-guide.md +0 -0
@@ -8,177 +8,219 @@ next_step: null
8
8
 
9
9
  ## YOUR TASK:
10
10
 
11
- Set up GitFlow configuration, create main/develop branches, and configure worktree structure.
11
+ Set up GitFlow configuration with bare repository, worktrees, and branches.
12
12
 
13
13
  **ULTRA THINK before creating configuration.**
14
14
 
15
15
  ---
16
16
 
17
+ ## MANDATORY QUESTIONS
18
+
19
+ **⛔ ALWAYS ask these 3 questions, even if values can be auto-detected:**
20
+
21
+ | Question | Variable | Auto-detect from |
22
+ |----------|----------|------------------|
23
+ | Repository URL | `{REPO_URL}` | `git remote get-url origin` |
24
+ | Root folder | `{ROOT_FOLDER}` | Parent of current directory |
25
+ | Project name | `{PROJECT_NAME}` | Repo name from URL or folder |
26
+
27
+ ---
28
+
17
29
  ## EXECUTION SEQUENCE:
18
30
 
19
- ### 1. Detect Environment
31
+ ### 1. Detect Environment (for defaults only)
20
32
 
21
33
  ```bash
22
34
  # Check if we're in a git repository
23
35
  IS_GIT_REPO=$(git rev-parse --git-dir 2>/dev/null && echo "true" || echo "false")
24
36
 
25
- # Check if already initialized
26
- [ -f ".claude/gitflow/config.json" ] && {
27
- echo "GitFlow already initialized"
28
- # Show current config and ask to reinitialize
29
- }
37
+ # Auto-detect values for defaults (will be confirmed by user)
38
+ DETECTED_URL=$(git remote get-url origin 2>/dev/null || echo "")
39
+ DETECTED_FOLDER=$(dirname "$(pwd)")
40
+ DETECTED_NAME=$(basename -s .git "$DETECTED_URL" 2>/dev/null || basename "$(pwd)")
30
41
 
31
42
  # Detect git provider
32
- REMOTE_URL=$(git remote get-url origin 2>/dev/null || echo "")
33
- if [[ "$REMOTE_URL" == *"github.com"* ]]; then
43
+ if [[ "$DETECTED_URL" == *"github.com"* ]]; then
34
44
  GIT_PROVIDER="github"
35
- elif [[ "$REMOTE_URL" == *"dev.azure.com"* ]]; then
45
+ elif [[ "$DETECTED_URL" == *"dev.azure.com"* ]]; then
36
46
  GIT_PROVIDER="azuredevops"
37
47
  else
38
48
  GIT_PROVIDER="unknown"
39
49
  fi
40
50
 
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
51
+ # Check if already initialized
52
+ ALREADY_INITIALIZED=$([ -f ".claude/gitflow/config.json" ] && echo "true" || echo "false")
53
+ ```
54
+
55
+ ### 2. Handle Existing Configuration
49
56
 
50
- # Detect existing branches
51
- HAS_MAIN=$(git branch -r --list "origin/main" | wc -l)
52
- HAS_DEVELOP=$(git branch -r --list "origin/develop" | wc -l)
57
+ **If `ALREADY_INITIALIZED` = true:**
58
+
59
+ Display current configuration and ask what to do:
60
+
61
+ ```yaml
62
+ AskUserQuestion:
63
+ - header: "Existing"
64
+ question: "GitFlow is already initialized. Current config will be shown. What do you want to do?"
65
+ options:
66
+ - label: "Reconfigure (Recommended)"
67
+ description: "Review and update all settings"
68
+ - label: "Repair"
69
+ description: "Fix missing directories only"
70
+ - label: "View only"
71
+ description: "Display current config and exit"
72
+ - label: "Cancel"
73
+ description: "Exit without changes"
74
+ multiSelect: false
53
75
  ```
54
76
 
55
- ### 2. Configuration Questions
77
+ **Handle choices:**
78
+ - **Reconfigure**: Continue to step 3 (will ask all questions again)
79
+ - **Repair**: Check directories, fix missing ones, exit
80
+ - **View only**: Display config, exit
81
+ - **Cancel**: Exit immediately
56
82
 
57
- **If NOT in a git repository (`IS_GIT_REPO` = false):**
83
+ ### 3. MANDATORY: Ask Repository URL
84
+
85
+ **⛔ ALWAYS ask, even if URL was detected:**
58
86
 
59
87
  ```yaml
60
88
  AskUserQuestion:
61
- - header: "Folder"
62
- question: "Where should the project be initialized?"
89
+ - header: "Repository"
90
+ question: "Repository URL? (detected: {DETECTED_URL})"
63
91
  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"
92
+ - label: "Use detected URL (Recommended)"
93
+ description: "{DETECTED_URL}"
94
+ - label: "Enter GitHub URL"
95
+ description: "https://github.com/org/repo.git"
96
+ - label: "Enter Azure DevOps URL"
97
+ description: "https://dev.azure.com/org/project/_git/repo"
98
+ - label: "Local only (no remote)"
99
+ description: "Initialize without remote (limited features)"
100
+ multiSelect: false
70
101
  ```
71
102
 
72
- **Always ask (Custom Setup only, or if auto-detected name is wrong):**
103
+ **If user selects "Enter GitHub URL" or "Enter Azure DevOps URL":**
104
+ - Capture URL via "Other" input
105
+ - Validate format
106
+ - Update `{REPO_URL}` and `{GIT_PROVIDER}`
107
+
108
+ ### 4. MANDATORY: Ask Root Folder
109
+
110
+ **⛔ ALWAYS ask where to create the project structure:**
111
+
112
+ ```yaml
113
+ AskUserQuestion:
114
+ - header: "Location"
115
+ question: "Root folder for project? (All worktrees will be created here)"
116
+ options:
117
+ - label: "Use parent folder (Recommended)"
118
+ description: "{DETECTED_FOLDER}/"
119
+ - label: "Use current folder"
120
+ description: "$(pwd)/ - Will create subfolders here"
121
+ - label: "Enter custom path"
122
+ description: "Specify a different location"
123
+ multiSelect: false
124
+ ```
125
+
126
+ **Explain the structure that will be created:**
127
+
128
+ ```
129
+ {ROOT_FOLDER}/
130
+ ├── .bare/ # Git bare repository
131
+ ├── 01-Main/ # Worktree: main branch
132
+ ├── 02-Develop/ # Worktree: develop branch
133
+ ├── features/ # Feature branch worktrees
134
+ ├── releases/ # Release branch worktrees
135
+ └── hotfixes/ # Hotfix branch worktrees
136
+ ```
137
+
138
+ ### 5. MANDATORY: Ask Project Name
139
+
140
+ **⛔ ALWAYS ask to confirm project name:**
73
141
 
74
142
  ```yaml
75
143
  AskUserQuestion:
76
144
  - header: "Project"
77
- question: "What is the project name? (detected: {PROJECT_NAME})"
145
+ question: "Project name? (detected: {DETECTED_NAME})"
78
146
  options:
79
147
  - label: "Use detected name (Recommended)"
80
- description: "Use '{PROJECT_NAME}' as project name"
148
+ description: "Project: {DETECTED_NAME}"
81
149
  - label: "Enter custom name"
82
150
  description: "Specify a different project name"
151
+ multiSelect: false
83
152
  ```
84
153
 
85
- **Setup mode:**
154
+ ### 6. Ask Worktree Mode
86
155
 
87
156
  ```yaml
88
157
  AskUserQuestion:
89
- - header: "Mode"
90
- question: "How do you want to set up GitFlow?"
91
- options:
92
- - label: "Quick Setup (Recommended)"
93
- description: "Auto-detect settings, create branches"
94
- - label: "Custom Setup"
95
- description: "Configure each option manually"
96
- - label: "Existing Config"
97
- description: "Use existing .claude/gitflow/config.json"
98
-
99
158
  - header: "Worktrees"
100
159
  question: "How should worktrees be organized?"
101
160
  options:
102
161
  - label: "Organized (Recommended)"
103
- description: "../features/, ../releases/, ../hotfixes/"
104
- - label: "Adjacent"
105
- description: "../worktrees/{type}/"
162
+ description: "01-Main, 02-Develop, features/, releases/, hotfixes/"
163
+ - label: "Simple"
164
+ description: "main/, develop/, features/, releases/, hotfixes/"
106
165
  - label: "Disabled"
107
- description: "No worktrees, use git checkout"
166
+ description: "No worktrees, use git checkout (not recommended)"
167
+ multiSelect: false
108
168
  ```
109
169
 
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)
170
+ ### 7. Create Directory Structure
116
171
 
117
- **If `IS_GIT_REPO` = false:**
172
+ **⛔ Create the COMPLETE structure:**
118
173
 
119
174
  ```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
- ```
175
+ cd "{ROOT_FOLDER}"
176
+
177
+ # Create bare repository if not exists
178
+ if [ ! -d ".bare" ]; then
179
+ git clone --bare "{REPO_URL}" .bare
180
+ # Configure bare repo for worktrees
181
+ cd .bare
182
+ git config core.bare false
183
+ git config core.worktree ..
184
+ cd ..
185
+ fi
134
186
 
135
- ### 3. Create Branches (if needed)
187
+ # Create worktree directories
188
+ mkdir -p features releases hotfixes
136
189
 
137
- ```bash
138
- # Ensure we have main
139
- [ "$HAS_MAIN" -eq 0 ] && {
140
- git checkout -b main
141
- git push -u origin main
142
- }
190
+ # Organized mode: numbered main folders
191
+ if [ "$WORKTREE_MODE" = "organized" ]; then
192
+ # Create main worktree
193
+ [ ! -d "01-Main" ] && git worktree add 01-Main main
143
194
 
144
- # Ensure we have develop
145
- [ "$HAS_DEVELOP" -eq 0 ] && {
146
- git checkout main
147
- git checkout -b develop
148
- git push -u origin develop
149
- }
150
- ```
195
+ # Create develop worktree
196
+ [ ! -d "02-Develop" ] && git worktree add 02-Develop develop
197
+ fi
151
198
 
152
- ### 4. Create Directory Structure
199
+ # Simple mode: named folders
200
+ if [ "$WORKTREE_MODE" = "simple" ]; then
201
+ [ ! -d "main" ] && git worktree add main main
202
+ [ ! -d "develop" ] && git worktree add develop develop
203
+ fi
153
204
 
154
- ```bash
155
- mkdir -p .claude/gitflow/{plans,logs,cache,backup}
156
-
157
- # Create worktree directories if mode != disabled
158
- case "$WORKTREE_MODE" in
159
- organized)
160
- mkdir -p ../features ../releases ../hotfixes
161
- ;;
162
- adjacent)
163
- mkdir -p ../worktrees/{features,releases,hotfixes}
164
- ;;
165
- esac
205
+ # Create gitflow config directory (in develop worktree)
206
+ DEVELOP_PATH=$([ "$WORKTREE_MODE" = "organized" ] && echo "02-Develop" || echo "develop")
207
+ mkdir -p "$DEVELOP_PATH/.claude/gitflow/{plans,logs,cache,backup}"
166
208
  ```
167
209
 
168
- ### 5. Create Configuration
210
+ ### 8. Create Configuration
169
211
 
170
- **Write `.claude/gitflow/config.json`:**
212
+ **Write `.claude/gitflow/config.json` in develop worktree:**
171
213
 
172
214
  ```json
173
215
  {
174
216
  "version": "2.0.0",
175
217
  "repository": {
176
218
  "name": "{PROJECT_NAME}",
177
- "defaultBranch": "main",
178
- "remoteUrl": "{remote_url}"
219
+ "rootFolder": "{ROOT_FOLDER}",
220
+ "remoteUrl": "{REPO_URL}"
179
221
  },
180
222
  "git": {
181
- "provider": "{github|azuredevops}",
223
+ "provider": "{GIT_PROVIDER}",
182
224
  "branches": {
183
225
  "main": "main",
184
226
  "develop": "develop"
@@ -191,24 +233,25 @@ esac
191
233
  },
192
234
  "worktrees": {
193
235
  "enabled": true,
194
- "mode": "{organized|adjacent|disabled}",
236
+ "mode": "{WORKTREE_MODE}",
195
237
  "structure": {
196
- "features": "../features",
197
- "releases": "../releases",
198
- "hotfixes": "../hotfixes"
238
+ "main": "{ROOT_FOLDER}/01-Main",
239
+ "develop": "{ROOT_FOLDER}/02-Develop",
240
+ "features": "{ROOT_FOLDER}/features",
241
+ "releases": "{ROOT_FOLDER}/releases",
242
+ "hotfixes": "{ROOT_FOLDER}/hotfixes"
199
243
  }
200
244
  },
201
245
  "versioning": {
202
246
  "strategy": "semver",
203
- "current": "{X.Y.Z}",
247
+ "current": "{VERSION}",
204
248
  "tagPrefix": "v",
205
249
  "sources": ["csproj", "package.json", "VERSION"]
206
250
  },
207
251
  "efcore": {
208
252
  "enabled": true,
209
253
  "validateOnCommit": true,
210
- "blockDestructive": true,
211
- "migrationNaming": "{context}_v{version}_{sequence}_{Description}"
254
+ "blockDestructive": true
212
255
  },
213
256
  "workflow": {
214
257
  "push": {
@@ -218,16 +261,16 @@ esac
218
261
  "autoLabels": true,
219
262
  "requireReview": true
220
263
  }
221
- },
222
- "language": {
223
- "code": "en"
224
264
  }
225
265
  }
226
266
  ```
227
267
 
228
- ### 6. Detect Version
268
+ ### 9. Detect Version
229
269
 
230
270
  ```bash
271
+ # In develop worktree
272
+ cd "$DEVELOP_PATH"
273
+
231
274
  # Priority: csproj > Directory.Build.props > package.json > VERSION > tag
232
275
  VERSION=$(grep -oP '<Version>\K[^<]+' *.csproj 2>/dev/null | head -1)
233
276
  [ -z "$VERSION" ] && VERSION=$(grep -oP '<Version>\K[^<]+' Directory.Build.props 2>/dev/null)
@@ -237,40 +280,68 @@ VERSION=$(grep -oP '<Version>\K[^<]+' *.csproj 2>/dev/null | head -1)
237
280
  [ -z "$VERSION" ] && VERSION="0.1.0"
238
281
  ```
239
282
 
240
- ### 7. Summary
283
+ ### 10. Summary
241
284
 
242
285
  ```
243
286
  ╔══════════════════════════════════════════════════════════════════╗
244
287
  ║ GITFLOW INITIALIZED ║
245
288
  ╠══════════════════════════════════════════════════════════════════╣
246
289
  ║ Project: {PROJECT_NAME} ║
247
- Provider: {github|azuredevops}
248
- Version: {X.Y.Z}
290
+ Root: {ROOT_FOLDER}
291
+ Remote: {REPO_URL}
292
+ ║ Provider: {GIT_PROVIDER} ║
293
+ ║ Version: {VERSION} ║
249
294
  ╠══════════════════════════════════════════════════════════════════╣
250
- Branches: ║
251
- - main: ✅ Ready
252
- ║ - develop: Ready
295
+ Structure: ║
296
+ ├── .bare/ (git bare repository)
297
+ ├── 01-Main/ (main branch)
298
+ ║ ├── 02-Develop/ (develop branch) ✅ ║
299
+ ║ ├── features/ (feature worktrees) ✅ ║
300
+ ║ ├── releases/ (release worktrees) ✅ ║
301
+ ║ └── hotfixes/ (hotfix worktrees) ✅ ║
253
302
  ╠══════════════════════════════════════════════════════════════════╣
254
- Worktrees: {mode}
255
- ║ - ../features/ (for feature branches) ║
256
- ║ - ../releases/ (for release branches) ║
257
- ║ - ../hotfixes/ (for hotfix branches) ║
303
+ Config: 02-Develop/.claude/gitflow/config.json
258
304
  ╠══════════════════════════════════════════════════════════════════╣
259
- Config: .claude/gitflow/config.json
260
- ╠══════════════════════════════════════════════════════════════════╣
261
- ║ NEXT: /gitflow start feature <name> ║
305
+ NEXT: cd 02-Develop && /gitflow -f <feature-name>
262
306
  ╚══════════════════════════════════════════════════════════════════╝
263
307
  ```
264
308
 
265
309
  ---
266
310
 
311
+ ## VALIDATION CHECKLIST:
312
+
313
+ Before completing init, verify:
314
+
315
+ - [ ] Repository URL confirmed by user
316
+ - [ ] Root folder confirmed by user
317
+ - [ ] Project name confirmed by user
318
+ - [ ] .bare/ directory exists
319
+ - [ ] 01-Main/ worktree exists and is on main branch
320
+ - [ ] 02-Develop/ worktree exists and is on develop branch
321
+ - [ ] features/, releases/, hotfixes/ directories exist
322
+ - [ ] .claude/gitflow/config.json created in develop worktree
323
+
324
+ ---
325
+
326
+ ## ERROR HANDLING:
327
+
328
+ | Error | Solution |
329
+ |-------|----------|
330
+ | Clone fails | Check URL, network, credentials |
331
+ | Worktree exists | Skip or offer to recreate |
332
+ | Permission denied | Check folder permissions |
333
+ | Branch missing | Create from default branch |
334
+
335
+ ---
336
+
267
337
  ## SUCCESS CRITERIA:
268
338
 
269
- - Configuration file created
270
- - main and develop branches exist
271
- - Worktree directories created (if enabled)
272
- - Version detected and stored
339
+ - All 3 mandatory questions asked
340
+ - Complete folder structure created
341
+ - Both main and develop worktrees functional
342
+ - Configuration file created
343
+ - ✅ User can navigate to 02-Develop and start working
273
344
 
274
345
  ## NEXT STEP:
275
346
 
276
- Init is standalone. User can now run `/gitflow start feature <name>`.
347
+ Init is standalone. User should `cd 02-Develop` then run `/gitflow -f <feature-name>`.
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: quick-search
3
+ description: Lightning-fast search to answer specific questions - optimized for speed
4
+ argument-hint: <question>
5
+ allowed-tools: Grep, Glob, Read
6
+ model: haiku
7
+ ---
8
+
9
+ <objective>
10
+ Answer questions at maximum speed using direct search tools. No agents, no deep analysis - just fast answers with citations.
11
+ </objective>
12
+
13
+ <quick_start>
14
+ ```bash
15
+ /quick-search where is LoginForm defined?
16
+ /quick-search find all API routes
17
+ /quick-search what config files exist?
18
+ ```
19
+ </quick_start>
20
+
21
+ <workflow>
22
+
23
+ ## 1. Identify
24
+
25
+ Parse the question:
26
+ - Extract key search terms
27
+ - Determine target file types or patterns
28
+ - **CRITICAL**: Be surgical - know exactly what to search
29
+
30
+ ## 2. Search (Direct Tools Only)
31
+
32
+ Use direct tools - **NO AGENTS**:
33
+ - `Grep` for code content search with specific patterns
34
+ - `Glob` for file name/path patterns
35
+ - Launch searches **in parallel** when possible
36
+
37
+ **SPEED RULE**: Max 2-3 search iterations total
38
+
39
+ ## 3. Read (Targeted)
40
+
41
+ - `Read` only the most relevant files found
42
+ - **CRITICAL**: Max 3-5 files - be selective
43
+ - Scan for the specific answer needed
44
+
45
+ ## 4. Answer
46
+
47
+ Direct response:
48
+ - Immediate answer to the question
49
+ - Include file references with line numbers (`file.ts:42`)
50
+ - **NO**: Long explanations or architectural context
51
+ - **YES**: Concise answer with evidence
52
+
53
+ </workflow>
54
+
55
+ <search_patterns>
56
+
57
+ **Finding implementations:**
58
+ ```
59
+ Grep: pattern="class FooBar" or "function fooBar"
60
+ ```
61
+
62
+ **Finding configs:**
63
+ ```
64
+ Glob: pattern="**/config.{js,ts,json}"
65
+ ```
66
+
67
+ **Finding imports/usage:**
68
+ ```
69
+ Grep: pattern="from ['\"].*moduleName['\"]"
70
+ ```
71
+
72
+ </search_patterns>
73
+
74
+ <execution_rules>
75
+
76
+ - **SPEED FIRST**: Answer in under 30 seconds
77
+ - **NO AGENTS**: Use direct tools only (Grep, Glob, Read)
78
+ - **PARALLEL SEARCH**: Run independent searches simultaneously
79
+ - **MINIMAL READING**: Read only what's absolutely necessary
80
+ - **NO DEEP ANALYSIS**: Surface-level answers with citations
81
+ - **STOP EARLY**: Once you have the answer, respond immediately
82
+
83
+ </execution_rules>
84
+
85
+ <priority>
86
+ Speed > Completeness. Fast answers beat perfect answers.
87
+ </priority>