Files
Krow-workspace/apps/mobile/ai_prompts/7-architecutre-fix.md
Achintha Isuru 19959a2b3f Add initial mobile app prototypes and staff payments feature
Introduces the first versions of client and staff mobile application prototypes, including platform-specific assets, screens, and configuration for Android, iOS, macOS, Linux, and Windows. Adds documentation, AI prompt guides, and a new staff payments feature module with repository, use cases, and presentation logic. Also includes generated localization files and supporting resources for both client and staff apps.
2026-01-25 17:01:18 -05:00

67 lines
1.9 KiB
Markdown

Task is to refactor an existing Flutter package so that it fully complies with the architecture rules defined in:
* `apps/mobile/docs/01-architecture-principles.md`
## TARGET PAGE
Package to refactor:
```
apps/mobile/packages/features/staff/shifts
```
Reference feature that already follows the architecture correctly (this is the GOLD STANDARD):
```
apps/mobile/packages/features/staff/authentication
```
## GOAL
Refactor the feature so that it strictly follows **KROW Clean Architecture principles**, while preserving **all existing behavior and UI output**.
The result must be structurally correct, testable, and aligned with feature-level responsibilities.
## STRICT RULES (NON-NEGOTIABLE)
You MUST follow **all** rules defined in:
* `apps/mobile/docs/01-architecture-principles.md`
Additionally, enforce the following:
### Architecture Rules
* The pages **MUST remain inside the feature package**
* The pages **MUST NOT import other features**
* Business logic **MUST NOT exist inside the page**
* State handling **MUST be moved to a Bloc/Cubit or external widget**
* Use cases **MUST live in `domain/`**
* Repository access **MUST go through abstractions**
### Presentation Rules
* Use `StatelessWidget` for pages
* If state is required:
* Move it to a Bloc/Cubit, OR
* Extract it into a separate widget file
* Use named parameters
* Add clear doc comments where structure or intent is non-obvious
### Safety Rules
* ❌ Do NOT remove existing functionality
* ❌ Do NOT change user-facing behavior
* ❌ Do NOT introduce new dependencies
* ❌ Do NOT break modular boundaries
## EXPECTED OUTPUT
* A refactored page that:
* Fully complies with `apps/mobile/docs/01-architecture-principles.md`
* Has clean separation of concerns
* Is easy to reason about and extend
* Any required supporting files (Bloc, use case, widget extraction) created **inside the same feature**
Proceed with the refactor now.