tribunal-kit 1.0.0 → 2.4.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/.agent/.shared/ui-ux-pro-max/README.md +3 -3
- package/.agent/ARCHITECTURE.md +205 -10
- package/.agent/GEMINI.md +37 -7
- package/.agent/agents/accessibility-reviewer.md +134 -0
- package/.agent/agents/ai-code-reviewer.md +129 -0
- package/.agent/agents/frontend-specialist.md +3 -0
- package/.agent/agents/game-developer.md +21 -21
- package/.agent/agents/logic-reviewer.md +12 -0
- package/.agent/agents/mobile-reviewer.md +79 -0
- package/.agent/agents/orchestrator.md +56 -26
- package/.agent/agents/performance-reviewer.md +36 -0
- package/.agent/agents/supervisor-agent.md +156 -0
- package/.agent/agents/swarm-worker-contracts.md +166 -0
- package/.agent/agents/swarm-worker-registry.md +92 -0
- package/.agent/rules/GEMINI.md +134 -5
- package/.agent/scripts/bundle_analyzer.py +259 -0
- package/.agent/scripts/dependency_analyzer.py +247 -0
- package/.agent/scripts/lint_runner.py +188 -0
- package/.agent/scripts/patch_skills_meta.py +177 -0
- package/.agent/scripts/patch_skills_output.py +285 -0
- package/.agent/scripts/schema_validator.py +279 -0
- package/.agent/scripts/security_scan.py +224 -0
- package/.agent/scripts/session_manager.py +144 -3
- package/.agent/scripts/skill_integrator.py +234 -0
- package/.agent/scripts/strengthen_skills.py +220 -0
- package/.agent/scripts/swarm_dispatcher.py +317 -0
- package/.agent/scripts/test_runner.py +192 -0
- package/.agent/scripts/test_swarm_dispatcher.py +163 -0
- package/.agent/skills/agent-organizer/SKILL.md +132 -0
- package/.agent/skills/agentic-patterns/SKILL.md +335 -0
- package/.agent/skills/api-patterns/SKILL.md +226 -50
- package/.agent/skills/app-builder/SKILL.md +215 -52
- package/.agent/skills/architecture/SKILL.md +176 -31
- package/.agent/skills/bash-linux/SKILL.md +150 -134
- package/.agent/skills/behavioral-modes/SKILL.md +152 -160
- package/.agent/skills/brainstorming/SKILL.md +148 -101
- package/.agent/skills/brainstorming/dynamic-questioning.md +10 -0
- package/.agent/skills/clean-code/SKILL.md +139 -134
- package/.agent/skills/code-review-checklist/SKILL.md +177 -80
- package/.agent/skills/config-validator/SKILL.md +165 -0
- package/.agent/skills/csharp-developer/SKILL.md +107 -0
- package/.agent/skills/database-design/SKILL.md +252 -29
- package/.agent/skills/deployment-procedures/SKILL.md +122 -175
- package/.agent/skills/devops-engineer/SKILL.md +134 -0
- package/.agent/skills/devops-incident-responder/SKILL.md +98 -0
- package/.agent/skills/documentation-templates/SKILL.md +175 -121
- package/.agent/skills/dotnet-core-expert/SKILL.md +103 -0
- package/.agent/skills/edge-computing/SKILL.md +213 -0
- package/.agent/skills/frontend-design/SKILL.md +76 -0
- package/.agent/skills/frontend-design/color-system.md +18 -0
- package/.agent/skills/frontend-design/typography-system.md +18 -0
- package/.agent/skills/game-development/SKILL.md +69 -0
- package/.agent/skills/geo-fundamentals/SKILL.md +158 -99
- package/.agent/skills/github-operations/SKILL.md +354 -0
- package/.agent/skills/i18n-localization/SKILL.md +158 -96
- package/.agent/skills/intelligent-routing/SKILL.md +89 -285
- package/.agent/skills/intelligent-routing/router-manifest.md +65 -0
- package/.agent/skills/lint-and-validate/SKILL.md +229 -27
- package/.agent/skills/llm-engineering/SKILL.md +258 -0
- package/.agent/skills/local-first/SKILL.md +203 -0
- package/.agent/skills/mcp-builder/SKILL.md +159 -111
- package/.agent/skills/mobile-design/SKILL.md +102 -282
- package/.agent/skills/nextjs-react-expert/SKILL.md +143 -227
- package/.agent/skills/nodejs-best-practices/SKILL.md +201 -254
- package/.agent/skills/observability/SKILL.md +285 -0
- package/.agent/skills/parallel-agents/SKILL.md +124 -118
- package/.agent/skills/performance-profiling/SKILL.md +143 -89
- package/.agent/skills/plan-writing/SKILL.md +133 -97
- package/.agent/skills/platform-engineer/SKILL.md +135 -0
- package/.agent/skills/powershell-windows/SKILL.md +167 -104
- package/.agent/skills/python-patterns/SKILL.md +149 -361
- package/.agent/skills/python-pro/SKILL.md +114 -0
- package/.agent/skills/react-specialist/SKILL.md +107 -0
- package/.agent/skills/readme-builder/SKILL.md +270 -0
- package/.agent/skills/realtime-patterns/SKILL.md +296 -0
- package/.agent/skills/red-team-tactics/SKILL.md +136 -134
- package/.agent/skills/rust-pro/SKILL.md +237 -173
- package/.agent/skills/seo-fundamentals/SKILL.md +134 -82
- package/.agent/skills/server-management/SKILL.md +155 -104
- package/.agent/skills/sql-pro/SKILL.md +104 -0
- package/.agent/skills/systematic-debugging/SKILL.md +156 -79
- package/.agent/skills/tailwind-patterns/SKILL.md +163 -205
- package/.agent/skills/tdd-workflow/SKILL.md +148 -88
- package/.agent/skills/test-result-analyzer/SKILL.md +299 -0
- package/.agent/skills/testing-patterns/SKILL.md +141 -114
- package/.agent/skills/trend-researcher/SKILL.md +228 -0
- package/.agent/skills/ui-ux-pro-max/SKILL.md +107 -0
- package/.agent/skills/ui-ux-researcher/SKILL.md +234 -0
- package/.agent/skills/vue-expert/SKILL.md +118 -0
- package/.agent/skills/vulnerability-scanner/SKILL.md +228 -188
- package/.agent/skills/web-design-guidelines/SKILL.md +148 -33
- package/.agent/skills/webapp-testing/SKILL.md +171 -122
- package/.agent/skills/whimsy-injector/SKILL.md +349 -0
- package/.agent/skills/workflow-optimizer/SKILL.md +219 -0
- package/.agent/workflows/api-tester.md +279 -0
- package/.agent/workflows/audit.md +168 -0
- package/.agent/workflows/brainstorm.md +65 -19
- package/.agent/workflows/changelog.md +144 -0
- package/.agent/workflows/create.md +67 -14
- package/.agent/workflows/debug.md +122 -30
- package/.agent/workflows/deploy.md +82 -31
- package/.agent/workflows/enhance.md +59 -27
- package/.agent/workflows/fix.md +143 -0
- package/.agent/workflows/generate.md +84 -20
- package/.agent/workflows/migrate.md +163 -0
- package/.agent/workflows/orchestrate.md +66 -17
- package/.agent/workflows/performance-benchmarker.md +305 -0
- package/.agent/workflows/plan.md +76 -33
- package/.agent/workflows/preview.md +73 -17
- package/.agent/workflows/refactor.md +153 -0
- package/.agent/workflows/review-ai.md +140 -0
- package/.agent/workflows/review.md +83 -16
- package/.agent/workflows/session.md +154 -0
- package/.agent/workflows/status.md +74 -18
- package/.agent/workflows/strengthen-skills.md +99 -0
- package/.agent/workflows/swarm.md +194 -0
- package/.agent/workflows/test.md +80 -31
- package/.agent/workflows/tribunal-backend.md +55 -13
- package/.agent/workflows/tribunal-database.md +62 -18
- package/.agent/workflows/tribunal-frontend.md +58 -12
- package/.agent/workflows/tribunal-full.md +70 -11
- package/.agent/workflows/tribunal-mobile.md +123 -0
- package/.agent/workflows/tribunal-performance.md +152 -0
- package/.agent/workflows/ui-ux-pro-max.md +100 -82
- package/README.md +117 -62
- package/bin/tribunal-kit.js +542 -288
- package/package.json +10 -6
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: github-operations
|
|
3
|
+
description: Complete Git and GitHub workflow orchestration. Handles branching, committing, pushing, pull requests, conflict resolution, and repository management. Use when working with Git repositories, GitHub Actions, or any version control operations.
|
|
4
|
+
allowed-tools: Read, Write, Edit, Glob, Grep, Bash
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
last-updated: 2026-03-19
|
|
7
|
+
applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# GitHub Operations Skill
|
|
11
|
+
|
|
12
|
+
> Git is a communication tool as much as a version control tool. Commit messages are letters to your future self and your team.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Ground Rules
|
|
17
|
+
|
|
18
|
+
1. **Never force-push to `main` or `master`** — use feature branches
|
|
19
|
+
2. **Always check `git status` before staging** — know what you are committing
|
|
20
|
+
3. **One logical change per commit** — atomic commits are easier to revert
|
|
21
|
+
4. **Pull before push** — always sync with remote first to avoid conflicts
|
|
22
|
+
5. **Never commit secrets** — use `.gitignore` and environment variables
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Core Workflow Patterns
|
|
27
|
+
|
|
28
|
+
### Standard Feature Branch Workflow
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# 1. Always start from an up-to-date main
|
|
32
|
+
git checkout main
|
|
33
|
+
git pull origin main
|
|
34
|
+
|
|
35
|
+
# 2. Create a descriptive feature branch
|
|
36
|
+
git checkout -b feat/your-feature-name
|
|
37
|
+
|
|
38
|
+
# 3. Make changes, then stage selectively
|
|
39
|
+
git add -p # Interactive: review each hunk before staging
|
|
40
|
+
git add path/to/specific/file # Or stage specific files
|
|
41
|
+
|
|
42
|
+
# 4. Commit with a meaningful message
|
|
43
|
+
git commit -m "feat(scope): short summary of change
|
|
44
|
+
|
|
45
|
+
- Detail 1: what was added/changed and why
|
|
46
|
+
- Detail 2: any side effects or dependencies"
|
|
47
|
+
|
|
48
|
+
# 5. Push and create PR
|
|
49
|
+
git push -u origin feat/your-feature-name
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Commit Message Convention (Conventional Commits)
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
<type>(<scope>): <short summary>
|
|
56
|
+
|
|
57
|
+
[optional body: explain WHY, not what]
|
|
58
|
+
|
|
59
|
+
[optional footer: BREAKING CHANGE, closes #issue]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Types:**
|
|
63
|
+
| Type | Use When |
|
|
64
|
+
|------|----------|
|
|
65
|
+
| `feat` | New feature |
|
|
66
|
+
| `fix` | Bug fix |
|
|
67
|
+
| `docs` | Documentation only |
|
|
68
|
+
| `refactor` | Code restructure, no behavior change |
|
|
69
|
+
| `perf` | Performance improvement |
|
|
70
|
+
| `test` | Adding or fixing tests |
|
|
71
|
+
| `chore` | Build, CI, dependency updates |
|
|
72
|
+
| `style` | Formatting, whitespace (no logic) |
|
|
73
|
+
|
|
74
|
+
**Example commit messages:**
|
|
75
|
+
```
|
|
76
|
+
feat(auth): add JWT refresh token rotation
|
|
77
|
+
fix(api): handle null response from external service
|
|
78
|
+
docs(readme): add installation and usage sections
|
|
79
|
+
chore(deps): upgrade typescript to 5.4
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Common Operations
|
|
85
|
+
|
|
86
|
+
### Fast Git Status Check
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
git status --short # Compact view
|
|
90
|
+
git diff --stat # What changed and how much
|
|
91
|
+
git log --oneline -10 # Last 10 commits, one line each
|
|
92
|
+
git log --oneline --graph --all # Full branch graph
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Staging Strategies
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Stage everything (use only when you know all changes are correct)
|
|
99
|
+
git add -A
|
|
100
|
+
|
|
101
|
+
# Stage interactively — review each change hunk
|
|
102
|
+
git add -p
|
|
103
|
+
|
|
104
|
+
# Stage a full directory
|
|
105
|
+
git add src/
|
|
106
|
+
|
|
107
|
+
# Stage individual files
|
|
108
|
+
git add file1.ts file2.ts
|
|
109
|
+
|
|
110
|
+
# Unstage a file (keep changes, remove from staging)
|
|
111
|
+
git restore --staged file.ts
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Undoing Mistakes
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Undo last commit, keep changes staged
|
|
118
|
+
git reset --soft HEAD~1
|
|
119
|
+
|
|
120
|
+
# Undo last commit, keep changes unstaged
|
|
121
|
+
git reset HEAD~1
|
|
122
|
+
|
|
123
|
+
# Discard all local changes (DESTRUCTIVE — cannot undo)
|
|
124
|
+
git restore .
|
|
125
|
+
|
|
126
|
+
# Revert a commit (creates a new "undo" commit — safe for shared branches)
|
|
127
|
+
git revert <commit-hash>
|
|
128
|
+
|
|
129
|
+
# Remove a file from git tracking but keep it locally
|
|
130
|
+
git rm --cached file.txt
|
|
131
|
+
echo "file.txt" >> .gitignore
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Resolving Merge Conflicts
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Pull with rebase (cleaner history than merge)
|
|
138
|
+
git pull --rebase origin main
|
|
139
|
+
|
|
140
|
+
# If rebase conflicts occur:
|
|
141
|
+
# 1. Fix conflicts in editor (look for <<<<<<, =======, >>>>>>>)
|
|
142
|
+
# 2. Stage resolved files
|
|
143
|
+
git add resolved-file.ts
|
|
144
|
+
# 3. Continue rebase
|
|
145
|
+
git rebase --continue
|
|
146
|
+
|
|
147
|
+
# If rebase is a mess, abort and start over
|
|
148
|
+
git rebase --abort
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Working with Remotes
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# Show all remotes
|
|
155
|
+
git remote -v
|
|
156
|
+
|
|
157
|
+
# Add a remote
|
|
158
|
+
git remote add origin https://github.com/user/repo.git
|
|
159
|
+
|
|
160
|
+
# Change remote URL
|
|
161
|
+
git remote set-url origin https://github.com/user/new-repo.git
|
|
162
|
+
|
|
163
|
+
# Fetch all remotes without merging
|
|
164
|
+
git fetch --all
|
|
165
|
+
|
|
166
|
+
# Push and set upstream tracking
|
|
167
|
+
git push -u origin branch-name
|
|
168
|
+
|
|
169
|
+
# Delete a remote branch
|
|
170
|
+
git push origin --delete branch-name
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### GitHub CLI (gh) Operations
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Create a pull request
|
|
177
|
+
gh pr create --title "feat: my feature" --body "Description of changes" --base main
|
|
178
|
+
|
|
179
|
+
# List open PRs
|
|
180
|
+
gh pr list
|
|
181
|
+
|
|
182
|
+
# Check PR status + reviews
|
|
183
|
+
gh pr status
|
|
184
|
+
|
|
185
|
+
# Merge PR (squash recommended for features)
|
|
186
|
+
gh pr merge --squash
|
|
187
|
+
|
|
188
|
+
# Create a release
|
|
189
|
+
gh release create v1.0.0 --title "v1.0.0 - Initial Release" --notes "Release notes here"
|
|
190
|
+
|
|
191
|
+
# Clone a repo
|
|
192
|
+
gh repo clone owner/repo-name
|
|
193
|
+
|
|
194
|
+
# View repo in browser
|
|
195
|
+
gh repo view --web
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Advanced Patterns
|
|
201
|
+
|
|
202
|
+
### Stashing Work in Progress
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# Stash changes with a label
|
|
206
|
+
git stash push -m "WIP: half-done auth feature"
|
|
207
|
+
|
|
208
|
+
# List all stashes
|
|
209
|
+
git stash list
|
|
210
|
+
|
|
211
|
+
# Apply most recent stash (keep it in stash list)
|
|
212
|
+
git stash apply
|
|
213
|
+
|
|
214
|
+
# Apply a specific stash
|
|
215
|
+
git stash apply stash@{2}
|
|
216
|
+
|
|
217
|
+
# Apply and drop at once
|
|
218
|
+
git stash pop
|
|
219
|
+
|
|
220
|
+
# Drop a specific stash
|
|
221
|
+
git stash drop stash@{0}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Tagging Releases
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
# Create an annotated tag (preferred for releases)
|
|
228
|
+
git tag -a v1.2.0 -m "Release version 1.2.0 — added X, fixed Y"
|
|
229
|
+
|
|
230
|
+
# Push tags to remote
|
|
231
|
+
git push origin --tags
|
|
232
|
+
|
|
233
|
+
# List existing tags
|
|
234
|
+
git tag -l
|
|
235
|
+
|
|
236
|
+
# Delete a tag locally and remotely
|
|
237
|
+
git tag -d v1.2.0
|
|
238
|
+
git push origin --delete v1.2.0
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Squashing Commits Before PR
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
# Interactive rebase to squash last N commits
|
|
245
|
+
git rebase -i HEAD~3
|
|
246
|
+
|
|
247
|
+
# In the editor: change 'pick' to 'squash' (or 's') for commits to merge
|
|
248
|
+
# Keep the first as 'pick', squash the rest into it
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## README Generation (Quick Pattern)
|
|
254
|
+
|
|
255
|
+
When adding or updating a README, use this checklist:
|
|
256
|
+
|
|
257
|
+
```
|
|
258
|
+
## README Checklist
|
|
259
|
+
- [ ] Project name and one-line description at the top
|
|
260
|
+
- [ ] Badges: build status, version, license
|
|
261
|
+
- [ ] Quick demo or screenshot
|
|
262
|
+
- [ ] Requirements / prerequisites
|
|
263
|
+
- [ ] Installation (copy-paste commands, no ambiguity)
|
|
264
|
+
- [ ] Usage with examples
|
|
265
|
+
- [ ] Configuration / environment variables table
|
|
266
|
+
- [ ] Contributing guidelines link
|
|
267
|
+
- [ ] License declaration
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## .gitignore Templates
|
|
273
|
+
|
|
274
|
+
### Node.js / TypeScript
|
|
275
|
+
|
|
276
|
+
```gitignore
|
|
277
|
+
node_modules/
|
|
278
|
+
dist/
|
|
279
|
+
build/
|
|
280
|
+
.env
|
|
281
|
+
.env.local
|
|
282
|
+
.env.*.local
|
|
283
|
+
*.log
|
|
284
|
+
.DS_Store
|
|
285
|
+
Thumbs.db
|
|
286
|
+
coverage/
|
|
287
|
+
.nyc_output/
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Python
|
|
291
|
+
|
|
292
|
+
```gitignore
|
|
293
|
+
__pycache__/
|
|
294
|
+
*.py[cod]
|
|
295
|
+
*.egg-info/
|
|
296
|
+
dist/
|
|
297
|
+
build/
|
|
298
|
+
.venv/
|
|
299
|
+
venv/
|
|
300
|
+
.env
|
|
301
|
+
*.log
|
|
302
|
+
.pytest_cache/
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Output Format
|
|
308
|
+
|
|
309
|
+
When this skill produces git operations or reviews them, structure your output as:
|
|
310
|
+
|
|
311
|
+
```
|
|
312
|
+
━━━ GitHub Operations Report ━━━━━━━━━━━━━━━━━━━━━━━
|
|
313
|
+
Skill: github-operations
|
|
314
|
+
Scope: [repo name / branch]
|
|
315
|
+
Operation: [commit / push / PR / merge / etc.]
|
|
316
|
+
─────────────────────────────────────────────────────
|
|
317
|
+
✅ Passed: [checks that passed, or "All clean"]
|
|
318
|
+
⚠️ Warnings: [non-blocking issues, or "None"]
|
|
319
|
+
❌ Blocked: [blocking issues requiring fix, or "None"]
|
|
320
|
+
─────────────────────────────────────────────────────
|
|
321
|
+
VBC status: PENDING → VERIFIED
|
|
322
|
+
Evidence: [git output / push confirmation / PR link]
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
**VBC (Verification-Before-Completion) is mandatory.**
|
|
326
|
+
Do not mark status as VERIFIED until concrete terminal evidence (e.g., push success, PR link) is provided.
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## 🏛️ Tribunal Integration (Anti-Hallucination)
|
|
331
|
+
|
|
332
|
+
**Slash command: `/review` or `/audit`**
|
|
333
|
+
**Active reviewers: `logic` · `security` · `devops`**
|
|
334
|
+
|
|
335
|
+
### ❌ Forbidden AI Tropes in GitHub Operations
|
|
336
|
+
|
|
337
|
+
1. **Inventing commit hashes** — never fabricate SHA hashes; always use `git log` to retrieve real ones.
|
|
338
|
+
2. **Assuming branch names** — always confirm the current branch with `git branch --show-current` before operating.
|
|
339
|
+
3. **Silently force-pushing** — never suggest `git push --force` without explicitly warning about history rewrite risks.
|
|
340
|
+
4. **Hallucinating `gh` subcommands** — only use `gh` commands from the official GitHub CLI docs.
|
|
341
|
+
5. **Skipping `git pull` before push** — always sync with remote first, especially on shared branches.
|
|
342
|
+
|
|
343
|
+
### ✅ Pre-Flight Self-Audit
|
|
344
|
+
|
|
345
|
+
Review these questions before any git operation:
|
|
346
|
+
|
|
347
|
+
```
|
|
348
|
+
✅ Did I check `git status` before staging changes?
|
|
349
|
+
✅ Is the commit message following Conventional Commits format?
|
|
350
|
+
✅ Did I verify the correct branch is active with `git branch --show-current`?
|
|
351
|
+
✅ Did I pull from remote before pushing to avoid conflicts?
|
|
352
|
+
✅ Are there any secrets, API keys, or credentials in the staged diff?
|
|
353
|
+
✅ If force-pushing, did I explicitly warn the user about history rewrite?
|
|
354
|
+
```
|
|
@@ -1,154 +1,216 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: i18n-localization
|
|
3
3
|
description: Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.
|
|
4
|
-
allowed-tools: Read, Glob, Grep
|
|
4
|
+
allowed-tools: Read, Write, Edit, Glob, Grep
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
last-updated: 2026-03-12
|
|
7
|
+
applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
|
|
5
8
|
---
|
|
6
9
|
|
|
7
|
-
#
|
|
10
|
+
# Internationalization & Localization
|
|
8
11
|
|
|
9
|
-
> Internationalization (i18n)
|
|
12
|
+
> Internationalization (i18n) is preparing code to support multiple languages.
|
|
13
|
+
> Localization (l10n) is the work of adapting to a specific locale.
|
|
14
|
+
> Do i18n once, properly. Do l10n for each market.
|
|
10
15
|
|
|
11
16
|
---
|
|
12
17
|
|
|
13
|
-
##
|
|
18
|
+
## The Core Rule: No Hardcoded Strings
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
Every user-visible string in the source code is a localization problem waiting to happen.
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
// ❌ Hardcoded — untranslatable
|
|
24
|
+
<button>Save Changes</button>
|
|
25
|
+
<p>You have {count} messages</p>
|
|
26
|
+
<p>Error: Invalid email address</p>
|
|
27
|
+
|
|
28
|
+
// ✅ Key-referenced — translatable
|
|
29
|
+
<button>{t('common.save')}</button>
|
|
30
|
+
<p>{t('inbox.messageCount', { count })}</p>
|
|
31
|
+
<p>{t('errors.invalidEmail')}</p>
|
|
32
|
+
```
|
|
21
33
|
|
|
22
34
|
---
|
|
23
35
|
|
|
24
|
-
##
|
|
36
|
+
## Translation File Structure
|
|
37
|
+
|
|
38
|
+
Organize translation keys hierarchically — flat files become unmaintainable past ~50 keys:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
// en.json
|
|
42
|
+
{
|
|
43
|
+
"common": {
|
|
44
|
+
"save": "Save Changes",
|
|
45
|
+
"cancel": "Cancel",
|
|
46
|
+
"loading": "Loading…",
|
|
47
|
+
"error": "Something went wrong"
|
|
48
|
+
},
|
|
49
|
+
"auth": {
|
|
50
|
+
"login": "Sign In",
|
|
51
|
+
"logout": "Sign Out",
|
|
52
|
+
"register": "Create Account",
|
|
53
|
+
"errors": {
|
|
54
|
+
"invalidEmail": "Enter a valid email address",
|
|
55
|
+
"passwordTooShort": "Password must be at least {{min}} characters"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"inbox": {
|
|
59
|
+
"messageCount_one": "{{count}} message",
|
|
60
|
+
"messageCount_other": "{{count}} messages"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
25
64
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
| Internal tool | ⚠️ Maybe |
|
|
31
|
-
| Single-region app | ⚠️ Consider future |
|
|
32
|
-
| Personal project | ❌ Optional |
|
|
65
|
+
**Key naming conventions:**
|
|
66
|
+
- `feature.element` or `feature.element.state`
|
|
67
|
+
- Error keys under `.errors`
|
|
68
|
+
- Never use the English text as the key (`"Save Changes": "Save Changes"`)
|
|
33
69
|
|
|
34
70
|
---
|
|
35
71
|
|
|
36
|
-
##
|
|
72
|
+
## Pluralization
|
|
37
73
|
|
|
38
|
-
|
|
74
|
+
Pluralization rules differ per language. Use your i18n library's plural system — never manual `if count > 1`:
|
|
39
75
|
|
|
40
|
-
```
|
|
41
|
-
|
|
76
|
+
```ts
|
|
77
|
+
// ❌ Only works for English
|
|
78
|
+
const label = count === 1 ? 'message' : 'messages';
|
|
42
79
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
80
|
+
// ✅ i18next handles per-language plural rules
|
|
81
|
+
t('inbox.messageCount', { count })
|
|
82
|
+
|
|
83
|
+
// Translation files handle the variants:
|
|
84
|
+
// English: { "messageCount_one": "{{count}} message", "messageCount_other": "{{count}} messages" }
|
|
85
|
+
// Arabic: 6 plural forms (zero, one, two, few, many, other)
|
|
86
|
+
// Russian: 3 plural forms with complex rules
|
|
47
87
|
```
|
|
48
88
|
|
|
49
|
-
|
|
89
|
+
---
|
|
50
90
|
|
|
51
|
-
|
|
52
|
-
import { useTranslations } from 'next-intl';
|
|
91
|
+
## Date, Number & Currency Formatting
|
|
53
92
|
|
|
54
|
-
|
|
55
|
-
const t = useTranslations('Home');
|
|
56
|
-
return <h1>{t('title')}</h1>;
|
|
57
|
-
}
|
|
58
|
-
```
|
|
93
|
+
Never format these manually. Use the browser's `Intl` API:
|
|
59
94
|
|
|
60
|
-
|
|
95
|
+
```ts
|
|
96
|
+
// Date
|
|
97
|
+
const date = new Date();
|
|
98
|
+
new Intl.DateTimeFormat('en-US').format(date); // "2/20/2026"
|
|
99
|
+
new Intl.DateTimeFormat('de-DE').format(date); // "20.2.2026"
|
|
61
100
|
|
|
62
|
-
|
|
63
|
-
|
|
101
|
+
// Number
|
|
102
|
+
new Intl.NumberFormat('en-US').format(1234567.89); // "1,234,567.89"
|
|
103
|
+
new Intl.NumberFormat('de-DE').format(1234567.89); // "1.234.567,89"
|
|
64
104
|
|
|
65
|
-
|
|
105
|
+
// Currency
|
|
106
|
+
new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(99.99);
|
|
107
|
+
// "$99.99"
|
|
108
|
+
new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(99.99);
|
|
109
|
+
// "99,99 €"
|
|
66
110
|
```
|
|
67
111
|
|
|
68
112
|
---
|
|
69
113
|
|
|
70
|
-
##
|
|
114
|
+
## RTL (Right-to-Left) Support
|
|
115
|
+
|
|
116
|
+
Arabic, Hebrew, Persian, Urdu are RTL languages. Supporting them requires more than flipping direction.
|
|
117
|
+
|
|
118
|
+
```html
|
|
119
|
+
<!-- Set direction on html element based on locale -->
|
|
120
|
+
<html lang="ar" dir="rtl">
|
|
71
121
|
|
|
122
|
+
<!-- Or dynamically -->
|
|
123
|
+
<html lang={locale} dir={isRTL(locale) ? 'rtl' : 'ltr'}>
|
|
72
124
|
```
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
125
|
+
|
|
126
|
+
```css
|
|
127
|
+
/* Use logical properties — they flip automatically with direction */
|
|
128
|
+
/* ❌ Physical: only works for LTR */
|
|
129
|
+
padding-left: 1rem;
|
|
130
|
+
margin-right: 2rem;
|
|
131
|
+
border-left: 2px solid;
|
|
132
|
+
|
|
133
|
+
/* ✅ Logical: works for both LTR and RTL */
|
|
134
|
+
padding-inline-start: 1rem;
|
|
135
|
+
margin-inline-end: 2rem;
|
|
136
|
+
border-inline-start: 2px solid;
|
|
84
137
|
```
|
|
85
138
|
|
|
86
139
|
---
|
|
87
140
|
|
|
88
|
-
##
|
|
141
|
+
## Detecting Hardcoded Strings (Code Audit)
|
|
89
142
|
|
|
90
|
-
|
|
143
|
+
Look for:
|
|
144
|
+
- JSX text content directly in tags: `<p>some text</p>` (not `<p>{t(...)}</p>`)
|
|
145
|
+
- Template literals with user-facing copy: `` `Welcome, ${name}!` ``
|
|
146
|
+
- Alert/toast calls with string literals: `toast.success('Saved!')`
|
|
147
|
+
- Error messages: `new Error('Invalid input')` shown to users
|
|
148
|
+
- `placeholder`, `aria-label`, `title` attributes hardcoded
|
|
91
149
|
|
|
92
|
-
|
|
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
|
|
150
|
+
---
|
|
98
151
|
|
|
99
|
-
|
|
152
|
+
## Scripts
|
|
100
153
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
- Forget about RTL layout
|
|
105
|
-
- Mix languages in same file
|
|
154
|
+
| Script | Purpose | Run With |
|
|
155
|
+
|---|---|---|
|
|
156
|
+
| `scripts/i18n_checker.py` | Scans codebase for hardcoded strings | `python scripts/i18n_checker.py <project_path>` |
|
|
106
157
|
|
|
107
158
|
---
|
|
108
159
|
|
|
109
|
-
##
|
|
160
|
+
## Output Format
|
|
161
|
+
|
|
162
|
+
When this skill produces a recommendation or design decision, structure your output as:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
━━━ I18N Localization Recommendation ━━━━━━━━━━━━━━━━
|
|
166
|
+
Decision: [what was chosen / proposed]
|
|
167
|
+
Rationale: [why — one concise line]
|
|
168
|
+
Trade-offs: [what is consciously accepted]
|
|
169
|
+
Next action: [concrete next step for the user]
|
|
170
|
+
─────────────────────────────────────────────────
|
|
171
|
+
Pre-Flight: ✅ All checks passed
|
|
172
|
+
or ❌ [blocking item that must be resolved first]
|
|
173
|
+
```
|
|
174
|
+
|
|
110
175
|
|
|
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
176
|
|
|
119
177
|
---
|
|
120
178
|
|
|
121
|
-
##
|
|
179
|
+
## 🤖 LLM-Specific Traps
|
|
122
180
|
|
|
123
|
-
|
|
124
|
-
/* CSS Logical Properties */
|
|
125
|
-
.container {
|
|
126
|
-
margin-inline-start: 1rem; /* Not margin-left */
|
|
127
|
-
padding-inline-end: 1rem; /* Not padding-right */
|
|
128
|
-
}
|
|
181
|
+
AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
|
|
129
182
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
183
|
+
1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
|
|
184
|
+
2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
|
|
185
|
+
3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
|
|
186
|
+
4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
187
|
+
5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
|
|
134
188
|
|
|
135
189
|
---
|
|
136
190
|
|
|
137
|
-
##
|
|
191
|
+
## 🏛️ Tribunal Integration (Anti-Hallucination)
|
|
138
192
|
|
|
139
|
-
|
|
193
|
+
**Slash command: `/review` or `/tribunal-full`**
|
|
194
|
+
**Active reviewers: `logic-reviewer` · `security-auditor`**
|
|
140
195
|
|
|
141
|
-
|
|
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
|
|
196
|
+
### ❌ Forbidden AI Tropes
|
|
147
197
|
|
|
148
|
-
|
|
198
|
+
1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
|
|
199
|
+
2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
|
|
200
|
+
3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
201
|
+
|
|
202
|
+
### ✅ Pre-Flight Self-Audit
|
|
203
|
+
|
|
204
|
+
Review these questions before confirming output:
|
|
205
|
+
```
|
|
206
|
+
✅ Did I rely ONLY on real, verified tools and methods?
|
|
207
|
+
✅ Is this solution appropriately scoped to the user's constraints?
|
|
208
|
+
✅ Did I handle potential failure modes and edge cases?
|
|
209
|
+
✅ Have I avoided generic boilerplate that doesn't add value?
|
|
210
|
+
```
|
|
149
211
|
|
|
150
|
-
|
|
212
|
+
### 🛑 Verification-Before-Completion (VBC) Protocol
|
|
151
213
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
214
|
+
**CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
|
|
215
|
+
- ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
|
|
216
|
+
- ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
|