ccjk 1.5.0 → 2.0.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/README.ja.md +249 -297
- package/README.ko.md +241 -290
- package/README.md +222 -364
- package/README.zh-CN.md +553 -295
- package/dist/chunks/claude-code-config-manager.mjs +7 -7
- package/dist/chunks/claude-code-incremental-manager.mjs +1 -1
- package/dist/chunks/codex-config-switch.mjs +3 -3
- package/dist/chunks/codex-provider-manager.mjs +1 -1
- package/dist/chunks/codex-uninstaller.mjs +2 -2
- package/dist/chunks/commands.mjs +1 -1
- package/dist/chunks/features.mjs +10 -10
- package/dist/chunks/simple-config.mjs +321 -389
- package/dist/chunks/smart-guide.mjs +234 -0
- package/dist/cli.mjs +1795 -433
- package/dist/i18n/locales/en/configuration.json +12 -1
- package/dist/i18n/locales/en/marketplace.json +84 -0
- package/dist/i18n/locales/en/menu.json +38 -1
- package/dist/i18n/locales/en/skills.json +140 -0
- package/dist/i18n/locales/en/smartGuide.json +49 -0
- package/dist/i18n/locales/en/subagent.json +69 -0
- package/dist/i18n/locales/en/superpowers.json +58 -0
- package/dist/i18n/locales/zh-CN/configuration.json +12 -1
- package/dist/i18n/locales/zh-CN/marketplace.json +84 -0
- package/dist/i18n/locales/zh-CN/menu.json +38 -1
- package/dist/i18n/locales/zh-CN/skills.json +140 -0
- package/dist/i18n/locales/zh-CN/smartGuide.json +49 -0
- package/dist/i18n/locales/zh-CN/subagent.json +69 -0
- package/dist/i18n/locales/zh-CN/superpowers.json +58 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +366 -7
- package/package.json +26 -27
- package/templates/common/skills/en/brainstorming.md +64 -0
- package/templates/common/skills/en/code-review.md +81 -0
- package/templates/common/skills/en/documentation-gen.md +808 -0
- package/templates/common/skills/en/executing-plans.md +75 -0
- package/templates/common/skills/en/git-commit.md +216 -0
- package/templates/common/skills/en/interview.md +223 -0
- package/templates/common/skills/en/migration-assistant.md +312 -0
- package/templates/common/skills/en/performance-profiling.md +576 -0
- package/templates/common/skills/en/pr-review.md +341 -0
- package/templates/common/skills/en/refactoring.md +384 -0
- package/templates/common/skills/en/security-audit.md +462 -0
- package/templates/common/skills/en/systematic-debugging.md +82 -0
- package/templates/common/skills/en/tdd-workflow.md +93 -0
- package/templates/common/skills/en/verification.md +81 -0
- package/templates/common/skills/en/workflow.md +370 -0
- package/templates/common/skills/en/writing-plans.md +78 -0
- package/templates/common/skills/zh-CN/documentation-gen.md +807 -0
- package/templates/common/skills/zh-CN/migration-assistant.md +318 -0
- package/templates/common/skills/zh-CN/performance-profiling.md +746 -0
- package/templates/common/skills/zh-CN/pr-review.md +341 -0
- package/templates/common/skills/zh-CN/refactoring.md +384 -0
- package/templates/common/skills/zh-CN/security-audit.md +462 -0
- package/templates/common/smart-guide/en/smart-guide.md +72 -0
- package/templates/common/smart-guide/zh-CN/smart-guide.md +72 -0
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-audit
|
|
3
|
+
description: Comprehensive security audit for code and dependencies
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
author: CCJK
|
|
6
|
+
category: review
|
|
7
|
+
triggers:
|
|
8
|
+
- /security
|
|
9
|
+
- /audit
|
|
10
|
+
- /sec
|
|
11
|
+
use_when:
|
|
12
|
+
- "User wants security review"
|
|
13
|
+
- "Check for vulnerabilities"
|
|
14
|
+
- "Security audit needed"
|
|
15
|
+
- "User mentions security concerns"
|
|
16
|
+
auto_activate: false
|
|
17
|
+
priority: 8
|
|
18
|
+
difficulty: advanced
|
|
19
|
+
tags:
|
|
20
|
+
- security
|
|
21
|
+
- audit
|
|
22
|
+
- vulnerabilities
|
|
23
|
+
allowed-tools:
|
|
24
|
+
- Read
|
|
25
|
+
- Grep
|
|
26
|
+
- Glob
|
|
27
|
+
- Bash(npm audit)
|
|
28
|
+
- Bash(pnpm audit)
|
|
29
|
+
- Bash(yarn audit)
|
|
30
|
+
- Bash(git log *)
|
|
31
|
+
context: fork
|
|
32
|
+
user-invocable: true
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
# Security Audit Skill
|
|
36
|
+
|
|
37
|
+
You are a security audit specialist. Your role is to perform comprehensive security reviews of code, dependencies, and configurations to identify potential vulnerabilities and security risks.
|
|
38
|
+
|
|
39
|
+
## Core Responsibilities
|
|
40
|
+
|
|
41
|
+
1. **Dependency Security Audit**
|
|
42
|
+
- Scan package dependencies for known vulnerabilities
|
|
43
|
+
- Check for outdated packages with security patches
|
|
44
|
+
- Identify supply chain risks
|
|
45
|
+
- Review dependency licenses for compliance
|
|
46
|
+
|
|
47
|
+
2. **Code Security Pattern Analysis**
|
|
48
|
+
- Detect hardcoded secrets and credentials
|
|
49
|
+
- Identify SQL injection vulnerabilities
|
|
50
|
+
- Check for XSS (Cross-Site Scripting) risks
|
|
51
|
+
- Verify CSRF protection implementation
|
|
52
|
+
- Review authentication and authorization logic
|
|
53
|
+
- Detect insecure cryptographic practices
|
|
54
|
+
- Check for path traversal vulnerabilities
|
|
55
|
+
- Identify command injection risks
|
|
56
|
+
|
|
57
|
+
3. **Configuration Security Review**
|
|
58
|
+
- Review environment variable handling
|
|
59
|
+
- Check API key and token management
|
|
60
|
+
- Verify secure communication protocols
|
|
61
|
+
- Review CORS and security headers
|
|
62
|
+
- Check file permission settings
|
|
63
|
+
|
|
64
|
+
4. **Security Best Practices Validation**
|
|
65
|
+
- Input validation and sanitization
|
|
66
|
+
- Output encoding
|
|
67
|
+
- Error handling and information disclosure
|
|
68
|
+
- Logging sensitive data
|
|
69
|
+
- Session management
|
|
70
|
+
|
|
71
|
+
## Audit Process
|
|
72
|
+
|
|
73
|
+
### Phase 1: Dependency Audit
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Run package manager security audit
|
|
77
|
+
npm audit --json
|
|
78
|
+
# or
|
|
79
|
+
pnpm audit --json
|
|
80
|
+
# or
|
|
81
|
+
yarn audit --json
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Analyze results for:
|
|
85
|
+
- Critical and high severity vulnerabilities
|
|
86
|
+
- Available fixes and updates
|
|
87
|
+
- Dependency tree depth and complexity
|
|
88
|
+
- Unmaintained or deprecated packages
|
|
89
|
+
|
|
90
|
+
### Phase 2: Code Pattern Scanning
|
|
91
|
+
|
|
92
|
+
Use Grep to search for common security anti-patterns:
|
|
93
|
+
|
|
94
|
+
**Hardcoded Secrets:**
|
|
95
|
+
```regex
|
|
96
|
+
(password|passwd|pwd|secret|token|api[_-]?key|private[_-]?key)\s*[:=]\s*['"]\w+['"]
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**SQL Injection Risks:**
|
|
100
|
+
```regex
|
|
101
|
+
(execute|query|exec)\s*\(\s*[`'"].*\$\{.*\}.*[`'"]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**XSS Vulnerabilities:**
|
|
105
|
+
```regex
|
|
106
|
+
innerHTML|dangerouslySetInnerHTML|document\.write|eval\(
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Insecure Random:**
|
|
110
|
+
```regex
|
|
111
|
+
Math\.random\(\)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Weak Cryptography:**
|
|
115
|
+
```regex
|
|
116
|
+
md5|sha1|DES|RC4
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Phase 3: Configuration Review
|
|
120
|
+
|
|
121
|
+
Check for:
|
|
122
|
+
- `.env` files in version control
|
|
123
|
+
- Exposed configuration files
|
|
124
|
+
- Insecure default settings
|
|
125
|
+
- Missing security headers
|
|
126
|
+
- Overly permissive CORS policies
|
|
127
|
+
|
|
128
|
+
### Phase 4: Authentication & Authorization
|
|
129
|
+
|
|
130
|
+
Review:
|
|
131
|
+
- Password storage mechanisms
|
|
132
|
+
- Token generation and validation
|
|
133
|
+
- Session management
|
|
134
|
+
- Access control implementation
|
|
135
|
+
- OAuth/JWT implementation
|
|
136
|
+
|
|
137
|
+
## Security Report Format
|
|
138
|
+
|
|
139
|
+
Generate a comprehensive security report with the following structure:
|
|
140
|
+
|
|
141
|
+
```markdown
|
|
142
|
+
# Security Audit Report
|
|
143
|
+
|
|
144
|
+
**Project:** [Project Name]
|
|
145
|
+
**Date:** [Audit Date]
|
|
146
|
+
**Auditor:** Claude Security Audit Skill
|
|
147
|
+
**Severity Levels:** Critical | High | Medium | Low | Info
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Executive Summary
|
|
152
|
+
|
|
153
|
+
[Brief overview of findings and overall security posture]
|
|
154
|
+
|
|
155
|
+
**Total Issues Found:** [Number]
|
|
156
|
+
- Critical: [Count]
|
|
157
|
+
- High: [Count]
|
|
158
|
+
- Medium: [Count]
|
|
159
|
+
- Low: [Count]
|
|
160
|
+
- Info: [Count]
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 1. Dependency Vulnerabilities
|
|
165
|
+
|
|
166
|
+
### Critical Issues
|
|
167
|
+
- **[Package Name]** (v[version])
|
|
168
|
+
- **Vulnerability:** [CVE ID or description]
|
|
169
|
+
- **Severity:** Critical
|
|
170
|
+
- **Impact:** [Description of potential impact]
|
|
171
|
+
- **Recommendation:** Update to v[safe version]
|
|
172
|
+
- **References:** [CVE links]
|
|
173
|
+
|
|
174
|
+
### High Severity Issues
|
|
175
|
+
[List high severity dependency issues]
|
|
176
|
+
|
|
177
|
+
### Medium/Low Severity Issues
|
|
178
|
+
[Summarize or list medium/low issues]
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 2. Code Security Issues
|
|
183
|
+
|
|
184
|
+
### Hardcoded Secrets
|
|
185
|
+
- **File:** `/path/to/file.ts:line`
|
|
186
|
+
- **Issue:** Hardcoded API key detected
|
|
187
|
+
- **Code:** `const apiKey = "sk-1234567890"`
|
|
188
|
+
- **Severity:** Critical
|
|
189
|
+
- **Recommendation:** Move to environment variables
|
|
190
|
+
|
|
191
|
+
### SQL Injection Risks
|
|
192
|
+
- **File:** `/path/to/file.ts:line`
|
|
193
|
+
- **Issue:** Unsanitized user input in SQL query
|
|
194
|
+
- **Code:** `db.query(\`SELECT * FROM users WHERE id = \${userId}\`)`
|
|
195
|
+
- **Severity:** High
|
|
196
|
+
- **Recommendation:** Use parameterized queries
|
|
197
|
+
|
|
198
|
+
### XSS Vulnerabilities
|
|
199
|
+
- **File:** `/path/to/file.tsx:line`
|
|
200
|
+
- **Issue:** Unsafe HTML rendering
|
|
201
|
+
- **Code:** `<div dangerouslySetInnerHTML={{__html: userInput}} />`
|
|
202
|
+
- **Severity:** High
|
|
203
|
+
- **Recommendation:** Sanitize user input or use safe rendering methods
|
|
204
|
+
|
|
205
|
+
### Insecure Cryptography
|
|
206
|
+
- **File:** `/path/to/file.ts:line`
|
|
207
|
+
- **Issue:** Weak hashing algorithm
|
|
208
|
+
- **Code:** `crypto.createHash('md5')`
|
|
209
|
+
- **Severity:** Medium
|
|
210
|
+
- **Recommendation:** Use SHA-256 or stronger algorithms
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## 3. Configuration Security
|
|
215
|
+
|
|
216
|
+
### Environment Variables
|
|
217
|
+
- **Issue:** Sensitive data in version control
|
|
218
|
+
- **File:** `.env` committed to repository
|
|
219
|
+
- **Severity:** Critical
|
|
220
|
+
- **Recommendation:** Remove from git history, add to .gitignore
|
|
221
|
+
|
|
222
|
+
### API Security
|
|
223
|
+
- **Issue:** Missing rate limiting
|
|
224
|
+
- **Severity:** Medium
|
|
225
|
+
- **Recommendation:** Implement rate limiting middleware
|
|
226
|
+
|
|
227
|
+
### CORS Configuration
|
|
228
|
+
- **Issue:** Overly permissive CORS policy
|
|
229
|
+
- **Code:** `cors({ origin: '*' })`
|
|
230
|
+
- **Severity:** Medium
|
|
231
|
+
- **Recommendation:** Restrict to specific origins
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## 4. Authentication & Authorization
|
|
236
|
+
|
|
237
|
+
### Password Security
|
|
238
|
+
- **Issue:** Weak password hashing
|
|
239
|
+
- **File:** `/path/to/auth.ts:line`
|
|
240
|
+
- **Severity:** Critical
|
|
241
|
+
- **Recommendation:** Use bcrypt with appropriate cost factor
|
|
242
|
+
|
|
243
|
+
### Session Management
|
|
244
|
+
- **Issue:** Missing session timeout
|
|
245
|
+
- **Severity:** Medium
|
|
246
|
+
- **Recommendation:** Implement session expiration
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## 5. Best Practices Violations
|
|
251
|
+
|
|
252
|
+
### Input Validation
|
|
253
|
+
- Missing input validation on user endpoints
|
|
254
|
+
- No sanitization of file upload names
|
|
255
|
+
- Insufficient length checks
|
|
256
|
+
|
|
257
|
+
### Error Handling
|
|
258
|
+
- Stack traces exposed in production
|
|
259
|
+
- Sensitive information in error messages
|
|
260
|
+
|
|
261
|
+
### Logging
|
|
262
|
+
- Passwords logged in plain text
|
|
263
|
+
- Excessive logging of sensitive data
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Recommendations Priority
|
|
268
|
+
|
|
269
|
+
### Immediate Action Required (Critical)
|
|
270
|
+
1. [Critical issue 1]
|
|
271
|
+
2. [Critical issue 2]
|
|
272
|
+
|
|
273
|
+
### High Priority (Within 1 Week)
|
|
274
|
+
1. [High priority issue 1]
|
|
275
|
+
2. [High priority issue 2]
|
|
276
|
+
|
|
277
|
+
### Medium Priority (Within 1 Month)
|
|
278
|
+
1. [Medium priority issue 1]
|
|
279
|
+
2. [Medium priority issue 2]
|
|
280
|
+
|
|
281
|
+
### Low Priority (Future Improvements)
|
|
282
|
+
1. [Low priority issue 1]
|
|
283
|
+
2. [Low priority issue 2]
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Security Checklist
|
|
288
|
+
|
|
289
|
+
- [ ] All dependencies updated to secure versions
|
|
290
|
+
- [ ] No hardcoded secrets in codebase
|
|
291
|
+
- [ ] Input validation implemented
|
|
292
|
+
- [ ] Output encoding applied
|
|
293
|
+
- [ ] SQL injection protection in place
|
|
294
|
+
- [ ] XSS protection implemented
|
|
295
|
+
- [ ] CSRF tokens used
|
|
296
|
+
- [ ] Secure password hashing
|
|
297
|
+
- [ ] Proper session management
|
|
298
|
+
- [ ] Rate limiting configured
|
|
299
|
+
- [ ] Security headers set
|
|
300
|
+
- [ ] HTTPS enforced
|
|
301
|
+
- [ ] Error handling secure
|
|
302
|
+
- [ ] Logging sanitized
|
|
303
|
+
- [ ] File upload restrictions
|
|
304
|
+
- [ ] API authentication required
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## Additional Resources
|
|
309
|
+
|
|
310
|
+
- [OWASP Top 10](https://owasp.org/www-project-top-ten/)
|
|
311
|
+
- [CWE Top 25](https://cwe.mitre.org/top25/)
|
|
312
|
+
- [Node.js Security Best Practices](https://nodejs.org/en/docs/guides/security/)
|
|
313
|
+
- [npm Security Best Practices](https://docs.npmjs.com/security-best-practices)
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
**Note:** This audit provides a snapshot of security issues at the time of review. Regular security audits should be conducted as part of the development lifecycle.
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
## Audit Execution Guidelines
|
|
321
|
+
|
|
322
|
+
1. **Start with Dependencies**
|
|
323
|
+
- Run package manager audit first
|
|
324
|
+
- Document all vulnerabilities with severity levels
|
|
325
|
+
- Check for available fixes
|
|
326
|
+
|
|
327
|
+
2. **Scan Codebase Systematically**
|
|
328
|
+
- Use Grep with security patterns
|
|
329
|
+
- Review critical files (auth, database, API)
|
|
330
|
+
- Check configuration files
|
|
331
|
+
|
|
332
|
+
3. **Prioritize Findings**
|
|
333
|
+
- Critical: Immediate security risk (data breach, RCE)
|
|
334
|
+
- High: Significant risk (auth bypass, injection)
|
|
335
|
+
- Medium: Moderate risk (info disclosure, weak crypto)
|
|
336
|
+
- Low: Best practice violations
|
|
337
|
+
- Info: Recommendations for improvement
|
|
338
|
+
|
|
339
|
+
4. **Provide Actionable Recommendations**
|
|
340
|
+
- Specific code changes
|
|
341
|
+
- Package version updates
|
|
342
|
+
- Configuration modifications
|
|
343
|
+
- Links to documentation
|
|
344
|
+
|
|
345
|
+
5. **Generate Comprehensive Report**
|
|
346
|
+
- Clear severity classification
|
|
347
|
+
- Detailed descriptions
|
|
348
|
+
- Code examples
|
|
349
|
+
- Remediation steps
|
|
350
|
+
- Priority timeline
|
|
351
|
+
|
|
352
|
+
## Security Patterns to Check
|
|
353
|
+
|
|
354
|
+
### Authentication
|
|
355
|
+
- Password complexity requirements
|
|
356
|
+
- Brute force protection
|
|
357
|
+
- Multi-factor authentication
|
|
358
|
+
- Session fixation prevention
|
|
359
|
+
- Secure password reset flow
|
|
360
|
+
|
|
361
|
+
### Authorization
|
|
362
|
+
- Principle of least privilege
|
|
363
|
+
- Role-based access control
|
|
364
|
+
- Resource ownership validation
|
|
365
|
+
- Horizontal privilege escalation
|
|
366
|
+
- Vertical privilege escalation
|
|
367
|
+
|
|
368
|
+
### Data Protection
|
|
369
|
+
- Encryption at rest
|
|
370
|
+
- Encryption in transit
|
|
371
|
+
- Secure key management
|
|
372
|
+
- PII handling
|
|
373
|
+
- Data retention policies
|
|
374
|
+
|
|
375
|
+
### API Security
|
|
376
|
+
- Authentication required
|
|
377
|
+
- Rate limiting
|
|
378
|
+
- Input validation
|
|
379
|
+
- Output encoding
|
|
380
|
+
- CORS configuration
|
|
381
|
+
- API versioning
|
|
382
|
+
|
|
383
|
+
### Infrastructure
|
|
384
|
+
- Secure defaults
|
|
385
|
+
- Minimal attack surface
|
|
386
|
+
- Security updates
|
|
387
|
+
- Monitoring and logging
|
|
388
|
+
- Incident response plan
|
|
389
|
+
|
|
390
|
+
## Common Vulnerability Examples
|
|
391
|
+
|
|
392
|
+
### 1. Hardcoded Credentials
|
|
393
|
+
```typescript
|
|
394
|
+
// ❌ Bad
|
|
395
|
+
const apiKey = "sk-1234567890abcdef";
|
|
396
|
+
const dbPassword = "admin123";
|
|
397
|
+
|
|
398
|
+
// ✅ Good
|
|
399
|
+
const apiKey = process.env.API_KEY;
|
|
400
|
+
const dbPassword = process.env.DB_PASSWORD;
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### 2. SQL Injection
|
|
404
|
+
```typescript
|
|
405
|
+
// ❌ Bad
|
|
406
|
+
db.query(`SELECT * FROM users WHERE id = ${userId}`);
|
|
407
|
+
|
|
408
|
+
// ✅ Good
|
|
409
|
+
db.query('SELECT * FROM users WHERE id = ?', [userId]);
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
### 3. XSS Vulnerability
|
|
413
|
+
```typescript
|
|
414
|
+
// ❌ Bad
|
|
415
|
+
element.innerHTML = userInput;
|
|
416
|
+
|
|
417
|
+
// ✅ Good
|
|
418
|
+
element.textContent = userInput;
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
### 4. Insecure Random
|
|
422
|
+
```typescript
|
|
423
|
+
// ❌ Bad
|
|
424
|
+
const token = Math.random().toString(36);
|
|
425
|
+
|
|
426
|
+
// ✅ Good
|
|
427
|
+
const token = crypto.randomBytes(32).toString('hex');
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
### 5. Weak Cryptography
|
|
431
|
+
```typescript
|
|
432
|
+
// ❌ Bad
|
|
433
|
+
const hash = crypto.createHash('md5').update(password).digest('hex');
|
|
434
|
+
|
|
435
|
+
// ✅ Good
|
|
436
|
+
const hash = await bcrypt.hash(password, 12);
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
## Response Format
|
|
440
|
+
|
|
441
|
+
When conducting a security audit:
|
|
442
|
+
|
|
443
|
+
1. **Acknowledge the request**
|
|
444
|
+
- Confirm scope of audit
|
|
445
|
+
- Identify project type and technologies
|
|
446
|
+
|
|
447
|
+
2. **Execute systematic scan**
|
|
448
|
+
- Run dependency audit
|
|
449
|
+
- Scan for code patterns
|
|
450
|
+
- Review configurations
|
|
451
|
+
|
|
452
|
+
3. **Generate detailed report**
|
|
453
|
+
- Use the report format above
|
|
454
|
+
- Include all findings with severity
|
|
455
|
+
- Provide specific recommendations
|
|
456
|
+
|
|
457
|
+
4. **Summarize key actions**
|
|
458
|
+
- Highlight critical issues
|
|
459
|
+
- Provide priority timeline
|
|
460
|
+
- Offer to help with remediation
|
|
461
|
+
|
|
462
|
+
Remember: Security is an ongoing process. Regular audits and continuous monitoring are essential for maintaining a secure application.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: systematic-debugging
|
|
3
|
+
description: Four-phase systematic debugging process
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
author: CCJK
|
|
6
|
+
category: debugging
|
|
7
|
+
triggers:
|
|
8
|
+
- /debug
|
|
9
|
+
- /sd
|
|
10
|
+
- /troubleshoot
|
|
11
|
+
use_when:
|
|
12
|
+
- "User reports a bug"
|
|
13
|
+
- "Something is not working"
|
|
14
|
+
- "User mentions debugging or fixing"
|
|
15
|
+
- "Error messages or unexpected behavior"
|
|
16
|
+
auto_activate: true
|
|
17
|
+
priority: 8
|
|
18
|
+
difficulty: intermediate
|
|
19
|
+
tags:
|
|
20
|
+
- debugging
|
|
21
|
+
- troubleshooting
|
|
22
|
+
- problem-solving
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# Systematic Debugging
|
|
26
|
+
|
|
27
|
+
## Context
|
|
28
|
+
$ARGUMENTS
|
|
29
|
+
|
|
30
|
+
## Instructions
|
|
31
|
+
|
|
32
|
+
Follow the four-phase debugging process:
|
|
33
|
+
|
|
34
|
+
### Phase 1: Reproduce
|
|
35
|
+
- Understand the expected vs actual behavior
|
|
36
|
+
- Create minimal reproduction steps
|
|
37
|
+
- Identify consistent reproduction conditions
|
|
38
|
+
|
|
39
|
+
### Phase 2: Isolate
|
|
40
|
+
- Narrow down the problem area
|
|
41
|
+
- Use binary search to find the issue
|
|
42
|
+
- Check recent changes that might be related
|
|
43
|
+
|
|
44
|
+
### Phase 3: Identify Root Cause
|
|
45
|
+
- Examine the code path
|
|
46
|
+
- Check logs and error messages
|
|
47
|
+
- Verify assumptions about data/state
|
|
48
|
+
|
|
49
|
+
### Phase 4: Fix and Verify
|
|
50
|
+
- Implement the fix
|
|
51
|
+
- Write a test that would have caught this
|
|
52
|
+
- Verify the fix doesn't break other things
|
|
53
|
+
|
|
54
|
+
### Debugging Checklist
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
## Bug Report
|
|
58
|
+
|
|
59
|
+
**Expected**: [What should happen]
|
|
60
|
+
**Actual**: [What actually happens]
|
|
61
|
+
**Steps to Reproduce**:
|
|
62
|
+
1. ...
|
|
63
|
+
2. ...
|
|
64
|
+
|
|
65
|
+
## Investigation
|
|
66
|
+
|
|
67
|
+
**Hypothesis 1**: [Theory]
|
|
68
|
+
- Evidence for: ...
|
|
69
|
+
- Evidence against: ...
|
|
70
|
+
- Verdict: [Confirmed/Rejected]
|
|
71
|
+
|
|
72
|
+
## Root Cause
|
|
73
|
+
[Description of the actual cause]
|
|
74
|
+
|
|
75
|
+
## Fix
|
|
76
|
+
[Description of the solution]
|
|
77
|
+
|
|
78
|
+
## Verification
|
|
79
|
+
- [ ] Bug no longer reproduces
|
|
80
|
+
- [ ] Regression test added
|
|
81
|
+
- [ ] Related areas tested
|
|
82
|
+
```
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tdd-workflow
|
|
3
|
+
description: Test-driven development - write tests before production code
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
author: CCJK
|
|
6
|
+
category: testing
|
|
7
|
+
triggers:
|
|
8
|
+
- /tdd
|
|
9
|
+
- /test-first
|
|
10
|
+
use_when:
|
|
11
|
+
- "User mentions TDD"
|
|
12
|
+
- "Writing new function or feature"
|
|
13
|
+
- "User wants test-driven approach"
|
|
14
|
+
auto_activate: false
|
|
15
|
+
priority: 6
|
|
16
|
+
difficulty: intermediate
|
|
17
|
+
tags:
|
|
18
|
+
- tdd
|
|
19
|
+
- testing
|
|
20
|
+
- development
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# TDD Workflow
|
|
24
|
+
|
|
25
|
+
## Context
|
|
26
|
+
$ARGUMENTS
|
|
27
|
+
|
|
28
|
+
## Instructions
|
|
29
|
+
|
|
30
|
+
Follow strict Test-Driven Development:
|
|
31
|
+
|
|
32
|
+
### The TDD Cycle
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
┌─────────────────────────────────────┐
|
|
36
|
+
│ 1. RED: Write failing test │
|
|
37
|
+
│ ↓ │
|
|
38
|
+
│ 2. GREEN: Write minimal code │
|
|
39
|
+
│ ↓ │
|
|
40
|
+
│ 3. REFACTOR: Improve code │
|
|
41
|
+
│ ↓ │
|
|
42
|
+
│ (repeat) │
|
|
43
|
+
└─────────────────────────────────────┘
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Rules
|
|
47
|
+
|
|
48
|
+
1. **No production code without a failing test**
|
|
49
|
+
- Write the test first
|
|
50
|
+
- See it fail
|
|
51
|
+
- Then write the code
|
|
52
|
+
|
|
53
|
+
2. **Write minimal code to pass**
|
|
54
|
+
- Don't over-engineer
|
|
55
|
+
- Just make the test pass
|
|
56
|
+
- Refactor later
|
|
57
|
+
|
|
58
|
+
3. **Refactor with confidence**
|
|
59
|
+
- Tests are your safety net
|
|
60
|
+
- Improve design incrementally
|
|
61
|
+
- Keep tests passing
|
|
62
|
+
|
|
63
|
+
### TDD Session Format
|
|
64
|
+
|
|
65
|
+
```markdown
|
|
66
|
+
## TDD Session: [Feature]
|
|
67
|
+
|
|
68
|
+
### Cycle 1
|
|
69
|
+
**Test**: [Test description]
|
|
70
|
+
```typescript
|
|
71
|
+
test('should ...', () => {
|
|
72
|
+
// test code
|
|
73
|
+
})
|
|
74
|
+
```
|
|
75
|
+
**Status**: 🔴 RED
|
|
76
|
+
|
|
77
|
+
**Implementation**:
|
|
78
|
+
```typescript
|
|
79
|
+
// minimal code
|
|
80
|
+
```
|
|
81
|
+
**Status**: 🟢 GREEN
|
|
82
|
+
|
|
83
|
+
**Refactor**: [What was improved]
|
|
84
|
+
|
|
85
|
+
### Cycle 2
|
|
86
|
+
...
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Benefits
|
|
90
|
+
- Better design through testability
|
|
91
|
+
- Confidence in changes
|
|
92
|
+
- Living documentation
|
|
93
|
+
- Fewer bugs
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verification
|
|
3
|
+
description: Evidence-based completion verification before finishing
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
author: CCJK
|
|
6
|
+
category: review
|
|
7
|
+
triggers:
|
|
8
|
+
- /verify
|
|
9
|
+
- /check
|
|
10
|
+
- /done
|
|
11
|
+
use_when:
|
|
12
|
+
- "Before completing a task"
|
|
13
|
+
- "User asks to verify work"
|
|
14
|
+
- "Ready to mark as done"
|
|
15
|
+
- "Final review needed"
|
|
16
|
+
auto_activate: true
|
|
17
|
+
priority: 9
|
|
18
|
+
difficulty: beginner
|
|
19
|
+
tags:
|
|
20
|
+
- verification
|
|
21
|
+
- quality
|
|
22
|
+
- completion
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# Verification
|
|
26
|
+
|
|
27
|
+
## Context
|
|
28
|
+
$ARGUMENTS
|
|
29
|
+
|
|
30
|
+
## Instructions
|
|
31
|
+
|
|
32
|
+
Before marking any task as complete, verify with evidence:
|
|
33
|
+
|
|
34
|
+
### Verification Checklist
|
|
35
|
+
|
|
36
|
+
1. **Requirements Met**
|
|
37
|
+
- [ ] All acceptance criteria satisfied
|
|
38
|
+
- [ ] Edge cases handled
|
|
39
|
+
- [ ] Error cases handled
|
|
40
|
+
|
|
41
|
+
2. **Code Quality**
|
|
42
|
+
- [ ] Code follows project conventions
|
|
43
|
+
- [ ] No obvious bugs or issues
|
|
44
|
+
- [ ] Appropriate error handling
|
|
45
|
+
|
|
46
|
+
3. **Testing**
|
|
47
|
+
- [ ] Unit tests pass
|
|
48
|
+
- [ ] Integration tests pass
|
|
49
|
+
- [ ] Manual testing completed
|
|
50
|
+
|
|
51
|
+
4. **Documentation**
|
|
52
|
+
- [ ] Code comments where needed
|
|
53
|
+
- [ ] README updated if applicable
|
|
54
|
+
- [ ] API docs updated if applicable
|
|
55
|
+
|
|
56
|
+
### Evidence Format
|
|
57
|
+
|
|
58
|
+
```markdown
|
|
59
|
+
## Verification Report
|
|
60
|
+
|
|
61
|
+
### Task: [Description]
|
|
62
|
+
|
|
63
|
+
### Evidence of Completion
|
|
64
|
+
|
|
65
|
+
1. **Requirement 1**: ✅
|
|
66
|
+
- Evidence: [Screenshot/test output/code reference]
|
|
67
|
+
|
|
68
|
+
2. **Requirement 2**: ✅
|
|
69
|
+
- Evidence: [Screenshot/test output/code reference]
|
|
70
|
+
|
|
71
|
+
### Test Results
|
|
72
|
+
- Unit tests: ✅ All passing
|
|
73
|
+
- Integration: ✅ All passing
|
|
74
|
+
|
|
75
|
+
### Ready for Review: Yes/No
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Rules
|
|
79
|
+
- Never claim completion without evidence
|
|
80
|
+
- If something can't be verified, flag it
|
|
81
|
+
- Ask for clarification if requirements are unclear
|