Skip to content
abp-contract-scaffolding logo

ABP Contract Scaffolding

abp-contract-scaffolding

Generate ABP Application.Contracts layer scaffolding (interfaces, DTOs, permissions) from technical design. Enables parallel development by abp-developer and qa-engineer. Use when: (1) backend-architect needs to generate contracts, (2) preparing for parallel implementation workflow, (3) creating ...

SKILL.md

Full skill instructions

ABP Contract Scaffolding

Generate Application.Contracts layer code to enable parallel development workflows.

Purpose

Contract scaffolding separates interface design from implementation, enabling:

  • abp-developer to implement against defined interfaces
  • qa-engineer to write tests against interfaces (before implementation exists)
  • True parallel execution in /​add-feature workflow

When to Use

  • Backend-architect creating technical design with contract generation
  • Preparing for parallel implementation and testing
  • Defining API contracts before implementation starts
  • Interface-first development approach

Project Structure

{Project}.Application.Contracts/
├── {Feature}/
│   ├── I{Entity}AppService.cs      # Service interface
│   ├── {Entity}Dto.cs              # Output DTO
│   ├── Create{Entity}Dto.cs        # Create input
│   ├── Update{Entity}Dto.cs        # Update input
│   └── Get{Entity}sInput.cs        # List filter/​pagination
└── Permissions/
    └── {Entity}Permissions.cs      # Permission constants

Templates

1. Service Interface

using System;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;

namespace {ProjectName}.{Feature};

/// <summary>
/// Application service interface for {Entity} management.
/// </​summary>
public interface I{Entity}AppService : IApplicationService
{
    /// <summary>
    /// Gets a paginated list of {entities}.
    /// </​summary>
    Task<PagedResultDto<{Entity}Dto>> GetListAsync(Get{Entity}sInput input);

    /// <summary>
    /// Gets a single {entity} by ID.
    /// </​summary>
    Task<{Entity}Dto> GetAsync(Guid id);

    /// <summary>
    /// Creates a new {entity}.
    /// </​summary>
    Task<{Entity}Dto> CreateAsync(Create{Entity}Dto input);

    /// <summary>
    /// Updates an existing {entity}.
    /// </​summary>
    Task<{Entity}Dto> UpdateAsync(Guid id, Update{Entity}Dto input);

    /// <summary>
    /// Deletes a {entity} by ID.
    /// </​summary>
    Task DeleteAsync(Guid id);
}

2. Output DTO

using System;
using Volo.Abp.Application.Dtos;

namespace {ProjectName}.{Feature};

/// <summary>
/// DTO for {Entity} output.
/// Inherits audit fields from FullAuditedEntityDto.
/// </​summary>
public class {Entity}Dto : FullAuditedEntityDto<Guid>
{
    /// <summary>
    /// {Property description}
    /// </​summary>
    public {Type} {PropertyName} { get; set; }

    // Add properties matching entity definition
}

3. Create Input DTO

using System;

namespace {ProjectName}.{Feature};

/// <summary>
/// DTO for creating a new {Entity}.
/// Validation is handled by FluentValidation in Application layer.
/// </​summary>
public class Create{Entity}Dto
{
    /// <summary>
    /// {Property description}
    /// </​summary>
    /// <remarks>Required. Max length: {N} characters.</​remarks>
    public string {PropertyName} { get; set; } = string.Empty;

    // Add required properties for creation
}

4. Update Input DTO

using System;

namespace {ProjectName}.{Feature};

/// <summary>
/// DTO for updating an existing {Entity}.
/// Validation is handled by FluentValidation in Application layer.
/// </​summary>
public class Update{Entity}Dto
{
    /// <summary>
    /// {Property description}
    /// </​summary>
    public string {PropertyName} { get; set; } = string.Empty;

    // Add updatable properties
}

5. List Filter Input DTO

using Volo.Abp.Application.Dtos;

namespace {ProjectName}.{Feature};

/// <summary>
/// Input DTO for filtering and paginating {Entity} list.
/// </​summary>
public class Get{Entity}sInput : PagedAndSortedResultRequestDto
{
    /// <summary>
    /// Optional text filter for searching by name or description.
    /// </​summary>
    public string? Filter { get; set; }

