/unwind:uw-analyze-domainfrom unwind
Analyzes domain entities, value objects, aggregates, enums, and validation rules in a codebase, writing structured documentation to docs/unwind/layers/domain-model/.
Ships in unwind. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Output: docs/unwind/layers/domain-model/ (folder with index.md + section files)
Principles: See analysis-principles.md - completeness, machine-readable, link to source, no commentary, incremental writes.
docs/unwind/layers/domain-model/
├── index.md # Overview, entity count, links to sections
├── entities.md # All entity definitions
├── value-objects.md # Value objects, embeddables
├── enums.md # All enum/union types
└── validation.md # Validation rules, constraints, state machines
For large codebases (20+ entities), split by aggregate/domain:
docs/unwind/layers/domain-model/
├── index.md
├── users-aggregate.md
├── orders-aggregate.md
└── ...
Step 1: Setup
mkdir -p docs/unwind/layers/domain-model/
Write initial index.md:
# Domain Model
## Sections
- [Entities](entities.md) - _pending_
- [Value Objects](value-objects.md) - _pending_
- [Enums](enums.md) - _pending_
- [Validation](validation.md) - _pending_
## Summary
_Analysis in progress..._
Step 2: Analyze and write entities.md
entities.md immediatelyindex.mdStep 3: Analyze and write value-objects.md
value-objects.md immediatelyindex.mdStep 4: Analyze and write enums.md
enums.md immediatelyindex.mdStep 5: Analyze and write validation.md
validation.md immediatelyindex.mdStep 6: Finalize index.md Update with final counts and summary
# Domain Model
## Entities
### User
[User.java](https://github.com/owner/repo/blob/main/src/domain/User.java)
```java
@Entity
@Table(name = "users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false, unique = true)
private String email;
@Enumerated(EnumType.STRING)
private UserStatus status = UserStatus.ACTIVE;
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
private List<Order> orders = new ArrayList<>();
public void suspend() {
if (this.status == UserStatus.DELETED) {
throw new IllegalStateException("Cannot suspend deleted user");
}
this.status = UserStatus.SUSPENDED;
}
}
[Continue for ALL entities...]
@Embeddable
public class Money {
private BigDecimal amount;
@Enumerated(EnumType.STRING)
private Currency currency;
public Money add(Money other) {
if (!this.currency.equals(other.currency)) {
throw new IllegalArgumentException("Currency mismatch");
}
return new Money(this.amount.add(other.amount), this.currency);
}
}
public enum UserStatus {
ACTIVE, SUSPENDED, DELETED
}
stateDiagram-v2
[*] --> DRAFT
DRAFT --> SUBMITTED: submit()
SUBMITTED --> PAID: markPaid()
SUBMITTED --> CANCELLED: cancel()
PAID --> SHIPPED: ship()
SHIPPED --> DELIVERED: deliver()
Source: Order.java:78-95
## Additional Requirements
### Validation Constraint Tables [MUST]
For each validation schema, create a constraint table:
```markdown
### Position Validation [MUST]
| Field | Type | Min | Max | Required | Default | Notes |
|-------|------|-----|-----|----------|---------|-------|
| name | string | 1 | 200 | yes | - | |
| fteBasis | number | 0 | 2 | yes | 1.0 | Full-time equivalent |
| capexPerc | number | 0 | 100 | yes | 0 | Percentage |
| allocation | number | 0 | 100 | yes | 100 | Percentage |
**Source:** `src/validation/positions.ts`
Document ALL enum/union type values:
### Position Type Enum [MUST]
```typescript
type PositionType = 'standard' | 'acting' | 'interim' | 'vacant'
| Value | Description |
|---|---|
| standard | Permanent position |
| acting | Temporary assignment |
| interim | Short-term coverage |
| vacant | Unfilled position |
### Permission Matrix [MUST]
Document role-permission mappings:
```markdown
### Permission Matrix [MUST]
| Resource | owner | admin | manager | member |
|----------|-------|-------|---------|--------|
| Organisation | manage | read | read | read |
| Employee | manage | manage | manage | read |
| Budget | manage | manage | read | - |
| Rate | manage | manage | read | - |
Document any self-referential constraints:
### Relationship Constraints [MUST]
- Position cannot report to itself: `fromPositionId !== toPositionId`
- End date must be after start date: `endDate > startDate`
Every entity, enum, and validation rule must have a [MUST], [SHOULD], or [DON'T] tag in its heading.
Default categorizations for domain model:
Example:
### User entity [MUST]
### UserStatus enum [MUST]
### EmailValidator [MUST]
### UserDTO [SHOULD]
See analysis-principles.md section 9 for full tagging rules.
If docs/unwind/layers/domain-model/ exists, compare current state and add ## Changes Since Last Review section to index.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub nearform/unwind --plugin unwind25 skills in this plugin
/uw-analyzeUse after unwind:uw-scan to orchestrate layer-by-layer analysis using specialist subagents/uw-analyze-apiUse when analyzing REST/GraphQL API endpoints, contracts, authentication, and client-facing interfaces/uw-analyze-databaseUse when analyzing the database layer including schema, migrations, ORM configuration, and data access patterns/uw-analyze-e2e-testsUse when analyzing end-to-end tests including browser automation, API workflows, and full system testing/uw-analyze-frontendUse when analyzing frontend/UI layer including components, state management, routing, and API integration (optional - skip if no frontend exists)/uw-analyze-infrastructureUse when analyzing build/dependency config, runtime configuration, program entrypoints, and deployment/ops assets the rebuild must reproduceOther plugins' skills for the same job