mo-development

Guide Monica .NET module creation, registration, and hosted-service observability.

13|6|Updated Feb 19, 2025
One-click install
npx skills add https://github.com/Tairitsua/Monica --skill mo-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mo-development
Source: https://github.com/Tairitsua/Monica/tree/main/.claude/skills/mo-development
Command: npx skills add https://github.com/Tairitsua/Monica --skill mo-development

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provides clear, enforceable guidance to developers building Monica .NET modules and hosted services so modules are correctly registered, configured, and observable across host and web runtimes.

Core Features & Use Cases

  • Module pattern and registration: Explains the Module{Name}, Option, Guide, and BuilderExtensions pattern and how to claim dependencies and register modules consistently.
  • Unified result model and boundaries: Defines when to use Res/Res<T> at UI-facing boundaries and when internal services should use standard .NET returns and exceptions.
  • Hosted-service observability: Describes MoBackgroundService, RecordState usage, heartbeat, history sizing, and CoordinatedLeaderService for leader-aware tasks.
  • Use case: Convert an internal background task into a well-behaved Monica hosted service that records operational state, validates required guide configuration keys, and downgrades safely from web to non-web hosting when needed.

Quick Start

Ask for step-by-step guidance to create a new Monica module that registers a facade returning Res<T>, declares dependencies, and adds a MoBackgroundService using RecordState for observability.

Frequently Asked Questions about mo-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I register a Monica .NET module and declare its dependencies correctly?

To register a Monica .NET module, apply the Module{Name}, Option, Guide, and BuilderExtensions pattern to consistently claim dependencies and configure the module across host and web runtimes.

What is the correct scope for using Res versus standard .NET returns in Monica modules?

Res and Res<T> result envelopes are designed for UI-facing boundaries in Monica modules, while internal services should use standard .NET returns and exceptions for their operations.

How do I add observability to a Monica hosted service using RecordState?

To add observability to a Monica hosted service, implement MoBackgroundService and use RecordState patterns to track heartbeat, history sizing, and operational state for your background tasks.

How do I validate required configuration keys for a Monica module?

Validate Monica module configuration by implementing GetRequestedConfigMethodKeys to ensure required guide configuration keys are properly validated before the module runtime initializes.

Can I downgrade a Monica hosted service from web to non-web hosting?

Yes, Monica hosted services can safely downgrade from web to non-web hosting by applying the correct module runtime kind selection and using MoBackgroundService patterns for consistent execution.

What is the best way to implement leader-aware background tasks in Monica?

For leader-aware background tasks in Monica, use CoordinatedLeaderService within your MoBackgroundService to manage leader election and ensure tasks execute only on the designated leader instance.