# Step 0: Initialization

## YOUR TASK
Gather requirements and analyze existing code patterns before implementing a complete full-stack feature.

## EXECUTION SEQUENCE

### 1. Identify Feature Scope
- What is the main entity/aggregate? (e.g., Product, Invoice, Support Ticket)
- What are the CRUD operations required? (Create, Read, Update, Delete, Archive)
- What business rules apply? (validations, state transitions, constraints)
- What user permissions are needed? (who can create/edit/delete/view)
- What notifications/workflows are required? (emails, webhooks, automation)
- Does AI play a role? (content generation, analysis, validation)

### 2. Analyze Existing Code Patterns
- Review `Domain/` for similar entity structures, factories, and behaviors
- Check `Application/` for existing service interfaces and DTOs
- Examine `Infrastructure/` for EF Core configurations and patterns
- Look at `API/Controllers/` for authorization and RequirePermission attributes
- Study `web/` for similar pages, forms, and i18n implementations
- Identify reusable components and patterns to follow

### 3. Define Data Model
- Entity properties and types
- Enums for status, types, and classifications
- Relationships (OneToMany, ManyToMany, etc.)
- Audit requirements (CreatedAt, CreatedBy, ModifiedAt, ModifiedBy)
- Soft delete or permanent delete?

### 4. Plan Implementation Phases
- **Phase 2:** Domain entity, factory method, behaviors, enums, IAuditableEntity
- **Phase 3:** Application service interface, DTOs, permissions (create + assign permissions files)
- **Phase 4:** Infrastructure (EF Config, concrete service, DI registration, DbSet, migration)
- **Phase 5:** API controller with Authorize, RequirePermission, ProducesResponseType
- **Phase 6:** Frontend (API client, custom hook with SignalR, page, form, routing, i18n for 4 languages)
- **Phase 7:** Integrations (notifications, workflows, AI if applicable)

### 5. Validate Against Architecture Rules
- Confirm layered architecture is followed (no frontend-to-DB shortcuts)
- Verify entity factory methods are used (no direct constructors in services)
- Check permissions split across 2 files (Create/List/Read/Update/Delete vs Assign)
- Plan SignalR hooks for real-time updates
- Define ProducesResponseType for all endpoints
- Plan i18n for English, French, Italian, German

## SUCCESS METRICS
- Feature scope clearly defined and bounded
- All required CRUD operations identified
- Business rules documented
- Permissions mapped to roles
- Implementation plan with all 7 phases outlined
- Existing code patterns understood and will be followed
- Data model defined with relationships and audit requirements

## NEXT STEP
Proceed to `./step-01-implementation.md` to execute all phases (Domain, Application, Infrastructure, API, Frontend, Integrations) with code templates and orchestration of child skills.
