# Developer Agent Prompt: To-Do App Project

This document outlines the development methodology, code implementation approach, technology stack strategy, code organization, and customized development workflow for the "To-Do App" project. This agent will strictly adhere to these guidelines to ensure efficient and high-quality code delivery.

## 1. Development Methodology

-   **Agile & Iterative:** Employ an agile, iterative development approach, focusing on delivering functional increments.
-   **Document-Driven:** All implementation will be guided by the following documents, which must be thoroughly analyzed before coding:
    -   `architecture_document.md` (for system architecture and design patterns)
    -   `tech_stack_document.md` (for technology choices and frameworks)
    -   `tasks_list.md` (for development tasks and progress tracking)
    -   `sprint_plan.md` (for development timeline and priorities)
    -   `.sureai/coding-standard.md` (for coding standards and conventions)
    -   `.sureai/ui-ux.md` (for UI/UX components, design tokens, theming, and accessibility guidelines)
-   **Test-Driven (where applicable):** Focus on writing unit and integration tests to ensure code correctness and prevent regressions.

## 2. Code Implementation Approach

-   **Task-Based Development:** Implement features strictly based on the subtasks defined in `.sureai/tasks_list.md`.
-   **Backend-First:** Prioritize the development of backend RESTful APIs for To-Do item management before integrating with the frontend.
-   **Convention Adherence:** Strictly follow existing code conventions, patterns, and styles found within the `authsec_springboot` (backend) and `authsec_angular` (frontend) codebases.
-   **Dynamic Folder Usage:** All backend code will reside in `to_do_app_20250925_053630-to_do_app_20250925_053630-b-b/` and all frontend code in `to_do_app_20250925_053630-to_do_app_20250925_053630-f-f/`. No new `backend/` or `frontend/` root directories will be created.
-   **File Management:** Before creating any file, check if it already exists. If it does, append or modify the existing content using `cat >>` or `sed -i`. Only create new files when absolutely necessary.

## 3. Technology Stack Implementation Strategy

### Backend (Spring Boot with MySQL)
-   **RESTful API Development:** Design and implement RESTful endpoints for CRUD (Create, Read, Update, Delete) operations on To-Do items.
-   **Data Persistence:** Utilize Spring Data JPA for seamless interaction with the MySQL database.
-   **Security:** Implement authentication and authorization mechanisms as specified in the `architecture_document.md` and existing `authsec_springboot` structure.
-   **Existing Structure:** Integrate new code within the existing Spring Boot project structure located at `to_do_app_20250925_053630-to_do_app_20250925_053630-b-b/authsec_springboot/backend/src/main/java/com/realnet/`.

### Frontend (Angular Clarity)
-   **Component-Based UI:** Develop modular Angular components for displaying To-Do lists, individual To-Do items, and forms for adding/editing To-Do items.
-   **Clarity Design System:** Leverage Clarity Design System components for a consistent and visually appealing user interface.
-   **Routing:** Implement Angular routing to navigate between different views (e.g., To-Do list, To-Do detail/form).
-   **API Integration:** Consume the backend RESTful APIs using Angular services to fetch and manipulate To-Do data.
-   **Existing Structure:** Integrate new code within the existing Angular project structure located at `to_do_app_20250925_053630-to_do_app_20250925_053630-f-f/authsec_angular/frontend/angular-clarity-master/src/app/`.

### Database (MySQL)
-   **Schema Definition:** Define a clear and efficient database schema for To-Do items, including fields like `id`, `title`, `description`, `completed` (boolean), and `dueDate`.
-   **Migration Scripts:** Create or update SQL migration scripts (e.g., `wf_table.sql` or new `.sql` files) to manage database schema changes.

## 4. Code Organization and Structure Framework

### Backend (`to_do_app_20250925_053630-to_do_app_20250925_053630-b-b/authsec_springboot/backend/src/main/java/com/realnet/`)
-   `com.realnet.<project_name>.model`: Contains JPA entities representing the To-Do item data model.
-   `com.realnet.<project_name>.repository`: Houses Spring Data JPA repositories for database access.
-   `com.realnet.<project_name>.service`: Encapsulates business logic related to To-Do operations.
-   `com.realnet.<project_name>.controller`: Defines REST controllers for exposing To-Do API endpoints.

### Frontend (`to_do_app_20250925_053630-to_do_app_20250925_053630-f-f/authsec_angular/frontend/angular-clarity-master/src/app/`)
-   `src/app/models`: TypeScript interfaces for defining the structure of To-Do items and other data transfer objects.
-   `src/app/services`: Angular services responsible for making HTTP requests to the backend API and handling data.
-   `src/app/components`: Contains presentational Angular components for the UI (e.g., `todo-list`, `todo-item`, `todo-form`).
-   `src/app/modules`: Organizes feature-specific modules (e.g., a `todo` module to encapsulate all To-Do related components, services, and routing).

## 5. Customized Development Workflow

1.  **Task Breakdown:** For each main task listed in `.sureai/tasks_list.md` (created by the SM agent), break it down into 3-8 granular subtasks that represent distinct implementation steps.
2.  **Sequential Implementation:** Implement subtasks one by one, updating the "Currently Working On" section and marking completed subtasks with `- [x]` in `.sureai/tasks_list.md`.
3.  **Code Generation & Modification:** Utilize `write_file` and `replace` tools to create new code files and modify existing ones as required by the subtasks.
4.  **Syntax & Static Checks:** After completing each subtask, run relevant language-specific syntax and static analysis checks (e.g., `npx -y tsc --noEmit` for TypeScript, Maven compile for Java) to catch errors early.
5.  **Main Task Testing:** Once all subtasks for a main task are completed, write and execute unit tests that cover the main task's functionality. Append ` — TEST: PASS` or ` — TEST: FAIL` to the main task header in `.sureai/tasks_list.md`.
6.  **Dependency Management:** Ensure `pom.xml` (backend) and `package.json` (frontend) are correctly updated with any new dependencies, and run respective install commands (`mvn install`, `npm install`).
7.  **Frontend File Validation (CRITICAL):** Before marking any frontend subtask as complete, rigorously validate that all created or modified frontend files contain actual, meaningful content to prevent blank screen issues. Use `find`, `cat`, `wc -c`, and `grep` commands for verification as outlined in the general instructions.
8.  **Application Smoke Test:** After all main tasks are fully completed and tested, perform a comprehensive application smoke test as detailed in the general instructions, including verifying file structure, installing all dependencies, and starting both backend and frontend servers to ensure they run without errors.