Community코딩 & 개발github.com

alfathafp/portofolio-web-design

CI/CD 파이프라인 설정을 자동화합니다. 빌드 및 배포 파이프라인을 설정하거나 수정할 때 사용하세요. 품질 게이트를 자동화하고, CI에서 테스트 러너를 구성하거나, 배포 전략을 수립해야 할 때 사용하세요.

portofolio-web-design란 무엇인가요?

이 스킬은 CI/CD(지속적 통합/지속적 배포) 파이프라인을 자동으로 설정하고 관리하는 방법을 제공합니다. 품질 게이트(린트, 타입 검사, 테스트, 빌드)를 자동화하여 모든 변경 사항이 병합되기 전에 엄격한 검증을 통과하도록 보장합니다. GitHub Actions 워크플로우 구성 예제, 데이터베이스 통합 테스트, E2E 테스트 설정, 배포 전략(프리뷰 배포, 기능 플래그, 단계적 롤아웃, 롤백)을 상세히 다루며, CI 최적화 기법과 일반적인 오해에 대한 설명도 포함합니다. 이 스킬은 Claude Code, Cursor, Codex 등 다양한 AI 에이전트 플랫폼에서 사용할 수 있으며, CI 실패 피드백을 에이전트에 전달하여 수정하는 루프를 강조합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/alfathafp/portofolio-web-design/tree/HEAD/.agents/skills/ci-cd-and-automation

Installed? Explore more 코딩 & 개발 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

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

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

문서

CI/CD 및 자동화

개요

품질 게이트를 자동화하여 린트, 테스트, 타입 검사, 빌드를 통과하지 않은 변경 사항이 프로덕션에 도달하지 않도록 합니다. CI/CD는 다른 모든 스킬의 시행 메커니즘입니다. 인간과 에이전트가 놓치는 것을 잡아내며, 모든 변경 사항에 대해 일관되게 수행합니다.

시프트 레프트(Shift Left): 문제를 파이프라인에서 가능한 한 초기에 포착합니다. 린트에서 발견된 버그는 몇 분이면 해결되지만, 프로덕션에서 발견된 동일한 버그는 몇 시간이 걸립니다. 검사를 상류로 이동시키세요 — 정적 분석은 테스트 전에, 테스트는 스테이징 전에, 스테이징은 프로덕션 전에.

더 빠를수록 더 안전합니다: 더 적은 배치와 더 빈번한 릴리스는 위험을 증가시키지 않고 감소시킵니다. 3개의 변경 사항이 포함된 배포는 30개가 포함된 배포보다 디버깅하기 쉽습니다. 빈번한 릴리스는 릴리스 프로세스 자체에 대한 자신감을 키웁니다.

사용 시기

  • 새 프로젝트의 CI 파이프라인 설정
  • 자동화된 검사 추가 또는 수정
  • 배포 파이프라인 구성
  • 변경 사항이 자동화된 검증을 트리거해야 할 때
  • CI 실패 디버깅

품질 게이트 파이프라인

모든 변경 사항은 병합 전에 다음 게이트를 통과합니다:

풀 리퀘스트 열림
    │
    ▼
┌─────────────────┐
│   린트 검사      │  eslint, prettier
│   ↓ 통과         │
│   타입 검사      │  tsc --noEmit
│   ↓ 통과         │
│   단위 테스트    │  jest/vitest
│   ↓ 통과         │
│   빌드           │  npm run build
│   ↓ 통과         │
│   통합 테스트    │  API/DB 테스트
│   ↓ 통과         │
│   E2E (선택)     │  Playwright/Cypress
│   ↓ 통과         │
│   보안 감사      │  npm audit
│   ↓ 통과         │
│   번들 크기      │  bundlesize 검사
└─────────────────┘
    │
    ▼
  리뷰 준비 완료

어떤 게이트도 건너뛸 수 없습니다. 린트가 실패하면 린트를 수정하세요 — 규칙을 비활성화하지 마세요. 테스트가 실패하면 코드를 수정하세요 — 테스트를 건너뛰지 마세요.

GitHub Actions 구성

기본 CI 파이프라인

# .github/workflows/ci.yml
name: CI

on:
  pull_request:
    branches: [main]
  push:
    branches: [main]

jobs:
  quality:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: '22'
          cache: 'npm'

      - name: 의존성 설치
        run: npm ci

      - name: 린트
        run: npm run lint

      - name: 타입 검사
        run: npx tsc --noEmit

      - name: 테스트
        run: npm test -- --coverage

      - name: 빌드
        run: npm run build

      - name: 보안 감사
        run: npm audit --audit-level=high

