Dev Playbook
Conventions

Naming Conventions

Consistent naming across code, files, and infrastructure.

Universal Rules

  1. English only — All code, variables, functions, files, commits, branches, PR titles: English
  2. Be descriptivegetUserById not getUser, isEmailVerified not flag
  3. Be consistent — Pick one term and stick with it. Don't mix user/account/member for the same concept.
  4. No abbreviationsrepository not repo, configuration not config. Exception: universally understood ones (id, url, api, dto, db)

By Language

Element.NET (C#)TypeScript/JSPython
FilesPascalCase.cskebab-case.tssnake_case.py
ClassesPascalCasePascalCasePascalCase
InterfacesIPascalCasePascalCasePascalCase (Protocol)
FunctionsPascalCasecamelCasesnake_case
VariablescamelCasecamelCasesnake_case
ConstantsPascalCaseSCREAMING_SNAKESCREAMING_SNAKE
Private fields_camelCase_camelCase or #field_snake_case
EnumsPascalCasePascalCasePascalCase

Git

ElementConventionExample
Branchtype/kebab-casefeat/user-authentication
Committype: lowercase descriptionfeat: add user login
Tagsemverv1.0.0
PR titleimperative, \< 70 charsAdd course enrollment capacity

Project Structure

ElementConventionExample
Directorieskebab-caseuser-management/
Config fileskebab-case or dot-notation.env, docker-compose.yml
Documentationkebab-case.mdapi-reference.md
Test filesMatch source + test suffixcourse-service.test.ts, test_course_service.py

Database

ElementConventionExample
TablesPascalCase (plural)Courses, EnrollmentRecords
ColumnsPascalCaseCreatedAt, TenantId
Foreign keysFK_Child_ParentFK_Enrollment_Course
IndexesIX_Table_ColumnIX_Courses_TenantId
MigrationsTimestamp_Description20250310_AddCourseTable

API Endpoints

GET    /api/courses              ← List
GET    /api/courses/{id}         ← Get by ID
POST   /api/courses              ← Create
PUT    /api/courses/{id}         ← Full update
PATCH  /api/courses/{id}         ← Partial update
DELETE /api/courses/{id}         ← Delete

# Nested resources
GET    /api/courses/{id}/students
POST   /api/courses/{id}/enroll
  • Plural nouns for resources
  • kebab-case for multi-word: /api/course-categories
  • No verbs in URLs (except actions): /api/courses/{id}/enroll is OK
  • Version prefix if needed: /api/v1/courses

Common Naming Patterns

ConceptPatternExample
Booleanis/has/can/should prefixisActive, hasPermission
Collectionspluralcourses, studentIds
Handlersverb + noun + HandlerCreateCourseHandler
Servicesnoun + ServiceCourseService
Repositoriesnoun + RepositoryCourseRepository
DTOsnoun + Dto/Request/ResponseCourseDto, CreateCourseRequest
Validatorsnoun + ValidatorCreateCourseValidator
Middlewarenoun + MiddlewareTenantMiddleware

On this page