Communitygithub.com

회복성 및 배포 안전

배포 계획, 롤백 설계, 인시던트 대응 또는 포스트모템 작성 시 사용합니다. 키워드 — 배포 안전, 롤백, 불변 아티팩트, 점진적 제공, 카나리, 블래스트 반경, 인시던트 대응, 무결점 포스트모템, 에러 예산.

회복성 및 배포 안전란 무엇인가요?

이 스킬은 소프트웨어 시스템의 회복성과 배포 안전성을 확보하기 위한 원칙과 실천 방법을 제공합니다. 핵심 철학은 '모든 실패를 예방하는 것'이 아니라 '작게 실패하고, 빠르게 복구하며, 매번 배우는 것'입니다. CI에서 단 한 번 빌드된 불변 아티팩트를 콘텐츠 다이제스트로 식별하여 스테이징, 프로덕션으로 승격시키며, 태그가 아닌 다이제스트를 기준으로 검증 및 롤백을 수행합니다. 또한 점진적 배포(카나리), 확장/축소 패턴을 통한 스키마 변경, 배포 전 체크리스트, 인시던트 대응 절차, 무결점 포스트모템, 에러 예산 기반 의사결정 등을 포함합니다. Claude Code, Cursor, Codex 등 다양한 AI 에이전트 플랫폼에서 활용 가능하며, 프로젝트의 전달 스킬과 함께 구성할 수 있습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/lguidolin/agent-skills/tree/main/skills/resilience-and-deploy-safety

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

회복성 및 배포 안전은(는) 무엇을 하나요?

개요

문제는 발생합니다. 우리의 자세는 '모든 실패를 예방하는 것'이 아니라 작게 실패하고, 빠르게 복구하며, 매번 배우는 것입니다. 신뢰성은 실패가 없는 상태가 아니라, 실패가 발생했을 때 블래스트 반경이 제한되고 복구 시간이 짧은 상태를 의미합니다.

배포 안전 — 모든 배포는 롤백 가능하고 점진적으로 노출되어야 함

  • 아티팩트는 불변이며 승격(promote)되며, 다시 빌드되지 않습니다. CI에서 한 번 빌드된 단일 이미지는 콘텐츠 다이제스트로 식별되어 프리뷰 → 스테이징 → 프로덕션으로 변경되지 않은 상태로 이동합니다. 환경마다 다시 빌드하는 것은 테스트하지 않은 것을 배포하는 것입니다.
  • 태그는 가변 포인터이며, 다이제스트가 정체성입니다. 태그는 덮어쓰여질 수 있으며 조용히 다른 곳을 가리킬 수 있습니다. 콘텐츠 다이제스트는 그렇지 않습니다. 각 환경은 자신이 검증한 다이제스트를 기록하며, 프로덕션은 하위 환경에서 검증된 다이제스트만 실행합니다. 따라서 '우리가 테스트한 바로 그 것'은 누군가가 기억해야 하는 규율이 아니라 파이프라인이 강제하는 속성입니다.
  • 프로덕션 배포 전에는 사람의 결정이 필요합니다. 단일 관리자의 경우 이는 의도적인 일시 중지와 감사 기록이지, 직무 분리가 아닙니다. 어떤 경우인지 명시하고, 과장하지 마십시오.
  • 실행 중인 버전은 배포 시점에 주입되며, 이미지에 빌드되어서는 안 됩니다. 빌드 인자로 빌드된 버전은 릴리스 스탬프를 찍기 위해 재빌드를 강제하며, 재빌드는 바로 승격이 피하고자 하는 것입니다.
  • 인프라가 별도 리포지토리에 있을 때는 확장/축소(expand/contract) 방식으로 조정합니다. 인프라가 먼저 확장(추가적, 하위 호환)되고, 이후 배포에서 애플리케이션이 새로운 기능을 사용하며, 더 이상 라이브 아티팩트가 예전 구조에 의존하지 않을 때만 인프라가 축소됩니다. 이는 스키마 변경과 동일한 규율입니다(zero-downtime-migrations 참조). 불변 조건: 아직 활성화되지 않은 인프라 변경을 필요로 하는 애플리케이션 아티팩트를 절대 배포하지 마십시오. 이 조건이 지켜지면 각 리포지토리는 독립적으로 롤백 가능하며, 이것이 두 리포지토리가 동기화되지 않았을 때 롤백을 처리 가능하게 만듭니다.
  • 롤백할 수 있을 때만 롤포워드(roll forward)하십시오. 위험한 변경을 배포하기 전에 롤백 경로가 존재하고 테스트되어 있어야 합니다. "이것을 어떻게 되돌릴까?" 라는 질문은 인시던트 중이 아니라 계획 단계에서 답해야 합니다.
  • 롤백은 이전에 정상이었던 다이제스트를 재배포하는 것입니다. 해당 다이제스트는 여전히 레지스트리에 있고 불변이므로, 롤백은 역방향 승격입니다. 절대 재빌드가 아니며, "예전 그대로" 재빌드하는 것도 아닙니다.
  • 점진적 노출. 새 버전은 점진적으로(헬스 게이트 롤아웃, 지원되는 경우 카나리) 사용자에게 도달하므로, 잘못된 릴리스가 모든 사람이 아닌 일부에게만 피해를 줍니다.
  • 스키마 변경은 코드 배포와 분리되며 확장/축소 방식을 따릅니다(zero-downtime-migrations 참조). 배포는 절대 동시에 파괴적인 마이그레이션을 필요로 해서는 안 됩니다.
  • 배포 준비 체크리스트가 프로덕션 게이트 역할을 합니다: 관찰 가능성 확보, 롤백 검증, 마이그레이션 확장 안전 확인, SLO 위반 없음.

