cp-toolkit 2.2.3 → 2.2.4

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 (71) hide show
  1. package/package.json +1 -1
  2. package/src/commands/add.js +23 -16
  3. package/src/commands/doctor.js +15 -10
  4. package/src/commands/init.js +55 -16
  5. package/templates/AGENTS.md +47 -0
  6. package/templates/ARCHITECTURE.md +42 -0
  7. package/templates/agents/backend-specialist.md +1 -0
  8. package/templates/agents/code-archaeologist.md +116 -106
  9. package/templates/agents/database-architect.md +1 -0
  10. package/templates/agents/debugger.md +1 -0
  11. package/templates/agents/devops-engineer.md +1 -0
  12. package/templates/agents/documentation-writer.md +1 -0
  13. package/templates/agents/explorer-agent.md +83 -73
  14. package/templates/agents/frontend-specialist.md +1 -0
  15. package/templates/agents/game-developer.md +1 -0
  16. package/templates/agents/mobile-developer.md +1 -0
  17. package/templates/agents/orchestrator.md +426 -416
  18. package/templates/agents/penetration-tester.md +1 -0
  19. package/templates/agents/performance-optimizer.md +1 -0
  20. package/templates/agents/product-manager.md +122 -112
  21. package/templates/agents/product-owner.md +105 -95
  22. package/templates/agents/project-planner.md +416 -406
  23. package/templates/agents/qa-automation-engineer.md +113 -103
  24. package/templates/agents/security-auditor.md +1 -0
  25. package/templates/agents/seo-specialist.md +1 -0
  26. package/templates/agents/test-engineer.md +1 -0
  27. package/templates/skills/core/behavioral-modes/SKILL.md +244 -242
  28. package/templates/skills/core/brainstorming/SKILL.md +166 -163
  29. package/templates/skills/core/mcp-builder/SKILL.md +178 -176
  30. package/templates/skills/core/parallel-agents/SKILL.md +187 -175
  31. package/templates/skills/core/plan-writing/SKILL.md +154 -152
  32. package/templates/skills/optional/api-patterns/SKILL.md +83 -81
  33. package/templates/skills/optional/app-builder/SKILL.md +78 -75
  34. package/templates/skills/optional/app-builder/templates/SKILL.md +41 -39
  35. package/templates/skills/optional/architecture/SKILL.md +58 -55
  36. package/templates/skills/optional/bash-linux/SKILL.md +201 -199
  37. package/templates/skills/optional/code-review-checklist/SKILL.md +110 -109
  38. package/templates/skills/optional/database-design/SKILL.md +54 -52
  39. package/templates/skills/optional/deployment-procedures/SKILL.md +243 -241
  40. package/templates/skills/optional/documentation-templates/SKILL.md +196 -194
  41. package/templates/skills/optional/frontend-design/SKILL.md +421 -418
  42. package/templates/skills/optional/game-development/2d-games/SKILL.md +120 -119
  43. package/templates/skills/optional/game-development/3d-games/SKILL.md +136 -135
  44. package/templates/skills/optional/game-development/SKILL.md +169 -167
  45. package/templates/skills/optional/game-development/game-art/SKILL.md +187 -185
  46. package/templates/skills/optional/game-development/game-audio/SKILL.md +192 -190
  47. package/templates/skills/optional/game-development/game-design/SKILL.md +131 -129
  48. package/templates/skills/optional/game-development/mobile-games/SKILL.md +110 -108
  49. package/templates/skills/optional/game-development/multiplayer/SKILL.md +133 -132
  50. package/templates/skills/optional/game-development/pc-games/SKILL.md +146 -144
  51. package/templates/skills/optional/game-development/vr-ar/SKILL.md +124 -123
  52. package/templates/skills/optional/game-development/web-games/SKILL.md +152 -150
  53. package/templates/skills/optional/geo-fundamentals/SKILL.md +158 -156
  54. package/templates/skills/optional/i18n-localization/SKILL.md +156 -154
  55. package/templates/skills/optional/lint-and-validate/SKILL.md +48 -45
  56. package/templates/skills/optional/mobile-design/SKILL.md +397 -394
  57. package/templates/skills/optional/nextjs-react-expert/SKILL.md +271 -267
  58. package/templates/skills/optional/nodejs-best-practices/SKILL.md +335 -333
  59. package/templates/skills/optional/performance-profiling/SKILL.md +145 -143
  60. package/templates/skills/optional/powershell-windows/SKILL.md +169 -167
  61. package/templates/skills/optional/python-patterns/SKILL.md +443 -441
  62. package/templates/skills/optional/red-team-tactics/SKILL.md +201 -199
  63. package/templates/skills/optional/seo-fundamentals/SKILL.md +130 -129
  64. package/templates/skills/optional/server-management/SKILL.md +163 -161
  65. package/templates/skills/optional/systematic-debugging/SKILL.md +111 -109
  66. package/templates/skills/optional/tailwind-patterns/SKILL.md +271 -269
  67. package/templates/skills/optional/tdd-workflow/SKILL.md +150 -149
  68. package/templates/skills/optional/testing-patterns/SKILL.md +179 -178
  69. package/templates/skills/optional/vulnerability-scanner/SKILL.md +278 -276
  70. package/templates/skills/optional/web-design-guidelines/SKILL.md +60 -57
  71. package/templates/skills/optional/webapp-testing/SKILL.md +188 -187
