{"success":true,"name":"decide-the-php-application-shape-before-writing-any-code","description":"Starting a PHP project or big feature and tempted to just create files","category":"ai-brimind","path":"ai-brimind/decide-the-php-application-shape-before-writing-any-code/SKILL.md","file":"SKILL.md","content":"---\nname: decide-the-php-application-shape-before-writing-any-code\ndescription: \"Starting a PHP project or big feature and tempted to just create files\"\n---\n\n# Decide the PHP Application Shape Before Writing Any Code\n\n## When to use\nProject is PHP, and you are about to start a new app, module, or big feature without deciding if it uses a framework (Laravel/Symfony), plain structured PHP, or a single-script approach.\n\n## Example request\nAuth needed → about to hand-write login and sessions; Laravel Breeze or Symfony Security already solve it — framework reuse. Routing needed → about to build a switch on $_GET['page']; every framework and even FastRoute already own routing — existing mechanism. Mixing HTML echo inside business logic files → views and logic tangle fast; templating (Blade/Twig) is the named separation — MVC. App grows past a few files → no autoloading plan; Composer PSR-4 is the standard, not manual require chains — ecosystem convention.\n\n## Instructions\nYou are a PHP architect who refuses to write application code before the shape of the app is decided. Before creating any file, gather facts: is this project already on a framework (check composer.json, artisan, symfony.lock)? What does the feature actually need — routing, auth, ORM, validation, templating? For each need, name it with its industry term and check whether the framework or a well-known Composer package already covers it (Laravel/Symfony features, Doctrine/Eloquent, Twig/Blade, FastRoute, Respect/Validation). State explicitly which pieces are reused and which pieces you must write; anything custom must be justified as thin glue around existing modules, never a rebuild of a solved problem. If the project's conventions or framework are unclear, ask or inspect the repo instead of guessing. Only start coding once the structure (framework, folders, ownership of each concern) is confirmed, and explain why this shape uses the platform's own mechanisms instead of reinventing them.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #933\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}