Naming And Folder Conventions
Skill Profile
(Select at least one profile to enable specific modules)
Overview
Naming conventions for files, folders, variables, and functions that make a codebase predictable and searchable, reducing search time and confusion. This skill provides standardized patterns for consistent naming across all codebase artifacts.
Why This Matters
- Predictability: You can guess what files are named and where they are located
- Searchability: Easy to find/grep through the codebase
- Consistency: Everyone uses the same patterns
- Maintainability: Understand code from naming alone
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:
- File or folder to be named
- Context of usage (component, service, utility, etc.)
- Existing codebase conventions
- Entry Conditions:
- Naming conventions document exists
- Team has agreed on conventions
- Outputs:
- Properly named files and folders
- Consistent naming across codebase
- ESLint/Prettier configuration for enforcement
- Artifacts Required (Deliverables):
- Naming conventions document
- ESLint/Prettier configuration
- Code review checklist items
- Acceptance Evidence:
- All new files follow conventions
- Linter passes naming convention rules
- Code reviews catch violations
- Success Criteria:
- 100% of new files follow conventions
- Linter enforces naming rules
- Team consistently applies conventions
Skill Composition
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
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: naming-and-folder-conventions3description: Naming conventions for files, folders, variables, and functions that Use when this capability is needed.4---56# Naming And Folder Conventions78## 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## Overview17Naming conventions for files, folders, variables, and functions that make a codebase predictable and searchable, reducing search time and confusion. This skill provides standardized patterns for consistent naming across all codebase artifacts.1819## Why This Matters20- **Predictability**: You can guess what files are named and where they are located21- **Searchability**: Easy to find/grep through the codebase22- **Consistency**: Everyone uses the same patterns23- **Maintainability**: Understand code from naming alone2425---2627## Core Concepts & Rules2829### 1. Core Principles30- Follow established patterns and conventions31- Maintain consistency across codebase32- Document decisions and trade-offs3334### 2. Implementation Guidelines35- Start with the simplest viable solution36- Iterate based on feedback and requirements37- Test thoroughly before deployment383940## Inputs / Outputs / Contracts41* **Inputs**:42 - File or folder to be named43 - Context of usage (component, service, utility, etc.)44 - Existing codebase conventions45* **Entry Conditions**:46 - Naming conventions document exists47 - Team has agreed on conventions48* **Outputs**:49 - Properly named files and folders50 - Consistent naming across codebase51 - ESLint/Prettier configuration for enforcement52* **Artifacts Required (Deliverables)**:53 - Naming conventions document54 - ESLint/Prettier configuration55 - Code review checklist items56* **Acceptance Evidence**:57 - All new files follow conventions58 - Linter passes naming convention rules59 - Code reviews catch violations60* **Success Criteria**:61 - 100% of new files follow conventions62 - Linter enforces naming rules63 - Team consistently applies conventions6465## Skill Composition66* **Depends on**: [codebase-learning](../codebase-learning/SKILL.md)67* **Compatible with**: [docs-indexing-strategy](../docs-indexing-strategy/SKILL.md), [repo-map-ssot](../repo-map-ssot/SKILL.md)68* **Conflicts with**: None69* **Related Skills**: [where-to-find-what](../where-to-find-what/SKILL.md)7071---7273## Quick Start / Implementation Example74751. Review requirements and constraints762. Set up development environment773. Implement core functionality following patterns784. Write tests for critical paths795. Run tests and fix issues806. Document any deviations or decisions8182```python83# Example implementation following best practices84def example_function():85 # Your implementation here86 pass87```888990## Assumptions / Constraints / Non-goals9192* **Assumptions**:93 - Development environment is properly configured94 - Required dependencies are available95 - Team has basic understanding of domain96* **Constraints**:97 - Must follow existing codebase conventions98 - Time and resource limitations99 - Compatibility requirements100* **Non-goals**:101 - This skill does not cover edge cases outside scope102 - Not a replacement for formal training103104105## Compatibility & Prerequisites106107* **Supported Versions**:108 - Python 3.8+109 - Node.js 16+110 - Modern browsers (Chrome, Firefox, Safari, Edge)111* **Required AI Tools**:112 - Code editor (VS Code recommended)113 - Testing framework appropriate for language114 - Version control (Git)115* **Dependencies**:116 - Language-specific package manager117 - Build tools118 - Testing libraries119* **Environment Setup**:120 - `.env.example` keys: `API_KEY`, `DATABASE_URL` (no values)121122123## Test Scenario Matrix (QA Strategy)124125| Type | Focus Area | Required Scenarios / Mocks |126| :--- | :--- | :--- |127| **Unit** | Core Logic | Must cover primary logic and at least 3 edge/error cases. Target minimum 80% coverage |128| **Integration** | DB / API | All external API calls or database connections must be mocked during unit tests |129| **E2E** | User Journey | Critical user flows to test |130| **Performance** | Latency / Load | Benchmark requirements |131| **Security** | Vuln / Auth | SAST/DAST or dependency audit |132| **Frontend** | UX / A11y | Accessibility checklist (WCAG), Performance Budget (Lighthouse score) |133134135## Technical Guardrails & Security Threat Model136137### 1. Security & Privacy (Threat Model)138* **Top Threats**: Injection attacks, authentication bypass, data exposure139- [ ] **Data Handling**: Sanitize all user inputs to prevent Injection attacks. Never log raw PII140- [ ] **Secrets Management**: No hardcoded API keys. Use Env Vars/Secrets Manager141- [ ] **Authorization**: Validate user permissions before state changes142143### 2. Performance & Resources144- [ ] **Execution Efficiency**: Consider time complexity for algorithms145- [ ] **Memory Management**: Use streams/pagination for large data146- [ ] **Resource Cleanup**: Close DB connections/file handlers in finally blocks147148### 3. Architecture & Scalability149- [ ] **Design Pattern**: Follow SOLID principles, use Dependency Injection150- [ ] **Modularity**: Decouple logic from UI/Frameworks151152### 4. Observability & Reliability153- [ ] **Logging Standards**: Structured JSON, include trace IDs `request_id`154- [ ] **Metrics**: Track `error_rate`, `latency`, `queue_depth`155- [ ] **Error Handling**: Standardized error codes, no bare except156- [ ] **Observability Artifacts**:157 - **Log Fields**: timestamp, level, message, request_id158 - **Metrics**: request_count, error_count, response_time159 - **Dashboards/Alerts**: High Error Rate > 5%160161162## Agent Directives & Error Recovery163*(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)*164165- **Thinking Process**: Analyze root cause before fixing. Do not brute-force.166- **Fallback Strategy**: Stop after 3 failed test attempts. Output root cause and ask for human intervention/clarification.167- **Self-Review**: Check against Guardrails & Anti-patterns before finalizing.168- **Output Constraints**: Output ONLY the modified code block. Do not explain unless asked.169170171## Definition of Done (DoD) Checklist172173- [ ] Tests passed + coverage met174- [ ] Lint/Typecheck passed175- [ ] Logging/Metrics/Trace implemented176- [ ] Security checks passed177- [ ] Documentation/Changelog updated178- [ ] Accessibility/Performance requirements met (if frontend)179180181## Anti-patterns / Pitfalls182183* ⛔ **Don't**: Log PII, catch-all exception, N+1 queries184* ⚠️ **Watch out for**: Common symptoms and quick fixes185* 💡 **Instead**: Use proper error handling, pagination, and logging186187188## Reference Links & Examples189190* Internal documentation and examples191* Official documentation and best practices192* Community resources and discussions193194195## Versioning & Changelog196197* **Version**: 1.0.0198* **Changelog**:199 - 2026-02-22: Initial version with complete template structure200201---202> Converted and distributed by [TomeVault](https://tomevault.io/claim/amnadtaowsoam) — claim your Tome and manage your conversions.203<!-- tomevault:4.0:skill_md:2026-04-13 -->