데이터베이스 통합 테스트 포함

  integration:
    runs-on: ubuntu-latest
    services:
      postgres:
        image: postgres:16
        env:
          POSTGRES_DB: testdb
          POSTGRES_USER: ci_user
          POSTGRES_PASSWORD: ${{ secrets.CI_DB_PASSWORD }}
        ports:
          - 5432:5432
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '22'
          cache: 'npm'
      - run: npm ci
      - name: 마이그레이션 실행
        run: npx prisma migrate deploy
        env:
          DATABASE_URL: postgresql://ci_user:${{ secrets.CI_DB_PASSWORD }}@localhost:5432/testdb
      - name: 통합 테스트
        run: npm run test:integration
        env:
          DATABASE_URL: postgresql://ci_user:${{ secrets.CI_DB_PASSWORD }}@localhost:5432/testdb

참고: CI 전용 테스트 데이터베이스라도 GitHub Secrets를 사용하여 자격 증명을 하드코딩하지 마세요. 이는 좋은 습관을 형성하고 다른 컨텍스트에서 테스트 자격 증명이 실수로 재사용되는 것을 방지합니다.

E2E 테스트

  e2e:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '22'
          cache: 'npm'
      - run: npm ci
      - name: Playwright 설치
        run: npx playwright install --with-deps chromium
      - name: 빌드
        run: npm run build
      - name: E2E 테스트 실행
        run: npx playwright test
      - uses: actions/upload-artifact@v4
        if: failure()
        with:
          name: playwright-report
          path: playwright-report/

CI 실패를 에이전트에 피드백하기

AI 에이전트와 함께 CI의 강점은 피드백 루프에 있습니다. CI가 실패하면:

CI 실패
    │
    ▼
실패 출력 복사
    │
    ▼
에이전트에 전달:
"CI 파이프라인이 다음 오류로 실패했습니다:
[구체적인 오류 붙여넣기]
문제를 수정하고 다시 푸시하기 전에 로컬에서 확인하세요."
    │
    ▼
에이전트 수정 → 푸시 → CI 재실행

주요 패턴:

린트 실패 → 에이전트가 `npm run lint --fix` 실행 후 커밋
타입 오류  → 에이전트가 오류 위치를 읽고 타입 수정
테스트 실패 → 에이전트가 디버깅 및 오류 복구 스킬 따름
빌드 오류 → 에이전트가 설정 및 의존성 확인

배포 전략

프리뷰 배포

모든 PR은 수동 테스트를 위한 프리뷰 배포를 받습니다:

# PR에 프리뷰 배포 (Vercel/Netlify 등)
deploy-preview:
  runs-on: ubuntu-latest
  if: github.event_name == 'pull_request'
  steps:
    - uses: actions/checkout@v4
    - name: 프리뷰 배포
      run: npx vercel --token=${{ secrets.VERCEL_TOKEN }}

기능 플래그

기능 플래그는 배포와 릴리스를 분리합니다. 불완전하거나 위험한 기능을 플래그 뒤에 배포하여 다음을 수행할 수 있습니다:

  • 코드를 활성화하지 않고 배포합니다. 준비가 되면 메인에 병합하고 활성화합니다.
  • 재배포 없이 롤백합니다. 코드를 되돌리는 대신 플래그를 비활성화합니다.
  • 카나리(Canary)로 새 기능을 출시합니다. 사용자 1%에 대해 활성화한 다음 10%, 그다음 100%.
  • A/B 테스트를 실행합니다. 기능 유무에 따른 동작을 비교합니다.
// 간단한 기능 플래그 패턴
if (featureFlags.isEnabled('new-checkout-flow', { userId })) {
  return renderNewCheckout();
}
return renderLegacyCheckout();

플래그 수명 주기: 생성 → 테스트용 활성화 → 카나리 → 전체 출시 → 플래그 및 데드 코드 제거. 영원히 살아있는 플래그는 기술 부채가 됩니다 — 생성할 때 정리 날짜를 설정하세요.

단계적 롤아웃

PR이 main에 병합됨
    │
    ▼
  스테이징 배포 (자동)
    │ 수동 확인
    ▼
  프로덕션 배포 (수동 트리거 또는 스테이징 후 자동)
    │
    ▼
  오류 모니터링 (15분 창)
    │
    ├── 오류 감지됨 → 롤백
    └── 정상 → 완료

