Localization
Skill Profile
(Select at least one profile to enable specific modules)
Overview
Localization (l10n) is the process of adapting an internationalized application to specific languages and regions. It goes beyond translation to include cultural, regional, and technical adaptations like date formats, currency, timezones, and cultural preferences.
Why This Matters
Core Concepts
| Cultural | Adapt to cultural norms |
| Regional | Adapt to regional preferences |
| Technical | Format dates, numbers, currencies |
| Visual | Adapt images, colors, layouts |
Inputs / Outputs / Contracts
- Inputs:
- <e.g., env vars, request payload, file paths, schema>
- Entry Conditions:
- <Pre-requisites: e.g., Repo initialized, DB running, specific branch checked out>
- Outputs:
- <e.g., artifacts (PR diff, docs, tests, dashboard JSON)>
- Artifacts Required (Deliverables):
- <e.g., Code Diff, Unit Tests, Migration Script, API Docs>
- Acceptance Evidence:
- <e.g., Test Report (screenshot/log), Benchmark Result, Security Scan Report>
- Success Criteria:
- <e.g., p95 < 300ms, coverage ≥ 80%>
Skill Composition
- Depends on: None
- Compatible with: None
- Conflicts with: None
- Related Skills: None
Quick Start
Assumptions / Constraints / Non-goals
- Assumptions:
- Development environment is properly configured
- Required dependencies are available
- Team has basic understanding of domain
- Constraints:
- Must follow existing codebase conventions
- Time and resource limitations
- Compatibility requirements
- Non-goals:
- This skill does not cover edge cases outside scope
- Not a replacement for formal training
Compatibility & Prerequisites
- Supported Versions:
- Python 3.8+
- Node.js 16+
- Modern browsers (Chrome, Firefox, Safari, Edge)
- Required AI Tools:
- Code editor (VS Code recommended)
- Testing framework appropriate for language
- Version control (Git)
- Dependencies:
- Language-specific package manager
- Build tools
- Testing libraries
- Environment Setup:
.env.example keys: API_KEY, DATABASE_URL (no values)
Test Scenario Matrix (QA Strategy)
| Type |
Focus Area |
Required Scenarios / Mocks |
| Unit |
Core Logic |
Must cover primary logic and at least 3 edge/error cases. Target minimum 80% coverage |
| Integration |
DB / API |
All external API calls or database connections must be mocked during unit tests |
| E2E |
User Journey |
Critical user flows to test |
| Performance |
Latency / Load |
Benchmark requirements |
| Security |
Vuln / Auth |
SAST/DAST or dependency audit |
| Frontend |
UX / A11y |
Accessibility checklist (WCAG), Performance Budget (Lighthouse score) |
Technical Guardrails & Security Threat Model
1. Security & Privacy (Threat Model)
- Top Threats: Injection attacks, authentication bypass, data exposure
2. Performance & Resources
3. Architecture & Scalability
4. Observability & Reliability
Agent Directives & Error Recovery
(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)
- Thinking Process: Analyze root cause before fixing. Do not brute-force.
- Fallback Strategy: Stop after 3 failed test attempts. Output root cause and ask for human intervention/clarification.
- Self-Review: Check against Guardrails & Anti-patterns before finalizing.
- Output Constraints: Output ONLY the modified code block. Do not explain unless asked.
Definition of Done (DoD) Checklist
Anti-patterns
Reference Links & Examples
- Internal documentation and examples
- Official documentation and best practices
- Community resources and discussions
Versioning & Changelog
- Version: 1.0.0
- Changelog:
- 2026-02-22: Initial version with complete template structure
1---2name: localization-23description: Localization (l10n) is the process of adapting an internationalized application to specific languages and regions. It goes beyond translation to include cultural, regional, and technical adaptations l4---5
6# Localization
7
8## Skill Profile
9*(Select at least one profile to enable specific modules)*
10- [ ] **DevOps**
11- [x] **Backend**
12- [ ] **Frontend**
13- [ ] **AI-RAG**
14- [ ] **Security Critical**
15
16## Overview
17Localization (l10n) is the process of adapting an internationalized application to specific languages and regions. It goes beyond translation to include cultural, regional, and technical adaptations like date formats, currency, timezones, and cultural preferences.
18
19## Why This Matters
20- **<Benefit>**: <short explanation>
21- **<Benefit>**: <short explanation>
22- **<Benefit>**: <short explanation>
23
24## Core Concepts
25| **Cultural** | Adapt to cultural norms |
26| **Regional** | Adapt to regional preferences |
27| **Technical** | Format dates, numbers, currencies |
28| **Visual** | Adapt images, colors, layouts |
29
30## Inputs / Outputs / Contracts
31* **Inputs**:
32 - <e.g., env vars, request payload, file paths, schema>
33* **Entry Conditions**:
34 - <Pre-requisites: e.g., Repo initialized, DB running, specific branch checked out>
35* **Outputs**:
36 - <e.g., artifacts (PR diff, docs, tests, dashboard JSON)>
37* **Artifacts Required (Deliverables)**:
38 - <e.g., Code Diff, Unit Tests, Migration Script, API Docs>
39* **Acceptance Evidence**:
40 - <e.g., Test Report (screenshot/log), Benchmark Result, Security Scan Report>
41* **Success Criteria**:
42 - <e.g., p95 < 300ms, coverage ≥ 80%>
43
44## Skill Composition
45* **Depends on**: None
46* **Compatible with**: None
47* **Conflicts with**: None
48* **Related Skills**: None
49
50## Quick Start
51#
52
53## Assumptions / Constraints / Non-goals
54
55* **Assumptions**:
56 - Development environment is properly configured
57 - Required dependencies are available
58 - Team has basic understanding of domain
59* **Constraints**:
60 - Must follow existing codebase conventions
61 - Time and resource limitations
62 - Compatibility requirements
63* **Non-goals**:
64 - This skill does not cover edge cases outside scope
65 - Not a replacement for formal training
66
67
68## Compatibility & Prerequisites
69
70* **Supported Versions**:
71 - Python 3.8+
72 - Node.js 16+
73 - Modern browsers (Chrome, Firefox, Safari, Edge)
74* **Required AI Tools**:
75 - Code editor (VS Code recommended)
76 - Testing framework appropriate for language
77 - Version control (Git)
78* **Dependencies**:
79 - Language-specific package manager
80 - Build tools
81 - Testing libraries
82* **Environment Setup**:
83 - `.env.example` keys: `API_KEY`, `DATABASE_URL` (no values)
84
85
86## Test Scenario Matrix (QA Strategy)
87
88| Type | Focus Area | Required Scenarios / Mocks |
89| :--- | :--- | :--- |
90| **Unit** | Core Logic | Must cover primary logic and at least 3 edge/error cases. Target minimum 80% coverage |
91| **Integration** | DB / API | All external API calls or database connections must be mocked during unit tests |
92| **E2E** | User Journey | Critical user flows to test |
93| **Performance** | Latency / Load | Benchmark requirements |
94| **Security** | Vuln / Auth | SAST/DAST or dependency audit |
95| **Frontend** | UX / A11y | Accessibility checklist (WCAG), Performance Budget (Lighthouse score) |
96
97
98## Technical Guardrails & Security Threat Model
99
100### 1. Security & Privacy (Threat Model)
101* **Top Threats**: Injection attacks, authentication bypass, data exposure
102- [ ] **Data Handling**: Sanitize all user inputs to prevent Injection attacks. Never log raw PII
103- [ ] **Secrets Management**: No hardcoded API keys. Use Env Vars/Secrets Manager
104- [ ] **Authorization**: Validate user permissions before state changes
105
106### 2. Performance & Resources
107- [ ] **Execution Efficiency**: Consider time complexity for algorithms
108- [ ] **Memory Management**: Use streams/pagination for large data
109- [ ] **Resource Cleanup**: Close DB connections/file handlers in finally blocks
110
111### 3. Architecture & Scalability
112- [ ] **Design Pattern**: Follow SOLID principles, use Dependency Injection
113- [ ] **Modularity**: Decouple logic from UI/Frameworks
114
115### 4. Observability & Reliability
116- [ ] **Logging Standards**: Structured JSON, include trace IDs `request_id`
117- [ ] **Metrics**: Track `error_rate`, `latency`, `queue_depth`
118- [ ] **Error Handling**: Standardized error codes, no bare except
119- [ ] **Observability Artifacts**:
120 - **Log Fields**: timestamp, level, message, request_id
121 - **Metrics**: request_count, error_count, response_time
122 - **Dashboards/Alerts**: High Error Rate > 5%
123
124
125## Agent Directives & Error Recovery
126*(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)*
127
128- **Thinking Process**: Analyze root cause before fixing. Do not brute-force.
129- **Fallback Strategy**: Stop after 3 failed test attempts. Output root cause and ask for human intervention/clarification.
130- **Self-Review**: Check against Guardrails & Anti-patterns before finalizing.
131- **Output Constraints**: Output ONLY the modified code block. Do not explain unless asked.
132
133
134## Definition of Done (DoD) Checklist
135
136- [ ] Tests passed + coverage met
137- [ ] Lint/Typecheck passed
138- [ ] Logging/Metrics/Trace implemented
139- [ ] Security checks passed
140- [ ] Documentation/Changelog updated
141- [ ] Accessibility/Performance requirements met (if frontend)
142
143
144## Anti-patterns
145#
146
147## Reference Links & Examples
148
149* Internal documentation and examples
150* Official documentation and best practices
151* Community resources and discussions
152
153
154## Versioning & Changelog
155
156* **Version**: 1.0.0
157* **Changelog**:
158 - 2026-02-22: Initial version with complete template structure
159