Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

migration-workflow迁移工作流程

Agent Skill

migration-workflow 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

539

周安装

22

GitHub Stars

315

下载量

174
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:migration-workflow(迁移工作流程)
来源仓库:https://github.com/codewithmukesh/dotnet-claude-kit
仓库路径:skills/migration-workflow
安装命令:
npx skills add https://github.com/codewithmukesh/dotnet-claude-kit --skill migration-workflow
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/codewithmukesh/dotnet-claude-kit --skill migration-workflow

简介

migration-workflow 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。
  • 通过 npx skills add 命令从指定仓库安装并使用该技能。
  • 安装前需确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Migration Workflow

Core Principles

  1. Verify before applying — Always review generated migration SQL before applying to any database. dotnet ef migrations script shows the exact SQL. Never apply blindly.
  2. Rollback plan always — Every migration has a rollback. For EF Core: dotnet ef database update <PreviousMigration>. For packages: git revert. For.NET version: branch-based rollback. Document the rollback before applying.
  3. Test after migration — Run the full test suite after every migration step. Migrations that break tests are not complete. Integration tests with Testcontainers catch real database issues.
  4. One change per migration — Each EF Core migration should represent a single logical change (add table, rename column, add index). Multiple unrelated changes in one migration make rollback impossible.
  5. Incremental updates — Update one package at a time, build, test. Update one target framework at a time, build, test. Never batch unrelated changes — when something breaks, you need to know which change caused it.

Patterns

EF Core Migration Workflow

Step-by-step workflow for creating and applying database migrations safely.

Step 1: Check Current State

# List all migrations and their status
dotnet ef migrations list --project src/Infrastructure --startup-project src/Api

# Verify the database is at the expected migration
dotnet ef database update --project src/Infrastructure --startup-project src/Api -- --dry-run

Step 2: Create Migration Use descriptive names that explain the change, not the entity:

# GOOD — Describes the change
dotnet ef migrations add AddOrderShippingAddress --project src/Infrastructure --startup-project src/Api
dotnet ef migrations add RenameCustomerEmailToContactEmail --project src/Infrastructure --startup-project src/Api
dotnet ef migrations add AddIndexOnOrderCreatedAt --project src/Infrastructure --startup-project src/Api

# BAD — Describes the entity, not the change
dotnet ef migrations add Order
dotnet ef migrations add UpdateCustomer

Step 3: Review Generated SQL

# Generate the SQL script for review
dotnet ef migrations script --idempotent --project src/Infrastructure --startup-project src/Api

# Or generate from a specific migration
dotnet ef migrations script PreviousMigration AddOrderShippingAddress --project src/Infrastructure --startup-project src/Api

Check for:

  • ⚠️ Data loss: DROP COLUMN, DROP TABLE, column type changes that lose precision
  • ⚠️ Long locks: ALTER TABLE on large tables without concurrent index creation
  • ⚠️ Default values: New non-nullable columns need defaults for existing rows

Step 4: Handle Data Loss Warnings If EF Core warns about potential data loss:

// In the migration file — explicitly handle data transformation
protected override void Up(MigrationBuilder migrationBuilder)
{
    // Step 1: Add new column as nullable
    migrationBuilder.AddColumn<string>("ContactEmail", "Customers", nullable: true);

    // Step 2: Copy data from old column
    migrationBuilder.Sql("UPDATE \"Customers\" SET \"ContactEmail\" = \"Email\"");

    // Step 3: Make non-nullable after data is copied
    migrationBuilder.AlterColumn<string>("ContactEmail", "Customers", nullable: false);

    // Step 4: Drop old column
    migrationBuilder.DropColumn("Email", "Customers");
}

Step 5: Apply and Verify

# Apply to development database
dotnet ef database update --project src/Infrastructure --startup-project src/Api

# Run tests to verify
dotnet test

Step 6: Rollback (if needed)

# Rollback to previous migration
dotnet ef database update PreviousMigrationName --project src/Infrastructure --startup-project src/Api

# Remove the failed migration from code
dotnet ef migrations remove --project src/Infrastructure --startup-project src/Api

NuGet Dependency Update Workflow

Safe process for updating NuGet packages without breaking the build.

Step 1: Audit Current State

# List all outdated packages
dotnet list package --outdated

# Check for vulnerable packages
dotnet list package --vulnerable

Step 2: Categorize Updates

  • Patch updates (1.0.0 → 1.0.1): Safe, bug fixes only. Update all patches at once.
  • Minor updates (1.0.0 → 1.1.0): Usually safe, new features. Update one at a time.
  • Major updates (1.0.0 → 2.0.0): Breaking changes expected. Update one at a time, read release notes.

