luongnv89/skills/devops-pipeline

Claude Code and agent skill by luongnv89/skills

Trust tier 2
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Configure pre-commit hooks and lean GitHub Actions for shift-left QA. Use when adding, auditing, speeding up CI/CD or cutting its Actions minutes or cost: max local checks, fast free CI. Skip for Terraform/K8s, deploy pipelines, or non-GitHub CI.

Install

npx vskill@latest install luongnv89/skills/devops-pipeline

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as luongnv89/skills/devops-pipeline.

DevOps Pipeline

Implement DevOps quality gates adapted to the project, shift-left: run as many checks as possible locally via pre-commit, so feedback is fast and CI is a safety net, not the primary gate.

Core principle: if a check can run on a developer's machine, it runs there. GitHub Actions runs only what a laptop genuinely cannot — matrix version testing, CI-only scans, deployment, the coverage summary — plus one cheap job proving the hooks were not bypassed. Speed comes only from free techniques.

Check Routing Table

Every check lands in exactly one lane. This table is the single source of truth; steps 2–3, the references, and generated config must agree with it.

LaneTime budgetWhat runs there
pre-commit stage (every commit)< 10s, changed files onlyFormat, lint, type-check (fastest free tool), offline security scans, unit tests related to the changed files, compile/import check
pre-push stage (every push)< 60sAffected tests (whole suite and coverage threshold when they fit), CLI E2E, slow lint rulesets
GitHub Actions, pull requestAs short as the slowest guard legDiff-scoped bypass guard
GitHub Actions, default branchFree on public repos, billed per minute on privateFull suite and version matrix (per merge, nightly on a busy private repo), cache seeding, CI-only scans, clean-VM tests, coverage summary, deploy/release

A check that fits an earlier lane must not be repeated in a later one; the only deliberate overlaps are the bypass guard, the default-branch full run that backstops affected-test selection, and security-setup's full-scan workflow, which that skill owns.

Repo Sync Before Edits (mandatory)

Before creating/updating/deleting files in an existing repository, sync the current branch with remote, stashing a dirty working tree first:

bash
git stash push -u -m "pre-sync" # only if the tree is dirty
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin && git pull --rebase origin "$branch"
git stash pop # only after a stash

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

Safety Rails

This skill writes config into someone else's repository and installs git hooks:

  • Never overwrite an existing file this skill writes (.pre-commit-config.yaml, workflows, .oxlintrc.json, vitest.config.*, scripts, AGENTS.md). If the target file exists, follow this merge procedure:
  1. Copy the file to <file>.bak.
  2. Prepare the merged content. Keep user-defined hooks, jobs, and pinned rev: values.
  3. Show the user the diff between <file>.bak and the merged content.
  4. If the user confirms, write the merged file. If the user declines, leave the original file unchanged and record the merge as declined.
  5. Keep <file>.bak until the user confirms the written result.
  • Show every new file as a diff before writing it.
  • Validate and dry-run before installing hooks, in Step 2's order, so findings surface without blocking any commit.
  • Check for an existing git hook before installing. pre-commit install moves a foreign hook to <hook>.legacy and runs it in migration mode. Never pass -f/--overwrite, which deletes it silently; deleting it needs the user's explicit confirmation.
  • Never run `git commit --no-verify` or `git push --no-verify` on the user's behalf, except security-setup's recorded-override commit. A failing hook is a finding to report, not an obstacle to route around.
  • Surface failures, never suppress them. Do not add a hook id to SKIP or lower a coverage threshold to turn a run green or make it faster, nor relax a lint rule or delete or skip a test without the user's approval of that named finding; a blanket "delete the slow tests" or "make it green" approves nothing. Report the failure and let the user decide.
  • No test retries. Generated config never reruns a failing test (pytest --reruns, jest.retryTimes, Vitest retry, Playwright retries). Existing retry config is a named audit finding, removed only after that finding's approval.
  • Never configure anything paid: no third-party or larger runners, no sharding on a private repo, no Actions cache above the free 10 GB, no paid or third-party service such as Codecov; coverage goes to the job summary.
  • Never merge. Committed changes end in a pull request the user merges; measurement runs are budgeted and approved before any push.
  • Never write CODEOWNERS or branch protection; the final report only proposes CODEOWNERS entries.
  • Stop rather than guess when the stack is undetected, pre-commit is absent, or origin is missing — see Step 1 and Edge Cases.

Workflow

1. Analyze Project

Detect project characteristics:

bash
ls -la package.json pyproject.toml Cargo.toml go.mod pom.xml build.gradle ./*.csproj 2>/dev/null
ls -la .eslintrc* .oxlintrc* .prettierrc* tsconfig.json mypy.ini setup.cfg ruff.toml 2>/dev/null
ls -la .pre-commit-config.yaml .github/workflows/*.yml 2>/dev/null
gh repo view --json visibility --jq .visibility # PUBLIC or PRIVATE

Identify:

  • Stack: languages, frameworks, build system, and the linters, formatters and type checkers already configured
  • Visibility: public (standard runners free, 4 vCPU) or private, INTERNAL included (billed per minute, each job rounded up, 2 vCPU). Step 3 generates the workflow for it; if gh cannot read it, ask, and assume private meanwhile. For a private repo, count default-branch commits over 30 days: git rev-list --count --first-parent --since=30.days <default-branch>.
  • Is this a CLI tool? If yes, list every command and subcommand for the E2E suite

If no package manifest matches, ask the user for the language and build system before Step 2. Step 1 is done when the language, build system, existing tooling, existing config files, visibility, and CLI status are recorded.

2. Configure Pre-commit Hooks (maximize local coverage)

If pre-commit is absent, show the install command and stop — see Edge Cases.

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

When pre-commit is available, write .pre-commit-config.yaml for the detected stack, each check in its routing-table lane, with default_stages: [pre-commit] (a hook with no stages: otherwise also runs on every push). If the file exists, use the Safety Rails merge procedure. See references/precommit-configs.md for tool choice and configs per language, and fast test runs.

  • Fastest free tool per check. Keep the repo's tools and propose faster ones in the diff, with a benchmark. JS/TS: Oxlint, with ESLint only for rules Oxlint lacks; set Oxlint's categories to error, since its warnings exit 0. Type-check: TypeScript 7's tsc, then bun check only if faster with the same errors (tsrs stays a local benchmark until 1.0). Python: Ruff, mypy as arbiter.
  • Every hook tool is a dev dependency. pytest -n auto needs pytest-xdist: when the dev extras lack it, add it in the same diff, or pytest fails with unrecognized arguments: -n.
  • Related unit tests on commit. The commit-stage unit hook keeps pass_filenames and require_serial: true and runs only the tests related to the staged files (vitest related --run, scripts/related-tests.py, changed Go packages), so the guard repeats only the diff's; pre-push runs the whole suite, with always_run: true so a deletion-only change still runs it (not in Multi-language, where the path-filtered matrices catch deletions).
  • Affected tests on `pre-push` when the whole suite exceeds 60 seconds: scripts/affected-tests.sh, which fails when source changed but no test was selected, and runs the whole suite when the diff deletes code.
  • Hooks, not AGENTS.md lines. An AGENTS.md instruction is advice an agent can skip; a hook blocks the commit or push. If the repo has an AGENTS.md, propose one line: hooks exist and must not be bypassed.
  • Vitest `isolate: false` only with the reference's per-file reset hook.

Modern stage names only (pre-commit, pre-push); run pre-commit migrate-config on a config still using the deprecated commit or push.

CLI End-to-End Testing

If the project is a CLI tool, create scripts/e2e_test.sh exercising every command/subcommand end-to-end (not just compiling), wired to the pre-push stage. See references/cli-e2e.md for command discovery, the script template, and the hook snippet.

Validate the config, dry-run it, then install the hooks, in this order:

  1. Run pre-commit validate-config .pre-commit-config.yaml. On a non-zero exit, report the error and install nothing.
  2. Stage the files this run wrote (--all-files sees tracked files only), then dry-run pre-commit run --all-files. Fixers may rewrite files, so report git diff --stat; record each failing hook id as a finding.
  3. If pre-commit or pre-push exists in the directory git rev-parse --git-path hooks prints (not always .git/hooks) without File generated by pre-commit, tell the user it will move to <hook>.legacy.
  4. Run pre-commit install, then pre-commit install --hook-type pre-push; the first alone installs no pre-push hooks.

Nothing local stops --no-verify, so never drop the CI bypass guard when trimming CI.

3. Create GitHub Actions Workflows (lean, fast CI)

If no workflow exists, write .github/workflows/ci.yml. If one exists, run the CI Speed Audit first, then use the Safety Rails merge procedure, listing each step that duplicates a hook outside the deliberate overlaps as a proposed removal; remove it only after the user confirms. Templates, for example the guard: references/github-actions.md.

CI runs exactly four kinds of thing:

  1. Bypass guard — re-runs both hook stages over the pull request's diff; when it changes hook config, a workflow or a hook script, first with the base branch's (base-branch gate).
  2. Version matrix — the only lane needing several runners, doubling as the full-suite backstop. Per merge; nightly only on a private repo with 30 or more default-branch commits a month.
  3. CI-only scans — checks that need the hosted runner rather than a laptop.
  4. Deploy / release — on merge to the default branch.

Make it fast, free techniques only: apply every item of references/github-actions.md → _Generated-workflow checklist_.

CI Speed Audit (existing pipelines)

Run it before changing an existing workflow, or alone when the user asks why CI is slow. It is read-only and runs no hooks; follow references/github-actions.md. Done when each job's queue/setup/work split comes from real runs, or the report says why none were measured, and the retry check ran.

CI Minutes Optimization (existing pipelines)

When the user wants Actions minutes or cost cut, follow references/ci-minutes.md: audit billed minutes per runner OS and the critical path, then report named findings. Apply only approved findings, on a branch, one atomic commit each, measured before and after; keep a change only when it beats noise with all jobs green, else revert it and log it in .github/CI-BUDGET.md. It ends in a pull request.

4. Verify Pipeline

Each command below is expected to exit 0:

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
91
Repository forks
14
7-day trend score
23

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 Mar 2026, 8 months ago.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/luongnv89/skills/devops-pipeline/badge)](https://verified-skill.com/skills/luongnv89/skills/devops-pipeline)

Something wrong with this skill or its page? Tell us.