@nano-step/skill-manager 5.6.1 → 5.6.2
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/private-catalog.json +5 -0
- package/skills/deep-design/SKILL.md +402 -0
- package/skills/deep-design/evals/evals.json +23 -0
- package/skills/deep-design/skill.json +7 -0
- package/skills/feature-analysis/SKILL.md +290 -0
- package/skills/feature-analysis/skill.json +15 -0
- package/skills/nano-brain/skill.json +7 -0
- package/skills/pr-code-reviewer/CHANGELOG.md +287 -0
- package/skills/pr-code-reviewer/RESEARCH.md +60 -0
- package/skills/pr-code-reviewer/SKILL.md +530 -0
- package/skills/pr-code-reviewer/assets/config.json +47 -0
- package/skills/pr-code-reviewer/checklists/backend-express.md +357 -0
- package/skills/pr-code-reviewer/checklists/ci-cd.md +428 -0
- package/skills/pr-code-reviewer/checklists/consumer-search-matrix.md +339 -0
- package/skills/pr-code-reviewer/checklists/database.md +382 -0
- package/skills/pr-code-reviewer/checklists/frontend-vue-nuxt.md +426 -0
- package/skills/pr-code-reviewer/checklists/review-checklist.md +116 -0
- package/skills/pr-code-reviewer/references/framework-rules/express.md +39 -0
- package/skills/pr-code-reviewer/references/framework-rules/nestjs.md +41 -0
- package/skills/pr-code-reviewer/references/framework-rules/typeorm.md +52 -0
- package/skills/pr-code-reviewer/references/framework-rules/typescript.md +50 -0
- package/skills/pr-code-reviewer/references/framework-rules/vue-nuxt.md +53 -0
- package/skills/pr-code-reviewer/references/nano-brain-integration.md +61 -0
- package/skills/pr-code-reviewer/references/performance-patterns.md +26 -0
- package/skills/pr-code-reviewer/references/quality-patterns.md +25 -0
- package/skills/pr-code-reviewer/references/report-template.md +167 -0
- package/skills/pr-code-reviewer/references/security-patterns.md +31 -0
- package/skills/pr-code-reviewer/references/subagent-prompts.md +323 -0
- package/skills/pr-code-reviewer/skill.json +15 -0
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
# CI/CD Checklist
|
|
2
|
+
|
|
3
|
+
Comprehensive review checklist for CI/CD, Docker, and deployment-related changes.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Dockerfile Security
|
|
8
|
+
|
|
9
|
+
### CRITICAL - Must Check
|
|
10
|
+
|
|
11
|
+
| Check | Pattern | Why |
|
|
12
|
+
|-------|---------|-----|
|
|
13
|
+
| No secrets in Dockerfile | `ARG`/`ENV` with secrets | Secrets in image layers |
|
|
14
|
+
| Non-root user | `USER node` | Security best practice |
|
|
15
|
+
| Specific base image tag | `node:18.19.0-alpine` | Reproducibility |
|
|
16
|
+
| Multi-stage build | `FROM ... AS builder` | Smaller final image |
|
|
17
|
+
|
|
18
|
+
### Detection Patterns
|
|
19
|
+
|
|
20
|
+
```dockerfile
|
|
21
|
+
# CRITICAL: Secret in Dockerfile
|
|
22
|
+
ENV API_KEY=sk-1234567890 # Exposed in image layers!
|
|
23
|
+
ARG DATABASE_PASSWORD=secret # Also exposed!
|
|
24
|
+
|
|
25
|
+
# SECURE: Use runtime secrets
|
|
26
|
+
# Pass via docker run -e or docker-compose
|
|
27
|
+
|
|
28
|
+
# CRITICAL: Running as root
|
|
29
|
+
FROM node:18
|
|
30
|
+
WORKDIR /app
|
|
31
|
+
# No USER directive = runs as root!
|
|
32
|
+
|
|
33
|
+
# SECURE: Non-root user
|
|
34
|
+
FROM node:18
|
|
35
|
+
WORKDIR /app
|
|
36
|
+
RUN chown -R node:node /app
|
|
37
|
+
USER node
|
|
38
|
+
|
|
39
|
+
# WARNING: Floating tag
|
|
40
|
+
FROM node:18 # Could change unexpectedly
|
|
41
|
+
|
|
42
|
+
# SECURE: Pinned version
|
|
43
|
+
FROM node:18.19.0-alpine3.19
|
|
44
|
+
|
|
45
|
+
# WARNING: Large image (no multi-stage)
|
|
46
|
+
FROM node:18
|
|
47
|
+
COPY . .
|
|
48
|
+
RUN npm install
|
|
49
|
+
RUN npm run build
|
|
50
|
+
# Final image includes devDependencies!
|
|
51
|
+
|
|
52
|
+
# SECURE: Multi-stage build
|
|
53
|
+
FROM node:18 AS builder
|
|
54
|
+
COPY . .
|
|
55
|
+
RUN npm ci && npm run build
|
|
56
|
+
|
|
57
|
+
FROM node:18-alpine
|
|
58
|
+
COPY --from=builder /app/dist ./dist
|
|
59
|
+
COPY --from=builder /app/node_modules ./node_modules
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 2. Docker Compose
|
|
65
|
+
|
|
66
|
+
### CRITICAL - Must Check
|
|
67
|
+
|
|
68
|
+
| Check | Pattern | Why |
|
|
69
|
+
|-------|---------|-----|
|
|
70
|
+
| No hardcoded secrets | Use `.env` file | Security |
|
|
71
|
+
| Health checks defined | `healthcheck:` | Orchestration |
|
|
72
|
+
| Resource limits | `deploy.resources.limits` | Stability |
|
|
73
|
+
| Restart policy | `restart: unless-stopped` | Availability |
|
|
74
|
+
|
|
75
|
+
### Detection Patterns
|
|
76
|
+
|
|
77
|
+
```yaml
|
|
78
|
+
# CRITICAL: Hardcoded secrets
|
|
79
|
+
services:
|
|
80
|
+
app:
|
|
81
|
+
environment:
|
|
82
|
+
- DATABASE_PASSWORD=secret123 # Exposed in repo!
|
|
83
|
+
|
|
84
|
+
# SECURE: Use .env file
|
|
85
|
+
services:
|
|
86
|
+
app:
|
|
87
|
+
env_file:
|
|
88
|
+
- .env
|
|
89
|
+
|
|
90
|
+
# WARNING: No health check
|
|
91
|
+
services:
|
|
92
|
+
app:
|
|
93
|
+
image: myapp
|
|
94
|
+
|
|
95
|
+
# SECURE: With health check
|
|
96
|
+
services:
|
|
97
|
+
app:
|
|
98
|
+
image: myapp
|
|
99
|
+
healthcheck:
|
|
100
|
+
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
|
|
101
|
+
interval: 30s
|
|
102
|
+
timeout: 10s
|
|
103
|
+
retries: 3
|
|
104
|
+
|
|
105
|
+
# WARNING: No resource limits
|
|
106
|
+
services:
|
|
107
|
+
app:
|
|
108
|
+
image: myapp
|
|
109
|
+
# Can consume unlimited resources!
|
|
110
|
+
|
|
111
|
+
# SECURE: With limits
|
|
112
|
+
services:
|
|
113
|
+
app:
|
|
114
|
+
image: myapp
|
|
115
|
+
deploy:
|
|
116
|
+
resources:
|
|
117
|
+
limits:
|
|
118
|
+
cpus: '1'
|
|
119
|
+
memory: 1G
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 3. CircleCI Configuration
|
|
125
|
+
|
|
126
|
+
### CRITICAL - Must Check
|
|
127
|
+
|
|
128
|
+
| Check | Pattern | Why |
|
|
129
|
+
|-------|---------|-----|
|
|
130
|
+
| Secrets in context | `context: secrets` | Not in config |
|
|
131
|
+
| Cache keys versioned | `v1-deps-{{ checksum }}` | Cache invalidation |
|
|
132
|
+
| Parallelism for tests | `parallelism: 4` | Speed |
|
|
133
|
+
| Approval for prod | `type: approval` | Safety |
|
|
134
|
+
|
|
135
|
+
### Detection Patterns
|
|
136
|
+
|
|
137
|
+
```yaml
|
|
138
|
+
# CRITICAL: Secret in config
|
|
139
|
+
jobs:
|
|
140
|
+
deploy:
|
|
141
|
+
steps:
|
|
142
|
+
- run: |
|
|
143
|
+
export API_KEY=sk-12345 # Exposed in repo!
|
|
144
|
+
|
|
145
|
+
# SECURE: Use context
|
|
146
|
+
jobs:
|
|
147
|
+
deploy:
|
|
148
|
+
context: production-secrets
|
|
149
|
+
steps:
|
|
150
|
+
- run: echo $API_KEY # From context
|
|
151
|
+
|
|
152
|
+
# WARNING: No cache versioning
|
|
153
|
+
- restore_cache:
|
|
154
|
+
keys:
|
|
155
|
+
- deps-{{ checksum "package-lock.json" }}
|
|
156
|
+
|
|
157
|
+
# SECURE: Versioned cache key
|
|
158
|
+
- restore_cache:
|
|
159
|
+
keys:
|
|
160
|
+
- v2-deps-{{ checksum "package-lock.json" }}
|
|
161
|
+
- v2-deps-
|
|
162
|
+
|
|
163
|
+
# WARNING: No approval for production
|
|
164
|
+
workflows:
|
|
165
|
+
deploy:
|
|
166
|
+
jobs:
|
|
167
|
+
- build
|
|
168
|
+
- deploy-prod # Deploys automatically!
|
|
169
|
+
|
|
170
|
+
# SECURE: Require approval
|
|
171
|
+
workflows:
|
|
172
|
+
deploy:
|
|
173
|
+
jobs:
|
|
174
|
+
- build
|
|
175
|
+
- hold:
|
|
176
|
+
type: approval
|
|
177
|
+
requires:
|
|
178
|
+
- build
|
|
179
|
+
- deploy-prod:
|
|
180
|
+
requires:
|
|
181
|
+
- hold
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## 4. Environment Variables
|
|
187
|
+
|
|
188
|
+
### CRITICAL - Must Check
|
|
189
|
+
|
|
190
|
+
| Check | Pattern | Why |
|
|
191
|
+
|-------|---------|-----|
|
|
192
|
+
| No secrets in code | Check for API keys | Security |
|
|
193
|
+
| .env in .gitignore | `.env` not committed | Security |
|
|
194
|
+
| .env.example exists | Template for devs | Onboarding |
|
|
195
|
+
| dotenv-vault for secrets | `.env.vault` | Encrypted secrets |
|
|
196
|
+
|
|
197
|
+
### Detection Patterns
|
|
198
|
+
|
|
199
|
+
```javascript
|
|
200
|
+
// CRITICAL: Hardcoded secret
|
|
201
|
+
const API_KEY = 'sk-1234567890abcdef'
|
|
202
|
+
|
|
203
|
+
// SECURE: From environment
|
|
204
|
+
const API_KEY = process.env.API_KEY
|
|
205
|
+
|
|
206
|
+
// WARNING: .env committed
|
|
207
|
+
// Check .gitignore includes:
|
|
208
|
+
.env
|
|
209
|
+
.env.local
|
|
210
|
+
.env.*.local
|
|
211
|
+
|
|
212
|
+
// SECURE: Use dotenv-vault
|
|
213
|
+
// .env.vault is encrypted, safe to commit
|
|
214
|
+
// Decrypt with DOTENV_KEY at runtime
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## 5. Build & Deploy Scripts
|
|
220
|
+
|
|
221
|
+
### CRITICAL - Must Check
|
|
222
|
+
|
|
223
|
+
| Check | Pattern | Why |
|
|
224
|
+
|-------|---------|-----|
|
|
225
|
+
| npm ci not npm install | `npm ci` | Reproducible builds |
|
|
226
|
+
| Lock file committed | `package-lock.json` | Version pinning |
|
|
227
|
+
| Build fails on error | `set -e` in scripts | Catch failures |
|
|
228
|
+
| No force push to main | `--force` blocked | History protection |
|
|
229
|
+
|
|
230
|
+
### Detection Patterns
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# WARNING: npm install in CI
|
|
234
|
+
npm install # Can install different versions!
|
|
235
|
+
|
|
236
|
+
# SECURE: npm ci
|
|
237
|
+
npm ci # Uses exact versions from lock file
|
|
238
|
+
|
|
239
|
+
# WARNING: Script continues on error
|
|
240
|
+
#!/bin/bash
|
|
241
|
+
npm run build
|
|
242
|
+
npm run test # Runs even if build failed!
|
|
243
|
+
|
|
244
|
+
# SECURE: Exit on error
|
|
245
|
+
#!/bin/bash
|
|
246
|
+
set -e
|
|
247
|
+
npm run build
|
|
248
|
+
npm run test
|
|
249
|
+
|
|
250
|
+
# CRITICAL: Force push in script
|
|
251
|
+
git push --force origin main # Destroys history!
|
|
252
|
+
|
|
253
|
+
# SECURE: Never force push main
|
|
254
|
+
# Add branch protection rules
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## 6. Dependency Management
|
|
260
|
+
|
|
261
|
+
### CRITICAL - Must Check
|
|
262
|
+
|
|
263
|
+
| Check | Pattern | Why |
|
|
264
|
+
|-------|---------|-----|
|
|
265
|
+
| No vulnerable deps | `npm audit` | Security |
|
|
266
|
+
| Lock file updated | `package-lock.json` | Consistency |
|
|
267
|
+
| Major version bumps reviewed | `^1.0.0` → `^2.0.0` | Breaking changes |
|
|
268
|
+
| Unused deps removed | `depcheck` | Bundle size |
|
|
269
|
+
|
|
270
|
+
### Detection Patterns
|
|
271
|
+
|
|
272
|
+
```json
|
|
273
|
+
// WARNING: Floating versions
|
|
274
|
+
{
|
|
275
|
+
"dependencies": {
|
|
276
|
+
"express": "*", // Any version!
|
|
277
|
+
"lodash": "latest" // Unpredictable!
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// SECURE: Pinned versions
|
|
282
|
+
{
|
|
283
|
+
"dependencies": {
|
|
284
|
+
"express": "^4.18.2", // Minor updates only
|
|
285
|
+
"lodash": "4.17.21" // Exact version
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Check for vulnerabilities
|
|
290
|
+
npm audit
|
|
291
|
+
npm audit fix
|
|
292
|
+
|
|
293
|
+
// Check for unused dependencies
|
|
294
|
+
npx depcheck
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## 7. Deployment Safety
|
|
300
|
+
|
|
301
|
+
### CRITICAL - Must Check
|
|
302
|
+
|
|
303
|
+
| Check | Pattern | Why |
|
|
304
|
+
|-------|---------|-----|
|
|
305
|
+
| Health check endpoint | `/health` or `/api/health` | Load balancer |
|
|
306
|
+
| Graceful shutdown | `SIGTERM` handler | Zero downtime |
|
|
307
|
+
| Database migrations first | Run before deploy | Data ready |
|
|
308
|
+
| Rollback plan | Previous version tagged | Recovery |
|
|
309
|
+
|
|
310
|
+
### Detection Patterns
|
|
311
|
+
|
|
312
|
+
```javascript
|
|
313
|
+
// WARNING: No health check endpoint
|
|
314
|
+
// Add to Express app:
|
|
315
|
+
app.get('/health', (req, res) => {
|
|
316
|
+
res.json({ status: 'ok', timestamp: Date.now() })
|
|
317
|
+
})
|
|
318
|
+
|
|
319
|
+
// WARNING: No graceful shutdown
|
|
320
|
+
// Process killed immediately, requests dropped!
|
|
321
|
+
|
|
322
|
+
// SECURE: Graceful shutdown
|
|
323
|
+
process.on('SIGTERM', async () => {
|
|
324
|
+
console.log('SIGTERM received, shutting down gracefully')
|
|
325
|
+
server.close(() => {
|
|
326
|
+
console.log('HTTP server closed')
|
|
327
|
+
// Close database connections
|
|
328
|
+
mysql.end()
|
|
329
|
+
redis.quit()
|
|
330
|
+
process.exit(0)
|
|
331
|
+
})
|
|
332
|
+
|
|
333
|
+
// Force exit after timeout
|
|
334
|
+
setTimeout(() => {
|
|
335
|
+
console.error('Forced shutdown after timeout')
|
|
336
|
+
process.exit(1)
|
|
337
|
+
}, 30000)
|
|
338
|
+
})
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
## 8. Monitoring & Logging
|
|
344
|
+
|
|
345
|
+
### WARNING - Should Check
|
|
346
|
+
|
|
347
|
+
| Check | Pattern | Why |
|
|
348
|
+
|-------|---------|-----|
|
|
349
|
+
| Structured logging | JSON format | Parsing |
|
|
350
|
+
| Log levels appropriate | `info`, `error`, `debug` | Filtering |
|
|
351
|
+
| No sensitive data logged | Mask passwords | Security |
|
|
352
|
+
| Error tracking configured | Sentry, etc. | Alerting |
|
|
353
|
+
|
|
354
|
+
### Detection Patterns
|
|
355
|
+
|
|
356
|
+
```javascript
|
|
357
|
+
// WARNING: Unstructured logging
|
|
358
|
+
console.log('User logged in: ' + userId)
|
|
359
|
+
|
|
360
|
+
// SECURE: Structured logging
|
|
361
|
+
logger.info('User logged in', { userId, timestamp: Date.now() })
|
|
362
|
+
|
|
363
|
+
// CRITICAL: Logging sensitive data
|
|
364
|
+
logger.info('Login attempt', { email, password }) // Password exposed!
|
|
365
|
+
|
|
366
|
+
// SECURE: Mask sensitive fields
|
|
367
|
+
logger.info('Login attempt', { email, password: '***' })
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
## 9. Breaking Changes in CI/CD
|
|
373
|
+
|
|
374
|
+
### Auto-Flag These Changes
|
|
375
|
+
|
|
376
|
+
| Signal | Severity | Action |
|
|
377
|
+
|--------|----------|--------|
|
|
378
|
+
| Node version changed | WARNING | Test all services |
|
|
379
|
+
| Base image changed | WARNING | Verify compatibility |
|
|
380
|
+
| Environment variable renamed | CRITICAL | Update all deployments |
|
|
381
|
+
| Port changed | CRITICAL | Update load balancer |
|
|
382
|
+
| Health check path changed | CRITICAL | Update orchestration |
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## Quick Checklist
|
|
387
|
+
|
|
388
|
+
Copy this for PR reviews:
|
|
389
|
+
|
|
390
|
+
```markdown
|
|
391
|
+
## CI/CD Review
|
|
392
|
+
|
|
393
|
+
### Dockerfile
|
|
394
|
+
- [ ] No secrets in Dockerfile
|
|
395
|
+
- [ ] Non-root user configured
|
|
396
|
+
- [ ] Base image tag pinned
|
|
397
|
+
- [ ] Multi-stage build (if applicable)
|
|
398
|
+
|
|
399
|
+
### Docker Compose
|
|
400
|
+
- [ ] Secrets in .env file (not hardcoded)
|
|
401
|
+
- [ ] Health checks defined
|
|
402
|
+
- [ ] Resource limits set
|
|
403
|
+
|
|
404
|
+
### CircleCI
|
|
405
|
+
- [ ] Secrets in context (not config)
|
|
406
|
+
- [ ] Cache keys versioned
|
|
407
|
+
- [ ] Approval required for production
|
|
408
|
+
|
|
409
|
+
### Environment
|
|
410
|
+
- [ ] No secrets in code
|
|
411
|
+
- [ ] .env in .gitignore
|
|
412
|
+
- [ ] .env.example exists
|
|
413
|
+
|
|
414
|
+
### Build
|
|
415
|
+
- [ ] npm ci used (not npm install)
|
|
416
|
+
- [ ] Lock file committed
|
|
417
|
+
- [ ] Scripts exit on error
|
|
418
|
+
|
|
419
|
+
### Deployment
|
|
420
|
+
- [ ] Health check endpoint exists
|
|
421
|
+
- [ ] Graceful shutdown handler
|
|
422
|
+
- [ ] Rollback plan documented
|
|
423
|
+
|
|
424
|
+
### Breaking Changes
|
|
425
|
+
- [ ] Node version change tested
|
|
426
|
+
- [ ] Environment variable renames communicated
|
|
427
|
+
- [ ] Port changes updated in infrastructure
|
|
428
|
+
```
|