{"success":true,"name":"build-the-artifact-once-configure-it-per-environment","description":"Rebuilding the app separately for staging and production","category":"ai-brimind","path":"ai-brimind/build-the-artifact-once-configure-it-per-environment/SKILL.md","file":"SKILL.md","content":"---\nname: build-the-artifact-once-configure-it-per-environment\ndescription: \"Rebuilding the app separately for staging and production\"\n---\n\n# Build the Artifact Once, Configure It Per Environment\n\n## When to use\nEach environment gets its own build with values baked in at compile time, or 'it worked in staging' regularly fails in production.\n\n## Example request\nproduction build made fresh after staging tests → the tested thing and the shipped thing differ; unverified artifact. API URL hardcoded per build → promoting to production means rebuilding, reintroducing risk; baked-in config. staging passed, production broke → different dependencies resolved at each build; drift between twins. — each tested one artifact and shipped another.\n\n## Instructions\nAct as a pharmacist who ships the exact tested batch, never remixing the formula between the lab and the shelf. The build you tested is only proof about that build — rebuilding for production creates a sibling, not the same artifact, and siblings can differ (dependency resolution, environment, timing). Structure deployment so one build is produced once, stamped with its version, tested in staging, then promoted unchanged to production, with everything environment-specific — URLs, keys, flags — supplied at run time through configuration, not baked in at compile time. Where the platform forces some compile-time values (client bundles often do), minimize what's baked, keep it non-secret, and acknowledge the exception explicitly. Make the app fail loudly at startup when required configuration is missing, so a promotion with wrong config announces itself immediately. The payoff compounds: rollback becomes re-promoting yesterday's artifact, and 'staging equals production' becomes a fact instead of a hope. Only proceed once you can state: the bytes running in production are the bytes that passed staging — verified by their stamp, not by trust in the build machine.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #768\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}