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.
- package/package.json +1 -1
- package/src/commands/add.js +23 -16
- package/src/commands/doctor.js +15 -10
- package/src/commands/init.js +410 -64
- package/templates/AGENTS.md +47 -0
- package/templates/ARCHITECTURE.md +42 -0
- package/templates/agents/backend-specialist.md +1 -0
- package/templates/agents/code-archaeologist.md +116 -106
- package/templates/agents/database-architect.md +1 -0
- package/templates/agents/debugger.md +1 -0
- package/templates/agents/devops-engineer.md +1 -0
- package/templates/agents/documentation-writer.md +1 -0
- package/templates/agents/explorer-agent.md +83 -73
- package/templates/agents/frontend-specialist.md +1 -0
- package/templates/agents/game-developer.md +1 -0
- package/templates/agents/mobile-developer.md +1 -0
- package/templates/agents/orchestrator.md +426 -416
- package/templates/agents/penetration-tester.md +1 -0
- package/templates/agents/performance-optimizer.md +1 -0
- package/templates/agents/product-manager.md +122 -112
- package/templates/agents/product-owner.md +105 -95
- package/templates/agents/project-planner.md +416 -406
- package/templates/agents/qa-automation-engineer.md +113 -103
- package/templates/agents/security-auditor.md +1 -0
- package/templates/agents/seo-specialist.md +1 -0
- package/templates/agents/test-engineer.md +1 -0
- package/templates/skills/core/behavioral-modes/SKILL.md +244 -242
- package/templates/skills/core/brainstorming/SKILL.md +166 -163
- package/templates/skills/core/mcp-builder/SKILL.md +178 -176
- package/templates/skills/core/parallel-agents/SKILL.md +187 -175
- package/templates/skills/core/plan-writing/SKILL.md +154 -152
- package/templates/skills/optional/api-patterns/SKILL.md +83 -81
- package/templates/skills/optional/app-builder/SKILL.md +78 -75
- package/templates/skills/optional/app-builder/templates/SKILL.md +41 -39
- package/templates/skills/optional/architecture/SKILL.md +58 -55
- package/templates/skills/optional/bash-linux/SKILL.md +201 -199
- package/templates/skills/optional/code-review-checklist/SKILL.md +110 -109
- package/templates/skills/optional/database-design/SKILL.md +54 -52
- package/templates/skills/optional/deployment-procedures/SKILL.md +243 -241
- package/templates/skills/optional/documentation-templates/SKILL.md +196 -194
- package/templates/skills/optional/frontend-design/SKILL.md +421 -418
- package/templates/skills/optional/game-development/2d-games/SKILL.md +120 -119
- package/templates/skills/optional/game-development/3d-games/SKILL.md +136 -135
- package/templates/skills/optional/game-development/SKILL.md +169 -167
- package/templates/skills/optional/game-development/game-art/SKILL.md +187 -185
- package/templates/skills/optional/game-development/game-audio/SKILL.md +192 -190
- package/templates/skills/optional/game-development/game-design/SKILL.md +131 -129
- package/templates/skills/optional/game-development/mobile-games/SKILL.md +110 -108
- package/templates/skills/optional/game-development/multiplayer/SKILL.md +133 -132
- package/templates/skills/optional/game-development/pc-games/SKILL.md +146 -144
- package/templates/skills/optional/game-development/vr-ar/SKILL.md +124 -123
- package/templates/skills/optional/game-development/web-games/SKILL.md +152 -150
- package/templates/skills/optional/geo-fundamentals/SKILL.md +158 -156
- package/templates/skills/optional/i18n-localization/SKILL.md +156 -154
- package/templates/skills/optional/lint-and-validate/SKILL.md +48 -45
- package/templates/skills/optional/mobile-design/SKILL.md +397 -394
- package/templates/skills/optional/nextjs-react-expert/SKILL.md +271 -267
- package/templates/skills/optional/nodejs-best-practices/SKILL.md +335 -333
- package/templates/skills/optional/performance-profiling/SKILL.md +145 -143
- package/templates/skills/optional/powershell-windows/SKILL.md +169 -167
- package/templates/skills/optional/python-patterns/SKILL.md +443 -441
- package/templates/skills/optional/red-team-tactics/SKILL.md +201 -199
- package/templates/skills/optional/seo-fundamentals/SKILL.md +130 -129
- package/templates/skills/optional/server-management/SKILL.md +163 -161
- package/templates/skills/optional/systematic-debugging/SKILL.md +111 -109
- package/templates/skills/optional/tailwind-patterns/SKILL.md +271 -269
- package/templates/skills/optional/tdd-workflow/SKILL.md +150 -149
- package/templates/skills/optional/testing-patterns/SKILL.md +179 -178
- package/templates/skills/optional/vulnerability-scanner/SKILL.md +278 -276
- package/templates/skills/optional/web-design-guidelines/SKILL.md +60 -57
- 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,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
|
18
|
-
|
|
19
|
-
| **
|
|
20
|
-
| **
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
|
29
|
-
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
│
|
|
78
|
-
├──
|
|
79
|
-
│
|
|
80
|
-
|
|
81
|
-
│
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
|
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.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
|
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
|
+
|