# Boundary Consistency Check

## Context

Module: {{MODULE_NAME}}
Module README: {{MODULE_README}}
Feature docs: {{FEATURE_DOCS}}
Other module READMEs: {{OTHER_MODULES}}
Other module features: {{OTHER_FEATURES}}

## Instructions

1. Read the module README and ALL feature docs for {{MODULE_NAME}}
2. Read ALL other module READMEs and their feature docs
3. For each feature in {{MODULE_NAME}}, check for boundary overlaps and dependency issues
4. Return results as markdown per the Output Format section

## Boundary Checks

For each feature in the target module:

| Check ID            | Question                                                                  |
| ------------------- | ------------------------------------------------------------------------- |
| boundary_overlap    | Does this feature overlap with features in other modules?                 |
| entity_ownership    | Is each entity owned by exactly one module? No shared entity definitions? |
| dependency_analysis | Are cross-module dependencies explicit and well-defined?                  |
| scope_leakage       | Does this feature handle concerns that belong to another module?          |

### How to Check

1. Extract all entities and operations from the target module's features
2. Extract all entities and operations from other modules' features
3. Compare for overlaps:
   - Same entity name in multiple modules → likely boundary issue
   - Same operation on same entity → scope leakage
   - Feature referencing another module's entities without explicit dependency → implicit dependency
4. For each overlap, determine if it's:
   - **Legitimate shared reference** (e.g., User entity referenced by many modules)
   - **Boundary violation** (e.g., both modules try to manage the same entity lifecycle)
   - **Missing dependency** (e.g., module uses entity without declaring dependency)

## Common Boundary Patterns

- **Ownership conflicts**: Two modules both define CRUD for the same entity
- **Scope creep**: Module handles validation/workflow that belongs elsewhere
- **Missing integration points**: Module needs data from another module but doesn't declare it
- **Redundant features**: Same capability implemented in multiple modules

## Output Format

Return your findings as a structured markdown report:

### Check Results

Table with columns: Feature, Target (overlapping module/feature), Check, Status (pass/fail/warn), Detail

One row per check performed.

### Recommendations

Numbered list grouped by priority (critical → high → medium → low). Each item is an actionable recommendation.

### Summary

Table with columns: Metric, Count

- Total checks
- Passed
- Failed
- Warned
