Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

data-seeder-generator

БесплатноБез исполняемых скриптовНе проверен

Generate ABP Framework data seeder contributors following project conventions. Auto-detects project structure, existing entities, namespaces, permission…

thapaliyabikendraот thapaliyabikendra★ 25 звёзд на GitHub

Об этом скилле

ABP Data Seeder Contributor Generator

Generates production-ready data seeder contributors following this project's conventions and ABP Framework best practices. This skill creates classes that implement IDataSeedContributor for seeding initial, reference, or lookup data into the database.

Key feature: Auto-detects project structure, existing entities, namespaces, and seeder patterns before generating — no manual configuration needed.


When to Use

  • Adding initial lookup/reference data (e.g., categories, types, enumerations)
  • Seeding default configuration or system data
  • Setting up multi-tenant default data
  • Creating data migrations with seed content
  • Populating test/development data
  • Any data that should exist when the application first runs or when a new tenant is provisioned

Step 0 — Auto-Detect Project Structure

Do this automatically before asking the user anything. Never ask what you can detect.

0.1 Find Solution and Project Name

# Find solution file
find . -name "*.sln" | head -3

# Extract project/solution name
basename $(find . -name "*.sln" | head -1) .sln

# Find all .csproj files and classify layers
find . -name "*.csproj" | sort
# *.Domain.csproj                  → Domain layer
# *.Domain.Shared.csproj           → Domain Shared (constants, enums)
# *.Application.csproj             → Application layer
# *.EntityFrameworkCore.csproj     → EF Core layer
# *.DbMigrator.csproj              → DbMigrator (tenant-aware seeders go here)
# *.HttpApi.Host.csproj            → Host layer

0.2 Detect Root Namespace

# Extract namespace from any existing AppService or entity
grep -m1 "^namespace " $(find . -name "*AppService.cs" ! -path "*/bin/*" | head -1) 2>/dev/null

# Fallback: read from .csproj RootNamespace
grep "RootNamespace" $(find . -name "*.Domain.csproj" | head -1) 2>/dev/null

0.3 Detect Existing Seeder Patterns

# Find all existing seeders — most important step
find . -name "*DataSeed*" -o -name "*SeedContributor*" -o -name "*SeederContributor*" \
  | grep "\.cs$" ! -path "*/bin/*" ! -path "*/obj/*" | head -10

# Read EVERY existing seeder found — learn the exact pattern used
# view each file found above

From existing seeders, extract:

  • Constructor style (primary constructor vs traditional)
  • Logging pattern (_logger.LogInformation messages format)
  • Existence check pattern (AnyAsync vs FirstOrDefaultAsync vs count)
  • Insert pattern (InsertAsync vs InsertManyAsync)
  • UoW pattern ([UnitOfWork] vs explicit IUnitOfWorkManager)
  • Whether IClientSeedingService is used
  • Whether feature flags are used
  • Namespace convention

0.4 Detect Existing Entities

# Find all domain entities
find . -name "*.cs" -path "*/Domain/*" ! -path "*/bin/*" ! -path "*/obj/*" \
  ! -path "*/Tests/*" ! -path "*/Data/*" | head -30

# Detect which use AggregateRoot vs Entity base class
grep -rl "AggregateRoot\|FullAuditedAggregateRoot\|Entity<" \
  --include="*.cs" . | grep -v "bin\|obj\|Tests" | head -20

# Read each entity to extract:
# - Property names and types
# - Required vs optional fields
# - Any SystemName / unique identifier property
# - Enum properties (need Domain.Shared scan too)
# Example:
view("src/{Project}.Domain/Entities/Customers/Customer.cs")

0.5 Detect Entity Constants (Domain.Shared)

# Find constants files in Domain.Shared
find . -name "*Consts*" -path "*/Domain.Shared/*" ! -path "*/bin/*" | head -10

# Read to find Items collections
grep -rn "public static class Items" --include="*.cs" . | head -10

# Read each consts file found
# view each consts file

0.6 Detect Enums

# Find all enum definitions
grep -rn "public enum" --include="*.cs" . \
  ! -path "*/bin/*" ! -path "*/obj/*" | head -20

# Read enum files for first/default values
find . -name "*.cs" -path "*/Domain.Shared/*" | xargs grep -l "public enum" 2>/dev/null | head -5
# view each found

0.7 Detect Permission Constants

# Find permission files
find . -name "*Permissions*.cs" ! -path "*/bin/*" | head -5

# Extract all permission constants
grep -rn "public const string" --include="*Permissions*.cs" . | head -30

# Find PermissionDefinitionProvider
find . -name "*PermissionDefinitionProvider.cs" | head -3
# view it

0.8 Detect Multi-Tenancy

# Check if multi-tenancy is enabled
grep -rn "IsMultiTenant\|MultiTenancy\|ITenantRepository\|ITenantManager" \
  --include="*.cs" . | head -5

# Check if IClientSeedingService exists (project-specific)
grep -rn "IClientSeedingService" --include="*.cs" . | head -5

# Find tenant constants
find . -name "*TenantConsts*" ! -path "*/bin/*" | head -3
# view if found

0.9 Detect Seeder File Locations

# Check all 3 possible seeder locations
ls src/*.Domain/Entities/ 2>/dev/null
ls src/*.Domain/Data/ 2>/dev/null
ls src/*.DbMigrator/ 2>/dev/null

# Determine which is used by existing seeders
find . -name "*DataSeed
Полный SKILL.md на GitHub

Установить data-seeder-generator в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл data-seeder-generator?

Generate ABP Framework data seeder contributors following project conventions. Auto-detects project structure, existing entities, namespaces, permission constants, and seeder patterns from the codebase — no manual configuration needed. Creates IDataSeedContributor implementations with proper dependency injection, logging, and tenant/feature awareness. Use when: (1) creating new seed data for entities, (2) adding initial/reference data, (3) scaffolding data initialization code, (4) maintaining data consistency across environments.

Как установить скилл data-seeder-generator?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл data-seeder-generator запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить data-seeder-generator с