scaffold-dto

Generates C# DTO classes and response wrappers with Guid-to-string conversion for ASP.NET Core services.

1|Updated Apr 27, 2026
One-click install
npx skills add https://github.com/GSU26SE55/backend --skill scaffold-dto-gsu26se55
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: scaffold-dto
Source: https://github.com/GSU26SE55/backend/tree/main/.claude/skills/dev/be/scaffold-dto
Command: npx skills add https://github.com/GSU26SE55/backend --skill scaffold-dto-gsu26se55

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually writing DTO classes, nested DTOs, and response wrappers for every entity in a .NET microservice is repetitive and error-prone, especially when enforcing conventions like Guid-to-string conversion and conditional nested includes. ## Core Features & Use Cases - DTO Scaffolding: Generates a main entity DTO with Guid-to-string Id conversion, audit fields, and soft-delete fields. - Response Wrappers: Creates CommonResponse-based wrappers for list, detail, create, update, delete, and restore endpoints, with PaginationResponse for list endpoints. - Inline Mapping Guidance: Provides handler mapping examples including nullable Guid conversion and conditional nested DTO includes, with no AutoMapper dependency. - Use Case: When adding a new Battery entity to BatteryService, run the scaffold to produce BatteryDTO plus all response wrappers following the project's shared conventions. ## Quick Start Ask the AI to scaffold DTOs for a service and entity, for example: run /scaffold-dto BatteryService Battery to generate the DTO and response wrapper files.

Frequently Asked Questions about scaffold-dto

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

FAQPage Schema
How do I scaffold DTO classes for a .NET entity?▼

Run the scaffold with the service name and entity name as arguments, such as /scaffold-dto BatteryService Battery. It generates the main DTO, nested DTO placeholders, and response wrapper classes in Application/DTOs/Response following project conventions.

How to convert Guid to string in C# DTO mapping?▼

Call entity.Id.ToString() when assigning the DTO Id property, which is typed as string. For nullable Guids, use entity.ParentId.HasValue ? entity.ParentId.Value.ToString() : null to handle null cases safely.

Should I use AutoMapper or inline mapping for DTOs in ASP.NET Core?▼

This convention uses inline mapping directly inside handlers rather than AutoMapper. Inline mapping keeps conversions explicit, makes conditional nested includes based on request flags straightforward, and avoids hidden mapping configuration.

How do I conditionally include nested DTOs in a response?▼

Check both that the navigation property is loaded and that the request flag is set, for example Parent = (entity.Parent != null && request.HasParent == true) ? new ParentDTO {...} : null. The nested DTO stays null when the include is not requested.

What response wrapper pattern works for paginated list endpoints?▼

Use CommonResponse<PaginationResponse<object>> for list endpoints so the payload supports pagination metadata and data shaping. Detail endpoints use CommonResponse<object>, while create, update, and delete operations return CommonResponse<EntityDTO>.