From e007933840b2d6b559d30b8e61590b58ff8d75f5 Mon Sep 17 00:00:00 2001 From: keito4 Date: Fri, 2 Jan 2026 20:48:52 +0900 Subject: [PATCH] feat: Add setup-ci command for comprehensive CI/CD setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add /setup-ci command with project type auto-detection - Support Next.js, Node.js, Terraform, and Monorepo projects - Provide three CI levels: minimal, standard, comprehensive - Include gap analysis comparing current vs recommended configuration - Add workflow templates for quality gates, testing, security, and E2E ๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .claude/commands/README.md | 27 ++ .claude/commands/setup-ci.md | 689 +++++++++++++++++++++++++++++++++++ 2 files changed, 716 insertions(+) create mode 100644 .claude/commands/setup-ci.md diff --git a/.claude/commands/README.md b/.claude/commands/README.md index fad4d9e6..b3499a0e 100644 --- a/.claude/commands/README.md +++ b/.claude/commands/README.md @@ -146,6 +146,33 @@ This directory contains pre-configured commands that provide automated workflows - Code quality gate enforcement - Development workflow integration +#### `setup-ci.md` + +**Purpose**: Setup comprehensive CI/CD workflows for your repository +**Features**: + +- Project type auto-detection (Next.js, Node.js, Terraform, Monorepo) +- Gap analysis comparing current vs recommended CI configuration +- Multi-level setup (minimal, standard, comprehensive) +- Security scanning, E2E tests, and Claude Code Review integration + +**Usage**: + +``` +/setup-ci # Auto-detect and recommend +/setup-ci --type nextjs # Specify project type +/setup-ci --level comprehensive # Full CI/CD setup +/setup-ci --dry-run # Preview changes only +``` + +**Levels**: + +| Level | Features | +| ------------- | --------------------------------------------------- | +| minimal | Lint + Build | +| standard | Lint + Test + Build + Security Audit | +| comprehensive | All + E2E + CodeQL + Claude Review + Scheduled Scan | + #### `container-health.md` **Purpose**: Verify DevContainer environment health and configuration diff --git a/.claude/commands/setup-ci.md b/.claude/commands/setup-ci.md new file mode 100644 index 00000000..d5326c93 --- /dev/null +++ b/.claude/commands/setup-ci.md @@ -0,0 +1,689 @@ +--- +description: Setup comprehensive CI/CD workflows for your repository +allowed-tools: Read, Write, Edit, Bash(git:*), Bash(gh:*), Bash(npm:*), Bash(pnpm:*), Bash(node:*), Bash(ls:*), Bash(cat:*), Bash(find:*), Bash(test:*), Bash(mkdir:*), Task, Glob, Grep +argument-hint: [--type nextjs|nodejs|terraform|monorepo] [--level minimal|standard|comprehensive] [--dry-run] +--- + +# CI/CD Setup Command + +ใƒชใƒใ‚ธใƒˆใƒชใซ้ฉๅˆ‡ใชCI/CDใƒฏใƒผใ‚ฏใƒ•ใƒญใƒผใ‚’ใ‚ปใƒƒใƒˆใ‚ขใƒƒใƒ—ใ—ใพใ™ใ€‚ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆใ‚ฟใ‚คใƒ—ใ‚’่‡ชๅ‹•ๆคœๅ‡บใ—ใ€ๆŽจๅฅจใƒฏใƒผใ‚ฏใƒ•ใƒญใƒผใ‚’ๆๆกˆใƒป้ฉ็”จใ—ใพใ™ใ€‚ + +## Overview + +ไปฅไธ‹ใฎCI/CDใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใ‚’่จญๅฎšใ—ใพใ™๏ผš + +1. **Quality Gates** - Lint, Format, Type Check +2. **Testing** - Unit Test, Coverage, E2E +3. **Security** - Audit, SAST, License Check +4. **Build & Deploy** - Build, Staging, Production +5. **AI Integration** - Claude Code Review + +## Step 1: Parse Arguments + +ๅผ•ๆ•ฐใ‹ใ‚‰่จญๅฎšใ‚’่ชญใฟๅ–ใ‚‹๏ผš + +- `--type TYPE`: ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆใ‚ฟใ‚คใƒ—๏ผˆ่‡ชๅ‹•ๆคœๅ‡บๅฏ่ƒฝ๏ผ‰ + - `nextjs`: Next.js ใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณ + - `nodejs`: Node.js ใƒ‘ใƒƒใ‚ฑใƒผใ‚ธ/ใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณ + - `terraform`: Terraform ใ‚คใƒณใƒ•ใƒฉ + - `monorepo`: ใƒขใƒŽใƒฌใƒๆง‹ๆˆ +- `--level LEVEL`: CI ใƒฌใƒ™ใƒซ๏ผˆใƒ‡ใƒ•ใ‚ฉใƒซใƒˆ: `standard`๏ผ‰ + - `minimal`: ๆœ€ๅฐ้™๏ผˆLint + Build๏ผ‰ + - `standard`: ๆจ™ๆบ–๏ผˆLint + Test + Build + Security๏ผ‰ + - `comprehensive`: ๅŒ…ๆ‹ฌ็š„๏ผˆๅ…จๆฉŸ่ƒฝ + E2E + Deploy๏ผ‰ +- `--dry-run`: ๅค‰ๆ›ดใ‚’้ฉ็”จใ›ใšใ€ๅทฎๅˆ†ใฎใฟ่กจ็คบ + +## Step 2: Detect Project Type + +ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆใ‚ฟใ‚คใƒ—ใ‚’่‡ชๅ‹•ๆคœๅ‡บ๏ผš + +```bash +# ใƒ•ใ‚กใ‚คใƒซๅญ˜ๅœจ็ขบ่ช +ls -la package.json next.config.* tsconfig.json pnpm-workspace.yaml *.tf 2>/dev/null +``` + +### ๆคœๅ‡บใƒซใƒผใƒซ + +| ๆกไปถ | ใ‚ฟใ‚คใƒ— | +| ----------------------------------------- | ---------- | +| `next.config.*` ใŒๅญ˜ๅœจ | nextjs | +| `pnpm-workspace.yaml` ใพใŸใฏ `lerna.json` | monorepo | +| `*.tf` ใƒ•ใ‚กใ‚คใƒซใŒๅญ˜ๅœจ | terraform | +| `package.json` ใฎใฟๅญ˜ๅœจ | nodejs | +| ไธŠ่จ˜ไปฅๅค– | ไธๆ˜Ž๏ผˆ็ขบ่ช | + +ๆคœๅ‡บ็ตๆžœใ‚’่กจ็คบ๏ผš + +``` +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +๐Ÿ” Project Detection +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” + +Type: {detected_type} +Package Manager: {npm|pnpm|yarn} +Language: {TypeScript|JavaScript} +Framework: {Next.js|Express|None} + +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +``` + +## Step 3: Check Existing CI + +ๆ—ขๅญ˜ใฎCI่จญๅฎšใ‚’็ขบ่ช๏ผš + +```bash +ls -la .github/workflows/*.yml 2>/dev/null +``` + +### ๆ—ขๅญ˜ใƒฏใƒผใ‚ฏใƒ•ใƒญใƒผใฎๅˆ†ๆž + +ๅ„ใƒฏใƒผใ‚ฏใƒ•ใƒญใƒผใƒ•ใ‚กใ‚คใƒซใ‚’่ชญใฟๅ–ใ‚Šใ€ไปฅไธ‹ใ‚’็ขบ่ช๏ผš + +- ใƒˆใƒชใ‚ฌใƒผๆกไปถ๏ผˆpush, PR, schedule๏ผ‰ +- ใ‚ธใƒงใƒ–ไธ€่ฆง๏ผˆlint, test, build, deploy็ญ‰๏ผ‰ +- ไฝฟ็”จใƒ„ใƒผใƒซ๏ผˆESLint, Prettier, Jest็ญ‰๏ผ‰ +- ใ‚ซใƒใƒฌใƒƒใ‚ธ่จญๅฎš + +็ตๆžœใ‚’่กจ็คบ๏ผš + +``` +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +๐Ÿ“‹ Existing CI Configuration +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” + +Workflows found: X files + +| File | Jobs | Triggers | +| -------------- | ----------------------- | --------------- | +| ci.yml | lint, test, build | push, PR | +| security.yml | audit, sast | schedule | + +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +``` + +## Step 4: Generate Recommendations + +ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆใ‚ฟใ‚คใƒ—ใจใƒฌใƒ™ใƒซใซๅŸบใฅใ„ใฆๆŽจๅฅจ่จญๅฎšใ‚’็”Ÿๆˆ๏ผš + +### 4.1 Next.js ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆ + +#### Minimal Level + +```yaml +# .github/workflows/ci.yml +name: CI + +on: + push: + branches: [main, develop] + pull_request: + branches: [main, develop] + +jobs: + quality: + 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 + - run: npm run build +``` + +#### Standard Level + +```yaml +# .github/workflows/ci.yml +name: CI + +on: + push: + branches: [main, develop] + pull_request: + branches: [main, develop] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + quality: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + - run: npm ci + + - name: Format Check + run: npm run format:check + + - name: Lint + run: npm run lint + + - name: Type Check + run: npm run type-check + + test: + runs-on: ubuntu-latest + needs: quality + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + - run: npm ci + + - name: Run Tests + run: npm test -- --coverage + + - name: Upload Coverage + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: false + + build: + runs-on: ubuntu-latest + needs: [quality, test] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + - run: npm ci + - run: npm run build + + security: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + - run: npm ci + - name: Security Audit + run: npm audit --audit-level=high + continue-on-error: true +``` + +#### Comprehensive Level + +Standard Level ใซๅŠ ใˆใฆไปฅไธ‹ใ‚’่ฟฝๅŠ ๏ผš + +```yaml +# .github/workflows/ci.yml (่ฟฝๅŠ ใ‚ธใƒงใƒ–) +e2e: + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + - run: npm ci + - name: Install Playwright + run: npx playwright install --with-deps chromium + - name: Run E2E Tests + run: npm run test:e2e + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: playwright-report + path: playwright-report/ +``` + +```yaml +# .github/workflows/security.yml +name: Security + +on: + push: + branches: [main] + schedule: + - cron: '0 2 * * *' + +jobs: + audit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + - run: npm ci + - name: npm audit + run: npm audit --audit-level=high + - name: License Check + run: npx license-checker --summary --failOn "GPL;AGPL" + + codeql: + runs-on: ubuntu-latest + permissions: + security-events: write + steps: + - uses: actions/checkout@v4 + - uses: github/codeql-action/init@v3 + with: + languages: javascript-typescript + - uses: github/codeql-action/analyze@v3 +``` + +```yaml +# .github/workflows/claude-code-review.yml +name: Claude Code Review + +on: + pull_request: + types: [opened, synchronize] + +jobs: + review: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Run Claude Review + uses: anthropics/claude-code-action@beta + with: + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + model: claude-sonnet-4-20250514 + direct_prompt: | + Review this PR for: + 1. Code quality and best practices + 2. Potential bugs or security issues + 3. Performance implications + 4. Test coverage adequacy +``` + +### 4.2 Node.js ใƒ‘ใƒƒใ‚ฑใƒผใ‚ธ + +#### Standard Level + +```yaml +# .github/workflows/ci.yml +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18, 20, 22] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run lint + - run: npm test -- --coverage + - name: Upload Coverage + if: matrix.node-version == 22 + uses: codecov/codecov-action@v4 + + release: + runs-on: ubuntu-latest + needs: test + if: github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + - run: npm ci + - name: Semantic Release + run: npx semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} +``` + +### 4.3 Terraform ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆ + +#### Standard Level + +```yaml +# .github/workflows/terraform-pr.yml +name: Terraform PR + +on: + pull_request: + paths: + - 'terraform/**' + - '.github/workflows/terraform-*.yml' + +permissions: + contents: read + pull-requests: write + id-token: write + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: hashicorp/setup-terraform@v3 + with: + terraform_version: '1.9' + + - name: Terraform fmt + run: terraform fmt -check -recursive + working-directory: terraform + + - name: Terraform init + run: terraform init -backend=false + working-directory: terraform + + - name: Terraform validate + run: terraform validate + working-directory: terraform + + security: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run Checkov + uses: bridgecrewio/checkov-action@v12 + with: + directory: terraform + output_format: sarif + output_file_path: results.sarif + - uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: results.sarif + + plan: + runs-on: ubuntu-latest + needs: [validate, security] + steps: + - uses: actions/checkout@v4 + - uses: hashicorp/setup-terraform@v3 + + - name: Terraform init + run: terraform init + working-directory: terraform + + - name: Terraform plan + id: plan + run: terraform plan -no-color -out=tfplan + working-directory: terraform + + - name: Comment PR + uses: actions/github-script@v7 + with: + script: | + const output = `#### Terraform Plan + \`\`\` + ${{ steps.plan.outputs.stdout }} + \`\`\` + `; + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: output + }); +``` + +### 4.4 ใƒขใƒŽใƒฌใƒ + +#### Standard Level + +```yaml +# .github/workflows/ci.yml +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + detect-changes: + runs-on: ubuntu-latest + outputs: + packages: ${{ steps.filter.outputs.changes }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + package-a: + - 'packages/package-a/**' + package-b: + - 'packages/package-b/**' + + test: + runs-on: ubuntu-latest + needs: detect-changes + if: needs.detect-changes.outputs.packages != '[]' + strategy: + matrix: + package: ${{ fromJson(needs.detect-changes.outputs.packages) }} + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + with: + version: 9 + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'pnpm' + - run: pnpm install --frozen-lockfile + - run: pnpm --filter ${{ matrix.package }} run lint + - run: pnpm --filter ${{ matrix.package }} run test + - run: pnpm --filter ${{ matrix.package }} run build + + release: + runs-on: ubuntu-latest + needs: test + if: github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: pnpm/action-setup@v4 + with: + version: 9 + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'pnpm' + - run: pnpm install --frozen-lockfile + - name: Release + run: pnpm run release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} +``` + +## Step 5: Show Gap Analysis + +็พๅœจใฎ่จญๅฎšใจๆŽจๅฅจ่จญๅฎšใฎๅทฎๅˆ†ใ‚’่กจ็คบ๏ผš + +``` +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +๐Ÿ“Š Gap Analysis +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” + +| Component | Current | Recommended | Status | +| ---------------- | ------- | ----------- | ------ | +| Lint | โœ… | โœ… | OK | +| Format Check | โŒ | โœ… | MISSING | +| Type Check | โœ… | โœ… | OK | +| Unit Tests | โš ๏ธ | โœ… | PARTIAL (no coverage) | +| E2E Tests | โŒ | โœ… | MISSING | +| Security Audit | โŒ | โœ… | MISSING | +| License Check | โŒ | โœ… | MISSING | +| CodeQL SAST | โŒ | โœ… | MISSING | +| Claude Review | โœ… | โœ… | OK | +| Concurrency | โŒ | โœ… | MISSING | + +Missing components: 6 +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +``` + +## Step 6: Apply Changes (if not --dry-run) + +ใƒฆใƒผใ‚ถใƒผใซ็ขบ่ชๅพŒใ€ไปฅไธ‹ใ‚’ๅฎŸ่กŒ๏ผš + +### 6.1 Create Workflow Directory + +```bash +mkdir -p .github/workflows +``` + +### 6.2 Write Workflow Files + +ๆŽจๅฅจใƒฏใƒผใ‚ฏใƒ•ใƒญใƒผใƒ•ใ‚กใ‚คใƒซใ‚’ไฝœๆˆ/ๆ›ดๆ–ฐ๏ผš + +- `.github/workflows/ci.yml` +- `.github/workflows/security.yml` (comprehensive) +- `.github/workflows/claude-code-review.yml` (comprehensive) + +### 6.3 Update package.json Scripts + +ๅฟ…่ฆใชnpmใ‚นใ‚ฏใƒชใƒ—ใƒˆใŒไธ่ถณใ—ใฆใ„ใ‚‹ๅ ดๅˆใฏ่ฟฝๅŠ ใ‚’ๆๆกˆ๏ผš + +```json +{ + "scripts": { + "format:check": "prettier --check .", + "type-check": "tsc --noEmit", + "test:e2e": "playwright test" + } +} +``` + +### 6.4 Create PR Template + +```bash +mkdir -p .github +``` + +`.github/PULL_REQUEST_TEMPLATE.md` ใ‚’ไฝœๆˆ๏ผš + +```markdown +## Summary + + + +## Type of Change + +- [ ] Bug fix +- [ ] New feature +- [ ] Breaking change +- [ ] Documentation update + +## Test Plan + + + +## Checklist + +- [ ] Tests pass locally +- [ ] Code follows project style guidelines +- [ ] Documentation updated if needed +``` + +## Step 7: Generate Summary + +``` +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +โœ… CI Setup Complete +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” + +Project Type: {type} +CI Level: {level} + +Files Created/Updated: +โœ… .github/workflows/ci.yml +โœ… .github/workflows/security.yml +โœ… .github/workflows/claude-code-review.yml +โœ… .github/PULL_REQUEST_TEMPLATE.md + +Next Steps: +1. Review the generated workflow files +2. Configure required secrets: + - CODECOV_TOKEN (for coverage reports) + - ANTHROPIC_API_KEY (for Claude reviews) +3. Push changes and verify CI runs +4. Adjust thresholds as needed + +โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” +``` + +## Required Secrets + +ใƒฌใƒ™ใƒซใซๅฟœใ˜ใฆๅฟ…่ฆใชSecrets๏ผš + +| Secret | Level | Purpose | +| ----------------- | ------------- | ------------------ | +| CODECOV_TOKEN | standard+ | Coverage reports | +| ANTHROPIC_API_KEY | comprehensive | Claude Code Review | +| NPM_TOKEN | release | npm publish | +| VERCEL_TOKEN | deploy | Vercel deployment | +| AWS_ACCESS_KEY_ID | deploy | AWS deployment | + +## CI Level Comparison + +| Feature | Minimal | Standard | Comprehensive | +| ----------------------- | :-----: | :------: | :-----------: | +| Lint | โœ… | โœ… | โœ… | +| Format Check | โŒ | โœ… | โœ… | +| Type Check | โœ… | โœ… | โœ… | +| Build | โœ… | โœ… | โœ… | +| Unit Tests | โŒ | โœ… | โœ… | +| Coverage Reports | โŒ | โœ… | โœ… | +| Security Audit | โŒ | โœ… | โœ… | +| License Check | โŒ | โŒ | โœ… | +| CodeQL SAST | โŒ | โŒ | โœ… | +| E2E Tests | โŒ | โŒ | โœ… | +| Claude Code Review | โŒ | โŒ | โœ… | +| Scheduled Security Scan | โŒ | โŒ | โœ… | +| Concurrency Control | โŒ | โœ… | โœ… | +| PR Templates | โŒ | โœ… | โœ… | + +## Related Commands + +| ใ‚ณใƒžใƒณใƒ‰ | ่ชฌๆ˜Ž | +| --------------------------- | ----------------------- | +| `/setup-team-protection` | GitHub ใƒ–ใƒฉใƒณใƒไฟ่ญท่จญๅฎš | +| `/setup-husky` | ใƒญใƒผใ‚ซใƒซ Git hooks ่จญๅฎš | +| `/pre-pr-checklist` | PR ไฝœๆˆๅ‰ใƒใ‚งใƒƒใ‚ฏ | +| `/security-credential-scan` | ่ช่จผๆƒ…ๅ ฑใ‚นใ‚ญใƒฃใƒณ | + +## Error Handling + +ใ‚จใƒฉใƒผ็™บ็”Ÿๆ™‚๏ผš + +1. ๅ…ทไฝ“็š„ใชใ‚จใƒฉใƒผๅ†…ๅฎนใ‚’ๅ ฑๅ‘Š +2. ๆ‰‹ๅ‹•ใงใฎไฟฎๆญฃๆ–นๆณ•ใ‚’ๆๆกˆ +3. ้ƒจๅˆ†็š„ใชๆˆๅŠŸใงใ‚‚้ฉ็”จๅฏ่ƒฝใชๅค‰ๆ›ดใฏ้ฉ็”จ