DevOps Pipeline
Implement comprehensive DevOps quality gates adapted to project type.
Repo Sync Before Edits (mandatory)
Before making any changes, sync with the remote to avoid conflicts:
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin
git pull --rebase origin "$branch"
If the working tree is dirty, stash first, sync, then pop. If origin is missing or conflicts occur, stop and ask the user before continuing.
Workflow
0. Create Feature Branch
Before making any changes:
- Check the current branch — if already on a feature branch for this task, skip
- Check the repo for branch naming conventions (e.g.,
feat/, feature/, etc.)
- Create and switch to a new branch following the repo's convention, or fallback to:
feat/devops-pipeline
1. Analyze Project
Detect project characteristics.
Use sub-agents for parallel discovery. Launch multiple Agent tool calls concurrently to keep the main context clean:
- Agent 1 — Stack detection: Scan for
package.json, pyproject.toml, Cargo.toml, go.mod, pom.xml, build.gradle, *.csproj and identify the primary language(s), frameworks (React, Next.js, Django, FastAPI, etc.), and build tools (npm, yarn, pnpm, pip, poetry, cargo, go, maven, gradle). Return a structured summary.
- Agent 2 — Existing tooling inventory: Check for existing linter/formatter configs (
.eslintrc*, .prettierrc*, tsconfig.json, mypy.ini, setup.cfg, ruff.toml) and existing CI configs (.pre-commit-config.yaml, .github/workflows/*.yml). Return a checklist of what is present vs missing.
- Agent 3 — Repository conventions: Inspect the repo for branch naming conventions, commit message style, and any existing contribution guidelines. Return the conventions found.
Collect the results from all three agents before proceeding.
2. Configure Pre-commit Hooks and GitHub Actions
Use sub-agents for parallel file creation. The pre-commit config and GitHub Actions workflow are independent of each other. Dispatch them concurrently using the Agent tool, then collect results:
Agent A — Pre-commit hooks: Install the pre-commit framework (pip install pre-commit or brew install pre-commit). Create .pre-commit-config.yaml based on the detected stack from Step 1. Use references/precommit-configs.md for language-specific configurations. Install hooks with pre-commit install. Return the path of the created config file and a summary of hooks configured.
Agent B — GitHub Actions workflow: Create .github/workflows/ci.yml mirroring the pre-commit checks. Use references/github-actions.md for workflow templates. Follow these key principles:
- Mirror pre-commit checks for consistency
- Use caching for dependencies
- Run on push and pull_request
- Add matrix testing for multiple versions if needed
Return the path of the created workflow file and a summary of jobs configured.
Each agent should return the path(s) of files it created or updated.
3. Verify Pipeline
# Test pre-commit locally
pre-commit run --all-files
# Commit and push to trigger CI
git add .pre-commit-config.yaml .github/workflows/ci.yml
git commit -m "ci: add pre-commit hooks and GitHub Actions"
git push
Check GitHub Actions tab for workflow status.
Tool Selection by Language
| Language |
Formatter |
Linter |
Security |
Types |
| JS/TS |
Prettier |
ESLint |
npm audit |
TypeScript |
| Python |
Black/Ruff |
Ruff |
Bandit |
mypy |
| Go |
gofmt |
golangci-lint |
gosec |
built-in |
| Rust |
rustfmt |
Clippy |
cargo-audit |
built-in |
| Java |
google-java-format |
Checkstyle |
SpotBugs |
- |
Resources
- references/precommit-configs.md - Pre-commit configurations by language
- references/github-actions.md - GitHub Actions workflow templates
1---2name: devops-pipeline3description: Implement pre-commit hooks and GitHub Actions for quality assurance. Use when asked to "setup CI/CD", "add pre-commit hooks", "create GitHub Actions", "setup quality gates", "automate testing", "add linting to CI", "setup code quality checks", "configure CI pipeline", "add automated checks", or any DevOps automation for code quality. Detects project type and configures appropriate tools. Trigger this skill whenever the user mentions CI, CD, pre-commit, GitHub Actions, linting automation, or quality gates — even if they don't use those exact terms.4---56# DevOps Pipeline78Implement comprehensive DevOps quality gates adapted to project type.910## Repo Sync Before Edits (mandatory)1112Before making any changes, sync with the remote to avoid conflicts:1314```bash15branch="$(git rev-parse --abbrev-ref HEAD)"16git fetch origin17git pull --rebase origin "$branch"18```1920If the working tree is dirty, stash first, sync, then pop. If `origin` is missing or conflicts occur, stop and ask the user before continuing.2122## Workflow2324### 0. Create Feature Branch2526Before making any changes:271. Check the current branch — if already on a feature branch for this task, skip282. Check the repo for branch naming conventions (e.g., `feat/`, `feature/`, etc.)293. Create and switch to a new branch following the repo's convention, or fallback to: `feat/devops-pipeline`3031### 1. Analyze Project3233Detect project characteristics.3435**Use sub-agents for parallel discovery.** Launch multiple Agent tool calls concurrently to keep the main context clean:3637- **Agent 1 — Stack detection**: Scan for `package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`, `pom.xml`, `build.gradle`, `*.csproj` and identify the primary language(s), frameworks (React, Next.js, Django, FastAPI, etc.), and build tools (npm, yarn, pnpm, pip, poetry, cargo, go, maven, gradle). Return a structured summary.38- **Agent 2 — Existing tooling inventory**: Check for existing linter/formatter configs (`.eslintrc*`, `.prettierrc*`, `tsconfig.json`, `mypy.ini`, `setup.cfg`, `ruff.toml`) and existing CI configs (`.pre-commit-config.yaml`, `.github/workflows/*.yml`). Return a checklist of what is present vs missing.39- **Agent 3 — Repository conventions**: Inspect the repo for branch naming conventions, commit message style, and any existing contribution guidelines. Return the conventions found.4041Collect the results from all three agents before proceeding.4243### 2. Configure Pre-commit Hooks and GitHub Actions4445**Use sub-agents for parallel file creation.** The pre-commit config and GitHub Actions workflow are independent of each other. Dispatch them concurrently using the Agent tool, then collect results:4647- **Agent A — Pre-commit hooks**: Install the pre-commit framework (`pip install pre-commit` or `brew install pre-commit`). Create `.pre-commit-config.yaml` based on the detected stack from Step 1. Use [references/precommit-configs.md](references/precommit-configs.md) for language-specific configurations. Install hooks with `pre-commit install`. Return the path of the created config file and a summary of hooks configured.48- **Agent B — GitHub Actions workflow**: Create `.github/workflows/ci.yml` mirroring the pre-commit checks. Use [references/github-actions.md](references/github-actions.md) for workflow templates. Follow these key principles:49 - Mirror pre-commit checks for consistency50 - Use caching for dependencies51 - Run on push and pull_request52 - Add matrix testing for multiple versions if needed5354 Return the path of the created workflow file and a summary of jobs configured.5556Each agent should return the path(s) of files it created or updated.5758### 3. Verify Pipeline5960```bash61# Test pre-commit locally62pre-commit run --all-files6364# Commit and push to trigger CI65git add .pre-commit-config.yaml .github/workflows/ci.yml66git commit -m "ci: add pre-commit hooks and GitHub Actions"67git push68```6970Check GitHub Actions tab for workflow status.7172## Tool Selection by Language7374| Language | Formatter | Linter | Security | Types |75|----------|-----------|--------|----------|-------|76| JS/TS | Prettier | ESLint | npm audit | TypeScript |77| Python | Black/Ruff | Ruff | Bandit | mypy |78| Go | gofmt | golangci-lint | gosec | built-in |79| Rust | rustfmt | Clippy | cargo-audit | built-in |80| Java | google-java-format | Checkstyle | SpotBugs | - |8182## Resources8384- [references/precommit-configs.md](references/precommit-configs.md) - Pre-commit configurations by language85- [references/github-actions.md](references/github-actions.md) - GitHub Actions workflow templates