devops-pipeline

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", or any DevOps automation for code quality. Detects project type and configures appropriate tools.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "devops-pipeline" with this command: npx skills add luongnv89/skills/luongnv89-skills-devops-pipeline

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

LanguageFormatterLinterSecurityTypes
JS/TSPrettierESLintnpm auditTypeScript
PythonBlack/RuffRuffBanditmypy
Gogofmtgolangci-lintgosecbuilt-in
RustrustfmtClippycargo-auditbuilt-in
Javagoogle-java-formatCheckstyleSpotBugs-

Resources

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

code-optimizer

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

code-review

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

vscode-extension-publisher

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

devops-pipeline

No summary provided by upstream source.

Repository SourceNeeds Review