agentleFS
LeanMeanCleanAppsLeanMeanCleanApps/CleanModelContextProtocol/.agents/skills/ci-for-your-solution/SKILL.md

ci-for-your-solution

Skill1 starsChanged 6 days agoMITView on GitHub

How CI works in a solution made from this template - the ci.yml that dotnet new ships, the Build Pipeline a "Use this template" copy keeps, and how to add security scans or a container check, or move the pipeline to Azure Pipelines, GitLab or another CI system. Use when CI fails on a fresh solution, when adding a check, or when the engineer asks how to set up CI anywhere other than GitHub Actions.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Agree what to add: Ask about each check in the table on its own, with a recommendation.

    line 33
  2. Distinctive:

    Add it as its own step or job: Use the system's standard task or action, and run the exact local command from the table.

    line 34
  3. Distinctive:

    Run different commands in the pipeline from the ones in AGENTS.md.

    line 60

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

CI for your solution

The rule

Every solution starts with a simple pipeline that runs the commands in AGENTS.md: format, build, and test with the 95% coverage gate. It needs no secrets, no paid features and no setup, so it's green on the first push. Anything more is added on purpose, with the engineer, one check at a time.

Made withPipelineWhat runs
dotnet new.github/workflows/ci.ymlRestore, format, build, test and the coverage gate
"Use this template" on GitHub.github/workflows/build-pipeline.yml, the template's ownFormat, build and test. The scans and the template's pack, verify and release jobs only run in the LeanMeanCleanApps organisation, and show as not run anywhere else

The Set up CI guide for your template on the Lean Mean Clean Apps docs site shows both, and links the template's full Build Pipeline as a worked example of every check below.

Adding a check

CheckLocal commandFails whenNeeds
Vulnerable packagesdotnet list package --vulnerable --include-transitiveA package has a known high or critical vulnerability. The command always exits 0, so fail the step when its output contains High or CriticalNothing
Dependency reviewGitHub's actions/dependency-review-action on pull requestsA new package is vulnerable or has a licence the team doesn't allowGitHub Advanced Security on a private repository
Containerdocker build . --target runThe image doesn't build. Add an image scanner such as Trivy if the team ships the containerDocker on the runner
Static analysisThe CI system's own scanner, such as CodeQL on GitHubA security finding the team hasn't acceptedGitHub Advanced Security on a private repository

Steps

  1. Start green. Push the solution and check the pipeline passes before changing it. If it fails on a fresh solution, run the same command locally and fix the cause, not the pipeline.
  2. Agree what to add. Ask about each check in the table on its own, with a recommendation. Vulnerable packages needs nothing, so recommend it first. Say up front when a check needs Advanced Security or another paid feature.
  3. Add it as its own step or job. Use the system's standard task or action, and run the exact local command from the table.
  4. Moving off GitHub Actions? Port ci.yml step for step to the team's system, such as Azure Pipelines, GitLab CI or Jenkins: install the SDK from global.json, then the same commands in the same order. Delete ci.yml once the new pipeline is green.
  5. Prove it. Open a pull request so the pipeline runs on itself. Then break something on purpose, like a formatting change or a failing assertion, and check it goes red before you put it back.
  6. Hand over. Tell the engineer which checks to make required on the main branch. That's their setting, not yours.

Coverage

Coverlet merges every test project into one report, so the gate checks the merged total once, at the end. A per-project Coverlet threshold would judge each project on a partly merged report. Keep the settings in ci.yml in step with coverage.

- run: >-
    dotnet test --configuration Release --no-build -m:1
    -p:CollectCoverage=true -p:CoverletOutput=../results/ -p:MergeWith="../results/coverage.json"
    -p:CoverletOutputFormat=opencover%2cjson
    -p:ExcludeByFile="**/Program.cs%2c**/Migrations/*.cs%2c**/obj/**/*.cs"
    -p:ExcludeByAttribute="GeneratedCodeAttribute"
- run: |
    coverage=$(grep -o -m1 'sequenceCoverage="[0-9.]*"' tests/results/coverage.opencover.xml | grep -o '[0-9.]*')
    awk -v c="$coverage" 'BEGIN { exit (c < 95) }'

Don't

  • Copy the template-only jobs from the Build Pipeline: packing and verifying the template, Release Check and Publish.
  • Make a check depend on a secret, a paid service or an account to pass on a pull request, unless the engineer has agreed to it.
  • Lower the coverage threshold or skip a test to get a run green. Fix the cause (coverage, test-design).
  • Run different commands in the pipeline from the ones in AGENTS.md. If one has to change, change both.
  • Set up the CI system, runners, Advanced Security or branch rules yourself. Write the pipeline and say what the engineer needs to switch on.

Check

  • The pipeline runs on a pull request and every check is green.
  • A deliberate formatting change or failing test turns it red.
  • dotnet format --verify-no-changes, dotnet build and dotnet test pass locally on the same commit.

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.

Reviews can't be read right now.

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.