Model classes
Goal
Create classes with attributes, operations and operation parameters, relate them, and draw a class diagram. For an architect, data architect or software architect. You end with classes with typed attributes (with defaults), operations with return types and parameters, associations and generalizations, and a class diagram that shows them, all read back and checked.
Where it runs
This scenario needs the MCP server. Computer use covers its UI steps.
| Surface | How it runs |
|---|---|
| Claude Code | Fully |
| Claude Cowork | Fully, through a local session; a cloud session has no local MCP server. The scripting variation for a large class model is not available: it needs local code execution on the machine where EA runs, and a local session runs code in an isolated virtual machine instead. Computer use covers the UI steps. |
| Claude Desktop chat | Fully, except the UI steps, which you perform: starting EA and opening the model, and dismissing any dialog EA raises (you paste a screenshot of it into the conversation first). The scripting variation for a large class model is not available: it needs local code execution, which Claude Desktop chat does not have. |
| VS Code with GitHub Copilot | Fully, except the UI steps, which you perform: starting EA and opening the model, and dismissing any dialog EA raises (you paste a screenshot of it into the conversation first). The scripting variation for a large class model is available. |
Before you start
- The start-of-session check done.
- A target package, and a baseline if it holds content.
- For a technology-typed class: the technology loaded and enabled, and readable at the Location where it is stored (Project or Model). Check by technology id. An unknown stereotype for the technology fails the request and writes nothing.
- A design: the class names, their members and their relationships. The AI can propose one from your description. Agree it first.
Class-level work is a layer beneath element creation. A class is created first, then its members one at a time. Each member has its own identifiers, and the two ids a member returns are used by different later requests. The scenario is mostly about getting that sequence right and checking the result, because a wrong identifier fails at once and a wrong default fails silently. The skill is ea-modeling and its class-modeling reference.
The Westbrook illustration uses WBADataAsset and WBAAIModel. Both are declared against the Class metaclass. If you have no technology of your own, a plain UML class is the same flow.
Steps
- AI with computer use; otherwise you If EA is not running or the model is not open, start EA and open it. AI Power Tools
ea-start-hereruns the start-of-session check and, if a technology is used, confirms it is loaded. - You Approve the class design: classes, members and relationships.
- AI Power Tools
ea-modelingcreates the class elements, either in a technology (create_element_in_language, which takes the technology id and the stereotype and reports what it resolved to) or as plain UML classes. - AI Power Tools
ea-modelingcreates each attribute with its type and an optional default (create_attribute). - AI Power Tools
ea-modelingcreates each operation with its return type (create_operation). - AI Power Tools
ea-modelingadds each operation's parameters (add_parameter). - AI Power Tools
ea-modelingcreates the relationships. For class diagrams use the standard connector types: Association, Aggregation, Composition, Generalization, Dependency and Realization. EA stores the last one asRealisation, so the AI passes that spelling. A relationship runs from the client (source) to the supplier (target): a subclass is the client of its Generalization. - AI Power Tools
ea-modelingcreates the class diagram and places the classes and relationships. - AI Power Tools
ea-modelingreads everything back: the attributes and operations of each class, checked against the design. - You Look at the rendered diagram.
Identifiers. An attribute and an operation each return a small numeric id and a guid. Updating uses the guid. Deleting uses the owning element's id and the member's numeric id. A parameter returns only a guid. Where a request needs an id the AI did not just receive, it lists the owning element's members and matches by name.
Prompts to use
Opening
Follow-ups
Recommended models
| Model | Fit | Why |
|---|---|---|
| Claude Fable 5.1 | Capable | More than the task needs once the design is agreed |
| Claude Opus 5.5 | Capable | Helpful for the design |
| Claude Sonnet 5.5 | Recommended | Handles the identifier differences and the read-back |
| Claude Haiku 4.5 | Recommended | AI Power Tools computes the steps once the design is fixed. Check the identifier use |
Ratings are guidance based on the kind of reasoning the skill needs, not measured benchmarks.
Checking the result
- Accurate. The attribute and operation listings show the names, types, return types and defaults you asked for. A default reads two ways: an unset default reads as empty on creation and as the literal
<none>on a later read. That is EA's own placeholder. - Complete. Every class, attribute, operation and parameter in the design exists once. Relationship counts match. The diagram shows each class and its relationships.
- Nothing unintended changed. Only the new package content differs from the baseline.
Variations
- AI model classes.
WBAAIModelis also a Class. The AI-only tags apply only to the three AI stereotypes in the Westbrook technology. - Add members to existing classes. Start by reading the current members, then add.
- Many classes. Each attribute, operation and parameter is one request. For a large class model, consider an XMI import (Move content in and out of Enterprise Architect) or, where local code execution is available, scripting inside EA for the bulk, and use AI Power Tools for review.
Limitations
- Adding a parameter is the only parameter-writing operation, and it is not an upsert. A name that already exists on the operation raises an error and nothing is written. To change a parameter, recreate the operation, or edit the parameter in EA's own operation dialog, a UI step that is AI with computer use; otherwise you.
- A wrong default fails silently. A wrong id fails at once.
- Parameters have no numeric id. Listings show the parameter's id as empty. Use the guid or the name, which is unique per operation.
- Compartments cannot be removed from a drawn class, only reduced to names.
- Broad queries can time out on a live shared repository. The AI scopes verification to one element.