agentleFS
thettwethettwe/nyann/skills/gen-ci/SKILL.md

gen-ci

Skill6 starsChanged 3 months agoMITView on GitHub

Generate GitHub Actions CI workflows for this repository. TRIGGER ON: 'generate CI', 'add GitHub Actions', 'create CI workflow', 'set up CI', 'add CI/CD', 'create a CI pipeline', 'generate CI/CD', 'add continuous integration', 'set up GitHub Actions', 'add a lint+test workflow', 'add governance check', 'add PR health check', 'add drift check to CI', 'set up governance gate', 'enforce governance in CI'. Generates .github/workflows/ci.yml with lint, typecheck, and test jobs, and optionally .github/workflows/governance-check.yml with drift + health-score PR gating.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 0 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

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

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

    Run bin/detect-stack.sh --path .

    line 23
  2. Very specific:

    Run bin/gen-ci.sh --profile <profile> --stack <stack> --target .

    line 29
  3. Very specific:

    If the profile has a governance block, or if the user mentioned "governance", "health check", or "drift check", offer to also generate the …

    line 38
  4. Very specific:

    If the user accepts (or originally asked for it), add --governance to the gen-ci.sh invocation.

    line 45
  5. Very specific:

    Ask the user: "Write this CI workflow to .github/workflows/ci.yml?"

    line 50
  6. Very specific:

    If governance was generated: "Add a governance block to your profile to customize threshold and severity"

    line 62
  7. Very specific:

    If the profile has ci.enabled: false, explain that CI generation is disabled in the profile and offer to enable it.

    line 69
  8. Very specific:

    If .github/workflows/ci.yml already exists with nyann markers, inform the user it will be regenerated (not duplicated).

    line 70
  9. Very specific:

    No stack detected → use generic.yml template, warn that lint/test steps are placeholders

    line 75
  10. Very specific:

    No profile found → use default profile (CI disabled by default — offer to enable)

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

gen-ci — Generate GitHub Actions CI Workflow

You are the gen-ci skill. You generate a GitHub Actions CI workflow that mirrors the project's quality gates (lint, typecheck, test) based on the detected stack and nyann profile.

When to trigger

  • User asks to generate CI, add GitHub Actions, create a CI workflow, or set up CI/CD
  • User asks to add continuous integration, create a pipeline, or add a lint+test workflow
  • User asks to add a governance check, PR health check, drift check to CI, or governance gate
  • User is bootstrapping a new project and wants CI

DO NOT trigger on: general questions about CI/CD concepts, debugging existing workflows not managed by nyann, or requests to modify workflows outside nyann markers.

Execution flow

Phase 1: Detect stack and resolve profile

  1. Run bin/detect-stack.sh --path . to get a StackDescriptor JSON.
  2. Resolve and load the active profile via bin/load-profile.sh <name> (resolves preferences → CLAUDE.md markers → "default" fallback).

Phase 2: Preview the workflow

  1. Run bin/gen-ci.sh --profile <profile> --stack <stack> --target . --dry-run to preview the generated workflow.
  2. Show the user what will be generated:
    • Template selected (typescript/python/go/rust/generic)
    • Jobs and steps (lint, typecheck, test)
    • Package manager and version matrix
    • Path filters (if monorepo)

Phase 2.5: Offer governance check

If the profile has a governance block, or if the user mentioned "governance", "health check", or "drift check", offer to also generate the governance-check workflow:

"Also generate a governance check that runs doctor on every PR and posts a health report comment? (adds governance-check.yml)"

If the user accepts (or originally asked for it), add --governance to the gen-ci.sh invocation.

Phase 3: Confirm and write

  1. Ask the user: "Write this CI workflow to .github/workflows/ci.yml?"
  2. On confirmation, run:
    bin/gen-ci.sh --profile <profile> --stack <stack> --target . [--governance]
  3. Report what was written (ci.yml, and governance-check.yml if --governance).

Phase 4: Suggest next steps

  1. Suggest:
    • "Run /nyann:gen-templates to add PR and issue templates"
    • "Run /nyann:doctor to check overall repo health"
    • If governance was generated: "Add a governance block to your profile to customize threshold and severity"
    • "Commit and push to see the workflow run"

Key constraints

  • The generated workflow uses marker comments (# nyann:ci:start / # nyann:ci:end). Regeneration replaces only the marked region; user content outside markers is preserved.
  • If the profile has ci.enabled: false, explain that CI generation is disabled in the profile and offer to enable it.
  • If .github/workflows/ci.yml already exists with nyann markers, inform the user it will be regenerated (not duplicated).
  • If .github/workflows/ci.yml exists WITHOUT markers, the script refuses by default — it warns and skips so user-written CI isn't accidentally clobbered. Pass --allow-merge-existing to gen-ci.sh to opt in to appending the marked block (existing content is preserved above the markers). Suggest manual cleanup either way if the result isn't what the user wants.

Error handling

  • No stack detected → use generic.yml template, warn that lint/test steps are placeholders
  • No profile found → use default profile (CI disabled by default — offer to enable)
  • Template file missing → die with error pointing to templates/ci/ directory

Governance check details

The --governance flag generates .github/workflows/governance-check.yml:

  • Runs bin/doctor-ci.sh on every PR against base branches
  • Posts a health-score summary as a PR comment (updated on re-push)
  • Blocks or warns based on the profile's governance.threshold (default 70)
  • Emits GitHub Actions annotations for missing files, misconfigured hooks, etc.

Profile governance configuration (optional — all fields have defaults):

{
  "governance": {
    "enabled": true,
    "threshold": 70,
    "severity": "block",
    "ignore": ["orphans", "stale"]
  }
}
FieldDefaultEffect
enabledtrueSet false to disable governance check generation
threshold70Minimum health score (0-100) to pass the gate
severity"block"block = fail check; warn = annotate only; off = skip
ignore[]Categories excluded from score (e.g. orphans, stale)

When to hand off

  • "Add PR and issue templates too" → gen-templates skill.
  • "Check repo health" → doctor skill.
  • "Apply branch protection" → gh-protect skill.
  • "Customize the governance threshold" → edit the profile's governance block.
  • "Commit and ship" → commit skill, then ship skill.

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.