Agent skill

Orchardcore Data Migration

by OrchardCMS in OrchardCMS/OrchardCore

Creates and updates OrchardCore data migrations (DataMigration classes with CreateAsync/UpdateFromX).

BSD-3-ClauseAuto-check passedDatabases

Install Orchardcore Data Migration

skills CLI
$ npx skills add OrchardCMS/OrchardCore --skill orchardcore-data-migration -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install OrchardCMS/OrchardCore orchardcore-data-migration --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/OrchardCMS/OrchardCore.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/orchardcore-data-migration .claude/skills/orchardcore-data-migration && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
orchardcore-data-migration
GitHub stars
8.2k
Token cost
~1.7k tokens
SKILL.md length
590 words
Files
3 (incl. references)
Skills in repo
16
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

Creates and updates OrchardCore data migrations (DataMigration classes with CreateAsync/UpdateFromX).

  • Works in 5 steps: Create the Migrations class → Register the migration → Write the initial CreateAsync → …
  • The user needs to alter content type definitions
  • SKILL.md covers When to use a migration, The version-chain rule (read…, Migration Workflow and Method signatures, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Orchardcore Data Migration is an agent skill from OrchardCMS/OrchardCore. Creates and updates OrchardCore data migrations (DataMigration classes with CreateAsync/UpdateFromX). Use when the user needs to alter content type definitions, create or change SQL index tables, patch existing content items, run a recipe migration, or version a module's schema.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/patterns.md` and `references/schema-builder.md`).

It sits in Databases, covering SQL. It works with SQL. The repository describes itself as: Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework. The licence is BSD-3-Clause.

When your agent uses it

  • The user needs to alter content type definitions
  • Change SQL index tables
  • Patch existing content items
  • Run a recipe migration

Example prompts

  • “Use the orchardcore-data-migration skill to create and updates OrchardCore data migrations (DataMigration classes with CreateAsync/UpdateFromX)”
  • “/orchardcore-data-migration”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Create the Migrations class
  2. Register the migration
  3. Write the initial CreateAsync
  4. Add UpdateFromX for each shipped change
  5. Test the migration

What it can do on your machine

Read from SKILL.md and the folder at commit 545c6a0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are csharp).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Orchardcore Data Migration loads about 1.7k tokens when it runs, and up to ~3.8k if it reads all its reference files. Until then it costs about 77 tokens; SKILL.md has 590 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~77
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from OrchardCMS/OrchardCore at commit 545c6a0, republished under its BSD-3-Clause licence (© OrchardCMS). 590 words, ~1,676 tokens.

Download SKILL.mdSave it as .claude/skills/orchardcore-data-migration/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
orchardcore-data-migration
description
Creates and updates OrchardCore data migrations (DataMigration classes with CreateAsync/UpdateFromX). Use when the user needs to alter content type definitions, create or change SQL index tables, patch existing content items, run a recipe migration, or version a module's schema.

OrchardCore Data Migration

This skill guides you through writing OrchardCore data migrations following project conventions.

A data migration is a class that inherits DataMigration. OrchardCore discovers its methods by reflection and runs them sequentially, per tenant, on application start. The chain starts at CreateAsync() and continues through UpdateFrom1Async(), UpdateFrom2Async(), … Each method returns the schema version number the next method must match.

When to use a migration

  • Define or alter content types / parts / fields (IContentDefinitionManager).
  • Create or alter SQL index tables (SchemaBuilder).
  • Patch existing content item data (query + ISession.SaveAsync).
  • Run a setup recipe at install/upgrade (IRecipeMigrator).
  • Seed roles, settings, or other documents.

The version-chain rule (read first)

The migration runner stores the last returned number per migration class per tenant. It then calls the method whose name matches: returned 4 → runs UpdateFrom4Async(). The method's return value is the new stored version.

RuleWhy
CreateAsync runs only on a fresh install.Existing tenants already passed it.
CreateAsync returns the current latest version, skipping all UpdateFromX.New sites get the final schema directly.
UpdateFromXAsync runs only when stored version == X.Sequential upgrade path.
Never renumber an already-shipped method.Other tenants store the old number; renumbering breaks their upgrade.
Each UpdateFromX returns X+1 (usually).Skipping is allowed when a later step subsumes an earlier one (return a higher number to jump).

Migration Workflow

Step 1: Create the Migrations class

Place Migrations.cs in the module root (or a Migrations/ subfolder for multiple classes, e.g. Migrations/PermissionMigrations.cs).

csharp
using OrchardCore.ContentManagement.Metadata;
using OrchardCore.Data.Migration;

namespace YourModule;

public sealed class Migrations : DataMigration
{
    private readonly IContentDefinitionManager _contentDefinitionManager;

    public Migrations(IContentDefinitionManager contentDefinitionManager)
    {
        _contentDefinitionManager = contentDefinitionManager;
    }

    public async Task<int> CreateAsync()
    {
        // ... define schema ...

        // Return the latest version so new installs skip every UpdateFromX.
        return 1;
    }
}

SchemaBuilder is injected by the base class — do not add it as a constructor parameter.

