К основному содержанию
команда

ci-setup — команда для Claude Code: что делает и как установить

Команда анализирует проект и настраивает конфигурации CI/CD для GitHub Actions, GitLab CI или Jenkins с тестами и сборкой.

Установить в Claude Code · Через claude-code-templates Все способы и платформы ↓
npx claude-code-templates@latest --command deployment/ci-setup
Открыть на GitHub

Что делает ci-setup

Команда исследует стек проекта через файлы манифестов (package.json, setup.py, go.mod или pom.xml), проверяет ветки Git и уже существующие воркфлоу в .github/workflows. На основе анализа она формирует сценарии автоматизации для целевой платформы: GitHub Actions, GitLab CI, Jenkins, CircleCI, Azure DevOps или AWS CodePipeline.

В сгенерированный конвейер закладываются шаги матричного тестирования, проверки линтерами, сканирование уязвимостей через Snyk, оптимизация кэша зависимостей и многоэтапная сборка Docker-образов. Команда также прописывает правила разделения окружений для staging и production с ручным подтверждением выкатки.

Для работы инструменту требуются разрешения Read, Write, Edit и Bash. Без настроенных секретов репозитория вроде SNYK_TOKEN или ключей облачных провайдеров созданные шаги безопасности и деплоя завершатся ошибкой.

Какие задачи решает

  • настроить пайплайн GitHub Actions или GitLab CI под стек репозитория
  • добавить матричное тестирование под разные версии рантайма
  • оптимизировать сборку с помощью кэширования зависимостей и многоэтапных Dockerfile
  • разграничить сценарии автоматического деплоя для staging и production

Примеры запросов агенту

  • /ci-setup --github-actions
  • /ci-setup --gitlab-ci
  • /ci-setup --full-setup

Как установить ci-setup

1Через claude-code-templates

npx claude-code-templates@latest --command deployment/ci-setup

2Вручную: положить файлы

.claude/commands/ci-setup.md

Вызов — /ci-setup. Для всех проектов — ~/.claude/commands/

Вопросы о ci-setup

Как установить ci-setup в Claude Code?

Выполните команду npx claude-code-templates@latest --command deployment/ci-setup. Шаблон команды сохранится в .claude/commands/ci-setup.md.

Что делает команда ci-setup?

Она считывает файлы конфигурации и зависимости репозитория, после чего генерирует готовые пайплайны сборки, тестирования и деплоя.

Какие платформы CI/CD поддерживает ci-setup?

Шаблон содержит инструкции для GitHub Actions, GitLab CI, Jenkins, CircleCI, Azure DevOps и AWS CodePipeline.

Исходный текст

ci-setup.md · MIT
---
allowed-tools: Read, Write, Edit, Bash
argument-hint: "[platform] | --github-actions | --gitlab-ci | --jenkins | --full-setup"
description: Setup comprehensive CI/CD pipeline with automated testing, building, and deployment
---

# CI/CD Pipeline Setup

Setup continuous integration pipeline: $ARGUMENTS

## Current Project Analysis

- Project type: @package.json or @setup.py or @go.mod or @pom.xml (detect language/framework)
- Existing workflows: !`find .github/workflows -name "*.yml" 2>/dev/null | head -3`
- Git branches: !`git branch -r | head -5`
- Dependencies: @package-lock.json or @requirements.txt or @go.sum (if exists)
- Build scripts: Check for build commands in package.json or Makefile

## Task

Implement comprehensive CI/CD following best practices: $ARGUMENTS

1. **Project Analysis**
   - Identify the technology stack and deployment requirements
   - Review existing build and test processes
   - Understand deployment environments (dev, staging, prod)
   - Assess current version control and branching strategy

2. **CI/CD Platform Selection**
   - Choose appropriate CI/CD platform based on requirements:
     - **GitHub Actions**: Native GitHub integration, extensive marketplace
     - **GitLab CI**: Built-in GitLab, comprehensive DevOps platform
     - **Jenkins**: Self-hosted, highly customizable, extensive plugins
     - **CircleCI**: Cloud-based, optimized for speed
     - **Azure DevOps**: Microsoft ecosystem integration
     - **AWS CodePipeline**: AWS-native solution

3. **Repository Setup**
   - Ensure proper `.gitignore` configuration
   - Set up branch protection rules
   - Configure merge requirements and reviews
   - Establish semantic versioning strategy

4. **Build Pipeline Configuration**
   
   **GitHub Actions Example:**
   ```yaml
   name: CI/CD Pipeline
   
   on:
     push:
       branches: [ main, develop ]
     pull_request:
       branches: [ main ]
   
   jobs:
     test:
       runs-on: ubuntu-latest
       steps:
         - uses: actions/checkout@v3
         - name: Setup Node.js
           uses: actions/setup-node@v3
           with:
             node-version: '18'
             cache: 'npm'
         - run: npm ci
         - run: npm run test
         - run: npm run build
   ```

   **GitLab CI Example:**
   ```yaml
   stages:
     - test
     - build
     - deploy
   
   test:
     stage: test
     script:
       - npm ci
       - npm run test
     cache:
       paths:
         - node_modules/
   ```

5. **Environment Configuration**
   - Set up environment variables and secrets
   - Configure different environments (dev, staging, prod)
   - Implement environment-specific configurations
   - Set up secure secret management

6. **Automated Testing Integration**
   - Configure unit test execution
   - Set up integration test running
   - Implement E2E test execution
   - Configure test reporting and coverage

   **Multi-stage Testing:**
   ```yaml
   test:
     strategy:
       matrix:
         node-version: [16, 18, 20]
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v3
       - uses: actions/setup-node@v3
         with:
           node-version: ${{ matrix.node-version }}
       - run: npm ci
       - run: npm test
   ```

7. **Code Quality Gates**
   - Integrate linting and formatting checks
   - Set up static code analysis (SonarQube, CodeClimate)
   - Configure security vulnerability scanning
   - Implement code coverage thresholds

8. **Build Optimization**
   - Configure build caching strategies
   - Implement parallel job execution
   - Optimize Docker image builds
   - Set up artifact management

   **Caching Example:**
   ```yaml
   - name: Cache node modules
     uses: actions/cache@v3
     with:
       path: ~/.npm
       key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
       restore-keys: |
         ${{ runner.os }}-node-
   ```

9. **Docker Integration**
   - Create optimized Dockerfiles
   - Set up multi-stage builds
   - Configure container registry integration
   - Implement security scanning for images

   **Multi-stage Dockerfile:**
   ```dockerfile
   FROM node:18-alpine AS builder
   WORKDIR /app
   COPY package*.json ./
   RUN npm ci --only=production
   
   FROM node:18-alpine AS runtime
   WORKDIR /app
   COPY --from=builder /app/node_modules ./node_modules
   COPY . .
   EXPOSE 3000
   CMD ["npm", "start"]
   ```

10. **Deployment Strategies**
    - Implement blue-green deployment
    - Set up canary releases
    - Configure rolling updates
    - Implement feature flags integration

11. **Infrastructure as Code**
    - Use Terraform, CloudFormation, or similar tools
    - Version control infrastructure definitions
    - Implement infrastructure testing
    - Set up automated infrastructure provisioning

12. **Monitoring and Observability**
    - Set up application performance monitoring
    - Configure log aggregation and analysis
    - Implement health checks and alerting
    - Set up deployment notifications

13. **Security Integration**
    - Implement dependency vulnerability scanning
    - Set up container security scanning
    - Configure SAST (Static Application Security Testing)
    - Implement secrets scanning

   **Security Scanning Example:**
   ```yaml
   security:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v3
       - name: Run Snyk to check for vulnerabilities
         uses: snyk/actions/node@master
         env:
           SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
   ```

14. **Database Migration Handling**
    - Automate database schema migrations
    - Implement rollback strategies
    - Set up database seeding for testing
    - Configure backup and recovery procedures

15. **Performance Testing Integration**
    - Set up load testing in pipeline
    - Configure performance benchmarks
    - Implement performance regression detection
    - Set up performance monitoring

16. **Multi-Environment Deployment**
    - Configure staging environment deployment
    - Set up production deployment with approvals
    - Implement environment promotion workflow
    - Configure environment-specific configurations

   **Environment Deployment:**
   ```yaml
   deploy-staging:
     needs: test
     if: github.ref == 'refs/heads/develop'
     runs-on: ubuntu-latest
     steps:
       - name: Deploy to staging
         run: |
           # Deploy to staging environment
   
   deploy-production:
     needs: test
     if: github.ref == 'refs/heads/main'
     runs-on: ubuntu-latest
     environment: production
     steps:
       - name: Deploy to production
         run: |
           # Deploy to production environment
   ```

17. **Rollback and Recovery**
    - Implement automated rollback procedures
    - Set up deployment verification tests
    - Configure failure detection and alerts
    - Document manual recovery procedures

18. **Notification and Reporting**
    - Set up Slack/Teams integration for notifications
    - Configure email alerts for failures
    - Implement deployment status reporting
    - Set up metrics dashboards

19. **Compliance and Auditing**
    - Implement deployment audit trails
    - Set up compliance checks (SOC 2, HIPAA, etc.)
    - Configure approval workflows for sensitive deployments
    - Document change management processes

