resources/skills/x-generate-ci/SKILL.md
Generates or updates CI/CD pipelines per project stack with actionlint validation.
npx skillsauth add edercnj/claude-environment x-generate-ciInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generates or updates CI/CD pipeline configurations for {{PROJECT_NAME}} based on detected project stack. Analyzes existing workflows to avoid duplication, generates customized GitHub Actions workflows for CI, CD, release, and security scanning, validates generated YAML with actionlint, and supports monorepo path-based triggers.
/x-generate-ci — generate all pipelines (default: all)/x-generate-ci ci — generate CI pipeline (build + test + security scan)/x-generate-ci cd — generate CD pipeline (deploy staging + production + rollback)/x-generate-ci release — generate release pipeline (semantic versioning + changelog)/x-generate-ci security — generate security scan pipeline (scheduled SAST + dependency audit)/x-generate-ci all — generate all pipeline types/x-generate-ci ci --monorepo — generate with path-based triggers for monorepo/x-generate-ci ci --force — overwrite existing workflows| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| type | Enum | all | Pipeline type: ci, cd, release, security, all |
| --monorepo | Flag | false | Activate path-based triggers for monorepo |
| --force | Flag | false | Overwrite existing workflow files |
| Pipeline | File | Purpose |
|----------|------|---------|
| CI | .github/workflows/ci.yml | Build + test + security scan on develop/release/*/hotfix/*/PRs |
| CD Staging | .github/workflows/deploy-staging.yml | Deploy to staging on push to develop |
| CD Production | .github/workflows/deploy-production.yml | Deploy to production on main push or v* tags (with approval gate) |
| Rollback | .github/workflows/rollback.yml | Manual rollback with version input |
| Release | .github/workflows/release.yml | Tag-driven changelog + GitHub Release + artifact publish |
| Security Scan | .github/workflows/security-scan.yml | Weekly + push SAST/CodeQL/Semgrep + container scan; SARIF upload |
| Dependency Audit | .github/workflows/dependency-audit.yml | Daily CVE + outdated check; auto-create issues for criticals |
1. DETECT -> Identify language + build tool from config files (pom.xml/package.json/go.mod/...)
+ Dockerfile/docker-compose/Helm/Terraform for deployment-step detection
2. ANALYZE -> Scan .github/workflows/ for existing files; apply conflict-resolution rules
3. GENERATE -> Render per-type YAML using language-specific setup actions and cache paths
4. VALIDATE -> Run actionlint (fail-open: warn + continue when not installed)
5. REPORT -> Markdown table of generated/updated files with validation status
Per-stack build steps, per-pipeline YAML templates, monorepo path-based trigger logic, and conflict-resolution rules in references/full-protocol.md:
--force).v* tags, scheduled security scan, daily dependency audit); language-specific setup action + cache path + build cmd + test cmd table.services/, packages/, apps/).| Scenario | Action |
|----------|--------|
| Language not detected | List supported languages, ask user to specify |
| Workflow file exists (no --force) | Report "file exists, use --force to overwrite" |
| actionlint not installed | Warn and skip validation (non-blocking) |
| Invalid type argument | Default to "all", warn user |
| No Dockerfile found (CD requested) | Generate CD without container steps, warn user |
| No project config found | Report error with setup instructions |
| Skill | Relationship | Context |
|-------|-------------|---------|
| devops-engineer agent | calls | Used for advanced pipeline customization via Agent tool |
| ci-cd-patterns KP | reads | Pipeline templates and best practices |
| x-audit-dependencies | reads | Dependency audit pipeline references audit commands |
| x-generate-security-pipeline | reads | Security pipeline references scanning configurations |
| Pack | File | Purpose |
|------|------|---------|
| ci-cd-patterns | .claude/knowledge/ci-cd-patterns/index.md | Pipeline templates and best practices |
| ci-cd-patterns | .claude/knowledge/ci-cd-patterns/github-actions-patterns.md | GitHub Actions reusable workflows |
| ci-cd-patterns | .claude/knowledge/ci-cd-patterns/pipeline-security.md | Security gates in CI pipelines |
Minimum viable contract above. Detailed 6-stack detection rules, full YAML templates per pipeline kind, language-specific build matrix, monorepo path-trigger logic, conflict-resolution rules, and report template live in references/full-protocol.md per ADR-0012 (skill body slim-by-default).
development
Documentation freshness gate: validates 6 dimensions (readme, api, adr, etc.) per PR.
testing
Conditional dep-policy gate: CVEs, licenses, versions, freshness; SARIF + report.
documentation
Incrementally updates the service or system architecture document; never regenerative.
development
Scans code and git history for leaked credentials, API keys, and tokens; SARIF output.