cosmix/loom/loom-ci-cd

Claude Code and agent skill by cosmix/loom

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

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

Designs and implements CI/CD pipelines: testing, builds, deployment, security scanning. Not for: a loom stage/job.

Install

npx vskill@latest install cosmix/loom/loom-ci-cd

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

SKILL.md

The same SKILL.md was published earlier as cosmix/loom/loom-ci-cd.

CI/CD

Overview

Pipeline design, security hardening, and optimization across GitHub Actions, GitLab CI, Jenkins, CircleCI, and cloud-native platforms. The load-bearing content is Expert Practices (bottom) — supply-chain, least-privilege, OIDC, cache trust boundaries, and platform gotchas. Read that section for any non-trivial pipeline.

Design Principles

  • Fail fast, cheap-first: lint → typecheck → unit → integration → build → deploy. A stage should only run if everything cheaper passed.
  • Parallelize independent work; shard slow test suites across runners; matrix multi-version/OS.
  • Cache by lock-file hash, scoped by OS — never by branch (see cache gotcha). Cache deps, build output, Docker layers.
  • Build once, promote by digest — never rebuild per environment (see Design Patterns). What you validated in staging must be the exact bytes that reach prod.
  • Least privilege: permissions: {} default, grant per-job; OIDC not stored cloud keys; pin actions by SHA.
  • Every deploy reversible; pipelines idempotent/re-runnable; manual approval gates for prod via environments.
  • Shift security left: SAST/secret/dependency scans early; container scan pre-push; block on CRITICAL/HIGH.
Deployment strategies
StrategyMechanismRollbackUse when
RollingReplace pods incrementallyRoll forward/backDefault; backward-compat schema
Blue-greenTwo full envs, flip trafficFlip back instantFast rollback, DB-compat needed
CanaryRoute N% to new version, rampDrop canaryRisk-averse, good metrics/SLOs
ShadowMirror traffic, discard responsesN/A (no user impact)Validate perf before real cutover

Examples

Examples are trimmed skeletons — repeat checkout/setup-* steps per job (jobs don't share a workspace). Pin every action, including `actions/*`, to a reviewed full commit SHA in real use; retain the action major only as a comment for update tooling.

GitHub Actions: full pipeline
yaml
name: CI/CD
on:
push: { branches: [main, develop] }
pull_request: { branches: [main] }
env: { REGISTRY: ghcr.io, IMAGE_NAME: ${{ github.repository }} }
permissions: {} # deny all; grant per-job below
concurrency: { group: "ci-${{ github.workflow }}-${{ github.head_ref || github.ref }}", cancel-in-progress: true }
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env: { POSTGRES_PASSWORD: postgres, POSTGRES_DB: test }
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@<full-commit-sha> # v4
- uses: actions/setup-node@<full-commit-sha> # v4
with: { node-version: "20", cache: "npm" } # cache keyed on lock file automatically
- run: npm ci
- run: npm test -- --coverage
env: { DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test }
build:
needs: test
runs-on: ubuntu-latest
permissions: { contents: read, packages: write } # only this job can push
steps:
- uses: actions/checkout@<full-commit-sha> # v4
- uses: docker/setup-buildx-action@<full-commit-sha> # v3; REQUIRED for type=gha cache
- uses: docker/login-action@<full-commit-sha> # v3
with: { registry: "${{ env.REGISTRY }}", username: "${{ github.actor }}", password: "${{ secrets.GITHUB_TOKEN }}" }
- id: meta
uses: docker/metadata-action@<full-commit-sha> # v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,prefix=
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- id: build
uses: docker/build-push-action@<full-commit-sha> # v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
provenance: mode=max # SLSA (private repos default mode=min)
sbom: true # NOT automatic; incompatible with load: true
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: { digest: "${{ steps.build.outputs.digest }}" }
deploy-production:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: production # gates/approvals configured on the environment
steps:
- uses: actions/checkout@<full-commit-sha> # v4
- name: Deploy by immutable digest
run: kubectl set image deployment/app app=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ needs.build.outputs.digest }}
GitLab CI
yaml
stages: [validate, test, build, deploy]
variables: { IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA }
workflow: # suppress duplicate branch pipeline when an MR is open
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
.node: { image: node:20-alpine, cache: { key: ${CI_COMMIT_REF_SLUG}, paths: [node_modules/] } }
test:
stage: test
extends: .node
services: [postgres:16]
variables: { POSTGRES_DB: test, POSTGRES_USER: r, POSTGRES_PASSWORD: r, DATABASE_URL: "postgresql://r:r@postgres:5432/test" }
script: [npm ci, npm test -- --coverage]
coverage: '/Lines\s*:\s*(\d+\.?\d*)%/'
artifacts: { reports: { junit: junit.xml, coverage_report: { coverage_format: cobertura, path: coverage/cobertura-coverage.xml } } }
deploy-production:
stage: deploy
# Pin a reviewed digest in the real pipeline; a tag is only illustrative here.
image: bitnami/kubectl@sha256:<reviewed-digest>
script:
- kubectl set image deployment/app app=$IMAGE_TAG -n production
- kubectl rollout status deployment/app -n production --timeout=300s
environment: { name: production, url: https://example.com }
when: manual # approval gate
rules: [{ if: $CI_COMMIT_BRANCH == "main" }]
Deploy via OIDC (no stored cloud keys)
yaml
jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
permissions:
id-token: write # REQUIRED for OIDC — omit and the token request silently returns empty
contents: read
steps:
- uses: actions/checkout@<full-commit-sha> # current approved major
- uses: aws-actions/configure-aws-credentials@<full-commit-sha> # current approved major; mints short-lived STS creds
with:
role-to-assume: arn:aws:iam::123456789012:role/gh-deploy # trust policy: sub StringEquals repo:org/repo:environment:production
aws-region: ${{ inputs.aws-region }}
- run: aws eks update-kubeconfig --name ${{ inputs.cluster }} --region ${{ inputs.aws-region }}
- run: kubectl set image deployment/app app=${{ inputs.image-digest }} -n ${{ inputs.environment }}
Security scanning jobs
yaml
jobs:
sast:
runs-on: ubuntu-latest
permissions: { security-events: write, contents: read } # upload-sarif needs this
steps:
- uses: actions/checkout@<full-commit-sha> # v4
- uses: github/codeql-action/init@<full-commit-sha> # v3
with: { languages: "javascript, python" }
- uses: github/codeql-action/autobuild@<full-commit-sha> # v3
- uses: github/codeql-action/analyze@<full-commit-sha> # v3
scan:
runs-on: ubuntu-latest
permissions: { contents: read, security-events: write } # upload-sarif needs security-events
steps:
- uses: actions/checkout@<full-commit-sha> # v4
with: { fetch-depth: 0 } # full history for secret detection
- uses: aquasecurity/trivy-action@<full-commit-sha> # current reviewed major; never a mutable branch
with: { scan-type: fs, scan-ref: ".", format: sarif, output: trivy.sarif, severity: "CRITICAL,HIGH" }
- uses: github/codeql-action/upload-sarif@<full-commit-sha> # v3
with: { sarif_file: trivy.sarif }
- uses: trufflesecurity/trufflehog@<full-commit-sha>
with: { base: "${{ github.event.repository.default_branch }}", head: HEAD }

Tool map: SAST CodeQL / Semgrep / SonarQube (sonarqube-scan-action; sonarcloud-github-action archived 2025-10) · deps Trivy / Snyk / Dependabot · secrets TruffleHog / GitGuardian · container Trivy / Grype · DAST OWASP ZAP (against a deployed env).

Matrix + sharding
yaml
jobs:
unit:
strategy:
fail-fast: false # let all cells finish; true kills the whole matrix on first failure
matrix: { node: [18, 20, 22], os: [ubuntu-latest, macos-latest] }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@<full-commit-sha> # v4
- uses: actions/setup-node@<full-commit-sha> # v4
with: { node-version: "${{ matrix.node }}", cache: npm }
- run: npm ci && npm test
integration:
strategy: { matrix: { shard: [1, 2, 3, 4] } } # split slow suite across runners
runs-on: ubuntu-latest
steps:
- run: npm run test:integration -- --shard=${{ matrix.shard }}/4
Monorepo path filtering
yaml
jobs:
changes:
runs-on: ubuntu-latest
outputs: { api: "${{ steps.f.outputs.api }}", web: "${{ steps.f.outputs.web }}" }
steps:
- uses: actions/checkout@<full-commit-sha> # v4
- uses: dorny/paths-filter@<full-commit-sha> # current approved major
id: f
with:
filters: |
api: ['services/api/**', 'packages/shared/**']
web: ['services/web/**', 'packages/shared/**']
test-api:
needs: changes
if: needs.changes.outputs.api == 'true' # skip unchanged services
runs-on: ubuntu-latest
steps: [{ uses: actions/checkout@<full-commit-sha> }] # v4; build/test api

Alternatives to hand-rolled filtering: Turborepo/Nx affected graphs, Bazel — they compute the change-impact DAG and skip unaffected targets.

ML pipeline skeleton
yaml
# jobs: data-validation -> train -> evaluate (gate) -> deploy
jobs:
train:
needs: data-validation # Great Expectations / schema check on DVC-pulled data first
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@<full-commit-sha> # v4
- uses: actions/setup-python@<full-commit-sha> # v5
with: { python-version: "3.11", cache: pip }
- run: pip install -r requirements.txt mlflow
- run: python training/train.py --model-version ${{ inputs.model-version || github.sha }} # tag model with git SHA
env: { MLFLOW_TRACKING_URI: "${{ secrets.MLFLOW_TRACKING_URI }}" }
- uses: actions/upload-artifact@<full-commit-sha> # v4
with: { name: trained-model, path: models/output/ }
evaluate:
needs: train
runs-on: ubuntu-latest
steps:
- run: python evaluation/check_metrics.py --min-accuracy 0.85 --min-f1 0.80 # perf gate: fail = no deploy

ML specifics: validate data schema/quality before training; track experiments (MLflow/W&B); version models by SHA; gate deploy on metric thresholds; roll out via shadow → canary; auto-rollback on live perf degradation.

Caching & Parallelization

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

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

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

Source

Popularity

Repository stars
56
Repository forks
3
7-day trend score
20

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

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/cosmix/loom/loom-ci-cd/badge)](https://verified-skill.com/skills/cosmix/loom/loom-ci-cd)

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