agentleFS
elidadutra187elidadutra187/claude-skills/skills/migrate-aspnetboilerplate-to-abp/SKILL.md

migrate-aspnetboilerplate-to-abp

Skill0 starsChanged 5 days agoMITView on GitHub

Migrate existing ASP.NET Boilerplate projects to ABP.IO framework with step-by-step guidance, code transformation, and best practices.

  • Commits and pushes

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before starting migration, verify:

    line 18
  2. Distinctive:

    Solution: Use fully qualified names or alias directives

    line 542
  3. Very specific:

    Solution: Update entities to use Guid keys or configure custom keys

    line 550
  4. Distinctive:

    Solution: Update all repository calls to async

    line 560
  5. Distinctive:

    Solution: Update attribute references

    line 571
  6. Distinctive:

    Update to modern async patterns

    line 585

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Migrate ASP.NET Boilerplate to ABP.IO

Migrate existing ASP.NET Boilerplate projects to the modern ABP.IO framework with comprehensive guidance and automated transformation steps.

Primary Directive

Your goal is to guide the migration of an existing ASP.NET Boilerplate project to ABP.IO framework, ensuring minimal disruption and maximum compatibility.

Migration Assessment

Pre-Migration Checklist

Before starting migration, verify:

  • Current ASP.NET Boilerplate version
  • .NET Framework version (must be .NET Core compatible)
  • Third-party dependencies compatibility
  • Custom UI themes and components
  • Database schema and migrations
  • Custom modules and extensions
  • Team readiness and training needs

Migration Feasibility

Good Candidates for Migration:

  • ASP.NET Boilerplate 4.x+ projects
  • .NET Core compatible codebase
  • Standard ABP features usage
  • Moderate customization level
  • Active development project

Challenging Migrations:

  • Heavy custom UI modifications
  • Legacy .NET Framework code
  • Extensive third-party integrations
  • Highly customized authentication
  • Complex multi-tenant implementations

Migration Strategy

Phase 1: Preparation

1.1 Environment Setup

# Install ABP CLI
dotnet tool install -g Volo.Abp.Cli

# Verify installation
abp --version

1.2 Backup Current Project

# Create complete backup
cp -r MyProject MyProject_backup_$(date +%Y%m%d)

# Git tag current state
git tag aspnetboilerplate_final
git push origin aspnetboilerplate_final

1.3 Dependency Analysis

Create dependency inventory:

# List current packages
dotnet list package

# Analyze third-party dependencies
# Document custom modifications
# Note breaking changes needed

Phase 2: New ABP Project Creation

2.1 Template Selection

Based on project analysis, select appropriate ABP template:

# For standard web applications
abp new MyCompany.MyProject -t app -u mvc -d ef

# For applications with Angular
abp new MyCompany.MyProject -t app -u angular -d ef --tiered

# For simple applications
abp new MyCompany.MyProject -t app-nolayers -u mvc -d ef

2.2 Initial Setup

# Navigate to new project
cd MyCompany.MyProject

# Restore packages
dotnet restore

# Create initial database
dotnet ef database update

# Run application to verify
dotnet run --project src/MyCompany.MyProject.Web

Phase 3: Code Migration

3.1 Domain Layer Migration

Entity Migration Pattern:

// ASP.NET Boilerplate Entity
public class Product : FullAuditedEntity
{
    public string Name { get; set; }
    public decimal Price { get; set; }
    public ProductCategory Category { get; set; }
}

// ABP Entity
public class Product : FullAuditedAggregateRoot<Guid>
{
    public string Name { get; set; }
    public decimal Price { get; set; }
    public ProductCategory Category { get; set; }
    
    protected Product() { }
    
    public Product(
        Guid id, 
        string name, 
        decimal price, 
        ProductCategory category) : base(id)
    {
        Name = Check.NotNullOrWhiteSpace(name, nameof(name));
        Price = price;
        Category = category;
    }
}

Value Object Migration:

// ASP.NET Boilerplate
public class Address
{
    public string Street { get; set; }
    public string City { get; set; }
    public string Country { get; set; }
}