Step 2: Register the migration

In the module Startup.cs:

csharp
services.AddDataMigration<Migrations>();

Register each migration class separately if the module has more than one.

Step 3: Write the initial CreateAsync

Return the highest version your module currently ships. Example (content part):

csharp
public async Task<int> CreateAsync()
{
    await _contentDefinitionManager.AlterPartDefinitionAsync("TitlePart", builder => builder
        .Attachable()
        .WithDescription("Provides a Title for your content item."));

    // Shortcut other migration steps on new content definition schemas.
    return 2;
}
Step 4: Add UpdateFromX for each shipped change

When you change the schema in a release, append a new UpdateFromXAsync — never edit a prior one. Bump the number CreateAsync returns to match.

csharp
// This code can be removed in a later version.
public async Task<int> UpdateFrom1Async()
{
    await SchemaBuilder.AlterIndexTableAsync<LinkFieldIndex>(table => table
        .AddColumn<string>("BigUrl", column => column.Nullable().Unlimited()));

    return 2;
}
Show full SKILL.md (265 more words)Show less
Step 5: Test the migration
  1. Fresh install — run on a clean tenant; only CreateAsync executes, schema lands at the latest version.
  2. Upgrade — start from a DB at the previous version; confirm each UpdateFromX runs in order.
  3. Test on every targeted provider (SQLite, SQL Server, MySQL, PostgreSQL). SQLite cannot drop columns — guard with try/catch (see references/schema-builder.md).

Method signatures

MethodFormsRuns when
Createint Create() · Task<int> CreateAsync()fresh install
Updateint UpdateFromX() · Task<int> UpdateFromXAsync()stored version == X
Uninstallvoid Uninstall() · Task UninstallAsync()feature uninstalled

Static or instance, sync or async — all supported. Async (...Async) is the convention for new code.

Quick Reference

Common operations
GoalAPI
Define/alter content type_contentDefinitionManager.AlterTypeDefinitionAsync(...)
Define/alter part_contentDefinitionManager.AlterPartDefinitionAsync(...)
Remove part / typeRemovePart(...), DeletePartDefinitionAsync(...)
Create SQL index tableSchemaBuilder.CreateMapIndexTableAsync<TIndex>(...)
Add/drop column or indexSchemaBuilder.AlterIndexTableAsync<TIndex>(...)
Run a recipe_recipeMigrator.ExecuteAsync("init.recipe.json", this)
Patch content itemsISession.Query<ContentItem, ContentItemIndex>(...) + SaveAsync
Type definition builder methods
MethodEffect
.Creatable()Appears in the New menu
.Listable()Shows in content list
.Draftable()Supports drafts
.Versionable()Keeps version history
.Securable()Per-type permissions
.WithPart("PartName")Attaches a part

Gotchas

  • Always set column length on string index columns (.WithLength(n)) or .Unlimited() — unlengthed columns fail on some providers.
  • CreateAsync should return the latest version, not 1, once UpdateFromX methods exist.
  • Patch loops must page by DocumentId and call FlushAsync() periodically (see references/patterns.md).
  • Mark obsolete UpdateFromX methods with // This code can be removed in a later version. but keep them until you drop support for that upgrade path.

References

  • references/patterns.md — content definition changes, content-item data patching, recipe migrations
  • references/schema-builder.md — index tables, columns, indexes, provider quirks
  • src/docs/reference/modules/Migrations/README.md (repo) — official reference
  • AGENTS.md (repo root) — build commands

© OrchardCMS, BSD-3-Clause. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in .agents/skills/orchardcore-data-migration of OrchardCMS/OrchardCore.

  • SKILL.md
  • references/patterns.md
  • references/schema-builder.md

Open the folder on GitHubat commit 545c6a0

Compare with similar skills

Orchardcore Data Migration next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Orchardcore Data Migration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Orchardcore Data Migration this skillOrchardCMS/OrchardCore8.2k—~1.7kAutomated safety check: PassBSD-3-Clause
Evolving The Data ModelTriliumNext/Trilium38k—~2.1kAutomated safety check: PassAGPL-3.0
SQL Optimization Patternsynulihao/AgentSkillOS61711 repos~3.3kAutomated safety check: PassNone
SQL PortabilityHL7/sql-on-fhir151—~512Automated safety check: PassCustom licence
StmoSAP/project-foxhound1802 repos~1.8kAutomated safety check: PassGPL-3.0
DB Migrationskurealnum/dotfiles290—~820Automated safety check: PassNone

