Offline Vs Online Eval
Skill Profile
(Select at least one profile to enable specific modules)
Overview
This skill provides comprehensive guidance and best practices for implementation. It enables teams to achieve reliable, maintainable, and scalable solutions.
When to use / When NOT to use
- ✅ Use when: Implementing this capability in your project
- ✅ Use when: Need to follow established patterns and conventions
- ❌ Avoid when: The requirements don't match this skill's scope
- ❌ Avoid when: Simpler alternatives would suffice
Why This Matters
- Reduces Technical Debt: Following established patterns prevents costly rework
- Increases System Stability: Proper implementation reduces bugs and downtime
- Improves Team Velocity: Clear guidance helps teams work more efficiently
- Reduces Maintenance Costs: Well-structured code is easier to maintain
- Ensures Investment Confidence: Following standards gives confidence in technical decisions
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:
- Requirements and specifications
- Existing codebase and architecture
- Team context and constraints
- Entry Conditions:
- Project repository initialized
- Development environment set up
- Required dependencies installed
- Outputs:
- Implementation code and documentation
- Test cases and test results
- Deployment artifacts
- Artifacts Required (Deliverables):
- Source code changes
- Updated documentation
- Test coverage reports
- Acceptance Evidence:
- All tests passing
- Code review approved
- Documentation updated
- Success Criteria:
- Meets all functional requirements
- Follows established patterns
- Test coverage ≥ 80%
Skill Composition
- Depends on: None
- Compatible with: None
- Conflicts with: None
- Related Skills: None
Overview
Comprehensive guide to offline and online evaluation strategies for AI/ML models, including metrics, A/B testing, and production monitoring
Quick Start / Implementation Example
- Review requirements and constraints
- Set up development environment
- Implement core functionality following patterns
- Write tests for critical paths
- Run tests and fix issues
- Document any deviations or decisions
# Example implementation following best practices
def example_function():
# Your implementation here
pass
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 / Pitfalls
- ⛔ Don't: Log PII, catch-all exception, N+1 queries
- ⚠️ Watch out for: Common symptoms and quick fixes
- 💡 Instead: Use proper error handling, pagination, and logging
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: offline-vs-online-eval3description: * **Depends on**: None * **Compatible with**: None * **Conflicts with**: None * **Related Skills**: None # Overview Comprehensive guide to offline and online evaluation strategies for AI/ML models, in4---5
6# Offline Vs Online Eval
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
17This skill provides comprehensive guidance and best practices for implementation. It enables teams to achieve reliable, maintainable, and scalable solutions.
18
19### When to use / When NOT to use
20* ✅ **Use when**: Implementing this capability in your project
21* ✅ **Use when**: Need to follow established patterns and conventions
22* ❌ **Avoid when**: The requirements don't match this skill's scope
23* ❌ **Avoid when**: Simpler alternatives would suffice
24
25
26## Why This Matters
27- **Reduces Technical Debt**: Following established patterns prevents costly rework
28- **Increases System Stability**: Proper implementation reduces bugs and downtime
29- **Improves Team Velocity**: Clear guidance helps teams work more efficiently
30- **Reduces Maintenance Costs**: Well-structured code is easier to maintain
31- **Ensures Investment Confidence**: Following standards gives confidence in technical decisions
32
33
34## Core Concepts & Rules
35
36### 1. Core Principles
37- Follow established patterns and conventions
38- Maintain consistency across codebase
39- Document decisions and trade-offs
40
41### 2. Implementation Guidelines
42- Start with the simplest viable solution
43- Iterate based on feedback and requirements
44- Test thoroughly before deployment
45
46
47## Inputs / Outputs / Contracts
48
49* **Inputs**:
50 - Requirements and specifications
51 - Existing codebase and architecture
52 - Team context and constraints
53* **Entry Conditions**:
54 - Project repository initialized
55 - Development environment set up
56 - Required dependencies installed
57* **Outputs**:
58 - Implementation code and documentation
59 - Test cases and test results
60 - Deployment artifacts
61* **Artifacts Required (Deliverables)**:
62 - Source code changes
63 - Updated documentation
64 - Test coverage reports
65* **Acceptance Evidence**:
66 - All tests passing
67 - Code review approved
68 - Documentation updated
69* **Success Criteria**:
70 - Meets all functional requirements
71 - Follows established patterns
72 - Test coverage ≥ 80%
73
74
75## Skill Composition
76* **Depends on**: None
77* **Compatible with**: None
78* **Conflicts with**: None
79* **Related Skills**: None
80
81# Overview
82Comprehensive guide to offline and online evaluation strategies for AI/ML models, including metrics, A/B testing, and production monitoring
83
84## Quick Start / Implementation Example
85
861. Review requirements and constraints
872. Set up development environment
883. Implement core functionality following patterns
894. Write tests for critical paths
905. Run tests and fix issues
916. Document any deviations or decisions
92
93```python
94# Example implementation following best practices
95def example_function():
96 # Your implementation here
97 pass
98```
99
100
101## Assumptions / Constraints / Non-goals
102
103* **Assumptions**:
104 - Development environment is properly configured
105 - Required dependencies are available
106 - Team has basic understanding of domain
107* **Constraints**:
108 - Must follow existing codebase conventions
109 - Time and resource limitations
110 - Compatibility requirements
111* **Non-goals**:
112 - This skill does not cover edge cases outside scope
113 - Not a replacement for formal training
114
115
116## Compatibility & Prerequisites
117
118* **Supported Versions**:
119 - Python 3.8+
120 - Node.js 16+
121 - Modern browsers (Chrome, Firefox, Safari, Edge)
122* **Required AI Tools**:
123 - Code editor (VS Code recommended)
124 - Testing framework appropriate for language
125 - Version control (Git)
126* **Dependencies**:
127 - Language-specific package manager
128 - Build tools
129 - Testing libraries
130* **Environment Setup**:
131 - `.env.example` keys: `API_KEY`, `DATABASE_URL` (no values)
132
133
134## Test Scenario Matrix (QA Strategy)
135
136| Type | Focus Area | Required Scenarios / Mocks |
137| :--- | :--- | :--- |
138| **Unit** | Core Logic | Must cover primary logic and at least 3 edge/error cases. Target minimum 80% coverage |
139| **Integration** | DB / API | All external API calls or database connections must be mocked during unit tests |
140| **E2E** | User Journey | Critical user flows to test |
141| **Performance** | Latency / Load | Benchmark requirements |
142| **Security** | Vuln / Auth | SAST/DAST or dependency audit |
143| **Frontend** | UX / A11y | Accessibility checklist (WCAG), Performance Budget (Lighthouse score) |
144
145
146## Technical Guardrails & Security Threat Model
147
148### 1. Security & Privacy (Threat Model)
149* **Top Threats**: Injection attacks, authentication bypass, data exposure
150- [ ] **Data Handling**: Sanitize all user inputs to prevent Injection attacks. Never log raw PII
151- [ ] **Secrets Management**: No hardcoded API keys. Use Env Vars/Secrets Manager
152- [ ] **Authorization**: Validate user permissions before state changes
153
154### 2. Performance & Resources
155- [ ] **Execution Efficiency**: Consider time complexity for algorithms
156- [ ] **Memory Management**: Use streams/pagination for large data
157- [ ] **Resource Cleanup**: Close DB connections/file handlers in finally blocks
158
159### 3. Architecture & Scalability
160- [ ] **Design Pattern**: Follow SOLID principles, use Dependency Injection
161- [ ] **Modularity**: Decouple logic from UI/Frameworks
162
163### 4. Observability & Reliability
164- [ ] **Logging Standards**: Structured JSON, include trace IDs `request_id`
165- [ ] **Metrics**: Track `error_rate`, `latency`, `queue_depth`
166- [ ] **Error Handling**: Standardized error codes, no bare except
167- [ ] **Observability Artifacts**:
168 - **Log Fields**: timestamp, level, message, request_id
169 - **Metrics**: request_count, error_count, response_time
170 - **Dashboards/Alerts**: High Error Rate > 5%
171
172
173## Agent Directives & Error Recovery
174*(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)*
175
176- **Thinking Process**: Analyze root cause before fixing. Do not brute-force.
177- **Fallback Strategy**: Stop after 3 failed test attempts. Output root cause and ask for human intervention/clarification.
178- **Self-Review**: Check against Guardrails & Anti-patterns before finalizing.
179- **Output Constraints**: Output ONLY the modified code block. Do not explain unless asked.
180
181
182## Definition of Done (DoD) Checklist
183
184- [ ] Tests passed + coverage met
185- [ ] Lint/Typecheck passed
186- [ ] Logging/Metrics/Trace implemented
187- [ ] Security checks passed
188- [ ] Documentation/Changelog updated
189- [ ] Accessibility/Performance requirements met (if frontend)
190
191
192## Anti-patterns / Pitfalls
193
194* ⛔ **Don't**: Log PII, catch-all exception, N+1 queries
195* ⚠️ **Watch out for**: Common symptoms and quick fixes
196* 💡 **Instead**: Use proper error handling, pagination, and logging
197
198
199## Reference Links & Examples
200
201* Internal documentation and examples
202* Official documentation and best practices
203* Community resources and discussions
204
205
206## Versioning & Changelog
207
208* **Version**: 1.0.0
209* **Changelog**:
210 - 2026-02-22: Initial version with complete template structure