.agents/skills/github-actions-patterns/SKILL.md
# Skill: GitHub Actions Patterns **Description**: Guidance for agents implementing GitHub Actions workflow patterns, designing reusable workflows, vetting actions, and managing secrets securely. **When to use**: When implementing GitHub Actions workflows, creating reusable workflow components, selecting actions for CI/CD pipelines, or designing secrets management strategies. --- ## Quick Start ### I'm designing a new workflow 1. Read `.opencode/rules/patterns/workflows/design.md` for the 8
npx skillsauth add em-jones/staccato-toolkit .agents/skills/github-actions-patternsInstall 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.
Description: Guidance for agents implementing GitHub Actions workflow patterns, designing reusable workflows, vetting actions, and managing secrets securely.
When to use: When implementing GitHub Actions workflows, creating reusable workflow components, selecting actions for CI/CD pipelines, or designing secrets management strategies.
Read .opencode/rules/patterns/workflows/design.md for the 8 core patterns:
Reference the example: .github/workflows-examples/standard-pipeline.yml
Verify your workflow against the pattern checklist
.opencode/rules/patterns/actions/approved-actions-catalog.mdRead .opencode/rules/patterns/actions/secrets.md for the 8 patterns:
Never hardcode secrets; always use ${{ secrets.NAME }}
Read .opencode/rules/patterns/workflows/reusable.md for the 8 patterns:
Reference reusable example: .github/workflows-examples/reusable-*.yml
Read .opencode/rules/patterns/actions/curation.md for the 8 patterns:
Use the vetting checklist in pattern #1
ci.yml, deploy-staging.yml, nightly-audit.ymlneeds: for dependencies
if: to control when jobs/steps run
if: github.ref == 'refs/heads/main'continue-on-error: truealways() for cleanup/notification stepscache: npm in setup-nodeactions/checkout, docker/build-push-actioncodecov/codecov-action, golangci/golangci-lint-actionaquasecurity/trivy-action (security-focused organization)@v4 — Gets bug fixes, prevents major breaks (recommended)@v4.0.0 — Most stable, requires manual updates@master or @main — Never use in production${{ secrets.NAME }}echo "::add-mask::value"***)on: workflow_call triggerneeds: to control dependency order@v1 (gets v1.0, v1.1, v1.2)github.ref == 'refs/heads/main').github/workflows-examples/standard-pipeline.yml and customizev1.0.0 when ready.opencode/rules/patterns/workflows/reusable.md patterns 1-8.opencode/rules/patterns/actions/approved-actions-catalog.md@v4 or @v3 (not @master or @main)${{ secrets.NAME }}—automatically masked***).opencode/rules/patterns/actions/secrets.md patterns 1-8if: conditions work as expected?name: CI/CD Pipeline # Descriptive name
on: [push, pull_request]
env:
NODE_VERSION: "18" # Avoid secrets in env
jobs:
lint: # Parallel phase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm" # Performance
- run: npm ci
- run: npm run lint
continue-on-error: true # Optional
build: # Critical phase
runs-on: ubuntu-latest
needs: lint # Sequential gate (if lint fails, build is skipped)
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- run: npm ci
- run: npm run build
deploy: # Only on main
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main' # Conditional gate
environment: production # Requires approval
steps:
- uses: actions/checkout@v4
- run: |
./deploy.sh
env:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} # Secrets are masked
name: Reusable Build
on:
workflow_call:
inputs:
node-version:
type: string
required: false
default: "18"
jobs:
build:
runs-on: ubuntu-latest
steps:
# Validate input
- name: Validate node version
run: |
if [[ ! "${{ inputs.node-version }}" =~ ^[0-9]+$ ]]; then
echo "::error::Invalid node version"
exit 1
fi
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: "npm"
- run: npm ci
- run: npm run build
jobs:
deploy:
steps:
# ✓ Correct: Secret injected via ${{ secrets.NAME }}
- run: deploy.sh
env:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} # Automatically masked
# ✗ Wrong: Hardcoded secret
# - run: deploy.sh --token="abc123"
# ✗ Wrong: Secret in output
# - run: echo "${{ secrets.DEPLOY_TOKEN }}" # Masked but visible
# ✓ Correct: If you must output, mask it
- run: |
DERIVED=$(echo -n "${{ secrets.DEPLOY_TOKEN }}" | sha256sum)
echo "::add-mask::${DERIVED}"
echo "Hash: ${DERIVED}"
.opencode/rules/patterns/workflows/design.md.opencode/rules/patterns/workflows/reusable.md.opencode/rules/patterns/actions/curation.md.opencode/rules/patterns/actions/secrets.md.github/workflows-examples/.opencode/rules/patterns/actions/approved-actions-catalog.mdThese patterns are reviewed quarterly. If a pattern becomes outdated:
Last Updated: 2024-02-25
Maintainers: Platform/DevOps Team
Review Schedule: Quarterly (January, April, July, October)
tools
<!--VITE PLUS START--> # Using Vite+, the Unified Toolchain for the Web This project is using Vite+, a unified toolchain built on top of Vite, Rolldown, Vitest, tsdown, Oxlint, Oxfmt, and Vite Task. Vite+ wraps runtime management, package management, and frontend tooling in a single global CLI called `vp`. Vite+ is distinct from Vite, but it invokes Vite through `vp dev` and `vp build`. ## Vite+ Workflow `vp` is a global binary that handles the full development lifecycle. Run `vp help` to pr
development
Guide for building performant data tables. Uses tanstack-table for table logic (sorting, filtering, pagination) and tanstack-virtual for rendering large datasets efficiently.
development
Expert guidance for building observable, expressive, and fault-tolerant TypeScript applications using the effect-ts/effect ecosystem. Covers Effect<A, E, R> type, error management, dependency injection via Layers, observability (logging, metrics, tracing), concurrency with Fibers, retry/scheduling, Schema validation, Streams, and Sinks.
tools
Complete E2E (end-to-end) and integration testing skill for TypeScript/NestJS projects using Jest, real infrastructure via Docker, and GWT pattern. ALWAYS use this skill when user needs to: **SETUP** - Initialize or configure E2E testing infrastructure: - Set up E2E testing for a new project - Configure docker-compose for testing (Kafka, PostgreSQL, MongoDB, Redis) - Create jest-e2e.config.ts or E2E Jest configuration - Set up test helpers for database, Kafka, or Redis - Configure .env.e2e environment variables - Create test/e2e directory structure **WRITE** - Create or add E2E/integration tests: - Write, create, add, or generate e2e tests or integration tests - Test API endpoints, workflows, or complete features end-to-end - Test with real databases, message brokers, or external services - Test Kafka consumers/producers, event-driven workflows - Working on any file ending in .e2e-spec.ts or in test/e2e/ directory - Use GWT (Given-When-Then) pattern for tests **REVIEW** - Audit or evaluate E2E tests: - Review existing E2E tests for quality - Check test isolation and cleanup patterns - Audit GWT pattern compliance - Evaluate assertion quality and specificity - Check for anti-patterns (multiple WHEN actions, conditional assertions) **RUN** - Execute or analyze E2E test results: - Run E2E tests - Start/stop Docker infrastructure for testing - Analyze E2E test results - Verify Docker services are healthy - Interpret test output and failures **DEBUG** - Fix failing or flaky E2E tests: - Fix failing E2E tests - Debug flaky tests or test isolation issues - Troubleshoot connection errors (database, Kafka, Redis) - Fix timeout issues or async operation failures - Diagnose race conditions or state leakage - Debug Kafka message consumption issues **OPTIMIZE** - Improve E2E test performance: - Speed up slow E2E tests - Optimize Docker infrastructure startup - Replace fixed waits with smart polling - Reduce beforeEach cleanup time - Improve test parallelization where safe Keywords: e2e, end-to-end, integration test, e2e-spec.ts, test/e2e, Jest, supertest, NestJS, Kafka, Redpanda, PostgreSQL, MongoDB, Redis, docker-compose, GWT pattern, Given-When-Then, real infrastructure, test isolation, flaky test, MSW, nock, waitForMessages, fix e2e, debug e2e, run e2e, review e2e, optimize e2e, setup e2e