mcaf-dotnet-format

Apply `dotnet format` to format .NET code and enforce `.editorconfig` style rules.

4|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/managedcode/MCPGateway --skill mcaf-dotnet-format
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcaf-dotnet-format
Source: https://github.com/managedcode/MCPGateway/tree/main/.codex/skills/mcaf-dotnet-format
Command: npx skills add https://github.com/managedcode/MCPGateway --skill mcaf-dotnet-format

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the process of formatting .NET code, ensuring consistency and adherence to project-specific style guidelines defined in .editorconfig. It also provides a CI-safe way to verify that code formatting is maintained.

Core Features & Use Cases

  • Automated Formatting: Applies dotnet format to C# and other .NET project files.
  • CI Verification: Integrates with CI pipelines to fail builds if code formatting drifts.
  • Style Enforcement: Enforces code style rules defined in the repository's .editorconfig file.
  • Use Case: Ensure all .NET code in a repository is consistently formatted before merging, preventing style debates and maintaining code quality.

Quick Start

Use the mcaf-dotnet-format skill to add dotnet format --verify-no-changes to the CI workflow for the current .NET solution.

Frequently Asked Questions about mcaf-dotnet-format

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

FAQPage Schema
How do I enforce .NET code style rules in CI pipelines?

You can enforce .NET code style rules in CI pipelines by adding the `dotnet format --verify-no-changes` command to fail builds when formatting drifts from the defined standards.

What is the best way to automatically format C# code before merging?

Automated formatting for C# code is best handled by applying the `dotnet format` CLI tool to project files, ensuring consistency and adherence to project-specific style guidelines before merging.

Does dotnet format work with .editorconfig standards?

Yes, `dotnet format` works directly with `.editorconfig` standards to enforce coding style rules defined in the repository, ensuring code quality and consistency across development teams.

How do I verify .NET formatting compliance without changing files?

To verify .NET formatting compliance without altering files, use the `dotnet format --verify-no-changes` command in your CI workflow to safely check for formatting drift.

Why should I use automated code formatting for .NET repositories?

Automated code formatting for .NET repositories prevents style debates, maintains code quality, and ensures consistent adherence to `.editorconfig` standards across the entire development team.

Can I use dotnet format to check multiple .NET project files at once?

Yes, you can apply `dotnet format` to C# and other .NET project files across a solution, automating the formatting process to ensure all code meets the required style guidelines.