Greenfield Rules
Imperative instructions for creating new modules or components in PurePoint.
Before You Start
- Read the Architecture page for the relevant domain — understand constraints and decisions
- Read the Product page for the relevant domain — understand what it needs to do
- Check Module Structure (Architecture) — understand module boundaries and dependency rules
New Module Checklist
- Create the module in the appropriate location per the project's module structure
- Define the public interface — what types and functions are exported
- Write the first test before the first implementation
- Verify the module compiles/builds independently
- Wire the module into its parent and any dependents
Conventions
- Follow existing patterns in the codebase for naming, error handling, and structure
- Core domain logic must not depend on transport or API layers
- No circular dependencies between modules
- Follow TDD — write the test first, then the implementation
Constraints
- New modules must build independently
- Follow the project's established dependency direction (core → transport → client)
- Colocate tests with the code they test
- Document public interfaces