# File and Code Naming Conventions v1.3.0

## 1. File Naming Rules (Strict)

### Core Rules
* **All Lowercase**: No capital letters are permitted in any filename.
* **No Separators**: Do not use dashes (`-`), underscores (`_`), or double underscores (`__`).
* **Dot Separation**: Use dots (`.`) to separate logical parts of the filename. 
* **Extension Placement**: The final dot must immediately precede the file extension.
* **Allowed Extensions**: `.php`, `.js`, `.json`, `.css`, `.md`

### Examples
* **Good**: 
  * `admin.tool.php` (admin + tool)
  * `audit.tool.php`
  * `bootstrap.core.php` (bootstrap + core)
  * `database.core.php`
  * `header.inc.php`
  * `app.config.json` (app + config)
  * `system.config.json`
  * `main.js`
  * `style.css`
  * `readme.md`
* **Bad**: 
  * `admin_tool.php` (contains underscore)
  * `admin-tool.php` (contains dash)
  * `Admin.Tool.php` (contains uppercase letters)
  * `bootstrap__core.php` (contains double underscore)
  * `my__file.php` (contains double underscore)

### Architectural Benefits of Dots
* **Grouping**: Enables wildcard operations like `*.tool.php`, `*.core.php`, `*.lib.php`, or `*.inc.php`.
* **Searchability**: Files can be searched natively using simple terminal commands like `ls *.tool.php`.
* **System Alignment**: Directly matches application identifier structures (e.g., `games.hangman`).

---

## 2. Code Naming Rules (PHP, JS, HTML)

### Strict camelCase Mandate
* **Functions**: Use `camelCase`. Do not use dots, dashes, or underscores.
  * **Good**: `sysPath()`, `appUrl()`, `authCheck()`, `csrfToken()`, `dbConnect()`
  * **Bad**: `sys.path()`, `sys_path()`, `sys-path()`, `sys__path()`
* **Variables**: Use `camelCase`. Do not use dots, dashes, or underscores.
  * **Good**: `$appId`, `$systemRoot`, `$userId`, `$baseUrl`
  * **Bad**: `$app_id`, `$system_root`, `$app.id`, `$app-id`, `$app__id`
* **Constants**: Use `camelCase` system variables instead of native language constants to eliminate underscores.
  * **Good**: `systemRoot`
  * **Bad**: `SYSTEM_ROOT`

### Structural Restrictons
* **No Custom Double Underscores**: Do not use `__` anywhere in filenames or code identifiers.
* **Rationale**: 
  * Dots in function names are invalid programming syntax (e.g., `sys.path()` causes parse errors in PHP/JS).
  * Underscores and dashes break `camelCase` consistency across the codebase.
  * Custom double underscores create naming conflicts and confusion with language-native magic methods.

---

## 3. Application Identifiers (App IDs)

### Structure & Path Mapping
* **Format**: App IDs must use dots following a `category.name` pattern.
  * **Examples**: `games.hangman`, `tools.auth`
* **Directory Mapping**: App IDs reflect physical directory hierarchies.
  * *Example*: The ID `games.hangman` maps to the physical path `websites/apps/games/hangman`.
* **Modification Policy**: The registry component handles the explicit mapping of IDs to paths. If an application needs to be renamed, **modify the change within the registry configuration only**. Do not rename physical files/folders.

---

## 4. Permitted Exceptions

* **Single-Word Entrypoints**: `index.php` is fully allowed as it is a single word and does not require separation.
* **Server Configurations**: Standard native files like `.htaccess` are allowed, though they should be avoided unless absolutely necessary.
* **System Documentation**: Standard lowercased documentation files like `readme.md` and `changelog.md` are valid exceptions.
* **Language Magic Constants**: Language-defined constants like PHP's `__FILE__` and `__DIR__` are allowed, provided they are not customized or user-defined.

