agentleFS
mag1artmag1art/skills/gitlab-ci-dotnet/SKILL.md

gitlab-ci-dotnet

Skill1 starsChanged 3 months agoApache-2.0View on GitHub

Use for GitLab CI/CD pipelines that restore, build, test, package, scan, and deploy C#/.NET services.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use for GitLab CI configuration, build/test jobs, caching, artifacts, service containers, Docker builds, deployments, and pipeline …

    line 23
  2. Distinctive:

    Do not change production deployment or secret settings without understanding the environment and approval path.

    line 27
  3. Distinctive:

    Prefer explicit validate, build, test, package, and deploy stages.

    line 31
  4. Very specific:

    Use dotnet restore, dotnet build --no-restore, and dotnet test --no-build where job boundaries permit.

    line 37
  5. Distinctive:

    Start PostgreSQL/RabbitMQ service containers only for jobs that need them.

    line 39
  6. Distinctive:

    Keep secrets in masked/protected CI variables, never YAML or logs.

    line 40
  7. Distinctive:

    Use needs for the actual dependency graph.

    line 41
  8. Distinctive:

    Keep Docker-in-Docker or socket access restricted and intentional.

    line 43
  9. Distinctive:

    Check YAML syntax, MR and protected-branch rules, cache correctness, artifact paths, test results, dependency readiness, secret masking, …

    line 47
  10. Very specific:

    Use an SDK image compatible with global.json.

    line 90

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

GitLab CI for .NET

When to Use

Use for GitLab CI configuration, build/test jobs, caching, artifacts, service containers, Docker builds, deployments, and pipeline troubleshooting for .NET projects.

When Not to Use

Do not change production deployment or secret settings without understanding the environment and approval path.

Pipeline Shape

Prefer explicit validate, build, test, package, and deploy stages. Keep restore, format/analyzer checks, build, tests, coverage, packaging, and deployment as reviewable jobs. Use rules to avoid deployments from untrusted branches.

.NET Rules

  • Pin or control the SDK with global.json and a deliberate container image.
  • Cache NuGet packages with a key including lockfiles or project files.
  • Use dotnet restore, dotnet build --no-restore, and dotnet test --no-build where job boundaries permit.
  • Publish test and coverage artifacts with bounded retention.
  • Start PostgreSQL/RabbitMQ service containers only for jobs that need them.
  • Keep secrets in masked/protected CI variables, never YAML or logs.
  • Use needs for the actual dependency graph.
  • Make retries explicit and avoid hiding flaky tests with unlimited retries.
  • Keep Docker-in-Docker or socket access restricted and intentional.

Quality Gate

Check YAML syntax, MR and protected-branch rules, cache correctness, artifact paths, test results, dependency readiness, secret masking, and deployment approvals.

Example: Build and Test Pipeline

stages: [validate, build, test, image]

variables:
  NUGET_PACKAGES: "$CI_PROJECT_DIR/.nuget/packages"

cache:
  key:
    files:
      - "*.sln"
      - "**/*.csproj"
      - "Directory.Packages.props"
  paths:
    - .nuget/packages/

validate:
  stage: validate
  image: mcr.microsoft.com/dotnet/sdk:10.0
  script:
    - dotnet format --verify-no-changes

build:
  stage: build
  image: mcr.microsoft.com/dotnet/sdk:10.0
  script:
    - dotnet restore
    - dotnet build --no-restore --configuration Release

test:
  stage: test
  image: mcr.microsoft.com/dotnet/sdk:10.0
 script:
    - dotnet restore
    - dotnet test --no-restore --configuration Release --logger "trx;LogFileName=test-results.trx"
 artifacts:
   when: always
   reports:
      junit: "**/TestResults/*.trx"

Use an SDK image compatible with global.json. Add PostgreSQL or RabbitMQ service containers only to jobs that need them, and make deployment rules explicit for protected branches.

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.