# io8 Project Manager Agent - Customized for This Project

## Project-Specific Instructions

```markdown
# io8PM Agent Instructions for "Notes App" Project

**Project Name:** Notes App
**User Prompt:** notes app
**Timestamp:** 2025-10-02_055810

## 1. Project Management Methodology

For the "Notes App" project, an **Agile (Scrum/Kanban hybrid) methodology** will be employed. This approach emphasizes iterative development, flexibility, continuous feedback, and rapid adaptation to evolving requirements.

*   **Iterative & Incremental:** The project will be broken down into manageable phases and sprints, delivering functional increments frequently.
*   **User-Centric:** All development will revolve around delivering maximum value to the end-user, ensuring their needs are met through continuous feedback loops. The `analysis_document.md` and its updates are crucial for understanding user requirements.
*   **Adaptive Planning:** While a strategic roadmap will be established, the plan will remain flexible, allowing for adjustments based on new insights, market changes, or technical discoveries.
*   **Transparency:** Regular communication and visible progress will be maintained across all stakeholders.

## 2. PRD Development Approach for "Notes App"

The Product Requirements Document (PRD) for the "Notes App" will be a living document, evolving with the project. It will be built upon the existing `analysis_document.md`, `architecture_document.md`, and `tech_stack_document.md` to ensure a comprehensive and aligned product strategy.

**Key Steps for PRD Creation (io8PM Agent Focus):**

1.  **Consolidate & Synthesize:** Thoroughly review all previous agent outputs (`analysis_document.md`, `architecture_document.md`, `tech_stack_document.md`), especially the latest updates, to extract all relevant information regarding business objectives, user requirements, functional/non-functional requirements, and technical considerations for the "Notes App." Pay close attention to the expanded scope, including user authentication and advanced note management.
2.  **Structure Adherence:** Strictly follow the provided comprehensive PRD template structure, ensuring all mandatory sections are included and thoroughly detailed.
3.  **Phase-Oriented Detailing:** Clearly distinguish between **Phase 1 (MVP: Core Notes Management & User Authentication)** and **Phase 2 (Enhanced Features: Search, Filter, Rich Text, Tagging)** within the PRD. This distinction is critical in the Functional Requirements, Non-Functional Requirements, and especially the Epic Stories sections, using priority levels and explicit labeling.
4.  **User Story Focus:**
    *   Translate the "Notes App" specific user requirements from the `analysis_document.md` updates (e.g., US-001 to US-012) into concrete, actionable user stories following the "As a [user type], I want to [action/feature], so that [benefit/value]" format.
    *   Ensure each user story has clear, testable acceptance criteria, drawing directly from the `analysis_document.md` where provided, or inferring them based on context.
    *   Assign preliminary story points (using `[Estimate]` placeholder) and priority (High/Medium/Low) based on the phase (MVP stories are `High`, Phase 2 stories typically `Medium`).
    *   Ensure user stories are *not* the boilerplate developer stories but specifically for the Notes App end-user.
5.  **Technical Alignment:** Integrate specific details from the `architecture_document.md` (e.g., Client-Server, Layered Backend, API Design, Data Model, Security considerations like JWT, password hashing, input validation) and `tech_stack_document.md` (e.g., Angular, Clarity, Flask, PostgreSQL, Docker) into the "Technical Requirements" and "User Interface Requirements" sections. This ensures feasibility and alignment with the chosen technologies.
6.  **Risk & Success Identification:** Proactively identify potential technical, market, and user adoption risks relevant to a Notes App with authentication. Propose practical mitigation strategies. Define clear, measurable success metrics (KPIs) relevant to both phases of the project (e.g., user registration rate, note creation frequency, search usage).

## 3. Project Planning Framework

The "Notes App" project will follow a phased approach with iterative development cycles:

*   **Phase 1: Minimum Viable Product (MVP) - Core Notes & Authentication**
    *   **Focus:** Deliver the fundamental functionalities as outlined in `analysis_document.md` updates: User Registration, Login, Logout, and basic CRUD operations (Create, Read, Update, Delete) for notes.
    *   **Goal:** Provide a secure and usable core application that users can interact with immediately, validating the core value proposition. This forms the baseline for future enhancements.
    *   **Duration:** Estimated to be 2-3 sprints (e.g., 4-6 weeks), subject to team velocity.
*   **Phase 2: Enhanced Features - Search, Filter, Rich Text, Tagging**
    *   **Focus:** Implement advanced features identified in the `analysis_document.md` (search, filtering, rich text editing, tagging) to enrich the user experience and organization capabilities.
    *   **Goal:** Improve user experience, organization capabilities, and overall product stickiness, expanding the Notes App's value proposition.
    *   **Duration:** Estimated to be 3-4 sprints (e.g., 6-8 weeks), following MVP completion.

**General Planning Activities:**

*   **Product Backlog Refinement:** An ongoing process where the PM, with the development team, elaborates user stories, adds estimates, and refines priorities based on feedback and new insights.
*   **Sprint Planning:** At the beginning of each 2-week sprint, the team will select high-priority, ready-to-develop items from the backlog to commit to.
*   **Daily Stand-ups:** Short, daily meetings to synchronize activities, discuss progress, and identify impediments, fostering collaboration.
*   **Sprint Review:** At the end of each sprint, completed work will be demonstrated to stakeholders, and valuable feedback will be gathered to inform future iterations.
*   **Sprint Retrospective:** The team will reflect on the past sprint to identify areas for continuous improvement in processes, tools, and collaboration.

## 4. Timeline and Milestone Strategy

The "Notes App" project will be structured around two major milestones, corresponding to the planned phases, facilitating clear progress tracking and expectation setting:

*   **Milestone 1: MVP Release (End of Phase 1)**
    *   **Target Date:** To be defined after initial sprint planning and estimation. (e.g., Late October / Early November 2025)
    *   **Achieved When:**
        *   User authentication (registration, login, logout, password hashing, JWT security) is fully functional and robust.
        *   Users can securely create, view (list and detail), edit, and delete their personal notes, adhering to user data segregation.
        *   All notes are securely persisted in the PostgreSQL database, correctly linked to user accounts.
        *   The frontend (Angular Clarity boilerplate) provides an intuitive, responsive UI for these core features.
        *   Basic error handling, input validation, and user feedback mechanisms are implemented.
        *   Core unit and integration tests for authentication and basic CRUD operations pass.
    *   **Success Metrics:** Number of registered users, active daily users (ADU), successful note creation/editing/deletion rates, authentication success rate.

*   **Milestone 2: Enhanced Features Release (End of Phase 2)**
    *   **Target Date:** To be defined after MVP completion and Phase 2 sprint planning. (e.g., Mid-December 2025)
    *   **Achieved When:**
        *   Users can effectively search for notes by keywords in titles and content.
        *   Users can filter notes by various criteria (e.g., assigned tags, creation date range).
        *   Rich text editing capabilities for note content are fully implemented via CKEditor5 and correctly rendered.
        *   Users can assign, view, and manage (add/remove) tags for their notes.
        *   All new features are seamlessly integrated into the Angular Clarity UI, maintaining consistency.
        *   Performance targets for search and filter (e.g., within 3 seconds for large datasets) are met.
        *   Comprehensive test coverage for all enhanced features is achieved.
    *   **Success Metrics:** Usage rate of search/filter functionalities, average number of tags per note, user satisfaction scores related to editing and organization features.

## 5. Customized io8PM Workflow for "Notes App"

The `io8pm` agent will execute the following workflow, focusing on its core PM principles and the project's specific needs:

1.  **Deep Dive & PRD Creation:**
    *   Perform a final, comprehensive review of `analysis_document.md`, `architecture_document.md`, and `tech_stack_document.md` to ensure no requirement or technical constraint is missed.
    *   **CRITICALLY generate the initial content for `prd_document.md` following the exact comprehensive structure provided in the io8PM persona instructions.** This includes detailed Executive Summary, Product Vision, Target Users, Problem Statement, Solution Overview, Functional Requirements, Non-Functional Requirements, Epics with User Stories, UI Requirements, Technical Requirements, Success Metrics, Risk Assessment, Timeline & Milestones, and Dependencies & Assumptions.
    *   Ensure all user stories have placeholders for `[Estimate]` and clearly assigned `Priority` (High for MVP, Medium/Low for Phase 2).
    *   Populate `Technical Requirements` with details from `architecture_document.md` and `tech_stack_document.md`, emphasizing the Angular/Clarity frontend, Flask/Python backend, PostgreSQL, JWT, and Docker.
    *   Pay special attention to **NFRs** (especially Security NFR-002) and **Business Rules** from the `analysis_document.md` updates, integrating them thoroughly.
2.  **Project Plan Augmentation:**
    *   Based on the detailed PRD, generate high-level content for `project_plan.md`. This will include project phases (MVP, Enhanced), high-level timeline estimates derived from PRD milestones, resource considerations, testing strategy (unit, integration, E2E), and deployment strategy (Docker, CI/CD references).
3.  **Constructive Challenge & Prioritization:**
    *   During PRD and project plan creation, if any ambiguity, conflicting requirements, or potential scope creep is identified, proactively raise these.
    *   Ensure ruthless prioritization by clearly marking MVP features as `High` priority, aligning with the "MVP Focus" principle.
4.  **Clarity & Precision in Output:**
    *   Ensure all generated content for both `prd_document.md` and `project_plan.md` is clear, unambiguous, well-structured, and directly actionable for subsequent agents (e.g., io8codermaster, io8project_builder).
    *   Reference existing documents explicitly to maintain context and traceability.
5.  **Output Generation:** Present the final content for appending to `prd_document.md` and `project_plan.md` in the required STRICT JSON format.
```
```json
{
  "prd": "## Product Requirements Document (PRD)\n\n### Generated: 2025-10-02T06:18:00Z\n\n## 1. Executive Summary\nThe \"Notes App\" is a full-stack web application designed to empower users to securely create, manage, and organize their personal notes. Leveraging an Angular Clarity boilerplate for a robust and intuitive frontend, the application will provide core note CRUD functionalities and user authentication in its initial phase (MVP). Subsequent phases will introduce advanced features such as search, filtering, rich text editing, and tagging, enhancing user productivity and information retrieval. The project aims to deliver a reliable, secure, and user-friendly note-taking experience.\n\n## 2. Product Vision & Strategy\n**Product Vision:** To be the most intuitive, secure, and efficient digital note-taking platform that helps users capture, organize, and retrieve their personal knowledge seamlessly.\n\n**Strategic Goals:**\n*   **Goal 1: Achieve MVP with Core Features & Robust Authentication:** Successfully launch a foundational Notes App with essential CRUD operations and a secure user authentication system.\n*   **Goal 2: Enhance User Experience with Advanced Organization:** Implement advanced search, filtering, rich text editing, and tagging capabilities to improve note readability and discoverability.\n*   **Goal 3: Ensure Data Security & Privacy:** Maintain the highest standards for user data protection, including secure credential management and strict data segregation.\n*   **Goal 4: Foster Developer Efficiency:** Utilize the Angular Clarity boilerplate and a well-defined backend architecture to accelerate development and ensure maintainability for future enhancements.\n\n**Success Metrics:**\n*   **User Adoption:** Number of registered users, active daily/monthly users.\n*   **Feature Usage:** Frequency of note creation, editing, deletion, and (post-MVP) usage of search, filter, tagging, and rich text features.\n*   **Performance:** API response times, page load times, search query execution speed.\n*   **Security:** Number of reported vulnerabilities, successful login rates, failed login attempt rates.\n*   **User Satisfaction:** Positive feedback, high retention rates (qualitative and quantitative). \n\n## 3. Target Users & Personas\n**Primary Target User (End-User of Notes App):**\n*   **Name:** Elena (The Organized Professional)\n*   **Demographics:** 28-45 years old, professional, tech-savvy.\n*   **Needs:** A reliable and secure digital space to jot down ideas, meeting notes, project plans, and personal thoughts. Needs to quickly find specific information later, and ideally organize notes effectively.\n*   **Pain Points:** Losing scattered paper notes, struggling with disorganized digital files, concerns about privacy for personal thoughts, difficulty finding specific notes quickly in existing tools.\n*   **User Journey Mapping (Core):** Needs to register easily -> log in securely -> create a new note quickly with a title and content -> see all her notes in a clean list -> view a specific note's details -> edit it if needed -> delete old notes.\n\n**Secondary Target User (Developer/Team using Boilerplate):**\n*   **Name:** Alex (The Efficient Developer)\n*   **Demographics:** 25-40 years old, software engineer, works in a team.\n*   **Needs:** A standardized, pre-configured Angular project to kickstart new web applications, ensuring consistency and best practices. Needs clear documentation and easy extensibility.\n*   **Pain Points:** Time-consuming project setup, maintaining UI consistency across projects, boilerplate code fatigue, integrating complex UI frameworks.\n\n## 4. Problem Statement\nUsers currently lack a simple, secure, and well-organized digital platform to manage their personal notes. Existing solutions often either compromise on security, lack intuitive organization features, or present a cluttered user experience, leading to scattered information, difficulty in retrieval, and concerns about data privacy. This results in decreased productivity and frustration for individuals trying to effectively capture and leverage their personal knowledge.\n\n## 5. Solution Overview\nThe "Notes App" will provide a full-stack web application accessible via a modern web browser. The frontend will be built on Angular leveraging the Clarity Design System for a consistent and intuitive user experience. The backend will be a Python Flask RESTful API, interacting with a PostgreSQL database for secure data persistence. The solution will be delivered in two main phases:\n\n**Phase 1 (MVP): Core Notes Management & User Authentication**\n*   Secure user registration, login, and logout capabilities.\n*   CRUD (Create, Read, Update, Delete) operations for personal notes.\n*   A clean list view and detailed view for notes.\n\n**Phase 2: Enhanced Features**\n*   Powerful search functionality for note titles and content.\n*   Flexible filtering options (e.g., by tags, creation date).\n*   Rich text editing for enhanced note content formatting.\n*   Comprehensive tagging system for categorization and organization.\n\n## 6. Functional Requirements\n*   **FR-001: Create Note:** The system shall allow authenticated users to create new notes with a title and content.\n*   **FR-002: View Notes List:** The system shall display a list of all notes belonging to the authenticated user.\n*   **FR-003: View Single Note:** The system shall allow authenticated users to view the full details (title, content, tags) of a specific note.\n*   **FR-004: Edit Note:** The system shall allow authenticated users to modify the title and content of their existing notes.\n*   **FR-005: Delete Note:** The system shall allow authenticated users to delete their existing notes.\n*   **FR-006: Data Persistence:** All user-created notes shall be securely stored in the backend database.\n*   **FR-007: User Registration:** The system shall allow new users to register by providing a unique username and a password (adhering to complexity requirements).\n*   **FR-008: User Login:** The system shall allow registered users to log into their existing account using their username and password.\n*   **FR-009: User Logout:** The system shall provide a mechanism for users to securely log out, terminating their active session.\n*   **FR-010: Search Notes:** The system shall allow authenticated users to search for notes by keywords in their title or content (case-insensitive).\n*   **FR-011: Filter Notes:** The system shall provide options for authenticated users to filter their notes based on specific criteria (e.g., tags, creation date).\n*   **FR-012: Rich Text Editing:** The system shall provide a rich text editor for note content, enabling users to apply basic formatting (e.g., bold, italics, lists, headings).\n*   **FR-013: Manage Note Tags:** The system shall allow authenticated users to add, view, and remove tags associated with a note.\n\n## 7. Non-Functional Requirements\n*   **NFR-001: Performance:**\n    *   **Description:** The application should respond to user actions within acceptable timeframes to ensure a fluid experience.\n    *   **Acceptance Criteria:** Note listing within 2 seconds. Note save/update/delete within 1 second. Search and filter operations on up to 100,000 notes per user within 3 seconds.\n*   **NFR-002: Security (Enhanced):**\n    *   **Description:** The application shall ensure the confidentiality, integrity, and availability of user accounts and note data, protecting against unauthorized access, modification, and disclosure.\n    *   **Acceptance Criteria:**\n        *   User passwords shall be securely hashed (e.g., bcrypt) and salted before storage.\n        *   Authentication tokens (JWT) shall be used for API authorization and securely transmitted (HTTPS).\n        *   Access control mechanisms shall ensure a user can only view, edit, or delete their own notes (user data segregation).\n        *   API endpoints shall implement rate limiting for authentication attempts to prevent brute-force attacks.\n        *   All user input fields (including rich text) shall be thoroughly validated and sanitized on both frontend and backend to prevent injection vulnerabilities (e.g., XSS, SQL injection).\n*   **NFR-003: Usability:**\n    *   **Description:** The user interface must be intuitive, easy to navigate, and consistent, leveraging the Clarity Design System.\n    *   **Acceptance Criteria:** The UI adheres to Clarity Design System guidelines. Clear and timely feedback messages are provided for all user actions. The application is responsive across common device sizes and browsers.\n*   **NFR-004: Maintainability:**\n    *   **Description:** The codebase should be well-structured, documented, and adhere to best practices for both frontend (Angular) and backend (Flask) technologies.\n    *   **Acceptance Criteria:** Code conforms to established linting rules (ESLint, Black, Flake8). Clear module and component separation. Comprehensive comments for complex logic.\n*   **NFR-005: Scalability:**\n    *   **Description:** The system architecture should support an increasing number of users and notes without significant performance degradation.\n    *   **Acceptance Criteria:** The application supports up to 10,000 concurrent users with response times meeting NFR-001. The database architecture and indexing support 100,000 notes per user.\n*   **NFR-006: Data Integrity:**\n    *   **Description:** Ensure consistency, accuracy, and validity of stored note data.\n    *   **Acceptance Criteria:** Database constraints (e.g., foreign keys, unique constraints) are properly implemented. Transactions are used for multi-step data modifications to prevent partial updates.\n\n## 8. Epic Stories\n\n### Epic 1: User Authentication & Account Management (Phase 1 - MVP)\n**Epic Description:** Enable users to securely register for the Notes App, log in to access their personal notes, and log out to end their session.\n**Business Value:** Provides foundational security and personalized access, establishing trust and enabling individual data ownership.\n**Acceptance Criteria:** Users can successfully create, access, and secure their accounts.\n\n**User Stories:**\n- **US-006:** Register for an account\n  - **As a** new user\n  - **I want to** register for an account with a unique username and password\n  - **So that** I can securely store my personal notes.\n  - **Acceptance Criteria:**\n    - [ ] Given I am on the application's landing page, when I click on a \"Register\" button, then I am presented with a registration form requiring a username and password.\n    - [ ] When I enter a unique username and a strong password (min 8 chars, mixed case, num, special) and click \"Submit\", then my account is created, and I am either logged in or redirected to the login page.\n    - [ ] Given I try to register with an already existing username, then the system prevents registration and informs me that the username is taken.\n  - **Story Points:** [Estimate]\n  - **Priority:** High\n\n- **US-007:** Log into my account\n  - **As a** registered user\n  - **I want to** log into my account\n  - **So that** I can access my notes.\n  - **Acceptance Criteria:**\n    - [ ] Given I am on the login page, when I enter my correct username and password and click \"Login\", then I am successfully authenticated and redirected to my notes list.\n    - [ ] Given I enter incorrect credentials, then the system displays an error message \"Invalid username or password\".\n  - **Story Points:** [Estimate]\n  - **Priority:** High\n\n- **US-008:** Log out of my account\n  - **As a** registered user\n  - **I want to** securely log out of my account\n  - **So that** my session is terminated and my notes are protected.\n  - **Acceptance Criteria:**\n    - [ ] Given I am logged into the application, when I click on a \"Logout\" button/link, then my session is terminated, and I am redirected to the login page.\n  - **Story Points:** [Estimate]\n  - **Priority:** High\n\n### Epic 2: Core Note Management (Phase 1 - MVP)\n**Epic Description:** Enable authenticated users to perform fundamental CRUD operations on their notes: create, view, edit, and delete.\n**Business Value:** Provides the core utility of a note-taking application, allowing users to capture and manage their information.\n**Acceptance Criteria:** Users can fully manage their personal notes from creation to deletion.\n\n**User Stories:**\n- **US-001:** Create a new note\n  - **As a** registered user\n  - **I want to** create a new note with a title and content\n  - **So that** I can capture my thoughts and information.\n  - **Acceptance Criteria:**\n    - [ ] Given I am logged in and on the notes list page, when I click the \"New Note\" button, then I am presented with a form to enter a title and content.\n    - [ ] When I enter a title (min 1 char) and optional content and click \"Save\", then the note is saved, and I see it in my notes list.\n    - [ ] I receive a confirmation message upon successful saving.\n  - **Story Points:** [Estimate]\n  - **Priority:** High\n\n- **US-002:** View all my notes\n  - **As a** registered user\n  - **I want to** see a list of all my existing notes\n  - **So that** I can quickly browse and locate them.\n  - **Acceptance Criteria:**\n    - [ ] Given I am logged in and on the notes list page, when the page loads, then I see a list of my notes, each displaying its title and a snippet of its content.\n    - [ ] The list is ordered by creation date (newest first).\n  - **Story Points:** [Estimate]\n  - **Priority:** High\n\n- **US-003:** View a single note's details\n  - **As a** registered user\n  - **I want to** view the full content of a specific note\n  - **So that** I can review it in detail without distractions.\n  - **Acceptance Criteria:**\n    - [ ] Given I am on the notes list page, when I click on a note's title or entry, then I am navigated to a page displaying the full title and content of that note.\n  - **Story Points:** [Estimate]\n  - **Priority:** High\n\n- **US-004:** Edit an existing note\n  - **As a** registered user\n  - **I want to** modify an existing note's title or content\n  - **So that** I can update my information as it changes.\n  - **Acceptance Criteria:**\n    - [ ] Given I am viewing a single note, when I click an \"Edit\" button, then the note's title and content become editable in a form.\n    - [ ] When I make changes to the title or content and click \"Save\", then the note is updated, and I see the updated content in the detail view.\n    - [ ] I receive a confirmation message upon successful update.\n  - **Story Points:** [Estimate]\n  - **Priority:** High\n\n- **US-005:** Delete a note\n  - **As a** registered user\n  - **I want to** remove a note that is no longer needed\n  - **So that** my notes list remains organized and clutter-free.\n  - **Acceptance Criteria:**\n    - [ ] Given I am viewing a single note or on the notes list page, when I click a \"Delete\" button for a note, then I am presented with a confirmation dialog.\n    - [ ] When I confirm the deletion, then the note is permanently removed from my list.\n    - [ ] I receive a confirmation message upon successful deletion.\n  - **Story Points:** [Estimate]\n  - **Priority:** High\n\n### Epic 3: Advanced Note Organization (Search & Filter) (Phase 2 - Enhanced Features)\n**Epic Description:** Enable users to efficiently locate specific notes using keyword search and to organize their notes by applying filters.\n**Business Value:** Significantly improves user productivity by reducing the time and effort required to find specific information within their growing collection of notes.\n**Acceptance Criteria:** Users can quickly find and categorize notes using search and filter functionalities.\n\n**User Stories:**\n- **US-009:** Search my notes\n  - **As a** user\n  - **I want to** search my notes by keywords in their title or content\n  - **So that** I can quickly find specific information.\n  - **Acceptance Criteria:**\n    - [ ] Given I am viewing my notes list, when I type keywords into a search bar and press Enter, then the notes list updates to show only notes whose title or content (case-insensitive) matches the keywords.\n  - **Story Points:** [Estimate]\n  - **Priority:** Medium\n\n- **US-010:** Filter my notes\n  - **As a** user\n  - **I want to** filter my notes based on specific criteria\n  - **So that** I can organize and view them based on properties like tags or creation dates.\n  - **Acceptance Criteria:**\n    - [ ] Given I am viewing my notes list, when I select a filter option (e.g., a specific tag from a dropdown or a date range picker), then the notes list dynamically updates to show only notes matching the filter criteria.\n  - **Story Points:** [Estimate]\n  - **Priority:** Medium\n\n### Epic 4: Enhanced Note Content (Rich Text & Tagging) (Phase 2 - Enhanced Features)\n**Epic Description:** Provide users with rich text editing capabilities for their note content and a flexible tagging system for advanced categorization.\n**Business Value:** Enhances the readability and expressiveness of notes, and provides robust tools for personal knowledge management and retrieval.\n**Acceptance Criteria:** Users can create visually appealing notes and categorize them effectively using tags.\n\n**User Stories:**\n- **US-011:** Format note content with rich text\n  - **As a** user\n  - **I want to** apply basic formatting to my note content (e.g., bold, italics, lists, headings)\n  - **So that** my notes are more readable, expressive, and organized.\n  - **Acceptance Criteria:**\n    - [ ] Given I am creating or editing a note, when I use the rich text editor's toolbar options, then the selected text or new input is formatted accordingly.\n    - [ ] The formatted content is correctly saved and displayed when viewing the note.\n  - **Story Points:** [Estimate]\n  - **Priority:** Medium\n\n- **US-012:** Tag my notes\n  - **As a** user\n  - **I want to** assign multiple tags to my notes\n  - **So that** I can categorize them for better organization and easier retrieval later.\n  - **Acceptance Criteria:**\n    - [ ] Given I am creating or editing a note, when I enter or select one or more tags for the note, then the tags are associated with the note and displayed (e.g., in the detail view or notes list).\n    - [ ] The tags are saved with the note upon update.\n    - [ ] Users can remove tags from a note.\n  - **Story Points:** [Estimate]\n  - **Priority:** Medium\n\n## 9. User Interface Requirements\n*   **Clarity Design System:** The frontend UI will be built entirely using the VMware Clarity Design System, ensuring a consistent, accessible, and modern aesthetic.\n*   **Responsive Design:** The application UI must be fully responsive, adapting seamlessly to various screen sizes (desktop, tablet, mobile) using Angular's flexible layout capabilities.\n*   **Intuitive Navigation:** Clear navigation (e.g., sidebar, header links) to access notes list, account settings, and other features.\n*   **Forms & Input:** User-friendly forms for registration, login, note creation/editing, and tag management with clear labels, validation feedback, and placeholder text.\n*   **Note List View:** Display notes in an easily scannable format, showing title, snippet of content, creation/update date, and tags (when implemented).\n*   **Note Detail View:** A clean interface to display the full content of a single note, including rich text formatting.\n*   **Search & Filter UI:** Dedicated search bar and filter controls (e.g., dropdowns, tag clouds) to enable efficient note discovery.\n*   **Rich Text Editor:** Integration of a user-friendly WYSIWYG editor (e.g., CKEditor5) for note content.\n\n## 10. Technical Requirements\n*   **Architecture:** Client-Server architecture with a layered backend (Presentation, Service/Business Logic, Data Access) communicating via RESTful API.\n*   **Frontend (Angular):** Utilizes Angular 16+ with TypeScript, RxJS for reactive programming, and Angular's HttpClient for API communication. The Clarity boilerplate provides `CoreModule`, `SharedModule`, and encourages lazy-loaded `Feature Modules` (Auth, Notes).\n*   **Backend (Flask):** Developed with Python 3.9+ and Flask for a lightweight RESTful API. Gunicorn will serve the application. `Flask-JWT-Extended` for authentication, SQLAlchemy/`Flask-SQLAlchemy` for ORM, and `Marshmallow` for serialization/validation.\n*   **Database (PostgreSQL):** PostgreSQL will be the primary relational database for storing user and note data. Proper indexing on `user_id`, `created_at`, `updated_at`, `title`, and `content` (for search) will be implemented.\n*   **API Design:** RESTful API following standard HTTP methods, JSON data exchange. Endpoints for `/api/auth/*`, `/api/notes/*`, and `/api/tags/*` as defined in `architecture_document.md`.\n*   **Security:** JWT-based authentication, bcrypt for password hashing, HTTPS for data in transit, robust input validation/sanitization, role-based access control (user can only access their own notes), rate limiting on auth endpoints.\n*   **Scalability:** Stateless backend architecture for horizontal scaling. Database optimizations (indexing). Containerization with Docker/Kubernetes for deployment flexibility.\n*   **Integrations:** Potential integration with `@ckeditor/ckeditor5-angular` for rich text editing.\n\n## 11. Success Metrics & KPIs\n*   **Registration Conversion Rate:** Percentage of visitors who successfully register for an account.\n*   **Daily/Monthly Active Users (DAU/MAU):** Number of unique users performing an action (e.g., login, create/edit note) per day/month.\n*   **Note Creation Rate:** Average number of notes created per active user per period.\n*   **Search/Filter Usage Rate:** Percentage of users who utilize search/filter features per session.\n*   **API Latency:** Average response time for critical API endpoints (e.g., GET /api/notes, POST /api/notes).\n*   **Retention Rate:** Percentage of users who return to the app over time.\n*   **User Feedback/NPS:** Qualitative feedback and Net Promoter Score (NPS) for overall satisfaction.\n\n## 12. Risk Assessment\n*   **Security Vulnerabilities:** \n    *   **Risk:** Weak authentication, injection attacks (XSS, SQLi), unauthorized data access.\n    *   **Mitigation:** Strict password policies, JWT implementation, input validation/sanitization (frontend and backend), HTTPS, rate limiting, regular security audits, adherence to `NFR-002`.\n*   **Performance Bottlenecks:** \n    *   **Risk:** Slow loading times, sluggish search/filter with large datasets.\n    *   **Mitigation:** Efficient database indexing, lazy loading for frontend modules, optimized API queries, potential caching layer (Redis) in future, load testing.\n*   **User Adoption/Engagement:** \n    *   **Risk:** Users find the app difficult to use or not valuable enough compared to alternatives.\n    *   **Mitigation:** User-centric design (Clarity UI), iterative feedback cycles, continuous feature improvements, clear onboarding, strong value proposition communication.\n*   **Scope Creep:** \n    *   **Risk:** Expanding features beyond MVP, delaying core functionality delivery.\n    *   **Mitigation:** Strict adherence to phased approach, clear PRD, ruthless prioritization, regular stakeholder reviews to manage expectations.\n*   **Technical Debt:** \n    *   **Risk:** Accumulation of suboptimal code/design decisions impacting long-term maintainability.\n    *   **Mitigation:** Adherence to coding standards, regular code reviews, dedicated refactoring sprints, thorough testing.\n\n## 13. Timeline & Milestones\n*   **Phase 1: MVP - Core Notes & Authentication**\n    *   **Duration:** ~4-6 weeks (2-3 Sprints)\n    *   **Key Activities:** Frontend Auth Module, Notes CRUD UI, Backend Auth API, Notes API, Database Schema, Unit/Integration Tests.\n    *   **Milestone 1: MVP Release** (Target: Late October / Early November 2025)\n*   **Phase 2: Enhanced Features**\n    *   **Duration:** ~6-8 weeks (3-4 Sprints)\n    *   **Key Activities:** Frontend Search/Filter UI, Rich Text Editor Integration, Tagging UI, Backend Search/Filter Logic, Tag Management API, E2E Tests.\n    *   **Milestone 2: Enhanced Features Release** (Target: Mid-December 2025)\n\n## 14. Dependencies & Assumptions\n*   **Dependencies:**\n    *   Stable versions of Angular, Flask, PostgreSQL, and other core libraries.\n    *   Availability of a secure hosting environment (e.g., AWS).\n    *   Access to development tools (Git, VS Code, Docker).\n*   **Assumptions:**\n    *   The Angular Clarity boilerplate provides a solid, extensible foundation.\n    *   Developers are proficient in Angular, Python/Flask, and related technologies.\n    *   Clear communication channels exist between frontend, backend, and design teams.\n    *   Users have basic internet access and a modern web browser.\n",
  "project_plan": "## Project Plan\n\n### Generated: 2025-10-02T06:18:00Z\n\n## 1. Project Phases & High-Level Timeline\nThis project will be executed in two distinct phases, with iterative development within each phase.\n\n*   **Phase 1: Minimum Viable Product (MVP) - Core Notes & Authentication**\n    *   **Duration:** ~4-6 Weeks (e.g., 2-3 Sprints of 2 weeks each)\n    *   **Focus:** Establishing core functionality and user security.\n    *   **Milestone:** MVP Release (Target: Late October / Early November 2025)\n\n*   **Phase 2: Enhanced Features - Advanced Note Management**\n    *   **Duration:** ~6-8 Weeks (e.g., 3-4 Sprints of 2 weeks each)\n    *   **Focus:** Improving user experience, organization, and expressiveness.\n    *   **Milestone:** Enhanced Features Release (Target: Mid-December 2025)\n\n## 2. Key Milestones\n*   **Milestone 1: MVP Release (End of Phase 1)**\n    *   **Completion Criteria:** Full functionality for user registration, login, logout, and basic CRUD operations for notes. Secure data persistence. All `High` priority user stories (US-001 to US-008) from the PRD are implemented, tested, and accepted.\n    *   **Deliverables:** Deployed frontend and backend services for MVP, database with initial schema, user authentication working, basic note management UI, passing unit/integration tests.\n\n*   **Milestone 2: Enhanced Features Release (End of Phase 2)**\n    *   **Completion Criteria:** Implementation of search, filter, rich text editing, and tagging functionalities. All `Medium` priority user stories (US-009 to US-012) from the PRD are implemented, tested, and accepted.\n    *   **Deliverables:** Updated frontend and backend services with enhanced features, updated database schema for tags, comprehensive UI for advanced features, passing E2E tests, API documentation updated.\n\n## 3. Team & Resource Allocation (High-Level)\n*   **Product Manager (PM):** Drives product vision, PRD, backlog, stakeholder communication, risk management.\n*   **Frontend Developers:** (e.g., 2-3) Angular, TypeScript, Clarity Design System expertise.\n*   **Backend Developers:** (e.g., 1-2) Python, Flask, SQLAlchemy, PostgreSQL expertise.\n*   **DevOps/Infrastructure Engineer:** (Part-time/Shared) Docker, AWS, CI/CD setup.\n*   **QA Engineer:** (Part-time/Shared) Testing (manual/automated).\n\n## 4. Tools & Development Environment\n*   **Version Control:** Git (managed via GitHub/GitLab).\n*   **Project Management:** (e.g., Jira, Trello) for backlog, sprint boards.\n*   **IDEs:** Visual Studio Code (with relevant extensions for Angular, Python, Docker).\n*   **Database Management:** pgAdmin or similar for PostgreSQL.\n*   **Containerization:** Docker (Docker Compose for local development).\n\n## 5. Communication Plan\n*   **Daily Stand-ups:** Short, focused meetings for development team sync.\n*   **Bi-Weekly Sprint Reviews:** Demo of completed work to stakeholders, gathering feedback.\n*   **Bi-Weekly Sprint Retrospectives:** Internal team meeting for process improvement.\n*   **Ad-hoc Meetings:** As needed for design discussions, problem-solving, risk mitigation.\n*   **Documentation:** PRD, Architecture, Tech Stack, and Project Plan documents maintained in `.sureai/`.\n\n## 6. Testing Strategy\n*   **Unit Testing:**\n    *   **Frontend:** Karma and Jasmine for Angular components, services, and pipes.\n    *   **Backend:** Pytest for Python Flask application logic, services, and utility functions.\n*   **Integration Testing:**\n    *   **Backend:** Pytest to verify interactions between services, data access layer, and API endpoints.\n    *   **Frontend-Backend:** Testing API calls and data flow between Angular services and Flask endpoints.\n*   **End-to-End (E2E) Testing:** Cypress or Playwright for simulating full user journeys and validating core functionalities across the entire stack.\n*   **Security Testing:** Regular code reviews for security vulnerabilities, static analysis, and potentially penetration testing (post-MVP).\n\n## 7. Deployment Strategy\n*   **Containerization:** Both frontend and backend applications will be containerized using Docker, ensuring consistent environments.\n*   **Local Development:** Docker Compose will be used to orchestrate local development environment (frontend, backend, PostgreSQL).\n*   **CI/CD Pipeline:** GitHub Actions or GitLab CI will automate:\n    *   Code Linting & Formatting.\n    *   Unit and Integration Tests.\n    *   Docker Image Builds.\n    *   Deployment to Staging Environment upon successful builds.\n    *   Manual/Automated Deployment to Production Environment.\n*   **Hosting (Production):** AWS services (EC2 for compute, RDS for PostgreSQL, ECR for Docker images, S3 for static assets if needed) will be utilized for scalable and reliable hosting.\n"
}
```

## Base Agent Prompt Reference

This agent is based on the standard io8pm agent with project-specific customizations above.
Refer to the base io8pm agent prompt for general PM principles and workflow instructions.
