Feature Toggles
Skill Profile
(Select at least one profile to enable specific modules)
Overview
Feature toggles are runtime switches that enable or disable features without deploying new code. They decouple deployment from release, enabling gradual rollouts, A/B testing, and emergency feature disabling without code changes.
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
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: feature-toggles3description: Feature toggles are runtime switches that enable or disable features Use when this capability is needed.4---56# Feature Toggles78## Skill Profile9*(Select at least one profile to enable specific modules)*10- [ ] **DevOps**11- [x] **Backend**12- [ ] **Frontend**13- [ ] **AI-RAG**14- [ ] **Security Critical**1516## Overview17Feature toggles are runtime switches that enable or disable features without deploying new code. They decouple deployment from release, enabling gradual rollouts, A/B testing, and emergency feature disabling without code changes.1819## Why This Matters20- **<Benefit>**: <short explanation>21- **<Benefit>**: <short explanation>22- **<Benefit>**: <short explanation>2324## Core Concepts & Rules2526### 1. Core Principles27- Follow established patterns and conventions28- Maintain consistency across codebase29- Document decisions and trade-offs3031### 2. Implementation Guidelines32- Start with the simplest viable solution33- Iterate based on feedback and requirements34- Test thoroughly before deployment353637## Inputs / Outputs / Contracts38* **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%>5051## Skill Composition52* **Depends on**: None53* **Compatible with**: None54* **Conflicts with**: None55* **Related Skills**: None5657## Quick Start58#5960## Assumptions / Constraints / Non-goals6162* **Assumptions**:63 - Development environment is properly configured64 - Required dependencies are available65 - Team has basic understanding of domain66* **Constraints**:67 - Must follow existing codebase conventions68 - Time and resource limitations69 - Compatibility requirements70* **Non-goals**:71 - This skill does not cover edge cases outside scope72 - Not a replacement for formal training737475## Compatibility & Prerequisites7677* **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 language84 - Version control (Git)85* **Dependencies**:86 - Language-specific package manager87 - Build tools88 - Testing libraries89* **Environment Setup**:90 - `.env.example` keys: `API_KEY`, `DATABASE_URL` (no values)919293## Test Scenario Matrix (QA Strategy)9495| 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) |103104105## Technical Guardrails & Security Threat Model106107### 1. Security & Privacy (Threat Model)108* **Top Threats**: Injection attacks, authentication bypass, data exposure109- [ ] **Data Handling**: Sanitize all user inputs to prevent Injection attacks. Never log raw PII110- [ ] **Secrets Management**: No hardcoded API keys. Use Env Vars/Secrets Manager111- [ ] **Authorization**: Validate user permissions before state changes112113### 2. Performance & Resources114- [ ] **Execution Efficiency**: Consider time complexity for algorithms115- [ ] **Memory Management**: Use streams/pagination for large data116- [ ] **Resource Cleanup**: Close DB connections/file handlers in finally blocks117118### 3. Architecture & Scalability119- [ ] **Design Pattern**: Follow SOLID principles, use Dependency Injection120- [ ] **Modularity**: Decouple logic from UI/Frameworks121122### 4. Observability & Reliability123- [ ] **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 except126- [ ] **Observability Artifacts**:127 - **Log Fields**: timestamp, level, message, request_id128 - **Metrics**: request_count, error_count, response_time129 - **Dashboards/Alerts**: High Error Rate > 5%130131132## Agent Directives & Error Recovery133*(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)*134135- **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.139140141## Definition of Done (DoD) Checklist142143- [ ] Tests passed + coverage met144- [ ] Lint/Typecheck passed145- [ ] Logging/Metrics/Trace implemented146- [ ] Security checks passed147- [ ] Documentation/Changelog updated148- [ ] Accessibility/Performance requirements met (if frontend)149150151## Anti-patterns152#153154## Reference Links & Examples155156* Internal documentation and examples157* Official documentation and best practices158* Community resources and discussions159160161## Versioning & Changelog162163* **Version**: 1.0.0164* **Changelog**:165 - 2026-02-22: Initial version with complete template structure166167---168> Converted and distributed by [TomeVault](https://tomevault.io/claim/amnadtaowsoam) — claim your Tome and manage your conversions.169<!-- tomevault:4.0:skill_md:2026-04-13 -->