Step 3: Update Incrementally

# Patch updates — batch is safe
dotnet outdated --upgrade Patch

# Minor updates — one at a time
dotnet add src/Api/Api.csproj package Serilog.AspNetCore --version 9.1.0
dotnet build
dotnet test

# Major updates — one at a time with careful review
dotnet add src/Api/Api.csproj package WolverineFx
dotnet build  # Fix compilation errors
dotnet test   # Fix behavioral changes

Step 4: Reference Package Recommendations Check knowledge/package-recommendations.md before adding new packages:

  • Is there a built-in.NET alternative? (e.g., HybridCache vs third-party cache)
  • Is the package actively maintained?
  • Does it align with kit recommendations?

Step 5: Verify

dotnet build   # Clean compilation
dotnet test    # All tests pass

.NET Version Migration Workflow

Structured upgrade from older.NET versions to.NET 10.

Step 1: Assess Current State

→ get_project_graph
  List all projects and their target frameworks.
  Flag: mixed TFMs, test projects on different versions.

Step 2: Pre-Migration Checklist

  • All tests pass on current version
  • No pending EF Core migrations
  • Dependencies checked for.NET 10 compatibility
  • Branch created for migration work

Step 3: Update global.json

{
  "sdk": {
    "version": "10.0.100",
    "rollForward": "latestMinor"
  }
}

Step 4: Update Target Frameworks Update each .csproj (or Directory.Build.props if centralized):

<PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <LangVersion>14</LangVersion>
</PropertyGroup>

Step 5: Update Packages

# Update all Microsoft.* packages to 10.x
dotnet outdated --upgrade Major --include Microsoft.*
dotnet build  # Fix compilation issues

Step 6: Adopt New Features Reference knowledge/dotnet-whats-new.md:

  • Replace DateTime.Now/DateTime.UtcNow with TimeProvider
  • Use HybridCache instead of IDistributedCache
  • Convert classes to primary constructors where appropriate
  • Use collection expressions: int[] x = [1, 2, 3]
  • Use the field keyword in property accessors

Step 7: Verify

dotnet build                    # Clean build
dotnet test                     # All tests pass
dotnet format --verify-no-changes  # Formatting consistent

Then run the health check workflow from the project-setup skill to establish the new baseline.

Anti-patterns

Applying Migrations Without Reviewing SQL

# BAD — Blindly applying
dotnet ef database update
# Oops, dropped a column with 10 million rows of data
# GOOD — Review first, then apply
dotnet ef migrations script --idempotent > review.sql
# Read review.sql, check for DROP, ALTER, data loss
dotnet ef database update

Updating All Packages at Once

# BAD — Update everything, pray it works
dotnet outdated --upgrade Major
dotnet build  # 47 errors — which package caused this?
# GOOD — One at a time, build after each
dotnet add package WolverineFx
dotnet build && dotnet test  # ✅
dotnet add package Serilog --version 5.0.0
dotnet build && dotnet test  # ❌ — Serilog 5.0 broke the sink config

Skipping Tests After Migration

# BAD
dotnet ef database update  # "It compiled, ship it"
# GOOD
dotnet ef database update
dotnet test  # Run FULL test suite, especially integration tests
# Integration tests with Testcontainers will catch schema mismatches

Multiple Unrelated Changes in One Migration

# BAD — Three unrelated changes in one migration
dotnet ef migrations add UpdateEverything
# Contains: new table + renamed column + dropped index
# Rollback is all-or-nothing for three unrelated changes
# GOOD — One change per migration
dotnet ef migrations add AddShippingAddressTable
dotnet ef migrations add RenameCustomerEmailColumn
dotnet ef migrations add DropUnusedOrderIndex
# Each can be rolled back independently

Decision Guide

ScenarioWorkflowKey Step
New database tableEF Core MigrationCreate entity + config + migration
Column renameEF Core MigrationReview SQL for data preservation
Add indexEF Core MigrationCheck for long locks on large tables
Data transformationEF Core Migration + raw SQLCustom Up() with SQL statements
Outdated packagesNuGet UpdateOne at a time, build + test between each
Vulnerable packageNuGet Update (urgent)Update immediately, test, deploy
.NET version upgrade.NET MigrationPhase 1-4, verify at each phase
Add new packageNuGet UpdateCheck package-recommendations.md first
ExecuteUpdateAsync vs migrationDependsMigration for schema; ExecuteUpdateAsync for bulk data updates at runtime
Modify existing migrationNever if already appliedCreate new migration instead

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.72%
按下载量换算60

Claude

30.15%
按下载量换算52

Cursor

19.67%
按下载量换算34

Gemini CLI

8.35%
按下载量换算15

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills