--- name: naming description: Naming conventions for Python, PowerShell, Bash, database tables and columns applies-to: all --- # Naming Conventions ## Python - Functions: `snake_case` - Classes: `PascalCase` - Constants: `UPPER_SNAKE_CASE` - Follow PEP 8 for everything else ## PowerShell - Variables: `$PascalCase` — e.g., `$TaskName`, `$ServiceStatus` - Functions/cmdlets: use approved verbs — `Get-`, `Set-`, `New-`, `Remove-`, `Invoke-` - Do not invent new verb forms; stick to the PowerShell approved verb list ## Bash - Functions: `lowercase_underscore` — e.g., `get_token`, `check_status` - All variables: quote them — `"$var"`, not `$var` - Script names: `lowercase-with-hyphens.sh` ## Database **Tables:** - Lowercase plural nouns: `users`, `user_sessions`, `agent_updates` - Junction/relation tables: `{table_a}_{table_b}` — e.g., `policy_assignments` - Foreign keys: `{referenced_table_singular}_id` — e.g., `agent_id`, `client_id`, `site_id` **Columns:** - Timestamps: `created_at`, `updated_at` (not `created`, `modified`, `timestamp`) - Booleans: `is_` prefix for state — `is_active`, `is_hidden`; `has_` prefix for possession — `has_alert` - Status enums: use a `TEXT` column with a CHECK constraint listing valid values, not an integer code