Creates new Orchard Core modules with proper structure, manifest, startup, and patterns. Use when the user needs to create a new module, add content parts, fields, drivers, handlers, or admin functionality.
This skill is for contributing a module to the Orchard Core source repository.
For a module owned by an application that consumes Orchard Core packages, use
the orchardcore-modules skill instead.
What kind of module are you creating?
| Type | Description | Key Components | |------|-------------|----------------| | Content Part | Adds data/behavior to content items | Part, Driver, Views | | Content Field | Custom field type | Field, Driver, Views | | Settings | Site-wide configuration | SiteSettings, Driver | | Admin Feature | Admin pages/tools | Controller, Views, Menu | | API | REST endpoints | Minimal API endpoint class + Startup route registration | | Background Task | Scheduled jobs | IBackgroundTask |
# Create module folder
mkdir src/OrchardCore.Modules/OrchardCore.YourModule
cd src/OrchardCore.Modules/OrchardCore.YourModule
Every module needs these three files:
See references/module-structure.md for templates.
For Content Part modules:
Models/YourPart.cs
ViewModels/YourPartViewModel.cs
Drivers/YourPartDisplayDriver.cs
Views/YourPart.cshtml
Views/YourPart_Edit.cshtml
For Admin modules:
Controllers/AdminController.cs
Views/Admin/Index.cshtml
AdminMenu.cs
PermissionProvider.cs
For Data-storing modules:
Migrations.cs
Indexes/YourIndex.cs
See references/patterns.md for code templates.
public override void ConfigureServices(IServiceCollection services)
{
// Content part
services.AddContentPart<YourPart>()
.UseDisplayDriver<YourPartDisplayDriver>();
// Services
services.AddScoped<IYourService, YourService>();
// Migrations (if storing data)
services.AddDataMigration<Migrations>();
// Permissions (if securing features)
services.AddPermissionProvider<PermissionProvider>();
// Navigation (if adding admin menu)
services.AddNavigationProvider<AdminMenu>();
}
When a module exposes an endpoint that primarily returns JSON, prefer Orchard Core Minimal APIs over MVC ApiController classes.
Recommended pattern:
public override void Configure(IApplicationBuilder app, IEndpointRouteBuilder routes, IServiceProvider serviceProvider)
{
routes.AddGetWeatherEndpoint();
}
internal static class GetWeatherEndpoint
{
public static IEndpointRouteBuilder AddGetWeatherEndpoint(this IEndpointRouteBuilder builder)
{
_ = builder.MapGet("api/weather", HandleAsync)
.RequireAuthorization()
.DisableAntiforgery();
return builder;
}
private static Task<IResult> HandleAsync()
=> Task.FromResult<IResult>(TypedResults.Ok(new { ok = true }));
}
Use MVC controllers for HTML/admin pages; use Minimal APIs for lightweight JSON endpoints.
# Build the module
cd /path/to/orchardcore
dotnet build src/OrchardCore.Modules/OrchardCore.YourModule
# Run the application
cd src/OrchardCore.Cms.Web
dotnet run -f net10.0
# Enable the feature in Admin → Features
| Item | Convention | Example |
|------|------------|---------|
| Module folder | OrchardCore.ModuleName | OrchardCore.Rating |
| Namespace | OrchardCore.ModuleName | OrchardCore.Rating |
| Feature ID | OrchardCore.ModuleName | OrchardCore.Rating |
| Content Part | NamePart | RatingPart |
| Driver | NamePartDisplayDriver | RatingPartDisplayDriver |
| View | PartName.cshtml | RatingPart.cshtml |
| Edit View | PartName_Edit.cshtml | RatingPart_Edit.cshtml |
Add to .csproj as needed:
<!-- Core module support -->
<ProjectReference Include="..\..\OrchardCore\OrchardCore.Module.Targets\OrchardCore.Module.Targets.csproj" />
<!-- Content management -->
<ProjectReference Include="..\..\OrchardCore\OrchardCore.ContentManagement\OrchardCore.ContentManagement.csproj" />
<!-- Admin UI -->
<ProjectReference Include="..\..\OrchardCore\OrchardCore.Admin\OrchardCore.Admin.csproj" />
Use in Manifest.cs:
Content ManagementContentNavigationSecurityInfrastructureThemingDeveloperreferences/module-structure.md - Directory layout and file templatesreferences/patterns.md - Code patterns (parts, drivers, handlers, etc.)references/examples.md - Complete module examplesAGENTS.md (repo root) - Coding conventions and build commandsnpx skills add CrestApps/orchardcore-module-creator下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer