[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-fcfa87ba-2c26-489d-99e4-8a16f0f52cd9":3,"$fjl5nUkn__ngzuNyG0Nvm83-AzGjY9td9cPbl6cbfS_I":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"fcfa87ba-2c26-489d-99e4-8a16f0f52cd9","ci-cd-pipeline-builder","从检测到的项目堆栈信号生成实用的CI\u002FCD管道——快速基线生成、可重复检查、环境感知的部署阶段。用于设置新项目的CI、重构现有管道或标准化跨多个仓库的部署工作流程。","cat_coding_devops","mod_coding","alirezarezvani,coding","---\nname: \"ci-cd-pipeline-builder\"\ndescription: \"Generate pragmatic CI\u002FCD pipelines from detected project stack signals — fast baseline generation, repeatable checks, environment-aware deployment stages. Use when setting up CI for a new project, refactoring existing pipelines, or standardizing deployment workflows across multiple repos.\"\n---\n\n# CI\u002FCD Pipeline Builder\n\n**Tier:** POWERFUL  \n**Category:** Engineering  \n**Domain:** DevOps \u002F Automation\n\n## Overview\n\nUse this skill to generate pragmatic CI\u002FCD pipelines from detected project stack signals, not guesswork. It focuses on fast baseline generation, repeatable checks, and environment-aware deployment stages.\n\n## Core Capabilities\n\n- Detect language\u002Fruntime\u002Ftooling from repository files\n- Recommend CI stages (`lint`, `test`, `build`, `deploy`)\n- Generate GitHub Actions or GitLab CI starter pipelines\n- Include caching and matrix strategy based on detected stack\n- Emit machine-readable detection output for automation\n- Keep pipeline logic aligned with project lockfiles and build commands\n\n## When to Use\n\n- Bootstrapping CI for a new repository\n- Replacing brittle copied pipeline files\n- Migrating between GitHub Actions and GitLab CI\n- Auditing whether pipeline steps match actual stack\n- Creating a reproducible baseline before custom hardening\n\n## Key Workflows\n\n### 1. Detect Stack\n\n```bash\npython3 scripts\u002Fstack_detector.py --repo . --format text\npython3 scripts\u002Fstack_detector.py --repo . --format json > detected-stack.json\n```\n\nSupports input via stdin or `--input` file for offline analysis payloads.\n\n### 2. Generate Pipeline From Detection\n\n```bash\npython3 scripts\u002Fpipeline_generator.py \\\n  --input detected-stack.json \\\n  --platform github \\\n  --output .github\u002Fworkflows\u002Fci.yml \\\n  --format text\n```\n\nOr end-to-end from repo directly:\n\n```bash\npython3 scripts\u002Fpipeline_generator.py --repo . --platform gitlab --output .gitlab-ci.yml\n```\n\n### 3. Validate Before Merge\n\n1. Confirm commands exist in project (`test`, `lint`, `build`).\n2. Run generated pipeline locally where possible.\n3. Ensure required secrets\u002Fenv vars are documented.\n4. Keep deploy jobs gated by protected branches\u002Fenvironments.\n\n### 4. Add Deployment Stages Safely\n\n- Start with CI-only (`lint\u002Ftest\u002Fbuild`).\n- Add staging deploy with explicit environment context.\n- Add production deploy with manual gate\u002Fapproval.\n- Keep rollout\u002Frollback commands explicit and auditable.\n\n## Script Interfaces\n\n- `python3 scripts\u002Fstack_detector.py --help`\n  - Detects stack signals from repository files\n  - Reads optional JSON input from stdin\u002F`--input`\n- `python3 scripts\u002Fpipeline_generator.py --help`\n  - Generates GitHub\u002FGitLab YAML from detection payload\n  - Writes to stdout or `--output`\n\n## Common Pitfalls\n\n1. Copying a Node pipeline into Python\u002FGo repos\n2. Enabling deploy jobs before stable tests\n3. Forgetting dependency cache keys\n4. Running expensive matrix builds for every trivial branch\n5. Missing branch protections around prod deploy jobs\n6. Hardcoding secrets in YAML instead of CI secret stores\n\n## Best Practices\n\n1. Detect stack first, then generate pipeline.\n2. Keep generated baseline under version control.\n3. Add one optimization at a time (cache, matrix, split jobs).\n4. Require green CI before deployment jobs.\n5. Use protected environments for production credentials.\n6. Regenerate pipeline when stack changes significantly.\n\n## References\n\n- [references\u002Fgithub-actions-templates.md](references\u002Fgithub-actions-templates.md)\n- [references\u002Fgitlab-ci-templates.md](references\u002Fgitlab-ci-templates.md)\n- [references\u002Fdeployment-gates.md](references\u002Fdeployment-gates.md)\n- [README.md](README.md)\n\n## Detection Heuristics\n\nThe stack detector prioritizes deterministic file signals over heuristics:\n\n- Lockfiles determine package manager preference\n- Language manifests determine runtime families\n- Script commands (if present) drive lint\u002Ftest\u002Fbuild commands\n- Missing scripts trigger conservative placeholder commands\n\n## Generation Strategy\n\nStart with a minimal, reliable pipeline:\n\n1. Checkout and setup runtime\n2. Install dependencies with cache strategy\n3. Run lint, test, build in separate steps\n4. Publish artifacts only after passing checks\n\nThen layer advanced behavior (matrix builds, security scans, deploy gates).\n\n## Platform Decision Notes\n\n- GitHub Actions for tight GitHub ecosystem integration\n- GitLab CI for integrated SCM + CI in self-hosted environments\n- Keep one canonical pipeline source per repo to reduce drift\n\n## Validation Checklist\n\n1. Generated YAML parses successfully.\n2. All referenced commands exist in the repo.\n3. Cache strategy matches package manager.\n4. Required secrets are documented, not embedded.\n5. Branch\u002Fprotected-environment rules match org policy.\n\n## Scaling Guidance\n\n- Split long jobs by stage when runtime exceeds 10 minutes.\n- Introduce test matrix only when compatibility truly requires it.\n- Separate deploy jobs from CI jobs to keep feedback fast.\n- Track pipeline duration and flakiness as first-class metrics.\n","","imported","https:\u002F\u002Fgithub.com\u002Falirezarezvani\u002Fclaude-skills","user_system_seed","SkillOPIC",true,57,1242,"2026-05-16 13:53:27",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"DevOps","devops","mdi-cog-outline","CI\u002FCD、容器化、部署运维",3,162,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"7ada7ced-93a6-49a2-bc6a-441714d24f29","1.0.0","ci-cd-pipeline-builder.zip",8459,"uploads\u002Fskills\u002Ffcfa87ba-2c26-489d-99e4-8a16f0f52cd9\u002Fci-cd-pipeline-builder.zip","17d956cdc75f52e3895baa3e4fcf0e1fb4ee0231e2a46562e2ee661a03b62eac","[{\"path\":\"README.md\",\"isDirectory\":false,\"size\":1165},{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":5025},{\"path\":\"references\u002Fdeployment-gates.md\",\"isDirectory\":false,\"size\":429},{\"path\":\"references\u002Fgithub-actions-templates.md\",\"isDirectory\":false,\"size\":758},{\"path\":\"references\u002Fgitlab-ci-templates.md\",\"isDirectory\":false,\"size\":476},{\"path\":\"scripts\u002Fpipeline_generator.py\",\"isDirectory\":false,\"size\":9676},{\"path\":\"scripts\u002Fstack_detector.py\",\"isDirectory\":false,\"size\":5778}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]