/ci - CI/CD Pipeline Management
$ARGUMENTS
What This Command Does
Generate, update, or troubleshoot CI/CD pipeline configuration based on project type.
Project context
- CI config: !
cat .github/workflows/*.yml 2>/dev/null || cat .gitlab-ci.yml 2>/dev/null || echo "no-ci"
CI Detection Script
Detect CI platform and analyze configuration:
python3 ${CLAUDE_SKILL_DIR}/scripts/ci-detect.py [directory]
Returns JSON with:
platform - detected CI platform (github-actions, gitlab-ci, jenkins, bitbucket, circleci)
config_files[] - CI config file paths
project_type - detected project type (python, node, flutter, go, rust, php, docker)
jobs_found[] - job/stage names extracted from config
stages_detected[] - best-practice stages found (lint, test, build, deploy)
missing_stages[] - recommended stages not yet configured
suggested_template - pointer to ci-cd-patterns skill for templates
Auto-Detection
| File Found |
Project Type |
Pipeline |
package.json |
Node.js/TypeScript |
npm ci, lint, test, build |
pyproject.toml / setup.py |
Python |
pip install, ruff, mypy, pytest |
pubspec.yaml |
Flutter/Dart |
dart analyze, flutter test, build |
composer.json |
PHP |
composer install, phpstan, phpunit |
go.mod |
Go |
go vet, go test, go build |
Cargo.toml |
Rust |
cargo clippy, cargo test, cargo build |
Dockerfile |
Docker |
Build and push image |
Supported Platforms
- GitHub Actions (default):
.github/workflows/ci.yml
- GitLab CI:
.gitlab-ci.yml
Pipeline Stages
- Lint - Static analysis, formatting checks
- Test - Unit tests, integration tests with coverage
- Build - Compile, bundle, Docker image
- Deploy (optional) - Deploy to staging/production
Usage Examples
/ci # Generate CI config for detected project type
/ci github-actions # Explicitly use GitHub Actions
/ci add deploy staging # Add deployment stage for staging
/ci fix # Troubleshoot failing pipeline
/ci add matrix node 18,20,22 # Add matrix testing
Reference Skill
Use ci-cd-patterns skill for pipeline templates and best practices.
Rules
- MUST detect existing CI platform before generating a new config — do not overwrite silently
- NEVER commit generated CI configs that embed hardcoded secrets or tokens
- CRITICAL: preserve existing job names and triggers unless the user explicitly asks for a restructure
- MANDATORY: every generated pipeline must include lint + test stages at minimum
- MUST collect every failing job before diagnosing — do not stop at the first red check. A pipeline usually breaks in more than one place, and reporting only the first one costs a full cycle per remaining failure
Gotchas
- GitHub Actions YAML parses
on: as a reserved word only when unquoted. Writing "on": (quoted) produces a valid-looking file whose workflow never triggers. YAML anchors in this field also silently break.
- GitLab CI's
rules: and only:/except: are mutually exclusive at the job level. Mixing them fails parse on pipeline run but not at git push time — test with gitlab-ci-lint before committing.
secrets.* in GitHub Actions is undefined in workflows triggered from forked PRs (security boundary). Jobs that need secrets must gate on github.event.pull_request.head.repo.full_name == github.repository or use pull_request_target carefully.
actions/checkout@v6 defaults to fetch-depth: 1 (shallow). Commands that need history (git log, git describe, conventional-commit tools) fail with misleading errors — set fetch-depth: 0 for those jobs.
When NOT to Use
- For running tests locally — use
/test
- For general CI/CD patterns and theory — use
/ci-cd-patterns (knowledge skill)
- For deployment orchestration only — use
/deploy
- When the project has no VCS-hosted CI platform — generate locally-runnable scripts instead
1---2name: ci3description: Detect/generate/debug CI pipeline config (GitHub Actions, GitLab CI). Triggers: CI setup, build pipeline, GitHub Actions config, debug CI, GitLab CI.4---56# /ci - CI/CD Pipeline Management78$ARGUMENTS910## What This Command Does1112Generate, update, or troubleshoot CI/CD pipeline configuration based on project type.1314## Project context1516- CI config: !`cat .github/workflows/*.yml 2>/dev/null || cat .gitlab-ci.yml 2>/dev/null || echo "no-ci"`1718## CI Detection Script1920Detect CI platform and analyze configuration:21```bash22python3 ${CLAUDE_SKILL_DIR}/scripts/ci-detect.py [directory]23```2425Returns JSON with:26- `platform` - detected CI platform (github-actions, gitlab-ci, jenkins, bitbucket, circleci)27- `config_files[]` - CI config file paths28- `project_type` - detected project type (python, node, flutter, go, rust, php, docker)29- `jobs_found[]` - job/stage names extracted from config30- `stages_detected[]` - best-practice stages found (lint, test, build, deploy)31- `missing_stages[]` - recommended stages not yet configured32- `suggested_template` - pointer to ci-cd-patterns skill for templates3334## Auto-Detection3536| File Found | Project Type | Pipeline |37|------------|-------------|----------|38| `package.json` | Node.js/TypeScript | npm ci, lint, test, build |39| `pyproject.toml` / `setup.py` | Python | pip install, ruff, mypy, pytest |40| `pubspec.yaml` | Flutter/Dart | dart analyze, flutter test, build |41| `composer.json` | PHP | composer install, phpstan, phpunit |42| `go.mod` | Go | go vet, go test, go build |43| `Cargo.toml` | Rust | cargo clippy, cargo test, cargo build |44| `Dockerfile` | Docker | Build and push image |4546## Supported Platforms4748- **GitHub Actions** (default): `.github/workflows/ci.yml`49- **GitLab CI**: `.gitlab-ci.yml`5051## Pipeline Stages52531. **Lint** - Static analysis, formatting checks542. **Test** - Unit tests, integration tests with coverage553. **Build** - Compile, bundle, Docker image564. **Deploy** (optional) - Deploy to staging/production5758## Usage Examples5960```61/ci # Generate CI config for detected project type62/ci github-actions # Explicitly use GitHub Actions63/ci add deploy staging # Add deployment stage for staging64/ci fix # Troubleshoot failing pipeline65/ci add matrix node 18,20,22 # Add matrix testing66```6768## Reference Skill69Use `ci-cd-patterns` skill for pipeline templates and best practices.7071## Rules7273- **MUST** detect existing CI platform before generating a new config — do not overwrite silently74- **NEVER** commit generated CI configs that embed hardcoded secrets or tokens75- **CRITICAL**: preserve existing job names and triggers unless the user explicitly asks for a restructure76- **MANDATORY**: every generated pipeline must include lint + test stages at minimum77- **MUST** collect every failing job before diagnosing — do not stop at the first red check. A pipeline usually breaks in more than one place, and reporting only the first one costs a full cycle per remaining failure7879## Gotchas8081- GitHub Actions YAML parses `on:` as a reserved word only when unquoted. Writing `"on":` (quoted) produces a valid-looking file whose workflow **never triggers**. YAML anchors in this field also silently break.82- GitLab CI's `rules:` and `only:/except:` are mutually exclusive at the job level. Mixing them fails parse on pipeline run but not at `git push` time — test with `gitlab-ci-lint` before committing.83- `secrets.*` in GitHub Actions is undefined in workflows triggered from **forked** PRs (security boundary). Jobs that need secrets must gate on `github.event.pull_request.head.repo.full_name == github.repository` or use `pull_request_target` carefully.84- `actions/checkout@v6` defaults to `fetch-depth: 1` (shallow). Commands that need history (`git log`, `git describe`, conventional-commit tools) fail with misleading errors — set `fetch-depth: 0` for those jobs.8586## When NOT to Use8788- For running tests locally — use `/test`89- For general CI/CD patterns and theory — use `/ci-cd-patterns` (knowledge skill)90- For deployment orchestration only — use `/deploy`91- When the project has no VCS-hosted CI platform — generate locally-runnable scripts instead