// ABP Value Object
public class Address : ValueObject
{
    public string Street { get; set; }
    public string City { get; set; }
    public string Country { get; set; }
    
    protected override IEnumerable<object> GetEqualityComponents()
    {
        yield return Street;
        yield return City;
        yield return Country;
    }
}

Repository Migration:

// ASP.NET Boilerplate Repository Interface
public interface IProductRepository : IRepository<Product>
{
    List<Product> GetProductsByCategory(int categoryId);
}

// ABP Repository Interface
public interface IProductRepository : IRepository<Product, Guid>
{
    Task<List<Product>> GetProductsByCategoryAsync(Guid categoryId);
}

3.2 Application Layer Migration

Application Service Migration:

// ASP.NET Boilerplate Application Service
public class ProductAppService : ApplicationService, IProductAppService
{
    private readonly IRepository<Product> _productRepository;

    public ProductAppService(IRepository<Product> productRepository)
    {
        _productRepository = productRepository;
    }

    public ListResultDto<ProductDto> GetAll(GetAllProductsInput input)
    {
        var products = _productRepository.GetAllList();
        return new ListResultDto<ProductDto>(
            ObjectMapper.Map<List<Product>, List<ProductDto>>(products)
        );
    }
}

// ABP Application Service
public class ProductAppService : ApplicationService, IProductAppService
{
    private readonly IRepository<Product, Guid> _productRepository;

    public ProductAppService(IRepository<Product, Guid> productRepository)
    {
        _productRepository = productRepository;
    }

    public async Task<PagedResultDto<ProductDto>> GetListAsync(GetProductsInput input)
    {
        var queryable = await _productRepository.GetQueryableAsync();
        
        var products = await AsyncExecuter.ToListAsync(
            queryable
                .WhereIf(!input.Filter.IsNullOrWhiteSpace(), 
                    p => p.Name.Contains(input.Filter))
                .OrderBy(p => p.Name)
                .PageBy(input.SkipCount, input.MaxResultCount)
        );

        var totalCount = await AsyncExecuter.CountAsync(
            queryable.WhereIf(!input.Filter.IsNullOrWhiteSpace(), 
                p => p.Name.Contains(input.Filter))
        );

        return new PagedResultDto<ProductDto>(
            totalCount,
            ObjectMapper.Map<List<Product>, List<ProductDto>>(products)
        );
    }
}

DTO Migration:

// ASP.NET Boilerplate DTO
public class ProductDto : EntityDto
{
    public string Name { get; set; }
    public decimal Price { get; set; }
}

// ABP DTO
public class ProductDto : EntityDto<Guid>
{
    public string Name { get; set; }
    public decimal Price { get; set; }
}

public class CreateUpdateProductDto
{
    [Required]
    [StringLength(ProductConsts.MaxNameLength)]
    public string Name { get; set; }

    [Range(0.01, 10000.00)]
    public decimal Price { get; set; }
}

3.3 Infrastructure Layer Migration

Entity Framework Configuration:

// ASP.NET Boilerplate Configuration
public class ProductConfiguration : IEntityTypeConfiguration<Product>
{
    public void Configure(EntityTypeBuilder<Product> builder)
    {
        builder.ToTable("Products");
        
        builder.Property(p => p.Name)
            .IsRequired()
            .HasMaxLength(128);
            
        builder.Property(p => p.Price)
            .HasColumnType("decimal(18,2)");
    }
}

// ABP Configuration (similar but with updated namespaces)
public class ProductConfiguration : IEntityTypeConfiguration<Product>
{
    public void Configure(EntityTypeBuilder<Product> builder)
    {
        builder.ToTable(MyProjectConsts.DbTablePrefix + "Products", MyProjectConsts.DbSchema);
        
        builder.Property(x => x.Name)
            .IsRequired()
            .HasMaxLength(ProductConsts.MaxNameLength);

        builder.Property(x => x.Price)
            .HasColumnType("decimal(18,2)");
    }
}

3.4 Web Layer Migration

Controller Migration:

// ASP.NET Boilerplate Controller
public class ProductsController : AbpController
{
    private readonly IProductAppService _productAppService;