Similar skills

  • Evolving The Data Model

    TriliumNext/Trilium

    A skill your agent uses when adding a DB migration or a new column/field to a Becca entity in Trilium ("add a migration", "new column on notes/attributes", "ALTER TABLE", "add a field to…

    38k GitHub stars~2.1k tokensUpdated today
    DatabasesAuto-check passed
  • SQL Optimization Patterns

    ynulihao/AgentSkillOS

    Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.

    617 GitHub starsUsed in 11 repos~3.3k tokens
    DatabasesAuto-check passed
  • SQL Portability

    HL7/sql-on-fhir

    Analyse whether a SQL query is portable across database implementations using sqlglot transpilation.

    151 GitHub stars~512 tokensUpdated 2 days ago
    DatabasesAuto-check passed
  • Stmo

    SAP/project-foxhound

    Official

    Manage Redash queries and dashboards on Mozilla's STMO (sql.telemetry.mozilla.org) using stmo-cli.

    180 GitHub starsUsed in 2 repos~1.8k tokens
    DatabasesAuto-check passed
  • DB Migrations

    kurealnum/dotfiles

    A skill your agent uses when generating or regenerating Drizzle migration files, changing database schema tables or columns, resolving migration sequence conflicts after rebase, reviewing migration…

    290 GitHub stars~820 tokensUpdated 5 mo ago
    DatabasesAuto-check passed
  • Contact Filter

    ChatbotXIO/ChatbotX

    Work with the ChatbotX contact filter system — the shared filter model behind the contacts list, conversations, and broadcast audiences.

    881 GitHub stars~2.5k tokensUpdated today
    DatabasesAuto-check passed

More from OrchardCMS/OrchardCore

All 16 skills in this repo
  • Orchardcore Admin Edit Views

    OrchardCMS/OrchardCore

    Creates and updates OrchardCore admin edit views using the ocat- CSS class conventions.

    8.2k GitHub stars~3.7k tokensUpdated today
    Auto-check passed
  • Orchardcore Asset Manager

    OrchardCMS/OrchardCore

    Builds, watches, and manages frontend assets in OrchardCore.

    8.2k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Orchardcore Display Management

    OrchardCMS/OrchardCore

    Controls how OrchardCore renders content — placement.json rules, display drivers, shapes, zones, alternates, and editor groupings (tabs/cards/columns).

    8.2k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Orchardcore Docs Writer

    OrchardCMS/OrchardCore

    Authors OrchardCore documentation — MkDocs Material pages, module README docs, nav entries, admonitions, tabbed content, and redirects.

    8.2k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Orchardcore Localization

    OrchardCMS/OrchardCore

    Localizes OrchardCore apps — UI strings (IStringLocalizer/IViewLocalizer S, T, H), PO files and pluralization, content translation (LocalizationPart, culture picker), and supported-culture…

    8.2k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Orchardcore Module Creator

    OrchardCMS/OrchardCore

    Creates new OrchardCore modules with proper structure, manifest, startup, and patterns.

    8.2k GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Orchardcore Data Migration

What does Orchardcore Data Migration do?

Creates and updates OrchardCore data migrations (DataMigration classes with CreateAsync/UpdateFromX). Orchardcore Data Migration is an agent skill from OrchardCMS/OrchardCore. Creates and updates OrchardCore data migrations (DataMigration classes with CreateAsync/UpdateFromX).

When should I use Orchardcore Data Migration?

Orchardcore Data Migration fits situations like: the user needs to alter content type definitions; change SQL index tables; patch existing content items; run a recipe migration.

How do I install Orchardcore Data Migration in Claude Code?

Run `npx skills add OrchardCMS/OrchardCore --skill orchardcore-data-migration -a claude-code`. Or copy the skill folder (.agents/skills/orchardcore-data-migration in OrchardCMS/OrchardCore) into .claude/skills/orchardcore-data-migration in your project. Claude Code loads it when a task matches its description.

How do I install Orchardcore Data Migration in Codex?

Run `npx skills add OrchardCMS/OrchardCore --skill orchardcore-data-migration -a codex`. Or copy the skill folder (.agents/skills/orchardcore-data-migration in OrchardCMS/OrchardCore) into .agents/skills/orchardcore-data-migration in your project. Codex loads it when a task matches its description.

Can I use Orchardcore Data Migration in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add OrchardCMS/OrchardCore --skill orchardcore-data-migration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/orchardcore-data-migration, .gemini/skills/orchardcore-data-migration, .github/skills/orchardcore-data-migration and .opencode/skills/orchardcore-data-migration in your project.

What does Orchardcore Data Migration need to run?

SKILL.md names no scripts, command-line tools or credentials: Orchardcore Data Migration is instructions for the agent only.

Does Orchardcore Data Migration access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Orchardcore Data Migration safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Orchardcore Data Migration use?

Orchardcore Data Migration is published under the BSD-3-Clause licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Orchardcore Data Migration use?

About 1.7k tokens (SKILL.md is roughly 6.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.1k tokens, read only when the agent opens those files.

What are the alternatives to Orchardcore Data Migration?

Skills that share tags, products or a category with Orchardcore Data Migration: Evolving The Data Model (TriliumNext/Trilium, 38k stars), SQL Optimization Patterns (ynulihao/AgentSkillOS, 617 stars), SQL Portability (HL7/sql-on-fhir, 151 stars) and Stmo (SAP/project-foxhound, 180 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Orchardcore Data Migration?

OrchardCMS (a GitHub organization) maintains it in OrchardCMS/OrchardCore, which has 8,195 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on October 9, 2026.

Source: OrchardCMS/OrchardCore on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.