monica-application-building-block-development
Skill18 starsChanged 7 months agoMITView on GitHub
Apply Monica building block contracts when implementing, refactoring, or reviewing handlers, entities, repositories, events, jobs, options and their support types. Load monica-application and the project specification first.
In this repository34 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- monica-application-microserviceSkill
- monica-application-modular-monolithSkill
- monica-applicationSkill
- monica-application-ui-developmentSkill
- monica-application-uiSkill
- monica-application-unit-testingSkill
- monica-architectureSkill
- monica-coding-standardsSkill
- monica-contributionSkill
- monica-developmentSkill
- monica-docs-authoringSkill
- monica-frameworkSkill
- monica-guideSkill
- monica-infra-aiSkill
- monica-infra-configurationSkill
- monica-infra-hostingSkill
- monica-infra-jobsSkill
- monica-infra-messagingSkill
- monica-infra-observabilitySkill
- monica-infra-persistenceSkill
- monica-infra-uiSkill
- monica-infra-webSkill
- monica-opentelemetrySkill
- monica-requirement-designSkill
- monica-third-party-module-developmentSkill
- monica-troubleshootingSkill
- monica-ui-auditSkill
- monica-ui-bridge-debugSkill
- monica-ui-designSkill
- monica-ui-developmentSkill
- monica-ui-localizationSkill
- monica-unit-testingSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 3 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
When adding or refactoring application EventBus events and consumers, including outbox or inbox adoption, load the event contract and …
- Very specific: line 20
Prefer Monica-native types.
- Very specific: line 21
Keep persistence concerns in repositories and persistence classes, not in request handlers.
- Very specific: line 22
Keep repository implementations in the owning subdomain or service infrastructure boundary.
- Distinctive: line 23
Keep contracts stable: requests, DTOs, and events are not persistence entities.
- Very specific: line 24
Add explicit [BuildingBlockMetadata] to each application-authored discovered building block and [BuildingBlockRequirement] for applicable …
- Distinctive: line 25
Keep metadata, description, and requirement traceability explicit.
- Very specific: line 30
Do not add MVC [Http*], [Route], or [From*] attributes to generated ApplicationRequestHandler endpoints.
- Very specific: line 31
Use transport-independent ApplicationRequestHandler for use cases.
- Very specific: line 55
Use monica-application-microservice for split deployment and migration from legacy service hosts.
- Very specific: line 56
Use monica-application-modular-monolith for combined deployment and migration from merged legacy contexts.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Monica Application Building Block Development
Overview
Use this skill to implement application building blocks in Monica-based DDD projects. Before changing or reviewing building blocks, load $monica-application and the repository-designated project specification, even when this skill was invoked directly. The shared specification defines rule strength; specification evolution governs concrete architectural gaps and rule changes, not ordinary combinations of these building blocks.
Workflow
Use the unified architecture and the solution to locate the owning domain core or role library. Apply any local placement rule from the project skill. Use building block overview and composition map when the feature's building blocks are unclear; load only the matching building block reference below. Keep invariants on entities. For a multi-step business operation within one domain, use the DomainService template to decide what belongs in the service and what belongs at the request boundary. Check the support-type boundary before extracting business behavior into a separately registered class.
When adding or refactoring application EventBus events and consumers, including outbox or inbox adoption, load the event contract and handler templates before changing their delivery configuration.
Ground Rules
- Prefer Monica-native types. Follow the type naming, source filename, placement, boundary, and project-level extension rules when selecting a reusable specialization. Keep the application's concrete names and adopted extension families in its local guidance.
- Keep persistence concerns in repositories and persistence classes, not in request handlers. Use
$monica-infra-persistencefor the current operation, transaction, and provider contracts. - Keep repository implementations in the owning subdomain or service infrastructure boundary. Do not move a repository or adapter to
Platformjust because it uses an external library; only project-common reusable infrastructure belongs inPlatform. - Keep contracts stable: requests, DTOs, and events are not persistence entities.
- Add explicit
[BuildingBlockMetadata]to each application-authored discovered building block and[BuildingBlockRequirement]for applicable actual requirement IDs, following the metadata and coverage-debt rules. Do not inherit metadata or invent a requirement merely to fill the catalog. - Keep metadata, description, and requirement traceability explicit. Resolve optional ownership through the metadata rules.
- Construct result outcomes explicitly with
Result.Success(data),Result.Failure<T>(message, status), orResult.FromFailure<T>(source). Messages useWithMessage; success does not guarantee non-null data. Follow the result contract. - Make HTTP contracts request-owned. Put
[ApiEndpoint]on the request type and keep route, verb, and binding off theApplicationRequestHandlerhandler. - A request is published for generated API clients only when it is attributed source in the exact namespace
*.PublishedLanguages.Domain{DomainName}.Requests. Attributed requests outside that boundary remain local HTTP endpoints. - Generate interfaces in Protocol independently of placement. The complete
[ApplicationHost]generates per-operation clients and owned receivers; ordinary calls prefer Local and RunOnRole is reserved for a real execution requirement. See unified architecture and API generation. - Do not add MVC
[Http*],[Route], or[From*]attributes to generatedApplicationRequestHandlerendpoints. The request contract is the single endpoint authority. - Use transport-independent ApplicationRequestHandler for use cases.
[ApiEndpoint(ApiHttpMethod, route)]publishes a domain interface for UI and application callers while retaining HTTP metadata without exposing receivers. Unattributed requests and plain IRequestHandler remain internal mediator operations. - For capability setup and runtime behavior, use
$monica-infra-configuration,$monica-infra-jobs,$monica-infra-messaging, and$monica-infra-webas applicable. This skill owns the application building block's shape and placement.
Reference Navigation
- Building Block catalog and responsibilities: 00-building-block-overview.md
- Naming, placement, boundaries, and project-level extensions: 01-building-block-naming-and-boundaries.md
- Building Block selection by feature shape: 02-building-block-composition-map.md
- Metadata, ownership, and requirement traceability: 03-building-block-context-metadata.md
- Bounded CRUD, seeders, hosted services, controllers, internal mediator handlers, Facades, and support types: 04-adapters-lifecycle-and-support-types.md
ApplicationRequestHandlertemplates: 10-application-request-handler-template.mdDomainServicetemplates: 11-domain-service-template.md- Entity, request, and event templates: 12-entity-request-event-template.md
- Repository and DbContext templates: 13-repository-and-persistence-template.md
- Event handler templates: 14-event-handler-template.md
- Job templates: 15-job-template.md
- Continuous consumers, scoped work items, and shutdown: 18-hosted-service-template.md
- Aggregate concurrency and Actor replacement: 19-aggregate-concurrency.md
- Configuration templates: 16-configuration-template.md
- Connected request, handler, entity, and repository example: 17-connected-use-case-example.md
Scope Notes
- This skill is architecture-agnostic. It explains building block design, not solution topology.
- Use
monica-application-microservicefor split deployment and migration from legacy service hosts. - Use
monica-application-modular-monolithfor combined deployment and migration from merged legacy contexts.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

