create-deploy-strategy

生成部署策略配置。为 GitHub Actions 和 GitLab CI 创建蓝绿部署、金丝雀部署和滚动部署的配置示例,包含健康检查和回滚流程的定义,便于将策略直接集成到 CI/CD 管道中。

仓库最近推送
GitHub Stars
109
Forks
26
Issues / PRs
1

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "create-deploy-strategy":https://skillpi.com/zh/skills/deepskill-1eb1dbc7172841bdc99d292be8804d5a17844edffa2de07313986bdc7d6c9766。安装前核对上游来源和版本:https://github.com/dykyi-roman/awesome-claude-code。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

生成部署策略配置。为 GitHub Actions 和 GitLab CI 创建蓝绿部署、金丝雀部署和滚动部署的配置示例,包含健康检查和回滚流程的定义,便于将策略直接集成到 CI/CD 管道中。

0 下载

介绍来源: third_party · dykyi-roman · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: create-deploy-strategy
description: Generates deployment strategy configurations. Creates blue-green, canary, rolling deployment configs for GitHub Actions and GitLab CI with health checks and rollback procedures.

Deployment Strategy Generator

Generates deployment configurations for zero-downtime deployments.

Blue-Green Deployment

GitHub Actions

# .github/workflows/deploy-blue-green.yml
name: Blue-Green Deploy

on:
  push:
    tags: ['v*']
  workflow_dispatch:
    inputs:
      environment:
        description: 'Target environment'
        required: true
        type: choice
        options: [staging, production]

env:
  REGISTRY: ghcr.io
  IMAGE_NAME: ${{ github.repository }}

jobs:
  build:
    runs-on: ubuntu-latest
    outputs:
      image_tag: ${{ steps.meta.outputs.tags }}
    steps:
      - uses: actions/checkout@v4

      - name: Build and push image
        uses: docker/build-push-action@v5
        with:
          push: true
          tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}

  deploy:
    needs: build
    runs-on: ubuntu-latest
    environment:
      name: ${{ github.event.inputs.environment || 'production' }}
      url: ${{ steps.deploy.outputs.url }}
    steps:
      - uses: actions/checkout@v4

      - name: Determine target environment
        id: env
        run: |
          ACTIVE=$(curl -s https://api.example.com/active-env)
          if [ "$ACTIVE" = "blue" ]; then
            echo "target=green" >> $GITHUB_OUTPUT
            echo "url=https://green.example.com" >> $GITHUB_OUTPUT
          else
            echo "target=blue" >> $GITHUB_OUTPUT
            echo "url=https://blue.example.com" >> $GITHUB_OUTPUT
          fi

      - name: Deploy to inactive environment
        id: deploy
        env:
          TARGET: ${{ steps.env.outputs.target }}
          IMAGE: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
        run: |
          # Deploy to target environment
          ssh deploy@${{ secrets.DEPLOY_HOST }} << EOF
            docker pull $IMAGE
            docker-compose -f docker-compose.$TARGET.yml up -d
          EOF
          echo "url=${{ steps.env.outputs.url }}" >> $GITHUB_OUTPUT

      - name: Health check
        run: |
          for i in {1..30}; do
            if curl -sf "${{ steps.env.outputs.url }}/health"; then
              echo "Health check passed"
              exit 0
            fi
            sleep 10
          done
          echo "Health check failed"
          exit 1

      - name: Run smoke tests
        run: |
          npm run test:smoke -- --base-url="${{ steps.env.outputs.url }}"

      - name: Switch traffic
        if: success()
        run: |
          curl -X POST https://api.example.com/switch-traffic \
            -H "Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}" \
            -d '{"target": "${{ steps.env.outputs.target }}"}'

      - name: Rollback on failure
        if: failure()
        run: |
          echo "Deployment failed, keeping traffic on current environment"
          curl -X POST https://api.example.com/rollback \
            -H "Authorization: Bearer ${{ secrets.DEPLOY_TOKEN }}"

See references/templates.md for: Blue-Green GitLab CI, Canary GitHub Actions, Canary GitLab CI, Rolling Kubernetes, Rolling Docker Swarm configurations.

Health Check Endpoints

<?php
// src/Api/Action/HealthAction.php

declare(strict_types=1);

namespace App\Api\Action;

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;

final readonly class HealthAction
{
    public function __construct(
        private DatabaseHealthChecker $database,
        private CacheHealthChecker $cache,
        private QueueHealthChecker $queue,
    ) {}

    public function ready(ServerRequestInterface $request): ResponseInterface
    {
        $checks = [
            'database' => $this->database->check(),
            'cache' => $this->cache->check(),
            'queue' => $this->queue->check(),
        ];

        $healthy = !in_array(false, $checks, true);

        return new JsonResponse(
            [
                'status' => $healthy ? 'healthy' : 'unhealthy',
                'checks' => $checks,
                'timestamp' => (new DateTimeImmutable())->format('c'),
            ],
            $healthy ? 200 : 503
        );
    }

    public function live(ServerRequestInterface $request): ResponseInterface
    {
        return new JsonResponse([
            'status' => 'alive',
            'timestamp' => (new DateTimeImmutable())->format('c'),
        ]);
    }
}

Generation Instructions

  1. Identify deployment target:

    • Kubernetes / Docker Swarm / VMs
    • Cloud provider (AWS, GCP, Azure)
    • CI platform (GitHub, GitLab)
  2. Select strategy:

    • Blue-Green: Instant switch, 2x resources
    • Canary: Gradual rollout, metrics-based
    • Rolling: Gradual replace, minimal resources
  3. Configure health checks:

    • Readiness probe (can accept traffic)
    • Liveness probe (is alive)
    • Startup probe (is ready to be probed)
  4. Set up monitoring:

    • Error rate thresholds
    • Latency thresholds
    • Custom metrics
  5. Define rollback triggers:

    • Automatic on health check failure
    • Manual option always available

Usage

Provide:

  • Deployment target (K8s, Swarm, VMs)
  • Strategy (blue-green, canary, rolling)
  • CI platform (GitHub, GitLab)
  • Health check endpoints
  • Rollback criteria

The generator will:

  1. Create deployment workflow
  2. Configure health checks
  3. Set up traffic management
  4. Add monitoring hooks
  5. Implement rollback procedures

当前收录版本

0.0.1

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值85/100

亮点

  • 提供蓝绿、金丝雀、滚动部署等多种策略配置生成
  • 支持 GitHub Actions 和 GitLab CI 两大主流 CI 平台
  • 包含健康检查和回滚流程,提升部署可靠性
触发精准95/100

亮点

  • 触发词精准完整,明确描述生成部署策略配置功能
  • 覆盖多种部署策略和 CI 平台,边界清晰
结构规范90/100

亮点

  • 文档结构清晰,包含详细步骤和端到端示例
  • frontmatter 完整,代码示例丰富
执行可靠88/100

亮点

  • 提供具体的 YAML 配置和 PHP 健康检查代码
  • 覆盖健康检查、回滚流程等主要异常处理
证据可验 (前四项均值)90/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • api.example.com
  • blue.example.com
  • green.example.com

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。