CI/CD自动化

diegosouzapw2026-10-28查看 1431复制 761

为 Astro 项目自动生成和管理部署流水线。

Download (.md)

📘如何使用这个技能

  1. 1
    复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
  2. 2
    打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
  3. 3
    粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
  4. 4
    直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景

💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。

SKILL.md2392 chars
---
version: 1.0.0
name: CI/CD Automation
description: Automated generation and management of deployment pipelines for Astro projects.
---

# CI/CD Automation: DevOps Agent

> **ACTIVATION PHRASE**: "Activate CI/CD mode" or "Set up deployment pipeline"

This agent automates the creation and configuration of CI/CD pipelines, ensuring safe, performant, and reliable deployments for Astro-based websites.

## 1. Core Capabilities

### Pipeline Generation
- **GitHub Actions**: Generates `.github/workflows/deploy.yml` with caching and parallel jobs.
- **Vercel/Netlify**: Configures environment variables and build commands.
- **Preview Deployments**: Sets up automated previews for pull requests.

### Performance Budgeting
- **Lighthouse CI**: Integrates performance checks into the pipeline.
- **Bundle Size Watch**: Alerts on significant bundle size increases.
- **Build Caching**: Optimizes build times for Astro projects.

### Safety & Compliance
- **Sentinel Sync**: Runs `npm run sentinel` (Astro check) before every deploy.
- **HIPAA Scan**: Integrates with `sentinel-auditor` to check for PHI in logs.
- **Rollback Logic**: Defines emergency rollback procedures.

## 2. Standard Templates

### GitHub Actions (Astro + Vercel)
The agent generates a hardened `.github/workflows/deploy.yml` that includes:
1. **Checkout & Setup**: Node.js environment.
2. **Cache**: npm/pnpm and Astro cache.
3. **Build**: Production build simulation.
4. **Audit**: Lighthouse CI + Type check.
5. **Deploy**: Vercel/Netlify CLI deployment.

## 3. Workflow Logic

### Phase 1: Environment Audit
1. Identify the hosting provider (Vercel, Netlify, or Custom VPS).
2. Check for required secrets (VERCEL_TOKEN, GITHUB_TOKEN).
3. Verify `astro.config.mjs` output settings.

### Phase 2: Configuration
1. Write the YAML/Configuration files.
2. Set up Lefthook/Git Hooks for pre-commit validation.
3. Define the deployment strategy (e.g., Blue-Green if supported).

### Phase 3: Verification
1. Run a dry-run build.
2. Validate the workflow syntax.

## 4. Example Prompts

```text
CI/CD Automation: Generate a GitHub Actions workflow that runs Lighthouse CI and deploys to Vercel on every push to main.
```

```text
CI/CD Automation: Set up a pre-deployment safety check that blocks the build if there are any accessibility errors.
```

---
**Version**: 1.0.0
**Dependencies**: github-manager, sentinel-auditor
来源:skillsdirectory

评论0

登录后参与评论

还没有评论,来抢沙发吧