Maintains project thesaurus following DDD ubiquitous language principles for consistent domain-aligned naming of variables, functions, classes, DB fields, APIs, events, files, and directories.
npx claudepluginhub codealive-ai/ai-driven-development --plugin ai-driven-developmentThis skill is limited to using the following tools:
You enforce naming consistency across the codebase by maintaining a living thesaurus
Resolves fuzzy business terminology in Ruby on Rails DDD discussions by identifying canonical terms, mapping synonyms, resolving conflicts, and generating glossaries.
Extracts DDD-style glossary of domain terms from conversations into UBIQUITOUS_LANGUAGE.md, flags ambiguities and synonyms, proposes canonical terms.
Extracts DDD-style ubiquitous language glossary from conversation, flags ambiguities, proposes canonical terms, and saves to UBIQUITOUS_LANGUAGE.md. For defining domain terms or DDD discussions.
Share bugs, ideas, or general feedback.
You enforce naming consistency across the codebase by maintaining a living thesaurus of domain terms and consulting it every time something needs a name.
Three modes:
This skill combines two bodies of knowledge:
"A project should use a single, shared vocabulary. Every name in code, docs, APIs, and conversations must map to a term in the thesaurus. If a concept isn't in the thesaurus — add it before naming anything."
— Domain-Driven Design, Eric Evans
The codebase is primary evidence, not automatic authority. Use code to discover which terms are currently in circulation. Use the thesaurus and user input to decide which terms SHOULD be canonical.
## Legacy Terms and use the user's terms as canonicalTacit knowledge: For areas not yet implemented, the most important domain knowledge exists only in experts' heads, not in any artifact.
Locating the thesaurus:
THESAURUS.md already exists somewhere in the repo — use that locationdocs/THESAURUS.mdSingle source of truth for domain vocabulary.
### [Term]
- **Definition**: What this concept means in the business domain
- **NOT**: What this term does NOT mean (prevents confusion with similar concepts)
- **Synonyms to AVOID**: Terms that mean the same thing but must NOT be used
- **Related terms**: Other thesaurus terms this concept connects to
### [Term]
- **Definition**: [one sentence]
- **Synonyms to AVOID**: [list]
Why no "Use in code" field: The thesaurus defines concepts and canonical names, not how they appear in code. Code casing follows project conventions automatically.
The thesaurus captures concepts, not behavior. It's strong at nouns (entity names, roles, process names) but won't replace behavioral specs for business rules. Don't try to turn the thesaurus into a specification — keep entries short. If a concept has a critical invariant, note it briefly in the definition, not as a separate section.
Non-English domains: If the business domain operates in a non-English language, use
the original language for the canonical term. The thesaurus should reflect how domain
experts actually speak. Add an English translation only if the codebase uses English
identifiers: Счёт-фактура (Invoice in code).
ALWAYS before naming:
This is the single most important step. Before proposing ANY name for anything, find and read the thesaurus (see "Locating the thesaurus" above). Most naming tasks don't need a new term — the right name is already there.
Check:
If the thesaurus has a term that fits — stop here. You're done. Use that term.
Before minting a new term, try four levers (from FPF F.14 "Name less, express more"):
OrderLineItem reuses Order + LineItemNightOperator — use Operator with a time qualifier## Unresolved
with a [WHITE-SPOT] tag. Don't force a name for an undefined concept.Only after all four fail, mint a new term:
PremiumCustomerTask to Activity to sound universalWhen existing code uses a term that contradicts the thesaurus:
fetchPurchases() but thesaurus says the canonical term is Order, not Purchase"Use the business domain term. Singular. No technical suffixes.
GOOD: Order, Invoice, UserAccount, ShoppingCart
BAD: OrderAggregate, OrderRoot, OrderAggregateImpl, OrderEntity
Singular noun from the domain. Something with identity.
GOOD: OrderLineItem, PaymentTransaction, Customer
BAD: OrderLineItemEntity, OrderLineItemImpl, OrderLineItemObj
Singular noun describing an immutable concept. Describes what it is, not what it does.
GOOD: Money, Email, PhoneNumber, Address, DateRange
BAD: MoneyValue, EmailValidator, PriceInfo, AmountData
Past tense verb + noun. Something that happened.
GOOD: OrderPlaced, PaymentCaptured, InvoiceSent, InventoryReserved
BAD: OrderEvent, OnOrderPlaced, CreateOrder (that's a command)
Imperative verb + noun. An action requested.
GOOD: CreateOrder, CancelInvoice, ProcessRefund, ReserveInventory
BAD: OrderCreated (that's an event), NewOrder, OrderCommand
Question or retrieval. Verb + object or descriptive name.
GOOD: GetOrderById, FindInvoicesByCustomer, ListPendingOrders
BAD: RetrieveOrderData, OrderQuery, GetterForOrder
Named after business activities the domain expert recognizes.
GOOD: InvoiceCalculator, OrderFulfillment, NotificationSender
BAD: OrderManager, GenericService, HelperService
Repository suffix is acceptable — it's an infrastructure pattern.
GOOD: OrderRepository, InvoiceRepository, CustomerRepository
BAD: OrderStorage, OrderPersistence, OrderFinder, OrderDao
Commands (change state): Imperative verb, no "Get" prefix.
GOOD: order.Cancel(), order.AddLineItem(product, quantity), order.Recalculate()
BAD: order.CancelOrderMethod(), order.GetCancelled(), order.DoCancelOrder()
Queries (read-only): Start with Get, Is, Has, Can, or a domain verb.
GOOD: order.GetTotal(), order.IsExpired(), order.CanBeShipped()
BAD: order.FetchInfo(), order.CheckData()
The domain layer must be protected from transient jargon, vague terms, and implementation details. Maintain a Forbidden Lexicon in the thesaurus: terms that MUST NOT appear in domain code and must always be replaced with a specific domain term.
| Weasel Word | Problem | Fix |
|---|---|---|
Info | Meaningless suffix | Remove it: UserInfo -> User |
Data | Says nothing about the concept | Use domain term: OrderData -> Order |
Manager | Vague, hides responsibility | Split by actual responsibility |
Handler | Generic, unclear intent | Name after what it handles |
Service | Overused catch-all | Use specific domain activity name |
Base | Technical distraction | Remove, use composition |
Item | Too generic | Use domain term: Item -> OrderLineItem, Product |
Util / Helper | Indicates bad design | Move logic to domain objects |
Object / Obj | Never appropriate | Remove suffix |
Record / Model | Database concept leaking into domain | Use domain term |
Domain code must be free of implementation details:
BAD: MongoOrder, SqlUserRepository, HttpOrderService, OrderDto, OrderEntity
GOOD: Order, OrderRepository (interface), PaymentGateway, Order (just Order)
Technical prefixes/suffixes belong ONLY in the infrastructure layer:
INFRASTRUCTURE LAYER (OK): MongoOrderRepository, RedisSessionCache, HttpPaymentClient
DOMAIN LAYER (NEVER): MongoOrder, RedisSession, HttpPayment
Framework caveat: In frameworks that intentionally blend domain and persistence (Active Record pattern, ORM-centric frameworks), the model IS the domain entity. Keep the domain noun clean and let framework coupling live in inheritance, annotations, or metadata — not in the class name. Flag technical jargon only when it becomes part of the business-facing name or leaks outside its boundary.
Same concept called different things in different parts of code:
PROBLEM: "Customer" in auth, "User" in API, "Account" in billing — all mean the same thing
FIX: Pick ONE canonical term per bounded context. Add others to "Avoid" list.
Ban abbreviations in durable, domain-bearing names: types, exported functions, modules, API fields, DB columns, events, config keys.
Allow conventional short-lived local identifiers when meaning is obvious in scope:
i, j, ctx, req, res, err, tx, db, e for events.
Allow industry-standard acronyms when they are the dominant term: SKU, VAT,
URL, ID, OAuth. Do NOT force unnatural expansions if experts use the acronym.
PROBLEM: usr, user, account, acct — competing abbreviations for the same durable concept
FIX: Pick ONE canonical form for domain-bearing names. Short-lived locals are exempt.
BAD: record, entity, item, data, info, config, settings
GOOD: Use the specific domain term. "Config" → "LoanProduct". "Settings" → "NotificationPreferences"
BAD: RedisCache, PostgresStore, KafkaProducer, ElasticSearchIndex
GOOD: SessionStore, OrderHistory, EventPublisher, ProductCatalog
When different artifacts use different terms for the same concept across the knowledge chain, information is lost at each translation:
SMELL: Domain expert says "Campaign" → PM writes "Promotion" in spec →
Dev codes `marketing_push` → QA tests "advertising effort"
FIX: Same term everywhere: expert, PM, dev, QA all say and write "Campaign"
This is worse than synonym drift because each translation also loses nuance and business rules. How to detect: compare terms in requirements/specs/tickets against code names. If they don't match, the ubiquitous language has a translation gap — adopt the domain expert's term everywhere.
When the thesaurus provides a canonical term, apply it using the project's casing:
| Context | Convention | Example (term: "Order") |
|---|---|---|
| Class/Type | PascalCase | Order, OrderService |
| Function/Method | Project convention | createOrder / create_order |
| Variable | Project convention | pendingOrder / pending_order |
| Constant | UPPER_SNAKE | MAX_ORDER_ITEMS |
| Database table | Project convention | orders, order_items |
| API endpoint | kebab-case or convention | /orders, /order-items |
| Event/Message | PascalCase with past-tense verb | OrderPlaced, OrderCancelled |
| File/Directory | Project convention | order.ts, order_service.py |
Key rules:
ord), don't expand (orderObject), don't synonym (purchase)OrderItem, not PurchaseLineItemOrderRepository, OrderDTO (in infra layer only)ProcessingStage / processing_stage — keep all wordstotalAmount not amt, customerEmail not cEmailWhen changing terms, use the least strong relation that tells the truth (from FPF F.13):
| Operation | When | Effect on thesaurus |
|---|---|---|
| Add | New concept | Create entry. Minimum: definition + avoided synonyms |
| Rename | Wording improved, sense unchanged | Old name becomes legacy alias; grep codebase, suggest renames |
| Split | One term covered two senses | Old term deprecated; two new entries; disambiguation note |
| Merge | Two terms are really one sense | Pick canonical form; other becomes alias in "Avoid" list |
| Retire | Term was misleading, no single successor | Read-warning only ("avoid in new code; see X and Y") |
| Deprecate | Concept being phased out | Move to Legacy Terms with replacement pointer |
Key test: Can you point to the same concept before and after the change?
Alias parsimony: keep at most 1 legacy alias per term — the one readers will most likely encounter in old code.
THESAURUS.md? If not — add it firstIf any answer raises a concern — stop and fix before proceeding.