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