---
title: "Name files after what they hold · Agent Wranglers"
url: https://agentwranglers.se/playbook/architecture/structure/consistent-file-names
updated: 2026-10-20
licence: "All rights reserved"
---

# Name files after what they hold

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [Structure](https://agentwranglers.se/playbook/architecture/structure)
- Rule: Use one naming style for files and folders, and name each file after its main export.
- How: 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.
- 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:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers architecture playbook: https://agentwranglers.se/playbook/architecture/structure/consistent-file-names`.

- Previous: [Group code by feature](https://agentwranglers.se/playbook/architecture/structure/group-by-feature)
- Next: [Format all code with one tool](https://agentwranglers.se/playbook/architecture/structure/one-formatter)
- [Structure](https://agentwranglers.se/playbook/architecture/structure)
