skills/luongnv89/skills/devops-pipeline

devops-pipeline

SKILL.md

DevOps Pipeline

Implement comprehensive DevOps quality gates adapted to project type.

Repo Sync Before Edits (mandatory)

Before creating/updating/deleting files in an existing repository, sync the current branch with remote:

branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin
git pull --rebase origin "$branch"

If the working tree is not clean, stash first, sync, then restore:

git stash push -u -m "pre-sync"
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin && git pull --rebase origin "$branch"
git stash pop

If origin is missing, pull is unavailable, or rebase/stash conflicts occur, stop and ask the user before continuing.

Workflow

1. Analyze Project

Detect project characteristics:

# Check for package files and configs
ls -la package.json pyproject.toml Cargo.toml go.mod pom.xml build.gradle *.csproj 2>/dev/null
ls -la .eslintrc* .prettierrc* tsconfig.json mypy.ini setup.cfg ruff.toml 2>/dev/null
ls -la .pre-commit-config.yaml .github/workflows/*.yml 2>/dev/null

Identify:

  • Languages: JS/TS, Python, Go, Rust, Java, C#, etc.
  • Frameworks: React, Next.js, Django, FastAPI, etc.
  • Build system: npm, yarn, pnpm, pip, poetry, cargo, go, maven, gradle
  • Existing tooling: Linters, formatters, type checkers already configured

2. Configure Pre-commit Hooks

Install pre-commit framework:

pip install pre-commit  # or brew install pre-commit

Create .pre-commit-config.yaml based on detected stack. See references/precommit-configs.md for language-specific configurations.

Install hooks:

pre-commit install
pre-commit run --all-files  # Test on existing code

3. Create GitHub Actions Workflows

Create .github/workflows/ci.yml mirroring pre-commit checks. See references/github-actions.md for workflow templates.

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

4. Verify Pipeline

# Test pre-commit locally
pre-commit run --all-files

# Commit and push to trigger CI
git add .pre-commit-config.yaml .github/
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

Weekly Installs
27
GitHub Stars
1
First Seen
Feb 4, 2026
Installed on
opencode26
codex26
github-copilot24
kimi-cli24
gemini-cli24
amp24