claude-code-templates 1.2.0 → 1.2.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 +1 -1
- package/src/hook-scanner.js +123 -50
package/package.json
CHANGED
package/src/hook-scanner.js
CHANGED
|
@@ -110,56 +110,129 @@ function getHooksFromSettings(settingsPath) {
|
|
|
110
110
|
function getHookDescription(hook, matcher, type) {
|
|
111
111
|
const command = hook.command || '';
|
|
112
112
|
|
|
113
|
-
//
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
113
|
+
// Extract key patterns for more specific descriptions
|
|
114
|
+
if (command.includes('jq -r') && command.includes('bash-command-log')) {
|
|
115
|
+
return 'Log all Bash commands for debugging';
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (command.includes('console\\.log')) {
|
|
119
|
+
return 'Block console.log statements in JS/TS files';
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (command.includes('print(') && command.includes('py$')) {
|
|
123
|
+
return 'Block print() statements in Python files';
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (command.includes('fmt.Print') && command.includes('go$')) {
|
|
127
|
+
return 'Block fmt.Print statements in Go files';
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (command.includes('println!') && command.includes('rs$')) {
|
|
131
|
+
return 'Block println! macros in Rust files';
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (command.includes('npm audit') || command.includes('pip-audit') || command.includes('cargo audit')) {
|
|
135
|
+
return 'Security audit for dependencies';
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (command.includes('prettier --write')) {
|
|
139
|
+
return 'Auto-format JS/TS files with Prettier';
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (command.includes('black') && command.includes('py$')) {
|
|
143
|
+
return 'Auto-format Python files with Black';
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (command.includes('isort') && command.includes('py$')) {
|
|
147
|
+
return 'Auto-sort Python imports with isort';
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (command.includes('gofmt') && command.includes('go$')) {
|
|
151
|
+
return 'Auto-format Go files with gofmt';
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (command.includes('goimports')) {
|
|
155
|
+
return 'Auto-format Go imports with goimports';
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (command.includes('rustfmt') && command.includes('rs$')) {
|
|
159
|
+
return 'Auto-format Rust files with rustfmt';
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (command.includes('tsc --noEmit')) {
|
|
163
|
+
return 'Run TypeScript type checking';
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (command.includes('flake8') && !command.includes('git diff')) {
|
|
167
|
+
return 'Run Python linting with flake8';
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (command.includes('mypy')) {
|
|
171
|
+
return 'Run Python type checking with mypy';
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (command.includes('go vet') && !command.includes('git diff')) {
|
|
175
|
+
return 'Run Go static analysis with go vet';
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (command.includes('cargo check')) {
|
|
179
|
+
return 'Run Rust compilation checks';
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (command.includes('cargo clippy') && !command.includes('git diff')) {
|
|
183
|
+
return 'Run Rust linting with clippy';
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (command.includes('import \\* from')) {
|
|
187
|
+
return 'Warn about wildcard imports';
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (command.includes('jest') || command.includes('vitest')) {
|
|
191
|
+
return 'Auto-run tests for modified files';
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (command.includes('pytest')) {
|
|
195
|
+
return 'Auto-run Python tests for modified files';
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (command.includes('go test')) {
|
|
199
|
+
return 'Auto-run Go tests for modified files';
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (command.includes('cargo test')) {
|
|
203
|
+
return 'Auto-run Rust tests for modified files';
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (command.includes('eslint') && command.includes('git diff')) {
|
|
207
|
+
return 'Run ESLint on changed files';
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (command.includes('flake8') && command.includes('git diff')) {
|
|
211
|
+
return 'Run Python linting on changed files';
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (command.includes('bandit')) {
|
|
215
|
+
return 'Run Python security analysis';
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (command.includes('go vet') && command.includes('git diff')) {
|
|
219
|
+
return 'Run Go analysis on changed files';
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if (command.includes('staticcheck')) {
|
|
223
|
+
return 'Run Go static analysis on changed files';
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (command.includes('cargo clippy') && command.includes('git diff')) {
|
|
227
|
+
return 'Run Rust linting on changed files';
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (command.includes('bundlesize') || command.includes('webpack-bundle-analyzer')) {
|
|
231
|
+
return 'Analyze bundle size impact';
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (command.includes('notifications.log')) {
|
|
235
|
+
return 'Log Claude Code notifications';
|
|
163
236
|
}
|
|
164
237
|
|
|
165
238
|
// Generate description based on command analysis
|