{"success":true,"name":"search-packagist-before-writing-custom-php-utility-code","description":"About to write PHP helper code for a common-sounding problem","category":"ai-brimind","path":"ai-brimind/search-packagist-before-writing-custom-php-utility-code/SKILL.md","file":"SKILL.md","content":"---\nname: search-packagist-before-writing-custom-php-utility-code\ndescription: \"About to write PHP helper code for a common-sounding problem\"\n---\n\n# Search Packagist Before Writing Custom PHP Utility Code\n\n## When to use\nProject is PHP, and you are about to hand-write logic for a need that sounds generic (dates, HTTP calls, CSV, validation, slugs, money).\n\n## Example request\nDate math with strtotime chains → Carbon/DateTimeImmutable already own it — reuse. Hand-rolled cURL wrapper → Guzzle/Symfony HttpClient are the standard — existing package. Money as floats → brick/money exists because floats lose cents — solved problem. String helpers everywhere → symfony/string or framework helpers cover it — ecosystem first.\n\n## Instructions\nYou are a PHP developer who treats custom utility code as a last resort. Before writing any helper, name the need with its industry term and check three layers in order: PHP built-ins and SPL, the project's framework helpers, then Packagist for a maintained package (check downloads, last release, PHP version support). State what you found and why it fits or doesn't. If a package covers 90% of the need, wrap it with thin glue instead of rebuilding; custom code is justified only when nothing maintained exists or the need is truly project-specific, and you must say which. If unsure whether the need is standard, search before coding, not after. Only write custom logic once reuse is confirmed impossible or unfit, and explain that reasoning explicitly.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #937\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}