跳到正文
Skillpedia
部署与云(DevOps)29k · #9579

ci-cd-pipeline-builder

它能做什么

它查看代码仓库中的文件,识别所用的语言和工具,然后为 GitHub Actions 或 GitLab CI 创建一个入门流水线。适合设置或替换自动化检查的开发者。

适用场景

  • ✓当你为新代码仓库设置自动化测试和构建时。
  • ✓当你现有的流水线文件很脆弱,或是从其他项目复制过来时。
  • ✓当你想在 GitHub Actions 和 GitLab CI 之间迁移流水线时。

技能链接

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/skills/ci-cd-pipeline-builder/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/alirezarezvani/claude-skills/blob/main/engineering/skills/ci-cd-pipeline-builder/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我需要为这个仓库配置一个 GitHub Actions 流水线,运行 lint、测试和构建。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体根据项目文件识别技术栈,然后生成用于代码检查、测试、构建和部署的流水线阶段,并为该技术栈设置合适的缓存。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

CI/CD Pipeline Builder

Tier: POWERFUL
Category: Engineering
Domain: DevOps / Automation

Overview

Use this skill to generate pragmatic CI/CD pipelines from detected project stack signals, not guesswork. It focuses on fast baseline generation, repeatable checks, and environment-aware deployment stages.

Core Capabilities

  • Detect language/runtime/tooling from repository files
  • Recommend CI stages (lint, test, build, deploy)
  • Generate GitHub Actions or GitLab CI starter pipelines
  • Include caching and matrix strategy based on detected stack
  • Emit machine-readable detection output for automation
  • Keep pipeline logic aligned with project lockfiles and build commands

When to Use

  • Bootstrapping CI for a new repository
  • Replacing brittle copied pipeline files
  • Migrating between GitHub Actions and GitLab CI
  • Auditing whether pipeline steps match actual stack
  • Creating a reproducible baseline before custom hardening

Key Workflows

1. Detect Stack

python3 scripts/stack_detector.py --repo . --format text
python3 scripts/stack_detector.py --repo . --format json > detected-stack.json

Supports input via stdin or --input file for offline analysis payloads.

2. Generate Pipeline From Detection

python3 scripts/pipeline_generator.py \
  --input detected-stack.json \
  --platform github \
  --output .github/workflows/ci.yml \
  --format text

Or end-to-end from repo directly:

python3 scripts/pipeline_generator.py --repo . --platform gitlab --output .gitlab-ci.yml

3. Validate Before Merge

  1. Confirm commands exist in project (test, lint, build).
  2. Run generated pipeline locally where possible.
  3. Ensure required secrets/env vars are documented.
  4. Keep deploy jobs gated by protected branches/environments.

4. Add Deployment Stages Safely

  • Start with CI-only (lint/test/build).
  • Add staging deploy with explicit environment context.
  • Add production deploy with manual gate/approval.
  • Keep rollout/rollback commands explicit and auditable.

Script Interfaces

  • python3 scripts/stack_detector.py --help
    • Detects stack signals from repository files
    • Reads optional JSON input from stdin/--input
  • python3 scripts/pipeline_generator.py --help
    • Generates GitHub/GitLab YAML from detection payload
    • Writes to stdout or --output

References

常见问题

它支持哪些平台?

GitHub Actions 和 GitLab CI。

它怎么知道我的项目使用什么?

检测脚本会读取代码仓库中的文件,例如锁文件和构建配置。

这个流水线可以直接用于生产环境吗?

它是一个基准版本,之后你可能还需要添加自定义的加固措施。

详情

作者的原始描述

Use when setting up or refactoring CI/CD for a repo, before writing workflow YAML. Detects the stack with stack_detector.py and generates the pipeline with pipeline_generator.py.

repo: alirezarezvani/claude-skills

热度

GitHub 星标
29k
排名
#9579
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能