Output Templates
Skill Profile
(Select at least one profile to enable specific modules)
Overview
Output templates are structured formats for project deliverables. They ensure consistency, completeness, and clear communication across all projects.
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 / 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
- [Assumption 1]
- [Assumption 2]
- [Assumption 3]
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: output-templates3description: Output templates are structured formats for project deliverables. They ensure consistency, completeness, and clear communication across all projects.4---5
6# Output Templates
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
17Output templates are structured formats for project deliverables. They ensure consistency, completeness, and clear communication across all projects.
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 / Implementation Example
58
591. Review requirements and constraints
602. Set up development environment
613. Implement core functionality following patterns
624. Write tests for critical paths
635. Run tests and fix issues
646. Document any deviations or decisions
65
66```python
67# Example implementation following best practices
68def example_function():
69 # Your implementation here
70 pass
71```
72
73
74## Assumptions
75- [Assumption 1]
76- [Assumption 2]
77- [Assumption 3]
78
79## Compatibility & Prerequisites
80
81* **Supported Versions**:
82 - Python 3.8+
83 - Node.js 16+
84 - Modern browsers (Chrome, Firefox, Safari, Edge)
85* **Required AI Tools**:
86 - Code editor (VS Code recommended)
87 - Testing framework appropriate for language
88 - Version control (Git)
89* **Dependencies**:
90 - Language-specific package manager
91 - Build tools
92 - Testing libraries
93* **Environment Setup**:
94 - `.env.example` keys: `API_KEY`, `DATABASE_URL` (no values)
95
96
97## Test Scenario Matrix (QA Strategy)
98
99| Type | Focus Area | Required Scenarios / Mocks |
100| :--- | :--- | :--- |
101| **Unit** | Core Logic | Must cover primary logic and at least 3 edge/error cases. Target minimum 80% coverage |
102| **Integration** | DB / API | All external API calls or database connections must be mocked during unit tests |
103| **E2E** | User Journey | Critical user flows to test |
104| **Performance** | Latency / Load | Benchmark requirements |
105| **Security** | Vuln / Auth | SAST/DAST or dependency audit |
106| **Frontend** | UX / A11y | Accessibility checklist (WCAG), Performance Budget (Lighthouse score) |
107
108
109## Technical Guardrails & Security Threat Model
110
111### 1. Security & Privacy (Threat Model)
112* **Top Threats**: Injection attacks, authentication bypass, data exposure
113- [ ] **Data Handling**: Sanitize all user inputs to prevent Injection attacks. Never log raw PII
114- [ ] **Secrets Management**: No hardcoded API keys. Use Env Vars/Secrets Manager
115- [ ] **Authorization**: Validate user permissions before state changes
116
117### 2. Performance & Resources
118- [ ] **Execution Efficiency**: Consider time complexity for algorithms
119- [ ] **Memory Management**: Use streams/pagination for large data
120- [ ] **Resource Cleanup**: Close DB connections/file handlers in finally blocks
121
122### 3. Architecture & Scalability
123- [ ] **Design Pattern**: Follow SOLID principles, use Dependency Injection
124- [ ] **Modularity**: Decouple logic from UI/Frameworks
125
126### 4. Observability & Reliability
127- [ ] **Logging Standards**: Structured JSON, include trace IDs `request_id`
128- [ ] **Metrics**: Track `error_rate`, `latency`, `queue_depth`
129- [ ] **Error Handling**: Standardized error codes, no bare except
130- [ ] **Observability Artifacts**:
131 - **Log Fields**: timestamp, level, message, request_id
132 - **Metrics**: request_count, error_count, response_time
133 - **Dashboards/Alerts**: High Error Rate > 5%
134
135
136## Agent Directives & Error Recovery
137*(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)*
138
139- **Thinking Process**: Analyze root cause before fixing. Do not brute-force.
140- **Fallback Strategy**: Stop after 3 failed test attempts. Output root cause and ask for human intervention/clarification.
141- **Self-Review**: Check against Guardrails & Anti-patterns before finalizing.
142- **Output Constraints**: Output ONLY the modified code block. Do not explain unless asked.
143
144
145## Definition of Done (DoD) Checklist
146
147- [ ] Tests passed + coverage met
148- [ ] Lint/Typecheck passed
149- [ ] Logging/Metrics/Trace implemented
150- [ ] Security checks passed
151- [ ] Documentation/Changelog updated
152- [ ] Accessibility/Performance requirements met (if frontend)
153
154
155## Anti-patterns / Pitfalls
156
157* ⛔ **Don't**: Log PII, catch-all exception, N+1 queries
158* ⚠️ **Watch out for**: Common symptoms and quick fixes
159* 💡 **Instead**: Use proper error handling, pagination, and logging
160
161
162## Reference Links & Examples
163
164* Internal documentation and examples
165* Official documentation and best practices
166* Community resources and discussions
167
168
169## Versioning & Changelog
170
171* **Version**: 1.0.0
172* **Changelog**:
173 - 2026-02-22: Initial version with complete template structure
174