ci-cd-pipelinelisted
Install: claude install-skill tmj-90/gaffer
# Build pragmatic CI/CD pipelines
A pipeline that runs in 2 minutes and deploys reliably beats one that does everything and breaks weekly. Detect the real stack; emit stages that match the project's actual commands.
## Canonical pipeline stages
```
lint → test → build → scan → deploy-staging → smoke-test → deploy-prod
```
Not every project needs all stages. Drop what adds no signal; never skip `test` and `lint`.
## Stack detection signals
| File present | Inferred stack |
|-------------|---------------|
| `package.json` + `tsconfig.json` | TypeScript/Node |
| `pom.xml` | Java/Maven |
| `build.gradle` | Java/Gradle |
| `requirements.txt` / `pyproject.toml` | Python |
| `go.mod` | Go |
| `Cargo.toml` | Rust |
| `Dockerfile` | Container build needed |
| `.terraform/` or `*.tf` | Terraform plan/apply stage |
## Steps
1. **Detect the stack.** Read `package.json`, `pom.xml`, lockfiles, and `Dockerfile` — do not guess. Extract the actual test, lint, and build commands from the project's own scripts.
2. **Choose the minimal stage set.** Map detected commands to pipeline stages. If a stage has no command, omit it — a placeholder stage that always passes adds noise.
3. **Configure caching.** Cache dependency directories keyed by lockfile hash (e.g. `pnpm-lock.yaml`, `go.sum`). A cache miss should still produce a correct build.
4. **Add secrets hygiene.** All credentials via CI secret store — never hardcoded. Mask secrets in logs. Principle of least privilege for deploy tokens.