# Domain Best Practices Check

## Context

Module: {{MODULE_NAME}}
Module README: {{MODULE_README}}
Feature docs: {{FEATURE_DOCS}}

## Instructions

1. Read the module README at the path above
2. Read ALL feature docs at the paths above
3. **Web search** established ERP systems (Odoo, SAP, Oracle) and leading domain SaaS for this module's domain to understand industry-standard patterns
4. For each feature, evaluate whether the **domain design itself** follows industry best practices
5. Return results as markdown per the Output Format section

## Domain Design Checks

For each feature doc, evaluate the design decisions against ERP/SaaS industry norms:

| Check ID                | Question                                                                                                          |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------- |
| entity_design           | Does the entity model follow industry-standard patterns? (e.g., Person/Organization split, address normalization) |
| state_machine_design    | Do state transitions match how this domain typically works in production ERP systems?                             |
| business_rules_validity | Are the business rules realistic and aligned with real-world domain constraints?                                  |
| missing_capabilities    | Are there standard domain capabilities that are conspicuously absent?                                             |
| over_engineering        | Are there features or rules that go beyond what's standard and add unnecessary complexity?                        |
| compliance_alignment    | Does the design account for relevant industry standards or regulations? (e.g., ISO, tax law)                      |

### Module-Level Checks

| Check ID              | Question                                                                                   |
| --------------------- | ------------------------------------------------------------------------------------------ |
| domain_model_fit      | Does the module's entity decomposition match how this domain is typically modeled in ERPs? |
| integration_readiness | Are the integration points (what other modules will need) well-anticipated?                |

## How to Check

For each feature:

1. Identify the domain area (e.g., partner management, inventory, purchasing)
2. Research how Odoo, SAP, Oracle, and leading SaaS products design this domain area
3. Compare the feature's entity model, state transitions, and business rules against industry patterns
4. Flag deviations — some deviations are intentional simplifications (acceptable), others are design gaps (flag them)

## Common Domain Design Issues

- **Missing standard entity splits**: e.g., not distinguishing Person vs Organization in partner management
- **Non-standard state machines**: e.g., missing common states like "Draft" or "Pending Approval" that most ERPs include
- **Unrealistic business rules**: e.g., rules that would break in multi-currency or multi-tenant scenarios
- **Missing regulatory hooks**: e.g., tax handling that doesn't account for regional variations
- **Over-simplified relationships**: e.g., 1-1 where industry standard is N-N (e.g., contacts to organizations)

## Output Format

Return your findings as a structured markdown report:

### Check Results

For each finding:

- **Feature:** feature name
- **Check:** check ID
- **Status:** pass / fail / warn
- **Detail:** what was found and why it matters
- **Industry reference:** what Odoo/SAP/Oracle/SaaS does differently (if applicable)

### Recommendations

Numbered list grouped by priority (critical → high → medium → low). Each item should reference a specific industry practice and explain the recommended change.

### Summary

Table with columns: Metric, Count

- Total checks
- Passed
- Failed
- Warned
