skills/github-actions-nx/SKILL.md
GitHub Actions CI/CD conventions for Nx monorepos: affected-based pipelines, changed-file detection, matrix jobs for renderable artifacts, Go service testing, and artifact bundling. Trigger: When creating or modifying GitHub Actions workflows, adding CI for new Nx projects, or optimizing pipeline execution.
npx skillsauth add 333-333-333/agents github-actions-nxInstall 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.
Use this skill when:
.github/workflows/nrwl/nx-set-shas + nx show projects --affected to know WHICH projects changed. Never hardcode path checks with git diff alone.if: condition gated on the affected project output.git diff to detect the specific FILES that changed, then compile/render only those files via a matrix strategy.needs: only for real dependencies (e.g., bundle depends on compile).fail-fast: false in matrix strategies so one broken file doesn't block others.Every CI workflow follows a 3-layer structure:
Layer 1: Detection → "affected" job (Nx + git diff)
Layer 2: Execution → Per-project jobs (test, build, render)
Layer 3: Aggregation → Bundle jobs (merge artifacts, cleanup)
The affected job is always the first job and the SINGLE source of truth. All other jobs depend on it via needs: affected.
The affected job does two things:
Project outputs follow a naming convention: the Nx project name with the docs- prefix stripped. So docs-latex becomes latex, docs-diagrams becomes diagrams, and api-gateway stays api-gateway.
File-level outputs are JSON arrays (e.g., ["docs/latex/project/file.tex"]) consumed by fromJson() in matrix strategies. An empty array [] means nothing changed.
See assets/affected-job.yml for the full affected detection pattern.
When a new Nx project is created (e.g., api/booking with name api-booking):
affected job's "Check affected projects" stepoutputs: mapneeds: affected and an if: conditionFiles that need compilation or rendering (LaTeX, Mermaid, Protobuf, SVG, etc.) follow the detect-render-bundle pattern:
affected job, use git diff to find changed source files, resolve to root documents if needed, output as JSON arrayKey rules:
affected jobif: needs.affected.outputs.project == 'true' && needs.affected.outputs.changed-files != '[]'retention-days: 1 (temporary)retention-days: 30if: always() && needs.render-job.result != 'skipped'For files with dependencies (e.g., a LaTeX module included by a root document), the detection step must resolve the changed file to its root compilable document.
See assets/renderable-job.yml for the full render + bundle pattern.
Go microservices follow a standard 3-step job: test, build binary, build Docker image. Use actions/setup-go@v5 with go-version-file to pin the Go version from the service's go.mod.
See assets/go-service-job.yml for the full Go service CI pattern.
New Nx project added?
├─ It produces renderable artifacts (PDF, SVG, etc.)
│ → Use renderable pattern: detect changed files + matrix + bundle
│ → See assets/renderable-job.yml
├─ It's a Go microservice
│ → Use Go service pattern: test + build + docker
│ → See assets/go-service-job.yml
├─ It's a Flutter app
│ → Use Flutter pattern: analyze + test + build
│ → (extend when mobile/ is added)
└─ It's a generic library
→ Use simple pattern: lint + test
→ Gate with if: needs.affected.outputs.{key} == 'true'
| Convention | Rule |
|------------|------|
| Location | .github/workflows/ci.yml (single CI file) |
| Triggers | push to main + all pull_request |
| Permissions | Minimal: actions: read, contents: read |
| Job naming | Descriptive name: field, kebab-case id |
| Sections | Separated by # ==== comment banners with numbered sections |
| Runner | ubuntu-latest unless specific container needed |
| Node version | Pin to 20 via actions/setup-node@v4 |
| Go version | Pin via go-version-file pointing to service's go.mod |
| Artifacts | Named {type}-{hash} for individuals, bastet-{category} for bundles |
| File | Description |
|------|-------------|
| assets/affected-job.yml | Affected detection job with project-level and file-level outputs |
| assets/renderable-job.yml | Matrix render + bundle pattern for compilable artifacts |
| assets/go-service-job.yml | Go microservice test + build + Docker pattern |
nrwl/nx-set-shas action sets NX_BASE and NX_HEAD environment variablestesting
Review Flutter components and screens for UX/UI compliance. Trigger: When user invokes /ux-review command or requests UX audit.
development
TypeScript strict patterns and best practices. Trigger: When implementing or refactoring TypeScript in .ts/.tsx (types, interfaces, generics, const maps, type guards, removing any, tightening unknown).
testing
Testing philosophy and strategy for every feature: test pyramid, mandatory levels per change type, completion checklist, and skill delegation. Trigger: When planning tests for a feature, reviewing test coverage, defining acceptance criteria, or asking what tests a change needs.
development
Terraform security practices: sensitive variables, secret management, state protection, .gitignore patterns, and CI/CD credential handling. Trigger: When handling secrets in Terraform, configuring state backends, reviewing .gitignore for Terraform, or setting up CI/CD pipelines for infrastructure.