cicd-pipeline · git:20260911.3a0a7c8 · 2026-09-11 · sha256 46138799cde526d0

cicd-pipeline git:20260911.3a0a7c8A

Immutable. This exact content is served forever at /api/v1/blob/46138799cde526d0.

---
name: "cicd-pipeline"
description: "Generate CI/CD workflows (GitHub Actions, or self-hosted Woodpecker via provider)"
---
<!-- GENERATED by claude-power-pack - scripts/codex-skill-sync.py; edit .claude/commands/cicd/pipeline.md instead -->

# CI/CD Pipeline Generation

Generate CI/CD workflows from your Makefile targets. Defaults to GitHub Actions;
set `pipeline.provider: woodpecker` (or `both`) in `.claude/cicd.yml` to emit a
self-hosted Woodpecker `.woodpecker.yml`. For a hardened self-hosted pipeline
(secret-scan + image-security + runtime-smoke) and to scaffold the Woodpecker
server/agent, use `/cicd-woodpecker` instead.

## Steps

1. **Check for task manifest** - if `.claude/cicd_tasks.yml` exists, use it to inform pipeline generation:

```bash
if [ -f ".claude/cicd_tasks.yml" ]; then
    echo "Found cicd_tasks.yml manifest - pipeline will use manifest-defined steps"
    # The manifest defines plan steps (lint, test, deploy, etc.) with exact commands.
    # Pipeline generation should use these commands instead of defaults.
fi
```

When a manifest is present, the generated pipeline YAML should:
- Use the exact commands from the manifest's step definitions
- Include timeout values from the manifest
- Respect skip_if conditions as conditional steps
- Fall back to `make <target>` for steps not in the manifest

2. **Detect framework** using `lib/cicd`:

```bash
PYTHONPATH="$PWD:$HOME/Projects/claude-power-pack:$PYTHONPATH" uv run --project "$HOME/Projects/claude-power-pack" python -m lib.cicd detect --quiet
```

3. **Generate pipeline** (dry run first):

```bash
PYTHONPATH="$PWD:$HOME/Projects/claude-power-pack:$PYTHONPATH" uv run --project "$HOME/Projects/claude-power-pack" python -m lib.cicd pipeline
```

4. **Review output** with the user. Show the generated workflow YAML.

5. **Check for existing files** before writing:
   - If `.github/workflows/ci.yml` exists, ask before overwriting

6. **Write files** if approved:

```bash
PYTHONPATH="$PWD:$HOME/Projects/claude-power-pack:$PYTHONPATH" uv run --project "$HOME/Projects/claude-power-pack" python -m lib.cicd pipeline --write
```

7. **Report results**:

```
## CI Pipeline Generated

Framework: {framework} ({package_manager})

Files created:
  .github/workflows/ci.yml - CI pipeline with lint, test, build

Triggers: push to main, pull requests
Targets:  make lint, make test, make typecheck (if available)

To view: cat .github/workflows/ci.yml
```

## Notes

- Workflows use `make <target>` as steps (not direct tool commands)
- This keeps CI in sync with local development commands
- Caching is included for package managers (uv, npm, cargo, go)
- Matrix builds are configured from `.claude/cicd.yml` if present
- Configure pipeline settings in `.claude/cicd.yml`:
  ```yaml
  pipeline:
    provider: github-actions   # github-actions | woodpecker | both
    branches:
      main: [lint, test, typecheck, build, deploy]
      pr: [lint, test, typecheck]
    matrix:
      python: ["3.11", "3.12"]
  ```
- Self-hosted Woodpecker: set `provider: woodpecker` (or `both`) and see
  `/cicd-woodpecker` + `docs/skills/woodpecker-ci.md` for the hardening stages.