Agent skill
add-plugin
Add and configure a Momentum CMS plugin
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/add-plugin-donaldmurillo-momentum-cms
SKILL.md
Add Momentum CMS Plugin
Add and configure a plugin in this Momentum CMS project.
Arguments
$ARGUMENTS- Plugin name: "analytics", "otel", "event-bus", or an npm package name
Steps
- Identify the plugin to install
- Install the package (if not already a dependency)
- Import the plugin factory in
src/momentum.config.ts - Configure the plugin and add to the
pluginsarray - Run
npm run generateto regenerate types and admin config - Remind the user to restart the dev server
Official Plugins
Analytics (@momentumcms/plugins-analytics)
Adds event tracking, content performance dashboard, and block-level analytics.
npm install @momentumcms/plugins-analytics
// In src/momentum.config.ts
import { analyticsPlugin } from '@momentumcms/plugins-analytics';
const analytics = analyticsPlugin({
trackCollections: true,
});
const config = defineMomentumConfig({
// ...existing config
plugins: [authPlugin, analytics],
});
What it adds:
- Analytics dashboard admin page
- Content performance admin page
- Tracking rules collection
- Block-level impression and hover tracking fields
- CRUD event tracking hooks on all collections
OpenTelemetry (@momentumcms/plugins-otel)
Adds distributed tracing with OpenTelemetry spans for all collection operations.
npm install @momentumcms/plugins-otel
// In src/momentum.config.ts
import { otelPlugin } from '@momentumcms/plugins-otel';
const tracing = otelPlugin({
serviceName: 'my-cms',
});
const config = defineMomentumConfig({
// ...existing config
plugins: [authPlugin, tracing],
});
What it adds:
- Tracing hooks (before/afterChange, before/afterDelete) on all collections
- OTel log enricher for trace/span IDs
Event Bus (@momentumcms/plugins-core)
Pub/sub for collection lifecycle events. Already installed as a dependency.
// In src/momentum.config.ts
import { eventBusPlugin } from '@momentumcms/plugins-core';
const events = eventBusPlugin();
const config = defineMomentumConfig({
// ...existing config
plugins: [authPlugin, events],
});
// Subscribe to events anywhere:
events.bus.on('posts:afterChange', ({ doc, operation }) => {
console.log(`Post ${operation}:`, doc.title);
});
What it adds:
- Event hooks on all collections
- Typed event bus for subscribing to collection events
After Adding a Plugin
npm run generate # Regenerate types and admin config
npm run dev # Restart dev server
Custom Plugins
For writing your own plugin, see the Writing a Plugin documentation.
A custom plugin implements the MomentumPlugin interface:
import type { MomentumPlugin } from '@momentumcms/core';
export function myPlugin(config: MyConfig): MomentumPlugin {
return {
name: 'my-plugin',
collections: [], // Optional: add collections
adminRoutes: [], // Optional: add admin pages
modifyCollections(collections) {}, // Optional: inject fields/hooks
async onInit(context) {}, // Optional: before API init
async onReady(context) {}, // Optional: after API ready
async onShutdown(context) {}, // Optional: graceful shutdown
};
}
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?