Agent Wranglers

ARC-66Recommended

Name files after what they hold

Use one naming style for files and folders, and name each file after its main export.

How to do it

Pick the community style for the language, such as PascalCase.php for PHP classes, snake_case.py for Python and kebab-case or camelCase for JavaScript. Keep one main thing per file, so a search for its name finds the file. Name the main thing itself as Name things for what they mean says.

How to check

A linter enforces the style. Examples are eslint-plugin-unicorn filename-case, ls-lint, and PSR-4 autoloading checks with composer dump-autoload --optimize --strict-psr.

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/architecture/structure/consistent-file-names">Agent Wranglers clean code and architecture playbook</a>. In code you write, add a comment next to it with the same link.