agentleFS
tamldtamld/defense-in-depth/.agents/skills/skill-devops-github-actions/SKILL.md

skill-devops-github-actions

Skill4 starsChanged 7 months agoMITView on GitHub

Design, implement, and debug GitHub Actions workflows for DiD's server-side enforcement layer.

  • Commits and pushes

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run the full npm test + coverage gate on every PR

    line 23
  2. Very specific:

    No paid runners: All workflows must use ubuntu-latest or macos-latest (GitHub-hosted, free tier).

    line 31
  3. Very specific:

    No third-party actions for core logic: Use actions/checkout, actions/setup-node, and actions/cache only.

    line 32
  4. Distinctive:

    Ask: "What can a contributor bypass with git push --no-verify or by skipping the pre-commit hook?" These gaps are what CI must cover.

    line 41
  5. Distinctive:

    If the same steps appear in 2+ workflows:

    line 75

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SKILL: skill-devops-github-actions

Identity

Role: The CI Gate Architect
Philosophy: A local hook that can be bypassed with --no-verify is not a governance gate. Server-side CI is the last line of defense.


Mission

Design and implement GitHub Actions workflows that:

  1. Enforce governance gates server-side (cannot be bypassed by contributors)
  2. Run the full npm test + coverage gate on every PR
  3. Report failures with actionable messages (not raw stack traces)
  4. Stay within DiD's zero-cost CI constraint (GitHub-hosted runners, native Node)

Hard Gates

  1. No paid runners: All workflows must use ubuntu-latest or macos-latest (GitHub-hosted, free tier).
  2. No third-party actions for core logic: Use actions/checkout, actions/setup-node, and actions/cache only. Core enforcement logic is native shell/Node — never a third-party action.
  3. Coverage gate must be server-enforced: The coverage threshold check must be in CI, not only in local hooks.
  4. Composite Actions for reuse: Shared enforcement logic (e.g., "run tests + coverage") must be extracted to .github/actions/<name>/action.yml — not duplicated across workflows.

Workflow

Step 1: Understand the enforcement gap

Ask: "What can a contributor bypass with git push --no-verify or by skipping the pre-commit hook?" These gaps are what CI must cover.

Step 2: Design the workflow structure

# .github/workflows/ci.yml
name: CI
on:
  push:
    branches: [main]
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [18.x, 20.x, 22.x]  # Cross-version matrix

Step 3: Coverage gate pattern (DiD standard)

- name: Run tests with coverage
  run: |
    node --test --experimental-test-coverage \
      --test-reporter=spec \
      tests/*.test.js 2>&1 | tee coverage.txt

- name: Enforce coverage threshold
  run: |
    node scripts/check-coverage.js coverage.txt

Step 4: Composite Action extraction

If the same steps appear in 2+ workflows:

# .github/actions/run-tests/action.yml
name: Run Tests
description: Shared test runner with coverage gate
runs:
  using: composite
  steps:
    - run: npm ci
      shell: bash
    - run: npm test
      shell: bash

Step 5: Verify server-side enforcement

  • Open a PR with a known-failing test
  • Confirm CI blocks the merge (not just warns)
  • Confirm the failure message names the specific test/guard that failed

DiD-Specific CI Architecture

WorkflowTriggerPurpose
ci.ymlpush + PRTest suite + coverage gate
security.ymlpush + PR + schedulenpm audit + CodeQL
Composite: run-testssharedNode version matrix + coverage

Output Contract

FilePurpose
.github/workflows/<name>.ymlWorkflow definition
.github/actions/<name>/action.ymlReusable composite (if applicable)
scripts/check-coverage.jsCoverage threshold enforcement

Anti-Patterns

  1. Third-party coverage actions — codecov/codecov-action introduces an external dependency. DiD uses native Node coverage parsing.
  2. continue-on-error: true on enforcement steps — This converts a gate into a suggestion. Never use on coverage or test steps.
  3. Hardcoded Node version — Always use a matrix. DiD guarantees cross-version compatibility.
  4. Missing npm ci — Always use npm ci (not npm install) in CI for reproducible installs.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.