enforcing-dto-record

Enforce C# Data Transfer Objects to be declared as records.

Updated Feb 12, 2026
One-click install
npx skills add https://github.com/christian289/task_20260212 --skill enforcing-dto-record
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: enforcing-dto-record
Source: https://github.com/christian289/task_20260212/tree/main/.claude/skills/enforcing-dto-record
Command: npx skills add https://github.com/christian289/task_20260212 --skill enforcing-dto-record

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill enforces the use of 'record' instead of 'class' for Data Transfer Objects (DTOs), enhancing immutability and simplifying code maintenance.

Core Features & Use Cases

  • Enforces Record Usage: Forces all DTOs to be implemented as 'record' for immutability and value-based equality.
  • Immutability: Ensures that data cannot be modified once created, reducing bugs and improving code predictability.
  • Use Case: Use this Skill in your project to enforce a coding standard that encourages the use of 'record' for DTOs, improving overall code quality.

Quick Start

Apply the enforcing-dto-record skill to your next DTO class to ensure it is implemented as a 'record'.

Frequently Asked Questions about enforcing-dto-record

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

FAQPage Schema
How do I enforce C# record usage for DTOs to improve immutability?

To enforce C# record usage for DTOs, apply this Skill to your classes to ensure they are declared as 'record', guaranteeing immutability and value-based equality. This standardizes Data Transfer Object implementations across .NET projects.

Why use C# records instead of classes for Data Transfer Objects?

C# records provide built-in immutability and value-based equality, preventing data modification after creation. Using records for DTOs reduces bugs, improves code predictability, and simplifies maintenance compared to mutable classes.

Can I use this DTO record enforcement in my existing .NET project?

Yes, you can use this in existing .NET projects to enforce coding standards. Apply the Skill to your next DTO class to verify it is implemented as a 'record', ensuring code quality and immutability without requiring additional dependencies.

What's the best way to standardize DTO implementations as immutable records in C#?

The best way to standardize immutable DTO implementations is to enforce 'record' declarations over 'class'. This Skill forces all Data Transfer Objects to use records, providing immutability and value-based equality to improve overall code quality.

When should I not use C# records for my Data Transfer Objects?

You should not use C# records for DTOs when your data objects require mutability or complex behavioral methods. Records are designed for immutable data models; enforcing them on mutable state objects may conflict with your application's functional requirements.