djd1m/dz-harness/12factor-build-release-run-separation
Claude Code and agent skill by djd1m/dz-harness
- community
Checking that the SKILL.md file is still in the repository.
How a codebase turns into a running deployment: split it into three strictly ordered, one-way stages — BUILD (compile a versioned commit + its dependencies into an artifact), RELEASE (bind that exact build to the current config, stamped with a unique immutable release id), and RUN (just launch the processes against a chosen release). Covers immutable append-only releases, symlink/Capistrano-style rollback, and pushing complexity left into build so run stays boring and safe to trigger unattended…
Install
npx vskill@latest install djd1m/dz-harness/12factor-build-release-run-separationSKILL.md
The same SKILL.md was published earlier as djd1m/dz-harness/12factor-build-release-run-separation.
Build, release, run — structure the deploy lifecycle as three one-way stages
Decision
How should a codebase become a running deployment? Model it as three distinct, ordered, one-directional stages and enforce hard walls between them:
- Build — take the code at one specific committed version, fetch its dependencies, and compile
binaries and assets into a single executable bundle (the build artifact).
- Release — combine that exact build with the deploy's current config to form a release that is
ready to run as-is in the target environment. Every release gets a unique, immutable id.
- Run (runtime) — launch the application's processes against one chosen release.
Code (build) and config (release) meet only at the release stage; the run stage merely executes. The transformation flows one way — you can never push a runtime change back into build.
Protocol
Stage the pipeline.
- Pin a committed version of the code before building — no building from a dirty or moving tree.
- In build: resolve dependencies, compile, bundle assets → one immutable artifact.
- In release: inject the deploy's config into that artifact; emit a new release with a unique id.
Use a timestamp (e.g. 2011-04-06-20:32:17) or a monotonically increasing counter (e.g. v100).
- In run: pick a release and start the processes — nothing more.
Make releases an append-only ledger.
- A release, once cut, is frozen — never edit it in place.
- Any change — new code or new config — must produce a brand-new release, never mutate an old one.
- Because release ids never get reassigned, rollback is trivial: point the runtime back at a known-good
prior release. Tools like Capistrano keep releases in a directory and flip a symlink at the active one, so rollback is an instant symlink swap.
Push complexity left; keep run lean.
- Builds are kicked off deliberately by a developer who is watching, so errors surface in the foreground —
the build stage can afford to be elaborate.
- The run stage can fire on its own (a reboot, a process manager relaunching a crashed worker) at 3 a.m.
with nobody watching — so minimize its moving parts.
- Run-stage checklist: no dependency fetching, no asset compilation, no config resolution
beyond reading a prepared release — just start the processes.
Criteria / litmus table
| Criterion | Passes when | Fails (separation broken) when | |
|---|---|---|---|
| Three stages exist | build → release → run are separate, named steps | build and run blur into one script with no release boundary | |
| One-way flow | a runtime edit has no path back into build | you can hot-patch live code on the server | |
| Config meets code only at release | build has zero secrets/config baked in | config is compiled into the build artifact | |
| Immutable release id | every release has a unique frozen id | you can change what a given release id points to | |
| Trivial rollback | flip to a prior release id/symlink | rollback means re-running the whole pipeline by hand | |
| Lean run stage | run only launches processes | run fetches deps / compiles assets / resolves config |
Anti-patterns
| Anti-pattern | Why it fails | |
|---|---|---|
| Editing code directly on a live server | There is no channel to feed the edit back through build → the change is lost on next deploy and the stages are no longer separated | |
| Mutating an existing release in place | Destroys the audit trail and makes rollback unreliable — the same id now means two different things | |
| Baking config/secrets into the build | Collapses the release-stage injection; one build can no longer be promoted across environments (violates config separation) | |
| Fat run stage (compile/fetch/resolve at launch) | Multiplies the things that can break during an unattended 3 a.m. restart | |
| No release ids, or reusable ids | Rollback and auditing lose their guarantees — you can't say what ran when | |
| Keeping every release forever with no pruning | Immutable releases accumulate; without a retention policy storage bloats |
Related decisions
- 12factor-config-in-environment (Factor III) — the release stage assumes config lives outside the
build; if config is stored in the codebase, the build↔config wall at the release stage collapses.
- 12factor-stateless-processes (Factor VI) — the run stage executes the release as stateless
processes; immutable releases pair with share-nothing runtime.
- 12factor-disposability-fast-startup (Factor IX) — a lean run stage enables the fast startup / graceful shutdown
that lets a crashed process (or a rollback) relaunch instantly.
- 12factor-backing-services-as-resources (Factor IV) — config injected at release time is what points each
release at its attached databases/queues as swappable resources.
Источник
Источник: The Twelve-Factor App — V. Build, release, run, 12factor.net (CC BY 4.0), © the Twelve-Factor authors. Paraphrased and restructured; no verbatim runs. Deep reference: references/knowledge-units.md.
Self-check
- [x] Every step traces to a listed KU (3 KUs: stage-split, immutable-ledger, complexity-left)?
- [x] No verbatim run ≥ 8 words from the source?
- [x] Boundary clause names the sibling factors it is NOT?
- [x] trust_tier 0 (machine-distilled, unreviewed)?
Examples
- «настраиваю деплой — как правильно разложить его на этапы?» → build (собрать артефакт из зафиксированного
коммита + зависимостей) → release (вшить текущий конфиг, выдать уникальный id) → run (просто запустить процессы); правки на живом сервере запрещены — их некуда протолкнуть обратно через build.
- "how do I make rollback reliable?" → give every release a unique, immutable id and never mutate a
release; keep releases as an append-only ledger and flip the active pointer (Capistrano-style symlink) back to a known-good release.
- «почему приложение падает по ночам после рестарта?» → run-стадия слишком тяжёлая; вынеси установку
зависимостей, компиляцию ассетов и разрешение конфига в build, оставь run только запуск процессов.
- "can I just hot-patch the bug on prod?" → no — that breaks build/release/run separation; make a new
commit, cut a new build and a new release, and deploy that.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/skills-12factor/12factor-build-release-run-separation/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/djd1m/dz-harness/12factor-build-release-run-separation)