Current Task

INIT-011 — View Renderer and Layout System

Mandatory References (read before writing any code):

- AI.md (Sections 21–27 — operational rules)
- PROJECT.md
- WORKFLOW.md
- IMPLEMENTATION_ROADMAP.md
- Sprint 0 Execution Plan
- DBP
- ADR
- MIB (Version 1.0 — locate INIT-011 and read the complete section)
- TCS

Review implementations of:

- INIT-001
- INIT-002
- INIT-005
- INIT-003
- INIT-004
- INIT-006
- INIT-007
- INIT-008
- INIT-009
- INIT-010
- INIT-012

Review project memory:

.ai/memory/

to understand previous architectural decisions.

Requirements

Implement ONLY Task INIT-011.

Do NOT implement CORE-001 or any later task.

The implementation MUST follow the MIB exactly.

Create ONLY the files listed under INIT-011 "Files Expected".

Expected Files

- app/views/layouts/couple.php
- app/views/layouts/admin.php
- app/views/layouts/crew.php
- app/views/layouts/public.php

- app/views/components/nav_couple.php
- app/views/components/flash.php
- app/views/components/pagination.php

- public/assets/css/app.css
- public/assets/js/app.js

Requirements

Implement the approved View Rendering architecture.

The layout system must support:

- Layout wrapping
- View content injection
- Flash message component
- Navigation component
- Shared assets
- Proper HTML escaping
- Compatibility with BaseController::render()

Do NOT implement:

- Authentication
- Authorization
- Business modules
- Alpine components beyond placeholders
- Theme engine
- Invitation rendering
- Dashboard UI
- CRUD pages
- Dynamic navigation
- JavaScript application logic

Rules

- Native PHP 7.4 only.
- Framework-agnostic.
- PSR-4 compatible.
- HTML must remain clean and semantic.
- TailwindCSS compatible.
- Keep layouts reusable.
- Keep components stateless.
- No business logic.
- No database access.
- No session logic beyond rendering FlashMessage output.
- No routing changes.
- No controller changes unless strictly required by the documented rendering flow.

If implementation requires additional files not listed in the MIB:

STOP.

Explain why.

Wait for approval.

If documentation conflicts are found:

STOP.

Reference the conflicting documents.

Wait for approval.

Do NOT execute:

- git add
- git commit
- git push
- git tag
- git merge
- git checkout

Do NOT modify documentation.

Do NOT continue to CORE-001.

After implementation provide:

1. Implementation Summary
2. Files Created (verify against MIB)
3. Files Modified
4. Acceptance Criteria Verification
5. Definition of Done Checklist
6. Proposed Git Commit Message (do NOT execute)
7. Documentation Deviations (if any)

Implementation ends after INIT-011.

Wait for approval.