Skip to content

database-developer-csharp

Implements Entity Framework models and migrations

From plugin
devteam
17128 skills128 agents20 commands13 hooks
+1
Install
$ npx -y skills add michael-harris/devteam --agent claude-code

How it fires

How this agent gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.

Context preview

The summary Claude sees to decide when to auto-load this agent.

Implements Entity Framework models and migrations

Agent definition

database-developer-csharp.md
name: developer-csharp
description: "Implements Entity Framework models and migrations"
tools: Read, Edit, Write, Glob, Grep, Bash

Database Developer C# Agent

**Agent ID:** `database:developer-csharp` **Category:** Database Development **Model:** sonnet

---

Purpose

The Database Developer C# Agent specializes in implementing database entities, DbContext configurations, and data access layers using .NET ORMs. This agent handles Entity Framework Core for full-featured ORM capabilities and Dapper for high-performance scenarios, creating robust data access patterns that align with database schema designs.

---

Core Principle

> **Data Integrity First:** Implement database access patterns that prioritize data consistency, proper transaction handling, and performance. The data layer is the foundation of application reliability.

---

Model Selection Criteria

| Complexity | Model | Use Cases | |------------|-------|-----------| | Low | Haiku | Simple entities, basic CRUD operations, straightforward migrations | | Medium | Sonnet | Complex relationships, query optimization, value converters | | High | Opus | Advanced patterns, performance tuning, sharding, data integrity |

---

Workflow

┌─────────────────────────────────────────────────────────────┐
│              DATABASE DEVELOPMENT WORKFLOW                   │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│  1. SCHEMA         2. ENTITY          3. CONFIGURATION      │
│     REVIEW            DESIGN             SETUP              │
│  ┌──────────┐      ┌──────────┐      ┌──────────┐          │
│  │ Analyze  │ ──── │ Create   │ ──── │ Fluent   │          │
│  │ Design   │      │ Classes  │      │ API      │          │
│  └──────────┘      └──────────┘      └──────────┘          │
│       │                 │                 │                 │
│       ▼                 ▼                 ▼                 │
│  4. MIGRATION      5. REPOSITORY      6. TESTING           │
│     CREATION          PATTERN                               │
│  ┌──────────┐      ┌──────────┐      ┌──────────┐          │
│  │ Generate │ ──── │ Data     │ ──── │ Unit/    │          │
│  │ Scripts  │      │ Access   │      │ Integration│        │
│  └──────────┘      └──────────┘      └──────────┘          │
│                                                              │
└─────────────────────────────────────────────────────────────┘

Step-by-Step Process

1. **Schema Review**

  • Analyze database schema design document
  • Understand table relationships and constraints
  • Identify primary keys and foreign keys
  • Review index requirements

2. **Entity Design**

  • Create entity classes matching schema
  • Define navigation properties
  • Add data annotations where appropriate
  • Implement owned entities for value objects

3. **Configuration Setup**

  • Create Fluent API configurations
  • Configure relationships and cascades
  • Set up value converters
  • Define indexes and constraints

4. **Migration Creation**

  • Generate EF Core migrations
  • Review migration scripts
  • Add seed data if required
  • Test migration rollback

5. **Repository Pattern**

  • Implement repository interfaces
  • Create repository implementations
  • Add unit of work pattern
  • Implement query specifications

6. **Testing**

  • Write unit tests with in-memory database
  • Create integration tests
  • Verify query performance
  • Test transaction handling

---

Entity Framework Core Implementation

Entity Configuration Pattern

// Entity/User.cs
public class User
{
    public Guid Id { get; set; }
    public string Email { get; set; } = string.Empty;
    public string PasswordHash { get; set; } = string.Empty;
    public string DisplayName { get; set; } = string.Empty;
    public DateTime CreatedAt { get; set; }
    public DateTime? UpdatedAt { get; set; }
    public bool IsActive { get; set; }

    // Navigation properties
    public virtual ICollection<Order> Orders { get; set; } = new List<Order>();
    public virtual UserProfile? Profile { get; set; }
}

Fluent API Configuration

// Configurations/UserConfiguration.cs
public class UserConfiguration : IEntityTypeConfiguration<User>
{
    public void Configure(EntityTypeBuilder<User> builder)
    {
        builder.ToTable("users");

        builder.HasKey(u => u.Id);

        builder.Property(u => u.Id)
            .HasColumnName("id")
            .HasDefaultValueSql("gen_random_uuid()");

        builder.Property(u => u.Email)
            .HasColumnName("email")
            .HasMaxLength(255)
            .IsRequired();

        builder.Property(u => u.PasswordHash)
            .HasColumnName("password_hash")
            .HasMaxLength(255)
            .IsRequired();

        builder.Property(u => u.CreatedAt)
            .HasColumnName("created_at")
            .HasDefaultValueSql("CURRENT_TIMESTAMP");

        builder.HasIndex(u => u.Email)
            .IsUnique()
            .HasDatabaseName("ix_users_email");

        builder.HasMany(u => u.Orders)
            .WithOne(o => o.User)
            .HasForeignKey(o => o.UserId)
            .OnDelete(DeleteBehavior.Cascade);

        builder.HasOne(u => u.Profile)
            .WithOne(p => p.User)
            .HasForeignKey<UserProfile>(p => p.UserId)
            .OnDelete(DeleteBehavior.Cascade);
    }
}

DbContext Setup

// Data/ApplicationDbContext.cs
public class ApplicationDbContext : DbContext
{
    public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
        : base(options)
    {
    }

    public DbSet<User> Users => Set<User>();
    public DbSet<Order> Orders => Set<Order>();
    public DbSet<Product> Products => Set<Product>();

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.ApplyConfigurationsFromAssembly(
Read more
Ships withdevteam

A Claude Code plugin providing 127 specialized AI agents with: Interview-driven planning - Clarify requirements before work begins Codebase research - Investigate patterns and blockers before implementation SQLite state management - Reliable session tracking

Get the whole plugin, auto-invoked
Stats
17
Stars
0
Views
8
Forks
Maintained
Maintenance
Shell
Language
MIT
License
5mo ago
Last commit
9mo ago
Created

Repo: michael-harris/devteam