    /// <summary>
    /// Optional filter by active status.
    /// </​summary>
    public bool? IsActive { get; set; }

    // Add entity-specific filters
}

6. Permission Constants

namespace {ProjectName}.Permissions;

/// <summary>
/// Permission constants for {Entity} management.
/// These are registered in {ProjectName}PermissionDefinitionProvider.
/// </​summary>
public static class {Entity}Permissions
{
    /// <summary>
    /// Permission group name.
    /// </​summary>
    public const string GroupName = "{ProjectName}.{Entities}";

    /// <summary>
    /// Default permission (view/​list).
    /// </​summary>
    public const string Default = GroupName;

    /// <summary>
    /// Permission to create new {entities}.
    /// </​summary>
    public const string Create = GroupName + ".Create";

    /// <summary>
    /// Permission to edit existing {entities}.
    /// </​summary>
    public const string Edit = GroupName + ".Edit";

    /// <summary>
    /// Permission to delete {entities}.
    /// </​summary>
    public const string Delete = GroupName + ".Delete";
}

Common Patterns

Activation/​Deactivation Pattern

When entity supports activation lifecycle:

// In interface
Task<{Entity}Dto> ActivateAsync(Guid id);
Task<{Entity}Dto> DeactivateAsync(Guid id);

// In permissions
public const string Activate = GroupName + ".Activate";
public const string Deactivate = GroupName + ".Deactivate";

// In filter DTO
public bool? IsActive { get; set; }

Hierarchical Entity Pattern

When entity has parent-child relationships:

// In output DTO
public Guid? ParentId { get; set; }
public string? ParentName { get; set; }
public List<{Entity}Dto> Children { get; set; } = new();

// In interface
Task<List<{Entity}Dto>> GetChildrenAsync(Guid parentId);
Task MoveAsync(Guid id, Guid? newParentId);

// In filter DTO
public Guid? ParentId { get; set; }
public bool IncludeChildren { get; set; }

Lookup/​Reference Pattern

For dropdown lists and references:

// Lightweight DTO for dropdowns
public class {Entity}LookupDto
{
    public Guid Id { get; set; }
    public string Name { get; set; } = string.Empty;
}

// In interface
Task<List<{Entity}LookupDto>> GetLookupAsync();

Bulk Operations Pattern

When bulk operations are needed:

// In interface
Task<int> DeleteManyAsync(List<Guid> ids);
Task<List<{Entity}Dto>> CreateManyAsync(List<Create{Entity}Dto> inputs);

// In permissions
public const string DeleteMany = GroupName + ".DeleteMany";

Generation Checklist

When generating contracts, verify:

  • Interface extends IApplicationService
  • All DTOs in correct namespace {ProjectName}.{Feature}
  • Output DTO extends FullAuditedEntityDto<Guid> (or appropriate base)
  • Filter DTO extends PagedAndSortedResultRequestDto
  • Permission constants follow {Project}.{Resource}.{Action} pattern
  • XML documentation comments included
  • Properties match technical design specification
  • Required vs optional properties marked correctly
  • Collection properties initialized (= new() or = [])

Integration with /​add-feature

This skill is used by backend-architect agent in Phase 1 of /​add-feature:

Phase 1: backend-architect generates:
├── docs/​features/​{feature}/​technical-design.md
├── Application.Contracts/​{Feature}/​I{Entity}AppService.cs
├── Application.Contracts/​{Feature}/​{Entity}Dto.cs
├── Application.Contracts/​{Feature}/​Create{Entity}Dto.cs
├── Application.Contracts/​{Feature}/​Update{Entity}Dto.cs
├── Application.Contracts/​{Feature}/​Get{Entity}sInput.cs
└── Application.Contracts/​Permissions/​{Entity}Permissions.cs

Phase 2 (parallel):
├── abp-developer: Implements against interface
└── qa-engineer: Writes tests against interface

Naming Conventions