    public ProductsController(IProductAppService productAppService)
    {
        _productAppService = productAppService;
    }

    public ActionResult Index()
    {
        var products = _productAppService.GetAll(new GetAllProductsInput());
        return View(products);
    }
}

// ABP Controller
public class ProductsController : AbpControllerBase
{
    private readonly IProductAppService _productAppService;

    public ProductsController(IProductAppService productAppService)
    {
        _productAppService = productAppService;
    }

    public async Task<IActionResult> Index()
    {
        var products = await _productAppService.GetListAsync(new GetProductsInput());
        return View(products);
    }
}

Phase 4: Namespace and Package Updates

4.1 Namespace Changes

// ASP.NET Boilerplate namespaces
using Abp.Application.Services;
using Abp.Domain.Repositories;
using Abp.Authorization;
using Abp.UI;
using Abp.Domain.Entities;
using Abp.EntityFrameworkCore;
using Abp.AspNetCore.Mvc.Controllers;

// ABP namespaces
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Authorization;
using Volo.Abp;
using Volo.Abp.Domain.Entities;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.AspNetCore.Mvc;

4.2 Package Reference Updates

<!-- ASP.NET Boilerplate packages -->
<PackageReference Include="Abp.AspNetCore" Version="6.4.0" />
<PackageReference Include="Abp.EntityFrameworkCore" Version="6.4.0" />
<PackageReference Include="Abp.AspNetCore.Mvc" Version="6.4.0" />

<!-- ABP packages -->
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="8.0.0" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Volo.Abp.AspNetCore" Version="8.0.0" />

Phase 5: Configuration Migration

5.1 Module Configuration

// ASP.NET Boilerplate Module
[DependsOn(typeof(AbpAspNetCoreModule))]
public class MyProjectWebModule : AbpModule
{
    public override void Initialize()
    {
        IocManager.RegisterAssemblyByConvention(typeof(MyProjectWebModule));
    }
}

// ABP Module
[DependsOn(
    typeof(MyProjectApplicationModule),
    typeof(MyProjectEntityFrameworkCoreModule),
    typeof(AbpAspNetCoreMvcModule)
)]
public class MyProjectWebModule : AbpModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        Configure<AbpAspNetCoreMvcOptions>(options =>
        {
            options.ConventionalControllers.Create(typeof(MyProjectApplicationModule).Assembly);
        });
    }
}

5.2 Configuration Updates

// ASP.NET Boilerplate appsettings.json
{
  "ConnectionStrings": {
    "Default": "Server=localhost;Database=MyProjectDb;Trusted_Connection=true"
  }
}

// ABP appsettings.json
{
  "ConnectionStrings": {
    "Default": "Server=localhost;Database=MyProjectDb;Trusted_Connection=true"
  },
  "App": {
    "SelfUrl": "https://localhost:44300",
    "CorsOrigins": "https://localhost:44300"
  },
  "AuthServer": {
    "Authority": "https://localhost:44300",
    "RequireHttpsMetadata": "false"
  }
}

Phase 6: Testing and Validation

6.1 Unit Test Migration

// ASP.NET Boilerplate Test
public class ProductAppService_Tests : AppTestBase
{
    private readonly IProductAppService _productAppService;

    public ProductAppService_Tests()
    {
        _productAppService = Resolve<IProductAppService>();
    }

    [Fact]
    public void Should_Get_All_Products()
    {
        var products = _productAppService.GetAll(new GetAllProductsInput());
        products.Items.Count.ShouldBeGreaterThan(0);
    }
}

// ABP Test
public class ProductAppService_Tests : MyProjectApplicationTestBase
{
    private readonly IProductAppService _productAppService;

    public ProductAppService_Tests()
    {
        _productAppService = GetRequiredService<IProductAppService>();
    }

    [Fact]
    public async Task Should_Get_All_Products()
    {
        var products = await _productAppService.GetListAsync(new GetProductsInput());
        products.TotalCount.ShouldBeGreaterThan(0);
    }
}

6.2 Integration Testing

# Run all tests
dotnet test

