Prompt Templates

Proven formats for generating accurate UML models. Copy, customize, and paste into EcosystemCode.

Epic → Baseline

When to use: Starting a new project from an epic
Template
I need a [SYSTEM NAME] for [TARGET USER/ORGANIZATION].

## Business Context
[Describe the business problem this system solves and why it's needed]

## Key Features
- [Feature 1: brief description]
- [Feature 2: brief description]
- [Feature 3: brief description]
- [Feature 4: brief description]

## User Roles
- [Role 1]: [What they do in the system]
- [Role 2]: [What they do in the system]
- [Role 3]: [What they do in the system]

## Key Workflows
1. [Workflow 1: brief description of the process]
2. [Workflow 2: brief description of the process]
3. [Workflow 3: brief description of the process]

## Stateful Entities
- [Entity 1] goes through states: [State A] → [State B] → [State C]
- [Entity 2] goes through states: [State A] → [State B]

## Constraints & Requirements
- [Any specific business rules]
- [Performance requirements]
- [Integration requirements]

Please generate:
- Class diagrams for the data model
- State diagrams for stateful entities
- Sequence diagrams for key workflows
- Activity diagrams for complex processes

Example Output

  • 3-5 class diagrams covering domain entities
  • State machines for each stateful entity
  • Sequence diagrams for main user flows
  • Runnable React + Node.js + MongoDB baseline

User Story → Sequence Flow

When to use: Modeling a specific user interaction
Template
## User Story
As a [ROLE],
I want to [ACTION/GOAL],
So that [BENEFIT/VALUE].

## Acceptance Criteria

Given [PRECONDITION]
When [ACTION]
Then [EXPECTED RESULT]

Given [PRECONDITION]
When [ACTION]
Then [EXPECTED RESULT]

Given [PRECONDITION]
When [ACTION]
Then [EXPECTED RESULT]

## Participants
- [Actor 1]: [Role in this flow]
- [Actor 2]: [Role in this flow]
- [System Component]: [What it does]

## Edge Cases
- What happens if [edge case 1]?
- What happens if [edge case 2]?

Please generate a sequence diagram showing the complete flow, including error handling for edge cases.

Example Output

  • Sequence diagram with all participants
  • Message flows for happy path
  • Alt/opt blocks for edge cases
  • Generated API endpoints matching the flow

Acceptance Criteria → State Machine

When to use: Modeling entity lifecycle from ACs
Template
## Entity: [ENTITY NAME]

## States
- [State 1]: [Description of what this state means]
- [State 2]: [Description of what this state means]
- [State 3]: [Description of what this state means]
- [State 4]: [Description of what this state means]

## Transitions (Acceptance Criteria)

From [State 1] to [State 2]:
- Given the [entity] is in [State 1]
- When [trigger event/action]
- Then the [entity] moves to [State 2]
- And [side effect, e.g., notification sent]

From [State 2] to [State 3]:
- Given the [entity] is in [State 2]
- When [trigger event/action]
- Then the [entity] moves to [State 3]

From [State 2] to [State 1] (rollback):
- Given the [entity] is in [State 2]
- When [rollback condition]
- Then the [entity] returns to [State 1]

## Guards/Conditions
- Transition to [State X] only allowed if [condition]
- [Entity] cannot leave [State Y] until [condition met]

Please generate a state machine diagram showing all states, transitions, guards, and any entry/exit actions.

Example Output

  • State machine with all defined states
  • Labeled transitions with triggers
  • Guard conditions on transitions
  • Entry/exit actions where specified

Workflow → Activity Diagram

When to use: Modeling a multi-step business process
Template
## Process: [PROCESS NAME]

## Trigger
This process starts when: [trigger event]

## Participants/Swimlanes
- [Participant 1]: [Role/department]
- [Participant 2]: [Role/department]
- [System]: [Automated steps]

## Steps

1. [Participant 1] does [action]
   - Input: [what they need]
   - Output: [what they produce]

2. Decision: [question/condition]
   - If yes: go to step 3
   - If no: go to step 4

3. [Participant 2] does [action]
   - This can happen in parallel with step 4

4. [System] automatically [action]
   - Triggered by: [event]

5. [Participant 1] reviews [item]
   - If approved: continue to step 6
   - If rejected: return to step 1

6. Process ends with: [final state/output]

## Exception Handling
- If [error condition]: [what happens]
- Timeout after [duration]: [what happens]

Please generate an activity diagram showing the complete workflow with swimlanes, decision points, parallel execution where applicable, and exception handling.

Example Output

  • Activity diagram with swimlanes
  • Decision nodes with conditions
  • Fork/join for parallel activities
  • Exception flows and end states

Tips for Better Results

Be Specific

Include concrete examples and real entity names. "Order" is better than "thing".

Name Your States

Clearly define states like "Pending", "Approved", "Rejected" rather than describing them vaguely.

List All Roles

Mention every user type that interacts with the system—helps generate complete class diagrams.

Describe Flows

Walk through the steps in order. "User clicks X, system does Y, then Z happens."

Ready to Generate?

Copy a template, customize it, and paste into EcosystemCode to generate your UML models and runnable baseline.