@atlashub/smartstack-cli 1.4.0 → 1.4.1

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.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "SmartStack Claude Code automation toolkit - GitFlow, APEX, EF Core migrations, prompts and more",
5
5
  "author": {
6
6
  "name": "SmartStack",
@@ -0,0 +1,138 @@
1
+ ---
2
+ description: Create a SmartStack agent extension project
3
+ argument-hint: <name> [description]
4
+ ---
5
+
6
+ # Create Agent Extension
7
+
8
+ Scaffold a complete SmartStack **agent** extension project.
9
+
10
+ ## What is an Agent?
11
+
12
+ An agent is a specialized execution unit:
13
+ - Launched by commands for parallel execution
14
+ - Focused on specific tasks (search, analysis, etc.)
15
+ - Defined in markdown with YAML frontmatter
16
+ - Optimized with model selection (haiku/sonnet/opus)
17
+
18
+ ## Arguments
19
+
20
+ Parse from `$ARGUMENTS`:
21
+ - **name** (required): Agent name in kebab-case
22
+ - **description** (optional): What the agent does
23
+
24
+ ## Project Structure
25
+
26
+ ```
27
+ smartstack-{name}/
28
+ ├── package.json
29
+ ├── tsconfig.json
30
+ ├── tsup.config.ts
31
+ ├── README.md
32
+ ├── .gitignore
33
+ ├── src/
34
+ │ └── index.ts
35
+ └── templates/
36
+ └── agents/
37
+ └── {name}.md # Agent template
38
+ ```
39
+
40
+ ## Generated Agent Template
41
+
42
+ Create `templates/agents/{name}.md`:
43
+
44
+ ```markdown
45
+ ---
46
+ name: {name}
47
+ description: {description}
48
+ color: yellow
49
+ model: haiku
50
+ ---
51
+
52
+ # {PascalCaseName} Agent
53
+
54
+ {description}
55
+
56
+ ## Purpose
57
+
58
+ This agent specializes in:
59
+ - [Primary capability 1]
60
+ - [Primary capability 2]
61
+ - [Primary capability 3]
62
+
63
+ ## Search Strategy
64
+
65
+ ### 1. Initial Discovery
66
+ - Use `Glob` to find files matching patterns
67
+ - Focus on: `**/*.{relevant-extensions}`
68
+
69
+ ### 2. Deep Analysis
70
+ - Use `Grep` for specific code patterns
71
+ - Look for: `pattern1`, `pattern2`
72
+
73
+ ### 3. Context Building
74
+ - Use `Read` to examine key files
75
+ - Extract: imports, exports, dependencies
76
+
77
+ ### 4. Synthesis
78
+ - Compile findings
79
+ - Identify patterns
80
+ - Generate recommendations
81
+
82
+ ## Output Format
83
+
84
+ **CRITICAL**: Output findings directly in response. NEVER create files.
85
+
86
+ ### Findings Report
87
+
88
+ #### Relevant Files
89
+ | File | Purpose | Key Patterns |
90
+ |------|---------|--------------|
91
+ | path/to/file | description | patterns found |
92
+
93
+ #### Analysis
94
+ [Detailed analysis of findings]
95
+
96
+ #### Recommendations
97
+ 1. [First recommendation]
98
+ 2. [Second recommendation]
99
+ 3. [Third recommendation]
100
+
101
+ ## Tool Usage
102
+
103
+ Preferred tools for this agent:
104
+ - `Glob` - File discovery
105
+ - `Grep` - Pattern search
106
+ - `Read` - File content
107
+
108
+ ## Anti-Patterns
109
+
110
+ - **NEVER** create markdown files
111
+ - **NEVER** guess without evidence
112
+ - **NEVER** skip verification
113
+ - **ALWAYS** cite specific file paths
114
+
115
+ ## Priority
116
+
117
+ Accuracy > Completeness > Speed
118
+ ```
119
+
120
+ ## Model Selection Guide
121
+
122
+ | Use Case | Model | Reason |
123
+ |----------|-------|--------|
124
+ | Simple search | haiku | Fast, cheap |
125
+ | Analysis | sonnet | Good balance |
126
+ | Complex reasoning | opus | Best quality |
127
+
128
+ ## Workflow
129
+
130
+ 1. Parse name and description from `$ARGUMENTS`
131
+ 2. Validate name is kebab-case
132
+ 3. Create project directory
133
+ 4. Generate all files using Write tool
134
+ 5. Display success message
135
+
136
+ ---
137
+
138
+ User: $ARGUMENTS
@@ -0,0 +1,166 @@
1
+ ---
2
+ description: Create a SmartStack command extension project
3
+ argument-hint: <name> [description]
4
+ ---
5
+
6
+ # Create Command Extension
7
+
8
+ Scaffold a complete SmartStack **command** extension project.
9
+
10
+ ## What is a Command?
11
+
12
+ A command is a slash command that users invoke in Claude Code:
13
+ - `/my-command <args>` - Executes the command with arguments
14
+ - Defined in markdown with YAML frontmatter
15
+ - Contains workflow, rules, and execution logic
16
+
17
+ ## Arguments
18
+
19
+ Parse from `$ARGUMENTS`:
20
+ - **name** (required): Command name in kebab-case
21
+ - **description** (optional): What the command does
22
+
23
+ ## Project Structure
24
+
25
+ ```
26
+ smartstack-{name}/
27
+ ├── package.json
28
+ ├── tsconfig.json
29
+ ├── tsup.config.ts
30
+ ├── README.md
31
+ ├── .gitignore
32
+ ├── src/
33
+ │ └── index.ts
34
+ └── templates/
35
+ └── commands/
36
+ └── {name}.md # Main command template
37
+ ```
38
+
39
+ ## Generated Command Template
40
+
41
+ Create `templates/commands/{name}.md`:
42
+
43
+ ```markdown
44
+ ---
45
+ description: {description}
46
+ argument-hint: <task-description>
47
+ ---
48
+
49
+ # {PascalCaseName}
50
+
51
+ {description}
52
+
53
+ ## Workflow
54
+
55
+ ### 1. UNDERSTAND
56
+ - Parse user arguments: `$ARGUMENTS`
57
+ - Identify the task scope
58
+ - Gather necessary context
59
+
60
+ ### 2. ANALYZE
61
+ - Explore relevant codebase areas
62
+ - Identify patterns and constraints
63
+ - Document findings
64
+
65
+ ### 3. PLAN
66
+ - Design the approach
67
+ - Consider edge cases
68
+ - Validate against requirements
69
+
70
+ ### 4. EXECUTE
71
+ - Implement step by step
72
+ - Follow existing patterns
73
+ - Write clean code
74
+
75
+ ### 5. VERIFY
76
+ - Test the implementation
77
+ - Ensure no regressions
78
+ - Validate completeness
79
+
80
+ ## Execution Rules
81
+
82
+ 1. **ULTRA THINK** before each phase
83
+ 2. Use parallel agents when beneficial
84
+ 3. Document all decisions
85
+ 4. **MINIMAL CHANGES**: Only what's needed
86
+ 5. Test before declaring complete
87
+
88
+ ## Agent Usage
89
+
90
+ For exploration, launch agents:
91
+ - `explore-codebase` - Find relevant files
92
+ - `websearch` - Research solutions
93
+
94
+ ## Priority
95
+
96
+ Understanding > Correctness > Speed
97
+
98
+ ---
99
+
100
+ User: $ARGUMENTS
101
+ ```
102
+
103
+ ## Generated Files
104
+
105
+ ### package.json
106
+
107
+ ```json
108
+ {
109
+ "name": "@smartstack/{name}",
110
+ "version": "1.0.0",
111
+ "description": "{description}",
112
+ "private": false,
113
+ "type": "module",
114
+ "main": "./dist/index.js",
115
+ "files": ["dist", "templates"],
116
+ "scripts": {
117
+ "build": "tsup",
118
+ "dev": "tsup --watch"
119
+ },
120
+ "peerDependencies": {
121
+ "@atlashub/smartstack-cli": ">=1.0.0"
122
+ }
123
+ }
124
+ ```
125
+
126
+ ### src/index.ts
127
+
128
+ ```typescript
129
+ import * as path from 'path';
130
+ import * as fs from 'fs';
131
+
132
+ export function getTemplatesPath(): string {
133
+ return path.join(__dirname, '..', 'templates');
134
+ }
135
+
136
+ export async function install(targetDir: string): Promise<void> {
137
+ const src = path.join(getTemplatesPath(), 'commands');
138
+ const dest = path.join(targetDir, 'commands');
139
+ // Copy command templates
140
+ }
141
+
142
+ export const metadata = {
143
+ name: '{name}',
144
+ version: '1.0.0',
145
+ description: '{description}',
146
+ type: 'command'
147
+ };
148
+ ```
149
+
150
+ ## Workflow
151
+
152
+ 1. Parse name and description from `$ARGUMENTS`
153
+ 2. Validate name is kebab-case
154
+ 3. Create project directory
155
+ 4. Generate all files using Write tool
156
+ 5. Display success message with next steps
157
+
158
+ ## Validation
159
+
160
+ - Name must match: `^[a-z][a-z0-9-]*$`
161
+ - Directory must not exist
162
+ - Description should be meaningful
163
+
164
+ ---
165
+
166
+ User: $ARGUMENTS
@@ -0,0 +1,234 @@
1
+ ---
2
+ description: Create a SmartStack hook extension project
3
+ argument-hint: <name> [trigger] [description]
4
+ ---
5
+
6
+ # Create Hook Extension
7
+
8
+ Scaffold a complete SmartStack **hook** extension project.
9
+
10
+ ## What is a Hook?
11
+
12
+ A hook is a validation/action trigger:
13
+ - Runs automatically at specific points (pre-commit, pre-merge, etc.)
14
+ - Can block operations if issues detected
15
+ - Defined in markdown with detection patterns
16
+ - Integrates with GitFlow workflow
17
+
18
+ ## Arguments
19
+
20
+ Parse from `$ARGUMENTS`:
21
+ - **name** (required): Hook name in kebab-case
22
+ - **trigger** (optional): pre-commit | pre-merge | pre-push | post-commit
23
+ - **description** (optional): What the hook validates
24
+
25
+ ## Project Structure
26
+
27
+ ```
28
+ smartstack-{name}/
29
+ ├── package.json
30
+ ├── tsconfig.json
31
+ ├── tsup.config.ts
32
+ ├── README.md
33
+ ├── .gitignore
34
+ ├── src/
35
+ │ └── index.ts
36
+ └── templates/
37
+ └── hooks/
38
+ └── {name}.md # Hook template
39
+ ```
40
+
41
+ ## Generated Hook Template
42
+
43
+ ```markdown
44
+ ---
45
+ description: {description}
46
+ trigger: {trigger}
47
+ blocking: true
48
+ ---
49
+
50
+ # {PascalCaseName} Hook
51
+
52
+ {description}
53
+
54
+ ## Purpose
55
+
56
+ This hook validates [what it validates] before allowing [the action].
57
+
58
+ ## Trigger Points
59
+
60
+ | Trigger | When | Blocking |
61
+ |---------|------|----------|
62
+ | pre-commit | Before git commit | Yes |
63
+ | pre-merge | Before branch merge | Yes |
64
+ | pre-push | Before git push | Yes |
65
+ | post-commit | After git commit | No |
66
+
67
+ Current trigger: **{trigger}**
68
+
69
+ ## Detection Patterns
70
+
71
+ ### BLOCKING Patterns
72
+
73
+ These patterns will **prevent** the operation:
74
+
75
+ | Pattern | File Types | Risk Level | Reason |
76
+ |---------|-----------|------------|--------|
77
+ | `PATTERN_ONE` | *.ts, *.js | Critical | Description |
78
+ | `PATTERN_TWO` | *.sql | High | Description |
79
+ | `PATTERN_THREE` | * | Medium | Description |
80
+
81
+ ### WARNING Patterns
82
+
83
+ These patterns will **warn** but allow:
84
+
85
+ | Pattern | File Types | Reason |
86
+ |---------|-----------|--------|
87
+ | `WARN_PATTERN` | *.ts | Description |
88
+
89
+ ## Detection Script
90
+
91
+ ```bash
92
+ #!/bin/bash
93
+ # {PascalCaseName} Hook
94
+ # {description}
95
+
96
+ set -e
97
+
98
+ echo "🔍 Running {name} check..."
99
+
100
+ # Configuration
101
+ BLOCKING_PATTERNS=(
102
+ "PATTERN_ONE"
103
+ "PATTERN_TWO"
104
+ )
105
+
106
+ WARNING_PATTERNS=(
107
+ "WARN_PATTERN"
108
+ )
109
+
110
+ FILE_TYPES="*.ts *.js *.tsx *.jsx"
111
+
112
+ FOUND_BLOCKING=0
113
+ FOUND_WARNING=0
114
+
115
+ # Check blocking patterns
116
+ for pattern in "${BLOCKING_PATTERNS[@]}"; do
117
+ if grep -rn "$pattern" --include="$FILE_TYPES" . 2>/dev/null; then
118
+ echo "❌ BLOCKING: Found '$pattern'"
119
+ FOUND_BLOCKING=$((FOUND_BLOCKING + 1))
120
+ fi
121
+ done
122
+
123
+ # Check warning patterns
124
+ for pattern in "${WARNING_PATTERNS[@]}"; do
125
+ if grep -rn "$pattern" --include="$FILE_TYPES" . 2>/dev/null; then
126
+ echo "⚠️ WARNING: Found '$pattern'"
127
+ FOUND_WARNING=$((FOUND_WARNING + 1))
128
+ fi
129
+ done
130
+
131
+ # Results
132
+ if [ $FOUND_BLOCKING -gt 0 ]; then
133
+ echo ""
134
+ echo "╔═══════════════════════════════════════════╗"
135
+ echo "║ ❌ HOOK BLOCKED: $FOUND_BLOCKING issues found ║"
136
+ echo "╚═══════════════════════════════════════════╝"
137
+ echo ""
138
+ echo "Fix the issues above or bypass with:"
139
+ echo " SKIP_{NAME_UPPER}_HOOK=1 git commit -m 'message'"
140
+ exit 1
141
+ fi
142
+
143
+ if [ $FOUND_WARNING -gt 0 ]; then
144
+ echo ""
145
+ echo "⚠️ $FOUND_WARNING warnings found (non-blocking)"
146
+ fi
147
+
148
+ echo "✅ Hook PASSED"
149
+ exit 0
150
+ ```
151
+
152
+ ## Integration
153
+
154
+ ### With GitFlow
155
+
156
+ In `/gitflow:3-commit`, this hook runs automatically:
157
+
158
+ 1. User initiates commit
159
+ 2. Hook executes detection script
160
+ 3. If blocking patterns found → commit rejected
161
+ 4. User must fix or explicitly bypass
162
+
163
+ ### Manual Execution
164
+
165
+ ```bash
166
+ # Run hook manually
167
+ ./.claude/hooks/{name}.sh
168
+
169
+ # Check specific files
170
+ ./.claude/hooks/{name}.sh src/specific-file.ts
171
+ ```
172
+
173
+ ## Bypass (Emergency Only)
174
+
175
+ ```bash
176
+ # Use with extreme caution!
177
+ SKIP_{NAME_UPPER}_HOOK=1 git commit -m "message"
178
+
179
+ # Or in environment
180
+ export SKIP_{NAME_UPPER}_HOOK=1
181
+ ```
182
+
183
+ **WARNING**: Bypassing should be documented and justified.
184
+
185
+ ## Logging
186
+
187
+ All detections logged to:
188
+ `~/.claude/gitflow/logs/{name}.json`
189
+
190
+ ```json
191
+ {
192
+ "timestamp": "2024-01-15T10:30:00Z",
193
+ "hook": "{name}",
194
+ "trigger": "{trigger}",
195
+ "result": "blocked|passed|warning",
196
+ "blocking_issues": [],
197
+ "warnings": [],
198
+ "branch": "feature/xxx",
199
+ "user": "username"
200
+ }
201
+ ```
202
+
203
+ ## Customization
204
+
205
+ Edit patterns in the hook file:
206
+ - Add new blocking patterns
207
+ - Adjust file type filters
208
+ - Customize error messages
209
+
210
+ ## Priority
211
+
212
+ Security > Correctness > Speed
213
+ ```
214
+
215
+ ## Trigger Options
216
+
217
+ | Trigger | Use Case |
218
+ |---------|----------|
219
+ | `pre-commit` | Validate before local commit |
220
+ | `pre-merge` | Validate before branch merge |
221
+ | `pre-push` | Validate before pushing to remote |
222
+ | `post-commit` | Log/notify after commit |
223
+
224
+ ## Workflow
225
+
226
+ 1. Parse arguments (name, trigger, description)
227
+ 2. Validate name format
228
+ 3. Create project directory
229
+ 4. Generate hook template with proper trigger
230
+ 5. Display success message
231
+
232
+ ---
233
+
234
+ User: $ARGUMENTS