devopscicd
Use when: designing or reviewing CI/CD pipelines, GitHub Actions, stage design, environment gates, or artifact discipline.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when: designing or reviewing CI/CD pipelines, GitHub Actions, stage design, environment gates, or artifact discipline.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when: reviewing .prompt.md, .agent.md, SKILL.md, or .instructions.md files for contradictions, ambiguity, persona consistency, cognitive load, coverage gaps, and composition conflicts.
Use when: checking xanadAssistant workspace health, install status, repair reasons, or lockfile validity before proposing install, update, repair, or restore operations.
Use when: writing or reviewing Dockerfiles, container images, multi-stage builds, layer caching, or image security.
Use when: writing or reviewing Infrastructure as Code for naming, state management, modularity, and drift detection.
Use when: reviewing DevOps changes for pipeline safety, secret hygiene, permissions, rollback, and deployment risk.
Use when: writing or reviewing API and code documentation, including docstrings, OpenAPI patterns, and parameter tables.
| name | devopsCiCd |
| description | Use when: designing or reviewing CI/CD pipelines, GitHub Actions, stage design, environment gates, or artifact discipline. |
| type | reference |
| version | 1.0 |
| license | MIT |
Skill metadata: version "1.0"; tags [devops, ci-cd, github-actions, pipelines]; recommended tools [].
Use this skill when designing, reviewing, or debugging CI/CD pipelines.
devopsContainersdevopsInfraAsCodedevopsReviewStructure pipelines in ordered stages. Each stage must pass before the next runs.
| Stage | Purpose | Typical jobs |
|---|---|---|
| Validate | Fast, cheap checks | Lint, format check, type check |
| Test | Correctness | Unit tests, integration tests |
| Build | Produce artifacts | Compile, container image, package |
| Security | Risk gate | SAST, dependency scan, image scan |
| Deploy (staging) | Verify in production-like env | Smoke tests, E2E tests |
| Deploy (production) | Release to users | Canary, blue/green, or rolling |
Every stage must complete before the next begins; shortcutting a stage to speed up delivery invalidates the pipeline. Add a manual approval gate before production deploys when the risk surface is high.
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read # principle of least privilege — be explicit
jobs:
test:
runs-on: ubuntu-24.04 # pin OS version — avoid ubuntu-latest
steps:
- uses: actions/checkout@v4 # pin to major version tag, not SHA
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip # cache dependencies
- run: pip install -r requirements.txt
- run: pytest
Key rules:
permissions: to limit blast radius.@v4) at minimum; pin to a commit SHA for third-party actions.${{ secrets.FOO }} not $FOO in shell.jobs:
deploy-production:
environment: production # triggers required reviewers
needs: [test, build, security] # all upstream stages must pass
if: github.ref == 'refs/heads/main'
steps:
- name: Deploy
run: ./deploy.sh
env:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
env: block, not as positional arguments to scripts.image:${GITHUB_SHA}.| Anti-pattern | Fix |
|---|---|
uses: actions/checkout@main | Pin to @v4 or a SHA |
env: SECRET=${{ secrets.X }} with echo $SECRET | Never echo secrets |
if: always() on deploy | Deploy only on success |
| Build image in deploy job | Build once, promote the artifact |
permissions: write-all | Enumerate only what is needed |