# Check database migrations
dotnet ef migrations list

# Verify application startup
dotnet run --project src/MyCompany.MyProject.Web

Migration Automation Scripts

Batch Migration Script

#!/bin/bash
# migrate-to-abp.sh

PROJECT_NAME=$1
TEMPLATE_TYPE=${2:-"app"}
UI_FRAMEWORK=${3:-"mvc"}
DB_PROVIDER=${4:-"ef"}

echo "Migrating $PROJECT_NAME to ABP.IO..."

# Create new ABP project
abp new $PROJECT_NAME -t $TEMPLATE_TYPE -u $UI_FRAMEWORK -d $DB_PROVIDER

# Copy domain entities
echo "Copying domain entities..."
cp -r ../$PROJECT_NAME_backup/src/$PROJECT_NAME.Domain/Entities src/$PROJECT_NAME.Domain/

# Copy application services (with manual conversion needed)
echo "Preparing application services..."
mkdir -p src/$PROJECT_NAME.Application/Services

# Update package references
echo "Updating package references..."
find . -name "*.csproj" -exec sed -i 's/Abp\./Volo.Abp./g' {} \;

# Run initial setup
echo "Running initial setup..."
cd $PROJECT_NAME
dotnet restore
dotnet ef database update

echo "Migration setup complete! Manual conversion required for:"
echo "1. Application services"
echo "2. Controllers"
echo "3. Views/UI components"
echo "4. Configuration files"
echo "5. Custom business logic"

Common Migration Issues

Issue Resolution Guide

1. Namespace Conflicts

Problem: Ambiguous references between old and new ABP namespaces Solution: Use fully qualified names or alias directives

using OldAbp = Abp;
using NewAbp = Volo.Abp;

2. Entity Key Type Changes

Problem: ABP uses Guid keys by default Solution: Update entities to use Guid keys or configure custom keys

public class Product : FullAuditedAggregateRoot<int> // Use int instead of Guid
{
    // Entity definition
}

3. Async/Await Pattern Requirements

Problem: ABP requires async patterns for repository operations Solution: Update all repository calls to async

// Before
var products = _repository.GetAllList();

// After
var products = await _repository.GetListAsync();

4. Authorization Attribute Changes

Problem: Authorization attributes have different names Solution: Update attribute references

// Before
[AbpAuthorize("Products.Create")]

// After
[Authorize("Products.Create")]

Post-Migration Tasks

1. Performance Optimization

  • Review and optimize database queries
  • Implement proper caching strategies
  • Update to modern async patterns
  • Optimize entity configurations

2. Security Hardening

  • Update authentication configurations
  • Review permission definitions
  • Implement proper CORS policies
  • Update security headers

3. UI Modernization

  • Migrate to LeptonX theme
  • Update JavaScript libraries
  • Implement responsive design
  • Optimize for mobile devices

4. Testing Enhancement

  • Update test projects
  • Implement integration tests
  • Add performance tests
  • Set up CI/CD pipeline

Validation Checklist

Pre-Deployment Validation

  • All unit tests pass
  • Integration tests successful
  • Database migrations applied
  • Authentication working
  • Authorization permissions correct
  • UI components functional
  • API endpoints responding
  • Performance benchmarks met

Production Readiness

  • Environment variables configured
  • Logging and monitoring setup
  • Backup procedures documented
  • Rollback plan prepared
  • Team training completed
  • Documentation updated

Timeline Estimation

Small Projects (< 100 entities)

  • Assessment: 1-2 days
  • Migration: 3-5 days
  • Testing: 2-3 days
  • Total: 1-2 weeks

Medium Projects (100-500 entities)

  • Assessment: 3-5 days
  • Migration: 2-3 weeks
  • Testing: 1-2 weeks
  • Total: 4-6 weeks

Large Projects (> 500 entities)

  • Assessment: 1-2 weeks
  • Migration: 2-3 months
  • Testing: 1-2 months
  • Total: 4-7 months

This migration guide provides comprehensive steps to successfully transition from ASP.NET Boilerplate to ABP.IO while maintaining functionality and improving code quality.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.