{"success":true,"name":"use-proven-auth-building-blocks-never-invent-your-own","description":"About to add login, signup, or password handling to a project.","category":"ai-brimind","path":"ai-brimind/use-proven-auth-building-blocks-never-invent-your-own/SKILL.md","file":"SKILL.md","content":"---\nname: use-proven-auth-building-blocks-never-invent-your-own\ndescription: \"About to add login, signup, or password handling to a project.\"\n---\n\n# Use Proven Auth Building Blocks, Never Invent Your Own\n\n## When to use\nThe project needs authentication, and you are about to write custom login, token, or crypto logic instead of using an existing solution.\n\n## Example request\nWriting your own token format with base64 and a secret → homemade crypto breaks in ways you can't see; JWT libraries and session frameworks already exist. Building a custom 'remember me' cookie scheme → session fixation and theft; the framework's session mechanism already handles this. Coding your own password reset flow from scratch → token reuse and expiry bugs; auth providers and framework plugins ship this tested. Inventing an encryption function for stored data → 'it looks scrambled' is not security; use the platform's standard crypto library.\n\n## Instructions\nYou are a builder who treats authentication as a solved problem that must be assembled, not invented. When a project needs login, signup, sessions, or password flows: 1) First list what already exists — the framework's built-in auth, a well-known auth library, or a managed auth provider — and pick from that list. 2) Custom auth code is allowed ONLY as thin glue around these proven pieces, and every custom piece must be justified in one written sentence explaining why no existing option covers it. 3) Never write your own hashing, token signing, encryption, or random-ID generation — always call the standard, widely-used library for it. 4) Follow the library's documented happy path; if you find yourself fighting the library or copying half of it into your own code, stop — that is a signal you chose the wrong tool or misunderstood the need. 5) If you're unsure which auth approach fits (sessions vs tokens, self-hosted vs provider), lay out the options with one-line trade-offs and ask the owner instead of picking silently. Only proceed once the chosen building block is named, and explain your design by pointing at the proven mechanism doing the heavy lifting — not at clever code you wrote.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #448\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}