인시던트 대응 — 실패는 학습 입력

  • 심각도에 따라 분류하고 비례적으로 대응하며, 적절한 사람을 참여시킬 수 있는 알려진 경로를 확보하십시오.
  • 모든 사용자 대상 인시던트에 대해 무결점 포스트모템을 작성하십시오. 작성된 타임라인, 기여 원인(시스템적, 개인적이 아닌), 구체적인 행동 항목을 포함합니다. 질문은 "시스템의 어떤 부분이 이를 허용했는가"이지, "누가 잘못했는가"가 아닙니다.
  • 행동 항목은 추적되며 잊히지 않습니다. 향후 고려 사항 문서(recording-decisions 참조)로 이어져 실제 작업이 됩니다.
  • 에러 예산이 의사결정을 지배합니다. 신뢰성이 소진되었을 때는 예산이 회복될 때까지 신뢰성 작업이 기능 작업보다 우선합니다.

빠른 참조

위험한 배포 전확인 사항
아티팩트CI에서 한 번 빌드되고 다이제스트로 승격됨, 스테이징이 검증한 동일 아티팩트
게이트프로덕션 전에 기록된 사람의 결정
롤백경로가 존재하고 테스트됨
노출점진적/카나리, 한 번에 전체 아님
스키마확장 안전, 코드 배포와 분리
관찰 가능성문제가 발생 중인지 알 수 있는가?

이 규모를 언제 적용할 것인가

로컬/출시 전 프로젝트는 지금 이 규칙을 작성하고, 첫 번째 실제 사용자와 함께 활성화합니다. 이러한 속성은 이식 가능합니다(한 번 빌드, 테스트한 것을 승격, 프로덕션 전에 결정, 롤백 가능) — 그러나 메커니즘은 그렇지 않습니다. 다이제스트 승격은 컨테이너 호스트에서 의미가 있지만 정적 사이트에서는 대부분 무의미하며, 관리형 플랫폼은 프리뷰 환경과 즉각적인 롤백을 무료로 제공할 수 있습니다. 프로젝트의 전달 스킬에 메커니즘을 명시하고, 속성은 여기에 유지하십시오. 스택 메커니즘(k8s 프로브, 카나리, PR별 환경): cloud-delivery-aks.

전체 근거: engineering-constitution/references/engineering-constitution.md에 번들된 헌법 제12조.

Individual skills in this repo

This repo contains 18 individual skills — each has its own dedicated page.

lguidolin/change-hygiene-and-code-craft

Use when writing or refactoring code, structuring a commit or PR, or deciding whether to abstract duplication. Symptoms — mixing reorg with logic changes, a PR doing several things at once, a file growing large, the second copy of similar code, or unsure whether to DRY something up.

lguidolin/cloud-delivery-aks

Use when deploying to Kubernetes or Azure Kubernetes Service (AKS), configuring cloud secrets, setting up progressive rollout/canary, per-PR ephemeral environments, or k8s health probes. Keywords — Kubernetes, AKS, Key Vault, Argo Rollouts, Flagger, canary, blue-green, liveness, readiness, PodDisruptionBudget, HPA, rollback, GHCR.