20. **Pipeline Optimization**
    - Monitor pipeline performance and costs
    - Implement pipeline parallelization
    - Optimize resource allocation
    - Set up pipeline analytics and reporting

**Best Practices:**

1. **Fail Fast**: Implement early failure detection
2. **Parallel Execution**: Run independent jobs in parallel
3. **Caching**: Cache dependencies and build artifacts
4. **Security**: Never expose secrets in logs
5. **Documentation**: Document pipeline processes and procedures
6. **Monitoring**: Monitor pipeline health and performance
7. **Testing**: Test pipeline changes in feature branches
8. **Rollback**: Always have a rollback strategy

**Sample Complete Pipeline:**
```yaml
name: Full CI/CD Pipeline

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

jobs:
  lint-and-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: '18'
          cache: 'npm'
      - run: npm ci
      - run: npm run lint
      - run: npm run test:coverage
      - run: npm run build

  security-scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Security scan
        run: npm audit --audit-level=high

  deploy-staging:
    needs: [lint-and-test, security-scan]
    if: github.ref == 'refs/heads/develop'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Deploy to staging
        run: echo "Deploying to staging"

  deploy-production:
    needs: [lint-and-test, security-scan]
    if: github.ref == 'refs/heads/main'
    runs-on: ubuntu-latest
    environment: production
    steps:
      - uses: actions/checkout@v3
      - name: Deploy to production
        run: echo "Deploying to production"
```

Start with basic CI and gradually add more sophisticated features as your team and project mature.

© davila7 · MIT · davila7/claude-code-templates

Похожие слэш-команды

Все слэш-команды по теме «DevOps и инфраструктура» →
cicd-pipeline-setup aj-geddes Скилл помогает агенту спроектировать CI/CD пайплайн: тесты, сборка артефактов, проверки безопасности и деплой по окружениям. CX Codex +1 498установок deployment-engineer VoltAgent Community Проектирует CI/CD-пайплайны, настраивает стратегии релиза вроде canary или blue-green и автоматизирует откат сборок. Пригодится, когда нужно ускорить доставку кода без ручных деплоев. 6 079установок linear-release-setup linear Помогает настроить пайплайны Linear Release в GitHub Actions, GitLab CI или CircleCI. Проводит по шагам от выбора модели веток до добавления секретов. CX Codex +1 15 200установок ci-cd ahmedasmar Помогает проектировать пайплайны GitHub Actions и GitLab CI, ускорять сборки кешированием и находить причины сбоев в тестах или деплое. CX Codex +1 363установок cicd-automation Seth Hobson Плагин для настройки CI/CD-пайплайнов: конфигурация GitHub Actions и GitLab CI, оркестрация автоматического деплоя. Пригодится, когда нужно завести или переписать workflow. CX Codex ★ 41 823звёзд репо cicd-pipeline-generator ailabs-393 Скилл собирает конфиги пайплайнов для GitHub Actions, GitLab CI, CircleCI и Jenkins: линт, тесты, сборка, деплой. CX Codex +1 980установок

Из того же набора361

Весь набор →
architecture-scenario-explorer Прогоняет варианты архитектуры через сценарии нагрузки, роста и отказов, а потом раскладывает компромиссы по качественным атрибутам. 423установок cleanup-cache Очищает кэши npm, Homebrew, Yarn, браузеров и Python для освобождения диска. Помогает быстро вернуть место в системе через разные уровни зачистки. 416установок screenshot-interaction-analyzer Субагент читает скриншот интерфейса и описывает, что на нём можно нажать, куда ведут переходы и какие состояния меняются. Пригодится, когда есть картинка экрана, а макета или описания флоу нет. 414установок create-pull-request Команда оформляет черновики пулл-реквестов через GitHub CLI по единому шаблону проекта. Пригодится, чтобы стандартизировать заголовки с эмодзи и сохранять теги PR-Agent. 411установок firecrawl-scraper Скилл для глубокого сбора данных с веб-страниц, скриншотов, разбора PDF и обхода сайтов через API Firecrawl. 407установок python-pro Скилл для Claude, который ведёт разработку на Python 3.12+: async, типизация, профилирование, uv, ruff, pydantic и FastAPI. 399установок troubleshooting-guide Собирает документ с диагностическими процедурами, частыми сбоями и командами для проверки системы. Пригодится, когда нужно описать, как чинить сервис. 397установок performance-budget-guard Хук для Claude проверяет размер JS-бандла после сборки Next.js и не даёт выкатить сборку, которая вылезла за бюджет. 393установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой