| name | business-to-model-card |
| description | Use this skill when the input is product/business narrative and the goal is to produce executable domain modeling artifacts before YAML coding. It converts descriptions into model cards (context, aggregate, relations, state machine, validation, actions, events, custom overlays), enforces single-writer/cross-domain event rules, creates refine task lists, and prepares handoff inputs for `ubo-yaml-writing`. |
Business to Model Card
Purpose
Use this skill to bridge the gap between:
- Narrative business requirements.
- Concrete modeling decisions.
- YAML implementation handoff.
This skill is for principle + structure.
Use ubo-yaml-writing after this skill for schema-level authoring.
When To Trigger
Trigger when user asks any of:
- "How to model this business flow?"
- "Given product PRD/business description, produce domain model."
- "Need model card/template/refine checklist before coding."
- "Need to clarify core vs vertical vs tenant custom boundaries."
Core Rules
- Do not start from YAML. Start from model boundary and action semantics.
- Reuse existing core aggregate when available; do not create duplicate aggregate for lifecycle phase.
- Draft is usually a state (for example
status=draft), not a new aggregate.
- Cross-domain linkage goes through events, not direct writes to other domains' source-of-truth.
- Single-writer rule must be explicit for critical facts.
Workflow
Step 1: Normalize input
Extract:
- Business objective.
- Actors and roles.
- Facts that must be persisted.
- Lifecycle transitions.
- Tenant-specific differences.
Step 2: Define model boundary
Produce:
- Context responsibility / non-responsibility.
- Aggregate root and single write entry.
- Explicit "reuse existing model" note if applicable.
Step 3: Build action semantics
For each action define:
- Input.
- Preconditions.
- Effects (state/data/events).
- Idempotency key.
- Failure modes.
Step 4: Define validation and invariants
Three layers:
- Input validation.
- Business precondition validation.
- Post-action invariant.
Step 5: Define cross-domain events
For each event define:
- Publisher.
- Trigger.
- Consumers.
- Consumer-side idempotency.
Step 6: Define custom overlays
Must include:
- Overlay points (field/rule/node/template).
- Priority:
tenant custom > vertical > core.
- Same-layer conflict strategy.
- Fallback path.
Step 7: Emit artifacts
Always output:
- Model Card (full).
- Quality Gate mini-score.
- Refine task list (modular).
- YAML handoff checklist for
ubo-yaml-writing.
Output Contract
A. Model Card (required sections)
- Meta: model id, module, context, type.
- Boundary: responsible/not responsible, source-of-truth, single writer.
- Data: aggregate/entities/value objects/relations.
- State machine.
- Action list.
- Validation and invariants.
- Events.
- Custom overlay points.
- Core mapping and gaps.
- Test mapping.
B. Quality Gate mini-score (0-2 each)
- Boundary clarity.
- State-machine completeness.
- Constraint strength.
- Custom parameterization.
- Core mapping completeness.
Pass condition:
- Total >= 7/10.
- Key dimensions (state/constraint/mapping) cannot be 0.
C. Refine task list
Each task must include:
- Scope.
- Expected artifact.
- Exit criteria.
D. YAML handoff checklist
Before handing off to ubo-yaml-writing ensure:
- Aggregate and relation targets are stable.
- Action input/precondition/effects are stable.
- Invariant is testable.
- Overlay conflict strategy is fixed.
Quick Decision Heuristics
- "Need draft form save" -> add
save_draft action on existing aggregate; keep weak validation.
- "Need final submit" ->
submit_* action with strong validation and invariant checks.
- "Need cooperation with another domain" -> publish/consume events; no direct cross-domain fact write.
- "Need customer difference" -> parameterize in custom overlays; no model copy-per-tenant.