lguidolin/commit-history-rewrite

Use when an existing repository has messy commit history that needs to conform to conventional commits before adopting release-please, or when intermediate WIP/fixup/merge commits need to be cleaned up.

lguidolin/conventional-commits-and-releases

Use when committing, writing a commit message, opening a PR that will be squash-merged, or configuring automated versioning/changelogs. Keywords — conventional commits, release-please, semver, feat/fix/chore, breaking change, changelog.

lguidolin/defense-in-depth-security

Use when handling untrusted input, secrets, authentication/authorization, or dependencies — or threat-modeling a new surface. Keywords — STRIDE, threat model, least privilege, secrets management, supply chain, dependency scanning, input validation, audit log, defense in depth.

lguidolin/designing-before-building

Use when starting a feature, fixing a non-trivial bug, or about to write implementation code — before any code exists. Symptoms you need this: "this is simple, I'll just code it", reaching for the editor before a design is approved, or an idea that hasn't been turned into a spec and plan.

lguidolin/engineering-constitution

Use when starting work in a project that follows the engineering constitution, orienting to its rules, or deciding which engineering practice applies to a task — spec writing, commits, testing, security, deploys, database, or UI work.

lguidolin/graphql-contract-testing

Use when writing a GraphQL query/mutation that the UI and a test will share, or building route/schema contract or smoke tests. Symptoms — copying a query into a test, a test asserting on query text, schema change that didn't break the UI build, or RLS/permission drift. Keywords — graphql-codegen, typed document, contract test, route smoke test.

lguidolin/init-repo-CI

Use when setting up a new repository with conventional commits, release-please, and CI automation, or when retrofitting an existing repository that lacks automated versioning and PR validation workflows.

lguidolin/interface-craft-and-accessibility

Use when building or styling UI — components, layouts, forms, design tokens — or making accessibility decisions. Keywords — a11y, WCAG, keyboard navigation, focus state, contrast, design system, minimalist UI, component reuse, ARIA, semantic HTML.

lguidolin/merge-gates-and-automation

Use when setting up or changing CI, pre-push hooks, or a task runner, or deciding what must pass before merge. Symptoms — tempted to put authoritative checks only in a local hook, skip CI, bypass with --no-verify, or unsure what gates a merge vs. runs locally.

lguidolin/observability-and-slos

Use when adding logging, metrics, tracing, health checks, SLOs, or alerting — or when building a service surface that needs to be operable and debuggable. Keywords — structured logs, OpenTelemetry, correlation id, RED metrics, liveness, readiness, SLI, SLO, error budget, alerting.

lguidolin/performance-and-scale

Use when working on hot paths, list endpoints, pagination, data-access in loops, or public interfaces/schemas. Symptoms — unbounded queries, N+1 access, no latency budget, optimizing without measuring, or changing an interface many consumers depend on. Keywords — pagination, N+1, Hyrum's Law, performance budget, bundle size.

lguidolin/postgres-postgraphile-rls-and-sql

Use when writing PostgreSQL, PostGraphile config, Row-Level Security policies, SQL schema files, or working on the Browser→App→PostGraphile→Postgres data path. Keywords — RLS, SECURITY DEFINER, search_path, pgSettings, grants, roles, GraphQL depth limit, query cost, statement_timeout, SQL file organization.

lguidolin/recording-decisions

Use when a design or architecture decision has been made and needs to be captured — writing a decision record or ADR, updating a decision index, noting a deferred idea, or superseding a past decision. Keywords — ADR, decision record, rationale, rejected alternatives, dependency index.

lguidolin/ship-it

Use when the user wants to ship work — push, PR, archive decision records, merge, and clean up. Handles the full lifecycle from committing final changes through post-merge cleanup including converting specs/plans to compact decision records.

lguidolin/tests-as-a-control

Use when writing or modifying tests, when a test breaks during a refactor, or when testing permission/role rules. Symptoms — tempted to edit a test to make it pass, testing only the happy path, a deny-test that started passing, flaky tests, or unsure what to assert.

lguidolin/zero-downtime-migrations

Use when changing a database schema where data must survive the change — adding/removing/renaming columns, constraints, indexes, or backfilling. Symptoms — a destructive migration bundled with a code deploy, a NOT NULL column with a backfill, a table-locking UPDATE, or a rename. Keywords — expand/contract, parallel change, backfill, NOT VALID, CREATE INDEX CONCURRENTLY, graphile-migrate.

관련 스킬