롤백 계획

모든 배포는 되돌릴 수 있어야 합니다:

# 수동 롤백 워크플로우
name: Rollback
on:
  workflow_dispatch:
    inputs:
      version:
        description: '롤백할 버전'
        required: true

jobs:
  rollback:
    runs-on: ubuntu-latest
    steps:
      - name: 배포 롤백
        run: |
          # 지정된 이전 버전 배포
          npx vercel rollback ${{ inputs.version }}

환경 관리

.env.example       → 커밋됨 (개발자용 템플릿)
.env                → 커밋되지 않음 (로컬 개발)
.env.test           → 커밋됨 (테스트 환경, 실제 비밀번호 없음)
CI 비밀             → GitHub Secrets / 볼트에 저장
프로덕션 비밀       → 배포 플랫폼 / 볼트에 저장

CI는 절대 프로덕션 비밀을 가져서는 안 됩니다. CI 테스트용으로 별도의 비밀을 사용하세요.

CI를 넘어선 자동화

Dependabot / Renovate

# .github/dependabot.yml
version: 2
updates:
  - package-ecosystem: npm
    directory: /
    schedule:
      interval: weekly
    open-pull-requests-limit: 5

빌드 봇(Build Cop) 역할

CI를 녹색으로 유지하는 책임자를 지정하세요. 빌드가 깨지면 빌드 봇의 임무는 수정하거나 되돌리는 것입니다 — 변경을 초래한 사람이 아닙니다. 이렇게 하면 모두가 다른 누군가가 고칠 것이라고 가정하는 동안 깨진 빌드가 쌓이는 것을 방지합니다.

PR 검사

  • 필수 리뷰: 병합 전 최소 1개의 승인
  • 필수 상태 검사: 병합 전 CI 통과 필수
  • 브랜치 보호: main에 강제 푸시 금지
  • 자동 병합: 모든 검사 통과 및 승인 시 자동 병합

CI 최적화

파이프라인이 10분을 초과하면 다음 전략을 영향 순서대로 적용하세요:

느린 CI 파이프라인?
├── 의존성 캐싱
│   └── node_modules에 actions/cache 또는 setup-node cache 옵션 사용
├── 작업을 병렬로 실행
│   └── 린트, 타입 검사, 테스트, 빌드를 별도의 병렬 작업으로 분할
├── 변경된 부분만 실행
│   └── 경로 필터를 사용하여 관련 없는 작업 건너뛰기 (예: 문서 전용 PR에서 e2e 건너뛰기)
├── 매트릭스 빌드 사용
│   └── 여러 실행기에서 테스트 스위트 샤딩
├── 테스트 스위트 최적화
│   └── 중요 경로에서 느린 테스트 제거하고, 대신 일정에 따라 실행
└── 더 큰 실행기 사용
    └── CPU 집약적 빌드에 GitHub 호스팅 대형 실행기 또는 자체 호스팅 실행기 사용

예: 캐싱 및 병렬 처리

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: '22', cache: 'npm' }
      - run: npm ci
      - run: npm run lint

  typecheck:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: '22', cache: 'npm' }
      - run: npm ci
      - run: npx tsc --noEmit

  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: '22', cache: 'npm' }
      - run: npm ci
      - run: npm test -- --coverage

일반적인 합리화

합리화현실
"CI가 너무 느리다"파이프라인을 최적화하세요(아래 CI 최적화 참조), 건너뛰지 마세요. 5분 파이프라인이 몇 시간의 디버깅을 방지합니다.
"이 변경은 사소하니 CI를 건너뛰자"사소한 변경이 빌드를 깨뜨립니다. 어차피 사소한 변경에 CI는 빠릅니다.
"테스트가 불안정하니 다시 실행하자"불안정한 테스트는 실제 버그를 가리고 모두의 시간을 낭비합니다. 불안정성을 고치세요.
"나중에 CI를 추가하겠다"CI가 없는 프로젝트는 깨진 상태가 축적됩니다. 첫날부터 설정하세요.
"수동 테스트로 충분하다"수동 테스트는 확장되지 않고 반복 가능하지 않습니다. 할 수 있는 것을 자동화하세요.

