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.
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-a-use-caseSkill
- api-conventionsSkill
- branches-and-pull-requestsSkill
- cancellationSkill
- ci-pipelineSkill
- clean-architecture-layersSkill
- configuration-and-environmentsSkill
- coverageSkill
- csharp-house-styleSkill
- data-access-ef-coreSkill
- database-migrationsSkill
- docker-and-composeSkill
- docs-and-voiceSkill
- errors-and-exceptionsSkill
- expose-a-use-caseSkill
- family-syncSkill
- health-checksSkill
- integration-testsSkill
- json-serializationSkill
- mapping-with-mapperlySkill
- mcp-inspectorSkill
- mediatorSkill
- optional-token-authSkill
- packages-and-dependenciesSkill
- pagingSkill
- presentation-integration-testsSkill
- releasesSkill
- sample-dataSkill
- security-findingsSkill
- serilogSkill
- telemetrySkill
- template-authoringSkill
- test-designSkill
- time-providerSkill
- unit-testsSkill
- validationSkill
- writing-a-skillSkill
- xml-docs-and-openapiSkill
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
- Distinctive: line 33
Agree what to add: Ask about each check in the table on its own, with a recommendation.
- Distinctive: line 34
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.
- Distinctive: line 60
Run different commands in the pipeline from the ones in AGENTS.md.
≈ “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.
Files
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 with | Pipeline | What runs |
dotnet new | .github/workflows/ci.yml | Restore, format, build, test and the coverage gate |
| "Use this template" on GitHub | .github/workflows/build-pipeline.yml, the template's own | Format, 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
| Check | Local command | Fails when | Needs |
| Vulnerable packages | dotnet list package --vulnerable --include-transitive | A package has a known high or critical vulnerability. The command always exits 0, so fail the step when its output contains High or Critical | Nothing |
| Dependency review | GitHub's actions/dependency-review-action on pull requests | A new package is vulnerable or has a licence the team doesn't allow | GitHub Advanced Security on a private repository |
| Container | docker build . --target run | The image doesn't build. Add an image scanner such as Trivy if the team ships the container | Docker on the runner |
| Static analysis | The CI system's own scanner, such as CodeQL on GitHub | A security finding the team hasn't accepted | GitHub Advanced Security on a private repository |
Steps
- 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.
- 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.
- 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.
- Moving off GitHub Actions? Port
ci.ymlstep for step to the team's system, such as Azure Pipelines, GitLab CI or Jenkins: install the SDK fromglobal.json, then the same commands in the same order. Deleteci.ymlonce the new pipeline is green. - 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.
- 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 buildanddotnet testpass locally on the same commit.
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.

