Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
Plugin Module
Purpose
Create, modify, and review GrandNode plugins and modules using the repository's existing extension patterns.
When To Use
Use this skill when working in src/Plugins, src/Modules, plugin manifests, provider implementations, plugin settings, plugin install or uninstall logic, plugin controllers, plugin views, module startup, module output paths, or extension-point registrations.
Use this skill when asked to create a new payment, shipping, tax, widget, authentication, discount rule, exchange rate, theme, API, migration, installer, or scheduled task extension.
When Not To Use
Do not use this skill for ordinary core, business, domain, or web changes that do not add or modify plugins or modules.
Do not use this skill as the primary review for payment correctness, tenant isolation, MongoDB query safety, or security-sensitive behavior; combine it with the relevant skill when those concerns are present.
Inputs Required
- Repository root.
- Target extension type: plugin or module.
- Existing extension to use as the closest template.
- Desired system name, friendly name, group, and feature scope.
- Required provider interface or module startup behavior.
- Admin or store configuration requirements.
- Settings, localization resources, static assets, views, and tests required by the change.
Instructions
Mandatory Rules
- Identify whether the work is a plugin under
src/Pluginsor a module undersrc/Modules. - Identify the closest existing implementation and follow its folder, namespace, project, startup, controller, view, setting, and test patterns.
- Read
.ai/knowledge/plugin-types.mdbefore creating or changing a plugin. - Read
.ai/knowledge/module-types.mdbefore creating or changing a module. - Use a stable system name that matches the repository convention, such as
Payments.X,Shipping.X,Tax.X,Widgets.X,Authentication.X,DiscountRules.X,ExchangeRate.X, orTheme.X. - Add or update
Manifest.csfor plugins with[assembly: PluginInfo(...)]. - Add or update a plugin class that derives from
BasePluginwhen install, uninstall, or configuration behavior is required. - Register provider and service implementations in
StartupApplication : IStartupApplication. - Keep
Priority,BeforeConfigure, andConfigurebehavior consistent with nearby extensions unless the feature requires a different startup order. - Put plugin build output under
src/Web/Grand.Web/Plugins/{SystemName}and module build output undersrc/Web/Grand.Web/Modules/{ModuleName}. - Set project references to shared GrandNode projects with
Private=falseor the existing local casing and runtime exclusion pattern used by the closest template. - Add settings classes only when values must be persisted or configured.
- Add install logic for default settings and localization resources.
- Add uninstall logic that removes plugin-owned settings and localization resources.
- Add admin or store controllers only when configuration or interaction is required.
- Use
BaseAdminPluginController,BasePluginController, or the existing module controller base that matches the nearest implementation. - Add Razor views,
_ViewImports.cshtml, components, static assets, and route providers only when the extension needs UI. - Ensure plugin provider
SystemNameequals the default constant and manifest system name. - Ensure provider
ConfigurationUrl,FriendlyName,Priority,LimitedToStores, andLimitedToGroupsfollow the provider contract. - Add tests or update existing tests for provider behavior, startup registration, install or uninstall effects, and domain-specific behavior.
- Build the specific plugin or module project when execution is available.
- State any build or test command that was not run.
Recommendations
- Prefer copying the nearest existing extension shape before inventing a new structure.
- Prefer constants in a
Defaultsclass for provider system name, friendly name resource key, configuration URL, route names, and asset paths. - Prefer
ISettingServicefor plugin settings andIPluginTranslateResourcefor plugin-owned localization resources. - Prefer store-specific settings only when the existing service resolves store overrides.
- Prefer small provider methods that delegate complex behavior to plugin services.
- Prefer adding a new reference file only when a new extension type appears in the repository.
Constraints
- Never create a plugin or module outside
src/Pluginsorsrc/Modules. - Never use a system name that conflicts with an existing plugin or provider.
- Never register a provider without a matching provider interface expected by the target subsystem.
- Never put plugin-owned binaries, views, or assets directly into
Grand.Websource folders. - Never skip install or uninstall cleanup for settings and localization resources owned by the plugin.
- Never hardcode secrets, API keys, tokens, callback URLs, or environment-specific connection strings.
- Never introduce a package version outside central package management unless the repository pattern explicitly requires it.
- Never change shared build props to make one plugin work unless the change is necessary for all plugins or modules.
Expected Output
Produce one of these results:
- A new or modified plugin or module that follows GrandNode conventions.
- A review report with findings ordered by severity.
- A creation plan when implementation details are missing and cannot be inferred safely.
Include changed files, selected template, extension type, validation commands, and remaining risks.
Validation Checklist
- The correct plugin or module type was selected.
- The closest existing template was identified.
- Manifest, system name, defaults, provider, startup, settings, and plugin class are consistent.
- Build output path targets
src/Web/Grand.Web/Pluginsorsrc/Web/Grand.Web/Modules. - Provider interface registration is present and scoped correctly.
- Install and uninstall handle plugin-owned settings and localization resources.
- Controllers, routes, views, components, and assets are present only when needed.
- Store, vendor, group, language, currency, and permission scope were checked where relevant.
- Domain-specific behavior was checked with the matching review skill when needed.
- The narrowest relevant build or test command was run or reported as not run.
Examples
Example 1: Payment Plugin
Input: Create a redirect payment plugin named Payments.ExamplePay.
Output: Create src/Plugins/Payments.ExamplePay, add Manifest.cs, ExamplePayDefaults.cs, ExamplePayPaymentPlugin, ExamplePayPaymentProvider : IPaymentProvider, StartupApplication, settings, configuration controller and view, logo asset, project output path, install and uninstall resources, and payment provider tests.
Example 2: Widget Plugin
Input: Add a public tracking widget.
Output: Create a widget provider implementing IWidgetProvider, register it in startup, define widget zones, add a view component and view under the plugin, add settings and consent behavior when needed, and validate rendering in the selected zone.
Example 3: Scheduled Task Module Change
Input: Add a task that recalculates stale catalog data.
Output: Add an IScheduleTask implementation under Grand.Module.ScheduledTasks, register it with AddKeyedScoped<IScheduleTask, TaskType>("Task name"), keep the module output path unchanged, and add tests for idempotent task execution.