twelve-factor
БесплатноБез исполняемых скриптовНе проверенWHEN configuring, auditing, or refactoring deployable service or app operational boundaries—deploy-time configuration and secrets, backing services, process…
от mintuz★ 38 звёзд на GitHubОб этом скилле
Twelve-Factor Operational Discipline
Apply the twelve factors to match the target runtime. Run the Platform Applicability Gate before recommending or editing any code. Never enforce server-only rules (such as port binding, OS signal handlers, or banning local persistence) on runtimes where the platform contract forbids or replaces them.
Platform Applicability Gate
Identify the deployable runtime first and follow the column that matches it. In every audit or plan, state the applicability status (Full, Adapt, or N/A) and platform reason for each affected factor explicitly, and apply the concrete runtime APIs and constraints from the matching reference file rather than leaving guidance abstract.
| Factor | Backend services (containers / VMs / PaaS) | Edge / Serverless (Workers / Lambda) | Static web frontends / SPAs | Client-side iOS apps |
|---|---|---|---|---|
| I. Codebase | Full | Full | Full | Full |
| II. Dependencies | Full | Full | Full | Full (manifests + lockfiles) |
| III. Config | Full (runtime env / secret injection) | Adapt (platform bindings & secrets) | Adapt (public build-time config only; zero secrets) | Adapt (non-secret build config + Keychain + backend secrets; #if DEBUG only at composition root) |
| IV. Backing services | Full | Adapt (platform resource bindings) | Adapt (remote API endpoints) | Adapt (remote APIs + explicit local stores) |
| V. Build, release, run | Full (one immutable build artefact) | Full (immutable deploy bundle) | Adapt (build-time public config contract) | Adapt (signed immutable app bundle; versioned releases) |
| VI. Stateless processes | Full (zero in-memory / local-disk shared state) | Full (zero cross-invocation memory or /tmp state) |
N/A (stateful browser client) | N/A (stateful single-user client; never ban local persistence) |
| VII. Port binding | Full | N/A (platform owns sockets) | N/A (CDN / static host) | N/A (client UI / extensions) |
| VIII. Concurrency | Full (separate process types) | Adapt (isolate scaling + queues + cron) | N/A (browser runtime) | N/A (OS lifecycle + structured concurrency) |
| IX. Disposability | Full (SIGTERM/SIGINT drain + probes + idempotent jobs) |
Adapt (fast cold start + execution limits + idempotent handlers; no SIGTERM) |
Adapt (abort in-flight requests; handle tab close/offline) | Adapt (fast launch + crash-safe recovery journal + background-task expiration + .task cancellation; no SIGTERM or /health) |
| X. Dev/prod parity | Full | Adapt (local emulator + staging parity) | Adapt (production build & browser parity) | Adapt (physical-device Release parity; simulator is insufficient) |
| XI. Logs | Full (structured records to process streams + request correlation) | Adapt (structured records to platform-captured streams + request correlation) | Adapt (redacted telemetry; no secrets/PII) | Adapt (OS unified logging with explicit privacy masks; never stdout JSON or log files) |
| XII. Admin processes | Full (one-off repo scripts with same release & config) | Adapt (one-off CI/CD or admin job outside hot request path) | N/A | Adapt (versioned in-app schema migrations; no server shell) |
Adoption Order
- Greenfield: Run the Platform Applicability Gate, then apply every factor marked Full or Adapt from the first deployable slice.
- Brownfield: Adopt changes incrementally in risk order so live services stabilise without a rewrite:
- Config (Factor III) — centralise and validate deploy-varying settings with no domain restructure.
- Logs (Factor XI) — switch to structured, correlated platform-stream logs.
- Disposability (Factor IX) — add graceful shutdown, drain timeouts, probes, and idempotent retries (or client crash-safe recovery).
- Backing services (Factor IV) — inject resource bindings at the composition root.
- Stateless processes (Factor VI) — move in-memory or local-disk runtime state to external backing services (backend and edge only).
Factor Rules
I. Codebase
Track one deployable unit in revision control and produce many deploys from it. A monorepo is valid when each deployable service owns its entry point, deploy pipeline, and backing-service connections. Share code through owned packages or modules, never by copy-paste.
II. Dependencies
Declare every dependency explicitly in the project manifest and commit the lockfile. Isolate dependencies from global host packages. Treat external command-line tools invoked as subprocesses as explicit runtime dependencies: document them, constrain versions where practical, and verify availability at build or startup.
III. Config
Store deploy-varying configuration outside the build artefact via the runtime's supported injection mechanism. Never hardcode credentials or environment-specific endpoints. Never ship third-party API secrets inside client web bundles or mobile application packages.
Enforce every rule b
Установить twelve-factor в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл twelve-factor?
WHEN configuring, auditing, or refactoring deployable service or app operational boundaries—deploy-time configuration and secrets, backing services, process startup and graceful shutdown, structured logging, dev/prod parity, or one-off admin tasks; NOT for pure UI styling, internal logic refactoring, or domain design with no deployment or operational boundary; applies the twelve factors through an upfront platform applicability gate so server-only rules never misapply to edge functions or client apps.
Как установить скилл twelve-factor?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл twelve-factor запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic