.claude/skills/github-actions/SKILL.md
# GitHub Actions Patterns ## When to Load This Skill Load when working with: `.github/workflows/*.yml`, CI pipelines, lint/test/build/deploy jobs, matrix strategies, GitHub secrets, environment protection rules. Keywords: `github actions`, `ci`, `workflow`, `lint job`, `test job`, `deploy`, `matrix`, `pipeline` ## Canonical Job Templates ### Lint (ruff + mypy) ```yaml lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: astral-sh/setup-uv@v4 with:
npx skillsauth add pyramidheadshark/ml-claude-infra .claude/skills/github-actionsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Load when working with: .github/workflows/*.yml, CI pipelines, lint/test/build/deploy jobs, matrix strategies, GitHub secrets, environment protection rules.
Keywords: github actions, ci, workflow, lint job, test job, deploy, matrix, pipeline
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
with:
version: "latest"
- run: uv sync --frozen
- run: uv run ruff check .
- run: uv run mypy src/
test:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
with:
version: "latest"
- run: uv sync --frozen
- run: uv run pytest --cov=src --cov-report=xml --cov-fail-under=80
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
docker-build:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: cr.yandex
username: json_key
password: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
- uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.ref == 'refs/heads/main' }}
tags: cr.yandex/${{ secrets.YC_REGISTRY_ID }}/app:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
deploy:
runs-on: ubuntu-latest
needs: docker-build
environment: production
if: github.ref == 'refs/heads/main'
steps:
- uses: yc-actions/yc-cr-login@v2
with:
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }}
- name: Deploy to YC Serverless Container
run: |
yc serverless container revision deploy \
--container-name ${{ vars.CONTAINER_NAME }} \
--image cr.yandex/${{ secrets.YC_REGISTRY_ID }}/app:${{ github.sha }} \
--service-account-id ${{ secrets.YC_SA_ID }}
name: CI/CD
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
...
test:
needs: lint
...
docker-build:
needs: test
...
deploy:
needs: docker-build
environment: production
if: github.ref == 'refs/heads/main'
...
- uses: astral-sh/setup-uv@v4
with:
version: "latest"
enable-cache: true
cache-dependency-glob: "uv.lock"
strategy:
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: astral-sh/setup-uv@v4
with:
python-version: ${{ matrix.python-version }}
Use environment: production on deploy jobs — requires manual approval in GitHub UI (Settings → Environments).
secrets.* — sensitive values (tokens, keys, passwords) — encryptedvars.* — non-sensitive config (container names, region) — plain texttesting
# Design Doc Creator ## When to Load This Skill Load when: design documents, requirements, new project start. Short fixture skill for testing (optional/meta skill).
development
# Windows Developer Guide ## When to Load Automatically loaded on Windows (`platform_trigger: "win32"`). Applies to: `.py`, `.ps1`, `.bat`, `.cmd` files and any Windows-specific workflow. ## Python on Windows ### Encoding (CRITICAL) Windows defaults to `cp1251` / `cp1252` for file I/O. Always specify UTF-8 explicitly: ```python with open("file.txt", "r", encoding="utf-8") as f: content = f.read() Path("file.txt").read_text(encoding="utf-8") Path("file.txt").write_text(content, encodin
development
# Test-First Patterns ## When to Load This Skill Load when writing tests, creating `.feature` files, setting up conftest, discussing test strategy, or reviewing coverage. ## Philosophy Tests are written BEFORE code. Always. No exceptions. The order is: Design Doc → BDD Scenarios → Unit Tests → Implementation. BDD scenarios come from the design document's use cases section — they are a direct translation of business requirements into executable specifications. This makes tests the living do
testing
# Skill: Supply Chain Auditor ## When to Load Auto-load when: adding dependencies, reviewing packages, updating versions, or discussing `requirements.txt`, `pyproject.toml`, `package.json`. Triggers on `dependency`, `install`, `package`, `CVE`, `audit`, `vulnerable` (≥2 keywords). ## Core Rules Every new dependency addition must pass this checklist before merging: 1. **Pinned** — exact version in production (`==1.2.3` for pip, `"1.2.3"` for npm, not `^` or `~`). 2. **Maintained** — last com