Add New Aggregate Base Field

Automate adding a base field to an aggregate with type, persistence, and calculation settings.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/zeitwert/fm-server --skill add-new-aggregate-base-field
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Add New Aggregate Base Field
Source: https://github.com/zeitwert/fm-server/tree/main/.cursor/skills/add-new-entity-base-field
Command: npx skills add https://github.com/zeitwert/fm-server --skill add-new-aggregate-base-field

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automate adding a new base field to an existing aggregate.

Core Features & Use Cases

  • Define base field types and responsibilities (manual vs calculated)
  • Manage persistence decisions (volatile vs persistent) and calculation modes
  • Integrate with DTOs and lifecycle hooks like doCalcAll()

Quick Start

Use this skill to define a new base field for an existing aggregate, specifying its type, persistence, and calculation mode.

Frequently Asked Questions about Add New Aggregate Base Field

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

FAQPage Schema
How do I add a new base field to an existing aggregate in domain model design?

To add a base field to an aggregate, you define its type, responsibility, persistence, and calculation behavior. This process ensures the new field is correctly configured for manual input or calculated values within the domain model.

What is the difference between manual, calculated volatile, and calculated persistent aggregate fields?

Manual aggregate fields require direct input, calculated volatile fields compute values at runtime without persistence, and calculated persistent fields store computed results in the database. This distinction governs how fields are loaded, calculated, and exposed via DTOs.

How do I configure calculation behavior for a new aggregate field using lifecycle hooks?

You configure calculation behavior by integrating the new aggregate field into lifecycle hooks like doCalcAll(). This ensures calculated volatile or persistent fields are automatically computed and updated during the domain model's execution cycle.

When should I expose a calculated aggregate field through a DTO?

You should expose a calculated aggregate field through a DTO when the computed value needs to be transmitted to the presentation layer. Mapping calculated fields to DTOs ensures the calculated results are available without exposing underlying domain model persistence logic.

Can I define a new aggregate field as volatile without configuring database persistence?

Yes, you can define a new aggregate field as calculated volatile, meaning it skips database persistence entirely. The field is computed at runtime via lifecycle hooks like doCalcAll(), providing transient values without requiring persistent storage configuration.

What are the limitations of adding base fields to existing aggregates without defining calculation placement?

Without defining calculation placement, new calculated aggregate fields lack execution triggers, leading to stale or null values. Properly mapping fields to lifecycle methods like doCalcAll() is required to enforce calculation rules and ensure data consistency across the domain model.