agentleFS
TairitsuaTairitsua/Monica/.agents/skills/monica-application-project-unit-development/SKILL.md

monica-application-project-unit-development

Skill13 starsChanged 7 months agoMITView on GitHub

Create or refactor Monica application ProjectUnits, including requests, handlers, domain services, entities, repositories, events, options, and jobs. Use with the chosen microservice or modular-monolith architecture skill.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 2 are distinctive, and 12 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 12

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill for unit-level application development in Monica-based DDD projects.

    line 10
  2. Very specific:

    Use Monica-native base classes and interfaces only.

    line 18
  3. Very specific:

    Follow the naming, placement, and boundary rules in 01-project-unit-naming-and-boundaries.md.

    line 19
  4. Very specific:

    Keep persistence concerns in repositories and persistence classes, not in request handlers.

    line 20
  5. Very specific:

    Keep repository implementations in the owning subdomain or service infrastructure boundary.

    line 21
  6. Distinctive:

    Keep contracts stable: requests, DTOs, and events are not persistence entities.

    line 22
  7. Very specific:

    Add explicit [ProjectUnitMetadata] and one or more [ProjectUnitRequirement] annotations to every discovered unit.

    line 23
  8. Distinctive:

    Treat missing metadata, description, ownership, and requirement references as four independent catalog debts.

    line 24
  9. Very specific:

    If a handler returns Res<string>, use Res.Ok<string>(value) instead of Res.Ok(value) to avoid the non-generic string overload.

    line 25
  10. Very specific:

    Put [assembly: WebApiGenerationConfig(...)] in each assembly that owns attributed requests.

    line 28
  11. Very specific:

    Do not add MVC [Http*], [Route], or [From*] attributes to generated ApplicationService endpoints.

    line 29
  12. Very specific:

    Use ApplicationService only for HTTP-exposed mediator handlers.

    line 30
  13. Very specific:

    Use monica-application-microservice to decide service splits, published-language layout, and migration project boundaries.

    line 50
  14. Very specific:

    Use monica-application-modular-monolith to decide module splits, host composition, and cross-module contracts.

    line 51

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Monica Application ProjectUnit Development

Overview

Use this skill for unit-level application development in Monica-based DDD projects. It defines the common ProjectUnit language shared by both monica-application-microservice and monica-application-modular-monolith.

Workflow

Choose the owning subdomain and project with $monica-application-microservice or $monica-application-modular-monolith. Use unit overview and composition map when the feature's units are unclear; load only the matching unit example below. Keep rich entity behavior in the domain and orchestration in handlers.

Ground Rules

  • Use Monica-native base classes and interfaces only. Do not introduce Our* wrappers or FIPS-specific conventions.
  • Follow the naming, placement, and boundary rules in 01-project-unit-naming-and-boundaries.md. These rules are aligned with the current Monica.ProjectUnits discovery behavior.
  • Keep persistence concerns in repositories and persistence classes, not in request handlers. Use $monica-infra-persistence for 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 Platform just because it uses an external library; only project-common reusable infrastructure belongs in Platform.
  • Keep contracts stable: requests, DTOs, and events are not persistence entities.
  • Add explicit [ProjectUnitMetadata] and one or more [ProjectUnitRequirement] annotations to every discovered unit. Do not rely on metadata inherited from a base class.
  • Treat missing metadata, description, ownership, and requirement references as four independent catalog debts. Do not collapse them into one readiness score.
  • If a handler returns Res<string>, use Res.Ok<string>(value) instead of Res.Ok(value) to avoid the non-generic string overload.
  • Make HTTP contracts request-owned. Put [ApiEndpoint] on the request type and keep route, verb, binding, and optional operation name off the ApplicationService handler.
  • A request is published for generated RPC clients only when it is attributed source in the exact namespace *.PublishedLanguages.Domain{DomainName}.Requests. Attributed requests outside that boundary remain local HTTP endpoints.
  • Put [assembly: WebApiGenerationConfig(...)] in each assembly that owns attributed requests. Protocol assemblies select the required RpcClientTargets; local-only assemblies normally use None.
  • Do not add MVC [Http*], [Route], or [From*] attributes to generated ApplicationService endpoints. The request contract is the single endpoint authority.
  • Use ApplicationService only for HTTP-exposed mediator handlers. If a request is intentionally internal and must have no HTTP endpoint, implement IRequestHandler<TRequest, TResult> as a normal transient dependency instead of omitting [ApiEndpoint] from an ApplicationService.
  • For capability setup and runtime behavior, use $monica-infra-configuration, $monica-infra-jobs, $monica-infra-messaging, and $monica-infra-web as applicable. This skill owns the application unit's shape and placement.

Reference Navigation

  • Unit catalog and responsibilities: 00-project-unit-overview.md
  • Naming, placement, and boundary rules: 01-project-unit-naming-and-boundaries.md
  • Unit selection by feature shape: 02-project-unit-composition-map.md
  • Metadata, ownership, and requirement traceability: 03-project-unit-context-metadata.md
  • ApplicationService templates: 10-application-service-template.md
  • DomainService templates: 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
  • Configuration templates: 16-configuration-template.md

Scope Notes

  • This skill is architecture-agnostic. It explains unit design, not solution topology.
  • Use monica-application-microservice to decide service splits, published-language layout, and migration project boundaries.
  • Use monica-application-modular-monolith to decide module splits, host composition, and cross-module contracts.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.