위험 신호

  • 프로젝트에 CI 파이프라인 없음
  • CI 실패 무시 또는 침묵
  • 파이프라인 통과를 위해 CI에서 테스트 비활성화됨
  • 스테이징 확인 없이 프로덕션 배포
  • 롤백 메커니즘 없음
  • 코드 또는 CI 설정 파일에 비밀 저장 (비밀 관리자 아님)
  • 최적화 노력 없이 긴 CI 시간

확인

CI를 설정하거나 수정한 후:

  • 모든 품질 게이트가 존재함 (린트, 타입, 테스트, 빌드, 감사)
  • 모든 PR 및 main에 푸시 시 파이프라인 실행됨
  • 실패 시 병합 차단 (브랜치 보호 구성됨)
  • CI 결과가 개발 루프로 다시 피드백됨
  • 비밀은 코드가 아닌 비밀 관리자에 저장됨
  • 배포에 롤백 메커니즘이 있음
  • 테스트 스위트에 대해 파이프라인이 10분 미만으로 실행됨

Individual skills in this repo

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

alfathafp/portofolio-web-design

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).

alfathafp/portofolio-web-design

Tests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be configured.

alfathafp/portofolio-web-design

Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch. Use when asked to review a diff or a pull request, even when the diff is pasted inline.

alfathafp/portofolio-web-design

Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

alfathafp/portofolio-web-design

Establishes a project's quality bar as a written contract and stops agents quietly lowering it. Interviews the user on which dimensions matter, supplies sane default thresholds when they have no number in mind, records everything in CONSTRAINTS.md, and watches the diff for a weakened bar — new @ts-ignore or eslint-disable suppressions, skipped or deleted tests, assertions stripped out, unimplemented stubs, thresholds edited down. Use when no quality bar is written down, when the user says "set up constraints" or "define our standards", when the user wants dimensions they care about — accessibility, web performance, coverage — set up as enforced constraints, when an agent keeps silencing checks or skipping tests to get to green, when you need a coverage or performance threshold and don't know what number to pick, or when an agent writes more code than anyone will read.

alfathafp/portofolio-web-design

Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching between tasks, or when you need to configure rules files and context for a project.

alfathafp/portofolio-web-design

Guides systematic root-cause debugging. Use when tests fail, builds break, something that worked yesterday broke, behavior doesn't match expectations, or you encounter any unexpected error. Use when you need to figure out what broke and why — a systematic approach to finding and fixing the root cause rather than guessing.

alfathafp/portofolio-web-design

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

alfathafp/portofolio-web-design

Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.

alfathafp/portofolio-web-design

Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.

alfathafp/portofolio-web-design

Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

alfathafp/portofolio-web-design

Records decisions and documentation. Use when you need to document an architecture decision (ADR) or the reasoning behind a design choice, when changing public APIs, shipping features, or when you need to record context that future engineers and agents will need to understand the codebase.

alfathafp/portofolio-web-design

Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when you want every assumption cross-examined before proceeding, when stress-testing a plan for hidden failure modes, when correctness matters more than speed, when working in unfamiliar code, when stakes are high (production auth, security-sensitive logic, a high-stakes migration, irreversible operations), or any time a confident output would be cheaper to verify now than to debug later.

alfathafp/portofolio-web-design

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

alfathafp/portofolio-web-design

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

alfathafp/portofolio-web-design

Builds production-quality, accessible, responsive user-facing UIs. Use when building or modifying interfaces and pages, creating components, implementing layouts, meeting WCAG accessibility requirements, managing state, or when the output needs to look and feel production-quality rather than AI-generated.

alfathafp/portofolio-web-design

Structures git workflow practices. Use when making any code change. Use when committing, branching, resolving conflicts, splitting uncommitted work in a messy working tree into clean atomic commits, opening or reviewing a pull request (PR), pushing to a remote, or when you need to organize work across multiple parallel streams. Use when cutting a release, choosing a semantic version bump, tagging, or writing a changelog.

alfathafp/portofolio-web-design

Refines raw ideas into sharp, actionable concepts through structured divergent and convergent thinking. Use when an idea is still vague, when you need to stress-test assumptions before committing to a plan, or when you want to expand options before converging on one. Triggers on "ideate", "refine this idea", or "stress-test my plan".

alfathafp/portofolio-web-design

Delivers changes incrementally in thin, verifiable slices. Use when implementing any feature or change that touches more than one file, or when picking up the next task from a plan. Use when rolling a change out behind a feature flag, when you're about to write a large amount of code at once, or when a task feels too big to land in one step.

alfathafp/portofolio-web-design

Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.

관련 스킬