@@ -1,161 +1,163 @@
1
- ---
2
- name: server-management
3
- description: Server management principles and decision-making. Process management, monitoring strategy, and scaling decisions. Teaches thinking, not commands.
4
- allowed-tools: Read, Write, Edit, Glob, Grep, Bash
5
- ---
6
-
7
- # Server Management
8
-
9
- > Server management principles for production operations.
10
- > **Learn to THINK, not memorize commands.**
11
-
12
- ---
13
-
14
- ## 1. Process Management Principles
15
-
16
- ### Tool Selection
17
-
18
- | Scenario | Tool |
19
- |----------|------|
20
- | **Node.js app** | PM2 (clustering, reload) |
21
- | **Any app** | systemd (Linux native) |
22
- | **Containers** | Docker/Podman |
23
- | **Orchestration** | Kubernetes, Docker Swarm |
24
-
25
- ### Process Management Goals
26
-
27
- | Goal | What It Means |
28
- |------|---------------|
29
- | **Restart on crash** | Auto-recovery |
30
- | **Zero-downtime reload** | No service interruption |
31
- | **Clustering** | Use all CPU cores |
32
- | **Persistence** | Survive server reboot |
33
-
34
- ---
35
-
36
- ## 2. Monitoring Principles
37
-
38
- ### What to Monitor
39
-
40
- | Category | Key Metrics |
41
- |----------|-------------|
42
- | **Availability** | Uptime, health checks |
43
- | **Performance** | Response time, throughput |
44
- | **Errors** | Error rate, types |
45
- | **Resources** | CPU, memory, disk |
46
-
47
- ### Alert Severity Strategy
48
-
49
- | Level | Response |
50
- |-------|----------|
51
- | **Critical** | Immediate action |
52
- | **Warning** | Investigate soon |
53
- | **Info** | Review daily |
54
-
55
- ### Monitoring Tool Selection
56
-
57
- | Need | Options |
58
- |------|---------|
59
- | Simple/Free | PM2 metrics, htop |
60
- | Full observability | Grafana, Datadog |
61
- | Error tracking | Sentry |
62
- | Uptime | UptimeRobot, Pingdom |
63
-
64
- ---
65
-
66
- ## 3. Log Management Principles
67
-
68
- ### Log Strategy
69
-
70
- | Log Type | Purpose |
71
- |----------|---------|
72
- | **Application logs** | Debug, audit |
73
- | **Access logs** | Traffic analysis |
74
- | **Error logs** | Issue detection |
75
-
76
- ### Log Principles
77
-
78
- 1. **Rotate logs** to prevent disk fill
79
- 2. **Structured logging** (JSON) for parsing
80
- 3. **Appropriate levels** (error/warn/info/debug)
81
- 4. **No sensitive data** in logs
82
-
83
- ---
84
-
85
- ## 4. Scaling Decisions
86
-
87
- ### When to Scale
88
-
89
- | Symptom | Solution |
90
- |---------|----------|
91
- | High CPU | Add instances (horizontal) |
92
- | High memory | Increase RAM or fix leak |
93
- | Slow response | Profile first, then scale |
94
- | Traffic spikes | Auto-scaling |
95
-
96
- ### Scaling Strategy
97
-
98
- | Type | When to Use |
99
- |------|-------------|
100
- | **Vertical** | Quick fix, single instance |
101
- | **Horizontal** | Sustainable, distributed |
102
- | **Auto** | Variable traffic |
103
-
104
- ---
105
-
106
- ## 5. Health Check Principles
107
-
108
- ### What Constitutes Healthy
109
-
110
- | Check | Meaning |
111
- |-------|---------|
112
- | **HTTP 200** | Service responding |
113
- | **Database connected** | Data accessible |
114
- | **Dependencies OK** | External services reachable |
115
- | **Resources OK** | CPU/memory not exhausted |
116
-
117
- ### Health Check Implementation
118
-
119
- - Simple: Just return 200
120
- - Deep: Check all dependencies
121
- - Choose based on load balancer needs
122
-
123
- ---
124
-
125
- ## 6. Security Principles
126
-
127
- | Area | Principle |
128
- |------|-----------|
129
- | **Access** | SSH keys only, no passwords |
130
- | **Firewall** | Only needed ports open |
131
- | **Updates** | Regular security patches |
132
- | **Secrets** | Environment vars, not files |
133
- | **Audit** | Log access and changes |
134
-
135
- ---
136
-
137
- ## 7. Troubleshooting Priority
138
-
139
- When something's wrong:
140
-
141
- 1. **Check if running** (process status)
142
- 2. **Check logs** (error messages)
143
- 3. **Check resources** (disk, memory, CPU)
144
- 4. **Check network** (ports, DNS)
145
- 5. **Check dependencies** (database, APIs)
146
-
147
- ---
148
-
149
- ## 8. Anti-Patterns
150
-
151
- | Don't | ✅ Do |
152
- |----------|-------|
153
- | Run as root | Use non-root user |
154
- | Ignore logs | Set up log rotation |
155
- | Skip monitoring | Monitor from day one |
156
- | Manual restarts | Auto-restart config |
157
- | No backups | Regular backup schedule |
158
-
159
- ---
160
-
161
- > **Remember:** A well-managed server is boring. That's the goal.
1
+ ---
2
+ name: server-management
3
+ description: Server management principles and decision-making. Process management,
4
+ monitoring strategy, and scaling decisions. Teaches thinking, not commands.
5
+ allowed-tools: Read, Write, Edit, Glob, Grep, Bash
6
+ version: '1.0'
7
+ ---
8
+
9
+ # Server Management
10
+
11
+ > Server management principles for production operations.
12
+ > **Learn to THINK, not memorize commands.**
13
+
14
+ ---
15
+
16
+ ## 1. Process Management Principles
17
+
18
+ ### Tool Selection
19
+
20
+ | Scenario | Tool |
21
+ |----------|------|
22
+ | **Node.js app** | PM2 (clustering, reload) |
23
+ | **Any app** | systemd (Linux native) |
24
+ | **Containers** | Docker/Podman |
25
+ | **Orchestration** | Kubernetes, Docker Swarm |
26
+
27
+ ### Process Management Goals
28
+
29
+ | Goal | What It Means |
30
+ |------|---------------|
31
+ | **Restart on crash** | Auto-recovery |
32
+ | **Zero-downtime reload** | No service interruption |
33
+ | **Clustering** | Use all CPU cores |
34
+ | **Persistence** | Survive server reboot |
35
+
36
+ ---
37
+
38
+ ## 2. Monitoring Principles
39
+
40
+ ### What to Monitor
41
+
42
+ | Category | Key Metrics |
43
+ |----------|-------------|
44
+ | **Availability** | Uptime, health checks |
45
+ | **Performance** | Response time, throughput |
46
+ | **Errors** | Error rate, types |
47
+ | **Resources** | CPU, memory, disk |
48
+
49
+ ### Alert Severity Strategy
50
+
51
+ | Level | Response |
52
+ |-------|----------|
53
+ | **Critical** | Immediate action |
54
+ | **Warning** | Investigate soon |
55
+ | **Info** | Review daily |
56
+
57
+ ### Monitoring Tool Selection
58
+
59
+ | Need | Options |
60
+ |------|---------|
61
+ | Simple/Free | PM2 metrics, htop |
62
+ | Full observability | Grafana, Datadog |
63
+ | Error tracking | Sentry |
64
+ | Uptime | UptimeRobot, Pingdom |
65
+
66
+ ---
67
+
68
+ ## 3. Log Management Principles
69
+
70
+ ### Log Strategy
71
+
72
+ | Log Type | Purpose |
73
+ |----------|---------|
74
+ | **Application logs** | Debug, audit |
75
+ | **Access logs** | Traffic analysis |
76
+ | **Error logs** | Issue detection |
77
+
78
+ ### Log Principles
79
+
80
+ 1. **Rotate logs** to prevent disk fill
81
+ 2. **Structured logging** (JSON) for parsing
82
+ 3. **Appropriate levels** (error/warn/info/debug)
83
+ 4. **No sensitive data** in logs
84
+
85
+ ---
86
+
87
+ ## 4. Scaling Decisions
88
+
89
+ ### When to Scale
90
+
91
+ | Symptom | Solution |
92
+ |---------|----------|
93
+ | High CPU | Add instances (horizontal) |
94
+ | High memory | Increase RAM or fix leak |
95
+ | Slow response | Profile first, then scale |
96
+ | Traffic spikes | Auto-scaling |
97
+
98
+ ### Scaling Strategy
99
+
100
+ | Type | When to Use |
101
+ |------|-------------|
102
+ | **Vertical** | Quick fix, single instance |
103
+ | **Horizontal** | Sustainable, distributed |
104
+ | **Auto** | Variable traffic |
105
+
106
+ ---
107
+
108
+ ## 5. Health Check Principles
109
+
110
+ ### What Constitutes Healthy
111
+
112
+ | Check | Meaning |
113
+ |-------|---------|
114
+ | **HTTP 200** | Service responding |
115
+ | **Database connected** | Data accessible |
116
+ | **Dependencies OK** | External services reachable |
117
+ | **Resources OK** | CPU/memory not exhausted |
118
+
119
+ ### Health Check Implementation
120
+
121
+ - Simple: Just return 200
122
+ - Deep: Check all dependencies
123
+ - Choose based on load balancer needs
124
+
125
+ ---
126
+
127
+ ## 6. Security Principles
128
+
129
+ | Area | Principle |
130
+ |------|-----------|
131
+ | **Access** | SSH keys only, no passwords |
132
+ | **Firewall** | Only needed ports open |
133
+ | **Updates** | Regular security patches |
134
+ | **Secrets** | Environment vars, not files |
135
+ | **Audit** | Log access and changes |
136
+
137
+ ---
138
+
139
+ ## 7. Troubleshooting Priority
140
+
141
+ When something's wrong:
142
+
143
+ 1. **Check if running** (process status)
144
+ 2. **Check logs** (error messages)
145
+ 3. **Check resources** (disk, memory, CPU)
146
+ 4. **Check network** (ports, DNS)
147
+ 5. **Check dependencies** (database, APIs)
148
+
149
+ ---
150
+
151
+ ## 8. Anti-Patterns
152
+
153
+ | Don't | Do |
154
+ |----------|-------|
155
+ | Run as root | Use non-root user |
156
+ | Ignore logs | Set up log rotation |
157
+ | Skip monitoring | Monitor from day one |
158
+ | Manual restarts | Auto-restart config |
159
+ | No backups | Regular backup schedule |
160
+
161
+ ---
162
+
163
+ > **Remember:** A well-managed server is boring. That's the goal.
@@ -1,109 +1,111 @@
1
- ---
2
- name: systematic-debugging
3
- description: 4-phase systematic debugging methodology with root cause analysis and evidence-based verification. Use when debugging complex issues.
4
- allowed-tools: Read, Glob, Grep
5
- ---
6
-
7
- # Systematic Debugging
8
-
9
- > Source: obra/superpowers
10
-
11
- ## Overview
12
- This skill provides a structured approach to debugging that prevents random guessing and ensures problems are properly understood before solving.
13
-
14
- ## 4-Phase Debugging Process
15
-
16
- ### Phase 1: Reproduce
17
- Before fixing, reliably reproduce the issue.
18
-
19
- ```markdown
20
- ## Reproduction Steps
21
- 1. [Exact step to reproduce]
22
- 2. [Next step]
23
- 3. [Expected vs actual result]
24
-
25
- ## Reproduction Rate
26
- - [ ] Always (100%)
27
- - [ ] Often (50-90%)
28
- - [ ] Sometimes (10-50%)
29
- - [ ] Rare (<10%)
30
- ```
31
-
32
- ### Phase 2: Isolate
33
- Narrow down the source.
34
-
35
- ```markdown
36
- ## Isolation Questions
37
- - When did this start happening?
38
- - What changed recently?
39
- - Does it happen in all environments?
40
- - Can we reproduce with minimal code?
41
- - What's the smallest change that triggers it?
42
- ```
43
-
44
- ### Phase 3: Understand
45
- Find the root cause, not just symptoms.
46
-
47
- ```markdown
48
- ## Root Cause Analysis
49
- ### The 5 Whys
50
- 1. Why: [First observation]
51
- 2. Why: [Deeper reason]
52
- 3. Why: [Still deeper]
53
- 4. Why: [Getting closer]
54
- 5. Why: [Root cause]
55
- ```
56
-
57
- ### Phase 4: Fix & Verify
58
- Fix and verify it's truly fixed.
59
-
60
- ```markdown
61
- ## Fix Verification
62
- - [ ] Bug no longer reproduces
63
- - [ ] Related functionality still works
64
- - [ ] No new issues introduced
65
- - [ ] Test added to prevent regression
66
- ```
67
-
68
- ## Debugging Checklist
69
-
70
- ```markdown
71
- ## Before Starting
72
- - [ ] Can reproduce consistently
73
- - [ ] Have minimal reproduction case
74
- - [ ] Understand expected behavior
75
-
76
- ## During Investigation
77
- - [ ] Check recent changes (git log)
78
- - [ ] Check logs for errors
79
- - [ ] Add logging if needed
80
- - [ ] Use debugger/breakpoints
81
-
82
- ## After Fix
83
- - [ ] Root cause documented
84
- - [ ] Fix verified
85
- - [ ] Regression test added
86
- - [ ] Similar code checked
87
- ```
88
-
89
- ## Common Debugging Commands
90
-
91
- ```bash
92
- # Recent changes
93
- git log --oneline -20
94
- git diff HEAD~5
95
-
96
- # Search for pattern
97
- grep -r "errorPattern" --include="*.ts"
98
-
99
- # Check logs
100
- pm2 logs app-name --err --lines 100
101
- ```
102
-
103
- ## Anti-Patterns
104
-
105
- **Random changes** - "Maybe if I change this..."
106
- ❌ **Ignoring evidence** - "That can't be the cause"
107
- ❌ **Assuming** - "It must be X" without proof
108
- ❌ **Not reproducing first** - Fixing blindly
109
- ❌ **Stopping at symptoms** - Not finding root cause
1
+ ---
2
+ name: systematic-debugging
3
+ description: 4-phase systematic debugging methodology with root cause analysis and
4
+ evidence-based verification. Use when debugging complex issues.
5
+ allowed-tools: Read, Glob, Grep
6
+ version: '1.0'
7
+ ---
8
+
9
+ # Systematic Debugging
10
+
11
+ > Source: obra/superpowers
12
+
13
+ ## Overview
14
+ This skill provides a structured approach to debugging that prevents random guessing and ensures problems are properly understood before solving.
15
+
16
+ ## 4-Phase Debugging Process
17
+
18
+ ### Phase 1: Reproduce
19
+ Before fixing, reliably reproduce the issue.
20
+
21
+ ```markdown
22
+ ## Reproduction Steps
23
+ 1. [Exact step to reproduce]
24
+ 2. [Next step]
25
+ 3. [Expected vs actual result]
26
+
27
+ ## Reproduction Rate
28
+ - [ ] Always (100%)
29
+ - [ ] Often (50-90%)
30
+ - [ ] Sometimes (10-50%)
31
+ - [ ] Rare (<10%)
32
+ ```
33
+
34
+ ### Phase 2: Isolate
35
+ Narrow down the source.
36
+
37
+ ```markdown
38
+ ## Isolation Questions
39
+ - When did this start happening?
40
+ - What changed recently?
41
+ - Does it happen in all environments?
42
+ - Can we reproduce with minimal code?
43
+ - What's the smallest change that triggers it?
44
+ ```
45
+
46
+ ### Phase 3: Understand
47
+ Find the root cause, not just symptoms.
48
+
49
+ ```markdown
50
+ ## Root Cause Analysis
51
+ ### The 5 Whys
52
+ 1. Why: [First observation]
53
+ 2. Why: [Deeper reason]
54
+ 3. Why: [Still deeper]
55
+ 4. Why: [Getting closer]
56
+ 5. Why: [Root cause]
57
+ ```
58
+
59
+ ### Phase 4: Fix & Verify
60
+ Fix and verify it's truly fixed.
61
+
62
+ ```markdown
63
+ ## Fix Verification
64
+ - [ ] Bug no longer reproduces
65
+ - [ ] Related functionality still works
66
+ - [ ] No new issues introduced
67
+ - [ ] Test added to prevent regression
68
+ ```
69
+
70
+ ## Debugging Checklist
71
+
72
+ ```markdown
73
+ ## Before Starting
74
+ - [ ] Can reproduce consistently
75
+ - [ ] Have minimal reproduction case
76
+ - [ ] Understand expected behavior
77
+
78
+ ## During Investigation
79
+ - [ ] Check recent changes (git log)
80
+ - [ ] Check logs for errors
81
+ - [ ] Add logging if needed
82
+ - [ ] Use debugger/breakpoints
83
+
84
+ ## After Fix
85
+ - [ ] Root cause documented
86
+ - [ ] Fix verified
87
+ - [ ] Regression test added
88
+ - [ ] Similar code checked
89
+ ```
90
+
91
+ ## Common Debugging Commands
92
+
93
+ ```bash
94
+ # Recent changes
95
+ git log --oneline -20
96
+ git diff HEAD~5
97
+
98
+ # Search for pattern
99
+ grep -r "errorPattern" --include="*.ts"
100
+
101
+ # Check logs
102
+ pm2 logs app-name --err --lines 100
103
+ ```
104
+
105
+ ## Anti-Patterns
106
+
107
+ ❌ **Random changes** - "Maybe if I change this..."
108
+ ❌ **Ignoring evidence** - "That can't be the cause"
109
+ ❌ **Assuming** - "It must be X" without proof
110
+ ❌ **Not reproducing first** - Fixing blindly
111
+ ❌ **Stopping at symptoms** - Not finding root cause