project-structure

Configures .NET solution structure, centralized build properties, and central package management.

Updated Mar 8, 2026
One-click install
npx skills add https://github.com/AGIBuild/dotnet.CI.template --skill project-structure-agibuild
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: project-structure
Source: https://github.com/AGIBuild/dotnet.CI.template/tree/main/.cursor/skills/project-structure
Command: npx skills add https://github.com/AGIBuild/dotnet.CI.template --skill project-structure-agibuild

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up a new .NET solution involves repetitive decisions about folder layout, solution file formats, shared build properties, and package version management, and inconsistent choices lead to merge conflicts, version drift, and fragile builds. ## Core Features & Use Cases - Modern Solution Layout: Provides a standard src/tests directory structure with the XML-based .slnx solution format for .NET 9+ and migration guidance from legacy .sln files. - Centralized Build Configuration: Supplies ready-to-adapt Directory.Build.props, Directory.Build.targets, and Directory.Packages.props templates covering SourceLink, analyzers, NuGet audit, lock files, and central package management. - Reproducible Toolchain Setup: Covers global.json SDK pinning, nuget.config package source mapping for supply-chain security, .editorconfig style enforcement, and RELEASE_NOTES.md-driven versioning. - Use Case: When bootstrapping a new .NET product repository, apply this guidance to produce a solution with centralized package versions, deterministic CI restores, and SourceLink-enabled NuGet packages from day one. ## Quick Start Ask the AI to scaffold a new .NET solution following this skill's recommended structure with central package management and SourceLink enabled.

Frequently Asked Questions about project-structure

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up central package management in .NET?▼

Create a Directory.Packages.props file at the repo root with ManagePackageVersionsCentrally set to true and declare each dependency with PackageVersion entries. Project files then reference packages with PackageReference but no Version attribute, keeping all versions in one place.

How to migrate a .sln file to the .slnx format?▼

Run dotnet sln MySolution.sln migrate with the .NET 9 SDK or later to convert the legacy solution file to the XML-based .slnx format. Do not keep both .sln and .slnx files in the same repository after migration.

What is the difference between Directory.Build.props and Directory.Build.targets?▼

Directory.Build.props is imported early during project evaluation and defines shared properties like LangVersion and Nullable. Directory.Build.targets is imported after evaluation and suits shared analyzer package references and custom build targets.

Does the .slnx format work with older .NET SDK versions?▼

The .slnx format requires the .NET 9 SDK or later, or Visual Studio 17.13 and newer. On .NET 9, create one explicitly with dotnet new sln --format slnx; .NET 10 creates .slnx by default.

Why does my nested Directory.Build.props not inherit root settings?▼

Inner Directory.Build.props files do not automatically import outer ones. Add an explicit Import element using MSBuild GetPathOfFileAbove to pull in the parent file before defining directory-specific properties.

How do I pin the .NET SDK version for consistent builds?▼

Add a global.json file at the repo root specifying the SDK version and a rollForward policy. The recommended policy is latestFeature, which allows patch updates within the same feature band while keeping builds reproducible.