△
DMCallv1
Projects
AI Models
Docs
Inventory
Rules
Backup
AI Logs
Rules
/ Coding Standards / Edit
Edit Rule
Rule Info
Title *
Slug
Category
Workflow
Coding
Deployment
Database
Ai Usage
Backup
General
Sort Order
Public (accessible without API key)
Content (Markdown)
Markdown Source
# Coding Standards ## PHP - PHP 7.4+ — use typed properties, arrow functions, null coalescing - Class names: `PascalCase` - Method and variable names: `camelCase` - Constants: `UPPER_SNAKE_CASE` - File names match class names exactly - No inline HTML in PHP business logic — use view files - Escape all output: `htmlspecialchars($val, ENT_QUOTES, 'UTF-8')` - Validate at system boundaries (user input, external APIs), trust internal code ## JavaScript - `'use strict'` at top of files - `camelCase` for variables and functions - Use `const`/`let`, never `var` for new code - No inline event handlers in HTML — use `addEventListener` - Escape data before inserting into the DOM ## MongoDB - Collection prefix: `v1_` (e.g., `v1_projects`) - Always store `created_at` and `updated_at` as `UTCDateTime` - Use slugs as human-readable identifiers alongside `_id` - Upsert on slug when AI writes inventory or project data ## General - Avoid over-engineering — solve the current problem, not hypothetical future ones - Prefer editing existing files over creating new ones - Comment only where logic is non-obvious - No `var_dump` or debug output left in committed code
Preview
Save Changes
Cancel