gittools/gitversion/dotnet-dev

Claude Code and agent skill by gittools/gitversion

Trust tier 2
  • community
  • ext:[{"type":"config","description":"Configuration overrides"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Expert guidance for .NET development in this repository. Use this skill for building, testing, debugging, and understanding project structure, coding conventions, dependency injection patterns, and testing practices.

Install

npx vskill@latest install gittools/gitversion/dotnet-dev

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

.NET Development Skills

Expert guidance for .NET development in this repository.

Build & Test Commands

bash
# Build the solution
dotnet build ./src/GitVersion.slnx
# Build a single project
dotnet build --project ./src/GitVersion.Core/GitVersion.Core.csproj
# Run all tests
dotnet test --solution ./src/GitVersion.slnx
# Run tests for a specific project
dotnet test --project ./src/GitVersion.Core.Tests/GitVersion.Core.Tests.csproj
# Run tests with specific framework
dotnet test --project ./src/GitVersion.Core.Tests/GitVersion.Core.Tests.csproj --framework net10.0
# Run specific test by filter
dotnet test --project ./src/GitVersion.Core.Tests/GitVersion.Core.Tests.csproj --filter "FullyQualifiedName~TestClassName"
# Format code
dotnet format ./src/GitVersion.slnx
# Verify formatting (CI-friendly)
dotnet format --verify-no-changes ./src/GitVersion.slnx

Package Management

This repository uses Central Package Management via Directory.Packages.props.

Adding/Updating Packages
bash
# Add a package (version managed centrally)
dotnet add ./src/ProjectName/ProjectName.csproj package PackageName
# Update central package version in src/Directory.Packages.props

Important: Always update versions in src/Directory.Packages.props, not in individual .csproj files.

Directory.Packages.props Structure
xml
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="PackageName" Version="1.0.0" />
</ItemGroup>
</Project>

Project Structure

  • src/ - Main solution with production code and tests
  • new-cli/ - New CLI implementation (separate solution)
  • build/ - Build automation (Cake-based)
  • docs/ - Documentation
Key Projects
ProjectPurpose
GitVersion.CoreCore version calculation logic
GitVersion.AppCLI application
GitVersion.ConfigurationConfiguration file handling
GitVersion.OutputOutput formatters (JSON, BuildServer)
GitVersion.BuildAgentsCI/CD platform integrations
GitVersion.MsBuildMSBuild task integration
GitVersion.LibGit2SharpGit repository abstraction

Coding Conventions

Primary Constructors

Prefer primary constructors with readonly field assignments:

csharp
internal class BuildAgentResolver(IEnumerable<IBuildAgent> buildAgents, ILogger<BuildAgentResolver> logger) : IBuildAgentResolver
{
private readonly IEnumerable<IBuildAgent> buildAgents = buildAgents.NotNull();
private readonly ILogger<BuildAgentResolver> logger = logger.NotNull();
public IBuildAgent? Resolve()
{
// Use this.buildAgents and this.logger
}
}
Dependency Injection

Use constructor injection with ILogger<T> for logging:

csharp
public class MyService
{
private readonly ILogger<MyService> logger;
public MyService(ILogger<MyService> logger)
{
this.logger = logger;
}
}
Logging

Use Microsoft.Extensions.Logging with Serilog:

csharp
// Information level
this.logger.LogInformation("Processing {BranchName}", branch.Name);
// Warning level
this.logger.LogWarning("Configuration not found, using defaults");
// Error level
this.logger.LogError(ex, "Failed to calculate version");
// Debug level (verbose)
this.logger.LogDebug("Cache hit for {CacheKey}", key);
Nullable Reference Types

All projects use nullable reference types. Handle nullability explicitly:

csharp
public string? OptionalProperty { get; set; }
public string RequiredProperty { get; set; } = string.Empty;
File-Scoped Namespaces

Use file-scoped namespaces:

csharp
namespace GitVersion;
public class MyClass
{
// ...
}

Testing

Test Project Naming
  • Test projects mirror source projects: GitVersion.Core → GitVersion.Core.Tests
Test Frameworks
  • NUnit - Primary test framework
  • NSubstitute - Mocking framework
  • Shouldly - Assertion library
Test Patterns
csharp
[TestFixture]
public class MyServiceTests
{
[Test]
public void MethodName_Scenario_ExpectedResult()
{
// Arrange
var service = new MyService();
// Act
var result = service.DoSomething();
// Assert
result.ShouldBe(expected);
}
[TestCase("input1", "expected1")]
[TestCase("input2", "expected2")]
public void MethodName_WithParameters_ReturnsExpected(string input, string expected)
{
var result = service.Process(input);
result.ShouldBe(expected);
}
}

Configuration Files

Supported Names
  • GitVersion.yml
  • GitVersion.yaml
  • .GitVersion.yml
  • .GitVersion.yaml
Schema Location

JSON schemas are in schemas/ directory for validation.

Build Agents

Build agent integrations write environment variables with GitVersion_ prefix:

csharp
// Example: GitHub Actions
Environment.SetEnvironmentVariable($"GitVersion_{name}", value);

Common Tasks

Running the CLI Locally
bash
dotnet run --project src/GitVersion.App --framework net10.0
Debugging Tests
bash
# Run with detailed output
dotnet test --project ./src/GitVersion.Core.Tests/GitVersion.Core.Tests.csproj -v detailed
# Run specific test
dotnet test --filter "FullyQualifiedName=GitVersion.Core.Tests.MyTest"
Checking for Errors
bash
# Build with warnings as errors
dotnet build ./src/GitVersion.slnx -warnaserror

Public API Management

This repository uses Microsoft.CodeAnalysis.PublicApiAnalyzers to track public API surface.

Rules
  • `PublicAPI.Unshipped.txt`: All new or modified public APIs go here
  • `PublicAPI.Shipped.txt`: Only deletions are allowed; never add or modify entries directly
Workflow
  1. When adding new public APIs, they automatically get flagged and should be added to PublicAPI.Unshipped.txt
  2. When modifying existing APIs, move the old entry from PublicAPI.Shipped.txt to PublicAPI.Unshipped.txt (marked as

removed) and add the new signature to PublicAPI.Unshipped.txt

  1. Only remove entries from PublicAPI.Shipped.txt when an API is being deleted
  2. During release, unshipped APIs get moved to shipped via the mark-shipped.ps1 script

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
3,091
Repository forks
663
7-day trend score
40

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 19 Mar 2026, 8 months ago.

Extension points

  • configConfiguration overrides

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/gittools/gitversion/dotnet-dev/badge)](https://verified-skill.com/skills/gittools/gitversion/dotnet-dev)

Something wrong with this skill or its page? Tell us.