ComponentPatternExample
InterfaceI{Entity}AppServiceIBookAppService
Output DTO{Entity}DtoBookDto
Create DTOCreate{Entity}DtoCreateBookDto
Update DTOUpdate{Entity}DtoUpdateBookDto
Filter DTOGet{Entity}sInputGetBooksInput
Lookup DTO{Entity}LookupDtoBookLookupDto
Permissions{Entity}PermissionsBookPermissions

Related Skills

  • abp-framework-patterns - Full ABP patterns including implementation
  • technical-design-patterns - Technical design document templates
  • api-design-principles - REST API design best practices

More skills from diegosouzapw

accessibility logo
diegosouzapw/awesome-omni-skill

accessibility

Accessibility guidelines for VS Code features — covers accessibility help dialogs, accessible views, verbosity settings, accessibility signals, ARIA alerts/status announcements, keyboard navigation, and ARIA labels/roles. Applies to both new interactive UI surfaces and updates to existing feature...

62 1
View
mermaid-diagrams logo
diegosouzapw/awesome-omni-skill

mermaid-diagrams

Mermaid diagram creation for flowcharts, sequences, ERDs, and more. Generate diagrams from text in markdown files. Use for documentation, architecture diagrams, and visual representations. Triggers on mermaid, flowchart, sequence diagram, ERD, entity relationship, gantt chart, pie chart, class di...

62 1
View
tauri2-react-rust logo
diegosouzapw/awesome-omni-skill

tauri2-react-rust

Guides development of cross-platform desktop apps with Tauri 2, TypeScript, React, and Rust. Use when building Tauri apps, implementing IPC, designing Rust backend or TypeScript/React frontend, when researching or cloning a website (open site, snapshot elements), when verifying local dev or built...

62 1
View
fp-ts-errors logo
diegosouzapw/awesome-omni-skill

fp-ts-errors

Handle errors as values using fp-ts Either and TaskEither for cleaner, more predictable TypeScript code. Use when implementing error handling patterns with fp-ts.

62 0
View
ring:pre-dev-research logo
diegosouzapw/awesome-omni-skill

ring:pre-dev-research

Gate 0 research phase for pre-dev workflow. Dispatches 3 parallel research agents to gather codebase patterns, external best practices, and framework documentation BEFORE creating PRD/TRD. Outputs research.md with file:line references.

62 0
View
create-assistant logo
diegosouzapw/awesome-omni-skill

create-assistant

Create and configure Vapi voice AI assistants with models, voices, transcribers, tools, hooks, and advanced settings. Use when building voice agents, phone bots, customer support assistants, or any conversational AI that handles phone or web calls.

62 0
View
codex-headless logo
diegosouzapw/awesome-omni-skill

codex-headless

Delegiere Aufgaben an OpenAI Codex CLI im Headless-Mode. Nutzt ChatGPT Subscription (KEIN API Key). Nur Workspace-Zugriff, KEIN System-Zugriff. Auto-Accept mit --full-auto. Web-Recherche mit --search.

62 0
View
social-media-scheduler logo
diegosouzapw/awesome-omni-skill

social-media-scheduler

Generate a full week of social media content for any topic. Outputs platform-optimized posts for Twitter/X, LinkedIn, and Instagram with hashtags and posting times.

62 0
View
Data Privacy Compliance logo
diegosouzapw/awesome-omni-skill

Data Privacy Compliance

Data privacy and regulatory compliance specialist for GDPR, CCPA, HIPAA, and international data protection laws. Use when implementing privacy controls, conducting data protection impact assessments, ensuring regulatory compliance, or managing data subject rights. Expert in consent management, da...

62 0
View
triple-review logo
diegosouzapw/awesome-omni-skill

triple-review

Reviews a task using the TRIPLE protocol, as the review agent.

62 0
View
Tech Stack & Architecture Decision logo
diegosouzapw/awesome-omni-skill

Tech Stack & Architecture Decision

Define and document the technology stack and architecture decisions for a project. Use when the user needs to choose a tech stack, make architecture decisions, define infrastructure choices, or document technology selections. Triggers on requests like "define the tech stack", "choose technologies...

62 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View