generate-dto

Generate DTO for entity: $ARGUMENTS

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "generate-dto" with this command: npx skills add duc01226/easyplatform/duc01226-easyplatform-generate-dto

Generate DTO for entity: $ARGUMENTS

Instructions

Parse arguments:

  • Entity name (required): e.g., Employee , TextSnippetText

  • Options: --with-mapping (include MapToEntity), --minimal (core props only)

Find the entity:

  • Search in *.Domain/Entities/ folders

  • Read the entity class to understand its properties

Generate DTO following platform patterns:

Location: *.Application/EntityDtos/<EntityName>Dto.cs

Template:

public class {Entity}Dto : PlatformEntityDto<{Entity}, string> { // Empty constructor required public {Entity}Dto() { }

// Constructor maps from entity
public {Entity}Dto({Entity} entity) : base(entity)
{
    // Map core properties
}

// CORE PROPERTIES
public string? Id { get; set; }
// ... other properties from entity

// OPTIONAL LOAD PROPERTIES (for With* methods)
public RelatedDto? Related { get; set; }

// WITH* FLUENT METHODS
public {Entity}Dto WithRelated(RelatedEntity related)
{
    Related = new RelatedDto(related);
    return this;
}

// PLATFORM OVERRIDES
protected override object? GetSubmittedId() => Id;
protected override string GenerateNewId() => Ulid.NewUlid().ToString();
protected override {Entity} MapToEntity({Entity} entity, MapToEntityModes mode)
{
    // Map DTO properties back to entity
    return entity;
}

}

Read the template file for complete pattern:

  • .github/prompts/create-entity-dto.prompt.md

After generation:

  • Show the generated DTO

  • Ask if any properties should be excluded or modified

  • Offer to create the file

IMPORTANT Task Planning Notes

  • Always plan and break many small todo tasks

  • Always add a final review todo task to review the works done at the end to find any fix or enhancement needed

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

pdf-to-markdown

No summary provided by upstream source.

Repository SourceNeeds Review
General

markdown-to-docx

No summary provided by upstream source.

Repository SourceNeeds Review
General

docx-to-markdown

No summary provided by upstream source.

Repository SourceNeeds Review