cp-toolkit 2.2.2 → 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 +410 -64
  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,154 +1,156 @@
1
- ---
2
- name: i18n-localization
3
- description: Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.
4
- allowed-tools: Read, Glob, Grep
5
- ---
6
-
7
- # i18n & Localization
8
-
9
- > Internationalization (i18n) and Localization (L10n) best practices.
10
-
11
- ---
12
-
13
- ## 1. Core Concepts
14
-
15
- | Term | Meaning |
16
- |------|---------|
17
- | **i18n** | Internationalization - making app translatable |
18
- | **L10n** | Localization - actual translations |
19
- | **Locale** | Language + Region (en-US, tr-TR) |
20
- | **RTL** | Right-to-left languages (Arabic, Hebrew) |
21
-
22
- ---
23
-
24
- ## 2. When to Use i18n
25
-
26
- | Project Type | i18n Needed? |
27
- |--------------|--------------|
28
- | Public web app | Yes |
29
- | SaaS product | ✅ Yes |
30
- | Internal tool | ⚠️ Maybe |
31
- | Single-region app | ⚠️ Consider future |
32
- | Personal project | Optional |
33
-
34
- ---
35
-
36
- ## 3. Implementation Patterns
37
-
38
- ### React (react-i18next)
39
-
40
- ```tsx
41
- import { useTranslation } from 'react-i18next';
42
-
43
- function Welcome() {
44
- const { t } = useTranslation();
45
- return <h1>{t('welcome.title')}</h1>;
46
- }
47
- ```
48
-
49
- ### Next.js (next-intl)
50
-
51
- ```tsx
52
- import { useTranslations } from 'next-intl';
53
-
54
- export default function Page() {
55
- const t = useTranslations('Home');
56
- return <h1>{t('title')}</h1>;
57
- }
58
- ```
59
-
60
- ### Python (gettext)
61
-
62
- ```python
63
- from gettext import gettext as _
64
-
65
- print(_("Welcome to our app"))
66
- ```
67
-
68
- ---
69
-
70
- ## 4. File Structure
71
-
72
- ```
73
- locales/
74
- ├── en/
75
- │ ├── common.json
76
- ├── auth.json
77
- └── errors.json
78
- ├── tr/
79
- ├── common.json
80
- ├── auth.json
81
- └── errors.json
82
- └── ar/ # RTL
83
- └── ...
84
- ```
85
-
86
- ---
87
-
88
- ## 5. Best Practices
89
-
90
- ### DO
91
-
92
- - Use translation keys, not raw text
93
- - Namespace translations by feature
94
- - Support pluralization
95
- - Handle date/number formats per locale
96
- - Plan for RTL from the start
97
- - Use ICU message format for complex strings
98
-
99
- ### DON'T
100
-
101
- - Hardcode strings in components
102
- - Concatenate translated strings
103
- - Assume text length (German is 30% longer)
104
- - Forget about RTL layout
105
- - Mix languages in same file
106
-
107
- ---
108
-
109
- ## 6. Common Issues
110
-
111
- | Issue | Solution |
112
- |-------|----------|
113
- | Missing translation | Fallback to default language |
114
- | Hardcoded strings | Use linter/checker script |
115
- | Date format | Use Intl.DateTimeFormat |
116
- | Number format | Use Intl.NumberFormat |
117
- | Pluralization | Use ICU message format |
118
-
119
- ---
120
-
121
- ## 7. RTL Support
122
-
123
- ```css
124
- /* CSS Logical Properties */
125
- .container {
126
- margin-inline-start: 1rem; /* Not margin-left */
127
- padding-inline-end: 1rem; /* Not padding-right */
128
- }
129
-
130
- [dir="rtl"] .icon {
131
- transform: scaleX(-1);
132
- }
133
- ```
134
-
135
- ---
136
-
137
- ## 8. Checklist
138
-
139
- Before shipping:
140
-
141
- - [ ] All user-facing strings use translation keys
142
- - [ ] Locale files exist for all supported languages
143
- - [ ] Date/number formatting uses Intl API
144
- - [ ] RTL layout tested (if applicable)
145
- - [ ] Fallback language configured
146
- - [ ] No hardcoded strings in components
147
-
148
- ---
149
-
150
- ## Script
151
-
152
- | Script | Purpose | Command |
153
- |--------|---------|---------|
154
- | `scripts/i18n_checker.py` | Detect hardcoded strings & missing translations | `python scripts/i18n_checker.py <project_path>` |
1
+ ---
2
+ name: i18n-localization
3
+ description: Internationalization and localization patterns. Detecting hardcoded strings,
4
+ managing translations, locale files, RTL support.
5
+ allowed-tools: Read, Glob, Grep
6
+ version: '1.0'
7
+ ---
8
+
9
+ # i18n & Localization
10
+
11
+ > Internationalization (i18n) and Localization (L10n) best practices.
12
+
13
+ ---
14
+
15
+ ## 1. Core Concepts
16
+
17
+ | Term | Meaning |
18
+ |------|---------|
19
+ | **i18n** | Internationalization - making app translatable |
20
+ | **L10n** | Localization - actual translations |
21
+ | **Locale** | Language + Region (en-US, tr-TR) |
22
+ | **RTL** | Right-to-left languages (Arabic, Hebrew) |
23
+
24
+ ---
25
+
26
+ ## 2. When to Use i18n
27
+
28
+ | Project Type | i18n Needed? |
29
+ |--------------|--------------|
30
+ | Public web app | Yes |
31
+ | SaaS product | Yes |
32
+ | Internal tool | ⚠️ Maybe |
33
+ | Single-region app | ⚠️ Consider future |
34
+ | Personal project | ❌ Optional |
35
+
36
+ ---
37
+
38
+ ## 3. Implementation Patterns
39
+
40
+ ### React (react-i18next)
41
+
42
+ ```tsx
43
+ import { useTranslation } from 'react-i18next';
44
+
45
+ function Welcome() {
46
+ const { t } = useTranslation();
47
+ return <h1>{t('welcome.title')}</h1>;
48
+ }
49
+ ```
50
+
51
+ ### Next.js (next-intl)
52
+
53
+ ```tsx
54
+ import { useTranslations } from 'next-intl';
55
+
56
+ export default function Page() {
57
+ const t = useTranslations('Home');
58
+ return <h1>{t('title')}</h1>;
59
+ }
60
+ ```
61
+
62
+ ### Python (gettext)
63
+
64
+ ```python
65
+ from gettext import gettext as _
66
+
67
+ print(_("Welcome to our app"))
68
+ ```
69
+
70
+ ---
71
+
72
+ ## 4. File Structure
73
+
74
+ ```
75
+ locales/
76
+ ├── en/
77
+ ├── common.json
78
+ ├── auth.json
79
+ └── errors.json
80
+ ├── tr/
81
+ ├── common.json
82
+ │ ├── auth.json
83
+ └── errors.json
84
+ └── ar/ # RTL
85
+ └── ...
86
+ ```
87
+
88
+ ---
89
+
90
+ ## 5. Best Practices
91
+
92
+ ### DO
93
+
94
+ - Use translation keys, not raw text
95
+ - Namespace translations by feature
96
+ - Support pluralization
97
+ - Handle date/number formats per locale
98
+ - Plan for RTL from the start
99
+ - Use ICU message format for complex strings
100
+
101
+ ### DON'T
102
+
103
+ - Hardcode strings in components
104
+ - Concatenate translated strings
105
+ - Assume text length (German is 30% longer)
106
+ - Forget about RTL layout
107
+ - Mix languages in same file
108
+
109
+ ---
110
+
111
+ ## 6. Common Issues
112
+
113
+ | Issue | Solution |
114
+ |-------|----------|
115
+ | Missing translation | Fallback to default language |
116
+ | Hardcoded strings | Use linter/checker script |
117
+ | Date format | Use Intl.DateTimeFormat |
118
+ | Number format | Use Intl.NumberFormat |
119
+ | Pluralization | Use ICU message format |
120
+
121
+ ---
122
+
123
+ ## 7. RTL Support
124
+
125
+ ```css
126
+ /* CSS Logical Properties */
127
+ .container {
128
+ margin-inline-start: 1rem; /* Not margin-left */
129
+ padding-inline-end: 1rem; /* Not padding-right */
130
+ }
131
+
132
+ [dir="rtl"] .icon {
133
+ transform: scaleX(-1);
134
+ }
135
+ ```
136
+
137
+ ---
138
+
139
+ ## 8. Checklist
140
+
141
+ Before shipping:
142
+
143
+ - [ ] All user-facing strings use translation keys
144
+ - [ ] Locale files exist for all supported languages
145
+ - [ ] Date/number formatting uses Intl API
146
+ - [ ] RTL layout tested (if applicable)
147
+ - [ ] Fallback language configured
148
+ - [ ] No hardcoded strings in components
149
+
150
+ ---
151
+
152
+ ## Script
153
+
154
+ | Script | Purpose | Command |
155
+ |--------|---------|---------|
156
+ | `scripts/i18n_checker.py` | Detect hardcoded strings & missing translations | `python scripts/i18n_checker.py <project_path>` |
@@ -1,45 +1,48 @@
1
- ---
2
- name: lint-and-validate
3
- description: Automatic quality control, linting, and static analysis procedures. Use after every code modification to ensure syntax correctness and project standards. Triggers onKeywords: lint, format, check, validate, types, static analysis.
4
- allowed-tools: Read, Glob, Grep, Bash
5
- ---
6
-
7
- # Lint and Validate Skill
8
-
9
- > **MANDATORY:** Run appropriate validation tools after EVERY code change. Do not finish a task until the code is error-free.
10
-
11
- ### Procedures by Ecosystem
12
-
13
- #### Node.js / TypeScript
14
- 1. **Lint/Fix:** `npm run lint` or `npx eslint "path" --fix`
15
- 2. **Types:** `npx tsc --noEmit`
16
- 3. **Security:** `npm audit --audit-level=high`
17
-
18
- #### Python
19
- 1. **Linter (Ruff):** `ruff check "path" --fix` (Fast & Modern)
20
- 2. **Security (Bandit):** `bandit -r "path" -ll`
21
- 3. **Types (MyPy):** `mypy "path"`
22
-
23
- ## The Quality Loop
24
- 1. **Write/Edit Code**
25
- 2. **Run Audit:** `npm run lint && npx tsc --noEmit`
26
- 3. **Analyze Report:** Check the "FINAL AUDIT REPORT" section.
27
- 4. **Fix & Repeat:** Submitting code with "FINAL AUDIT" failures is NOT allowed.
28
-
29
- ## Error Handling
30
- - If `lint` fails: Fix the style or syntax issues immediately.
31
- - If `tsc` fails: Correct type mismatches before proceeding.
32
- - If no tool is configured: Check the project root for `.eslintrc`, `tsconfig.json`, `pyproject.toml` and suggest creating one.
33
-
34
- ---
35
- **Strict Rule:** No code should be committed or reported as "done" without passing these checks.
36
-
37
- ---
38
-
39
- ## Scripts
40
-
41
- | Script | Purpose | Command |
42
- |--------|---------|---------|
43
- | `scripts/lint_runner.py` | Unified lint check | `python scripts/lint_runner.py <project_path>` |
44
- | `scripts/type_coverage.py` | Type coverage analysis | `python scripts/type_coverage.py <project_path>` |
45
-
1
+ ---
2
+ name: lint-and-validate
3
+ description: 'Automatic quality control, linting, and static analysis procedures.
4
+ Use after every code modification to ensure syntax correctness and project standards.
5
+ Triggers onKeywords: lint, format, check, validate, types, static analysis.'
6
+ allowed-tools: Read, Glob, Grep, Bash
7
+ version: '1.0'
8
+ ---
9
+
10
+ # Lint and Validate Skill
11
+
12
+ > **MANDATORY:** Run appropriate validation tools after EVERY code change. Do not finish a task until the code is error-free.
13
+
14
+ ### Procedures by Ecosystem
15
+
16
+ #### Node.js / TypeScript
17
+ 1. **Lint/Fix:** `npm run lint` or `npx eslint "path" --fix`
18
+ 2. **Types:** `npx tsc --noEmit`
19
+ 3. **Security:** `npm audit --audit-level=high`
20
+
21
+ #### Python
22
+ 1. **Linter (Ruff):** `ruff check "path" --fix` (Fast & Modern)
23
+ 2. **Security (Bandit):** `bandit -r "path" -ll`
24
+ 3. **Types (MyPy):** `mypy "path"`
25
+
26
+ ## The Quality Loop
27
+ 1. **Write/Edit Code**
28
+ 2. **Run Audit:** `npm run lint && npx tsc --noEmit`
29
+ 3. **Analyze Report:** Check the "FINAL AUDIT REPORT" section.
30
+ 4. **Fix & Repeat:** Submitting code with "FINAL AUDIT" failures is NOT allowed.
31
+
32
+ ## Error Handling
33
+ - If `lint` fails: Fix the style or syntax issues immediately.
34
+ - If `tsc` fails: Correct type mismatches before proceeding.
35
+ - If no tool is configured: Check the project root for `.eslintrc`, `tsconfig.json`, `pyproject.toml` and suggest creating one.
36
+
37
+ ---
38
+ **Strict Rule:** No code should be committed or reported as "done" without passing these checks.
39
+
40
+ ---
41
+
42
+ ## Scripts
43
+
44
+ | Script | Purpose | Command |
45
+ |--------|---------|---------|
46
+ | `scripts/lint_runner.py` | Unified lint check | `python scripts/lint_runner.py <project_path>` |
47
+ | `scripts/type_coverage.py` | Type coverage analysis | `python scripts/type_coverage.py <project_path>` |
48
+