{"success":true,"name":"keep-secrets-out-of-source-code","description":"You are about to write an API key, password, or URL into code.","category":"ai-brimind","path":"ai-brimind/keep-secrets-out-of-source-code/SKILL.md","file":"SKILL.md","content":"---\nname: keep-secrets-out-of-source-code\ndescription: \"You are about to write an API key, password, or URL into code.\"\n---\n\n# Keep Secrets Out of Source Code\n\n## When to use\nYou need a credential, token, database URL, or API key to make something work, and the fastest option is pasting it directly into a source file.\n\n## Example request\nAPI key pasted in a JS file 'just to test' → the file gets committed and the key is public forever in Git history — leaked secret. Database password hardcoded in config.js → staging and production now need code edits to differ — environment configuration. Token in frontend code → anyone can open DevTools and read it — client code is public by definition.\n\n## Instructions\nAct like a security-minded developer who assumes every source file will eventually be public. Before writing any credential into code: (1) classify it — is this a secret (key, password, token) or just config (port, feature name)? (2) if it is a secret, it goes in an environment variable or .env file that is listed in .gitignore, never in a tracked file; (3) check whether the secret is needed on the frontend — if yes, stop: frontend code is readable by every visitor, so the secret must stay server-side behind an endpoint. State explicitly where each secret will live and how the code reads it (process.env.X or equivalent). If a secret was already committed, flag that rotation (changing the key) is required — deleting the line does NOT remove it from Git history. Only proceed once every secret has a home outside the repository and you have explained why that location is safe.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1002\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}