# io8 Project Manager Agent - Customized for This Project

## Project-Specific Instructions

```markdown
# io8Product Manager Agent Instructions for "Develop a Working Notes App"

**Project Title:** Working Notes Application

**User Prompt:** "develop a working notes app"

**Timestamp:** 2025-10-06T07:45:00Z

## 1. Project Management Methodology: Agile Scrum (Iterative & User-Focused)

This project will largely follow an Agile Scrum methodology, emphasizing iterative development, continuous feedback, and adaptability. The focus is on delivering incremental value, starting with a robust Minimum Viable Product (MVP).

**Key Principles:**
-   **Iterative Cycles (Sprints):** Development will be broken down into short, time-boxed sprints (e.g., 1-2 weeks).
-   **User Stories:** Requirements will be captured as user stories, prioritized, and estimated.
-   **Backlog Management:** A well-groomed product backlog will drive development, with features prioritized based on business value and user needs.
-   **Daily Stand-ups:** Promote collaboration and quick problem-solving.
-   **Reviews & Retrospectives:** Regular sessions to inspect the increment and adapt the process.

## 2. PRD Development Approach

The Product Requirements Document (PRD) will serve as the single source of truth for product scope and requirements. It will be developed iteratively based on current information and refined as the project progresses.

**Approach for "Working Notes App":**
-   **Comprehensive Baseline:** Leverage the `analysis_document.md`, `architecture_document.md`, and `tech_stack_document.md` to create a highly detailed PRD.
-   **MVP First:** Clearly delineate MVP features from future enhancements (as identified in `analysis_document.md` and `architecture_document.md`).
-   **User-Centric Stories:** Focus on detailed "As a <user>, I want to <action>, so that <benefit>" user stories with clear acceptance criteria.
-   **Epic Organization:** Group related user stories into logical epics to manage major feature areas (e.g., User Authentication, Note Management).
-   **Non-Functional Integration:** Explicitly include non-functional requirements (performance, security, usability, etc.) as they are critical for a robust application.
-   **Traceability:** Ensure requirements can be traced back to underlying business problems and forward to technical solutions.
-   **Append-Only:** All updates to the PRD will be appended with clear timestamps and section headers.

## 3. Project Planning Framework: Phased Development

The project will be structured into distinct phases to manage complexity and deliver value incrementally.

**Phases for "Working Notes App":**
-   **Phase 1 (MVP - Core Functionality):**
    -   **Focus:** Deliver the essential, core features of a notes application.
    -   **Key Deliverables:**
        -   User Registration, Login, Basic Password Reset.
        -   Note Creation (Title, Rich-text Content).
        -   View All Notes (List).
        -   View Single Note Detail.
        -   Edit Existing Notes.
        -   Delete Notes.
        -   Secure data storage (PostgreSQL) and API communication (FastAPI, JWT).
        -   Robust frontend (Angular Clarity Boilerplate).
-   **Phase 2 (Enhancements & Refinements):**
    -   **Focus:** Improve user experience, robustness, and internal tooling.
    -   **Key Deliverables:**
        -   Improved password reset flow (e.g., email integration).
        -   User profile management (e.g., change password).
        -   Rich-text editor enhancements.
        -   UI/UX polish, accessibility improvements.
        -   Comprehensive error handling and feedback messages.
        -   Enhanced monitoring and logging in production.
-   **Phase 3 (Advanced Features):**
    -   **Focus:** Introduce advanced organizational and discovery features.
    -   **Key Deliverables:**
        -   Full-text search for notes (FR-010).
        -   Note categorization or tagging (FR-011).
        -   Optional: Sharing notes.
        -   Optional: Version history for notes.

## 4. Timeline and Milestone Strategy

A high-level, flexible timeline will guide the project, with specific milestones for each phase. Detailed sprint planning will occur within each phase.

**Strategic Milestones:**
-   **M1: Core Authentication & Infrastructure Complete (End of Phase 1 - Sprint X):** User login/registration fully functional, secure, integrated with backend and DB. Frontend user dashboard accessible.
-   **M2: Core Note Management Complete (End of Phase 1 - Sprint Y):** All CRUD operations for notes are fully functional, secure, and integrated. Users can manage their notes end-to-end.
-   **M3: MVP Launch Readiness (End of Phase 1 - Sprint Z):** Application is stable, tested, deployed to staging/production, and ready for initial user adoption. All critical non-functional requirements are met.
-   **M4: Phase 2 Feature Completion (End of Phase 2):** All planned enhancements and refinements are integrated and validated.
-   **M5: Phase 3 Feature Completion (End of Phase 3):** Advanced search and organization features are implemented and released.

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

The io8PM Agent will perform the following steps for this project, adhering to its core principles:

1.  **Initial Context & Clarification:**
    -   Review user prompt: "develop a working notes app."
    -   Thoroughly read `analysis_document.md`, `architecture_document.md`, `tech_stack_document.md`.
    -   Identify any ambiguities or missing information; if found, flag for clarification.
    -   Confirm MVP scope based on existing documents (Auth & Core Notes CRUD).

2.  **Detailed PRD Generation (Focus of current execution):**
    -   Construct the `prd_document.md` following the strict structure provided, ensuring all sections are covered.
    -   Populate "Executive Summary" and "Product Vision" based on the consolidated project overview.
    -   Define "Target Users & Personas" based on the `analysis_document.md`.
    -   Elaborate on the "Problem Statement" and "Solution Overview".
    -   Detail "Functional Requirements" and "Non-Functional Requirements" using `analysis_document.md` and `architecture_document.md` content.
    -   **Crucially, create "Epic Stories" and detailed "User Stories" for MVP features, assigning clear acceptance criteria, story points (initial estimates), and priorities (High/Medium/Low).**
    -   Outline "UI Requirements" leveraging Clarity Design System from `tech_stack_document.md` and `architecture_document.md`.
    -   Specify "Technical Requirements" based on `architecture_document.md` and `tech_stack_document.md`.
    -   Define "Success Metrics & KPIs" that align with product objectives.
    -   Identify "Risk Assessment" and "Dependencies & Assumptions" based on overall project understanding.

3.  **High-Level Project Plan & Roadmap Outline:**
    -   Draft a high-level `project_plan.md` (as part of the JSON output) that outlines the phases, key activities, and estimated timelines derived from the PRD and overall scope.

4.  **Continuous Feedback & Iteration:**
    -   Be prepared to iterate on the PRD and project plan based on further input or changes.
    -   Proactively identify potential scope creep and advocate for MVP focus.

5.  **Documentation & Communication:**
    -   Ensure all generated content is clear, precise, and follows markdown formatting.
    -   Refer to other documents within the generated content for context and consistency.

## PM and Planning Instructions for this Project

-   **Prioritize Security:** Given the nature of personal notes, security (authentication, authorization, data encryption) must be a top priority from design to implementation (NFR-002 from `analysis_document.md`).
-   **User Experience:** Leverage the Clarity Design System to ensure an intuitive, responsive, and accessible UI, focusing on the core CRUD flows for notes (NFR-003, `architecture_document.md`).
-   **Backend Robustness:** Ensure the FastAPI backend is designed for reliability and scalability, with proper error handling and input validation (NFR-001, NFR-004, `architecture_document.md`).
-   **Modularity:** Maintain the modular structure of the Angular frontend (Core, Shared, Feature modules) and backend services to facilitate maintainability and future expansion.
-   **Testability:** Design components and services for easy unit and integration testing on both frontend and backend.
-   **Deployment Readiness:** Consider containerization (Docker) and CI/CD from the outset to ensure smooth deployment.
-   **Data Ownership:** Emphasize that notes are strictly owned by the user who created them; unauthorized access must be prevented at the API level (FR-009, `analysis_document.md`).
```
---
{
  "prd": "## Product Requirements Document (PRD)\n\n### Generated: 2025-10-06T07:45:00Z\n\n## 1. Executive Summary\nThis document outlines the requirements for the **Working Notes Application**, an intuitive and secure platform designed to help users efficiently manage their personal notes. Leveraging an existing Angular Clarity boilerplate for the frontend, a new FastAPI backend, and a PostgreSQL database, the application will provide core functionality for user authentication and comprehensive note management (create, view, edit, delete). The primary objective is to deliver a reliable, accessible, and private digital space for personal information management, enhancing user productivity and organization.\n\n## 2. Product Vision & Strategy\n**Product Vision Statement:** To empower individuals with a secure, intuitive, and highly accessible digital space for capturing, organizing, and retrieving their thoughts and information, fostering enhanced personal productivity and peace of mind.\n\n**Strategic Goals:**\n-   **Enable Core Productivity:** Provide essential tools for note creation, organization, and retrieval.\n-   **Ensure Data Security & Privacy:** Implement robust authentication, authorization, and data protection measures.\n-   **Deliver Intuitive User Experience:** Design a clean, responsive, and easy-to-use interface leveraging the Clarity Design System.\n-   **Build a Scalable & Maintainable Platform:** Establish a modular architecture that supports future growth and continuous development.\n\n**Success Metrics (KPIs):**\n-   User Acquisition Rate (new registrations per month)\n-   Monthly Active Users (MAU)\n-   Average number of notes created per active user per week.\n-   API Response Times (P90 for critical operations < 500ms)\n-   Application Uptime (target > 99.9%)\n-   Successful Login Rate\n-   Customer Satisfaction (e.g., through surveys, if implemented)\n\n## 3. Target Users & Personas\n**Persona: Olivia, The Organized Professional**\n-   **Demographics:** 28-45 years old, works in a knowledge-intensive field (e.g., marketing, project management, education), uses multiple digital tools daily.\n-   **Needs:**\n    -   A centralized place to jot down ideas, meeting notes, project tasks, and personal thoughts quickly.\n    -   Reliable storage that she can trust won't lose her data.\n    -   Easy access to her notes from different devices (though MVP focuses on web).\n    -   Privacy and security for sensitive information.\n    -   Ability to quickly find specific information within her notes.\n-   **Pain Points:**\n    -   Juggling multiple apps (physical notebooks, sticky notes, disparate digital tools) leading to disorganization.\n    -   Fear of losing important information due to lack of backup or synchronization.\n    -   Concerns about the security and privacy of her personal notes stored in generic cloud services.\n-   **User Journey Mapping (Simplified MVP):**\n    1.  **Awareness:** Olivia realizes she needs a better system for her notes.\n    2.  **Consideration:** She searches for a secure and organized notes app.\n    3.  **Registration:** She signs up for the Notes App, creates an account, and logs in (US-001, US-002).\n    4.  **First Note:** She creates her first note for a new project idea (US-004).\n    5.  **Daily Use:** She logs in daily to add new notes, review existing ones, and edit details (US-002, US-004, US-005, US-006, US-007).\n    6.  **Maintenance:** She occasionally deletes outdated notes (US-008).\n    7.  **Problem (Future):** As notes accumulate, she struggles to find specific items quickly (addressed in Phase 3 with search).\n\n## 4. Problem Statement\nUsers frequently encounter challenges in efficiently and securely managing their personal and professional information across fragmented tools. This often leads to disorganization, critical data loss, and privacy concerns. Existing solutions may lack robust security features, intuitive interfaces, or the ability to centralize diverse notes effectively, hindering personal productivity and creating mental overhead.\n\n## 5. Solution Overview\nThe **Working Notes Application** will be a web-based platform, extending an existing Angular Clarity boilerplate for a modern, responsive frontend. It will connect to a new FastAPI backend service, backed by a PostgreSQL database, to provide secure user authentication and comprehensive note management capabilities. Users will be able to register, log in, create, view, edit, and delete their private notes, with strict access control ensuring data ownership and privacy. The application aims to be an intuitive, reliable, and secure single source for personal information.\n\n## 6. Functional Requirements\nThe application will support the following core functional requirements, drawing from `analysis_document.md`:\n\n-   **FR-001: User Registration:** The system must allow new users to register for an account using a unique email address and a secure password.\n-   **FR-002: User Login:** Registered users must be able to log in to the application using their registered email and password.\n-   **FR-003: Password Reset Initiation:** The system must provide a mechanism for users to initiate a password reset process if they forget their password (MVP: basic flow, e.g., prompt for email; future: email-based reset).\n-   **FR-004: Note Creation:** Logged-in users must be able to create new notes, providing a title and rich-text content for each note.\n-   **FR-005: View All Notes:** Logged-in users must be able to view a list of all their created notes, with options to sort (e.g., by creation date, last modified date).\n-   **FR-006: View Single Note Detail:** Logged-in users must be able to select and view the full title and rich-text content of a specific note.\n-   **FR-007: Edit Existing Note:** Logged-in users must be able to modify the title and rich-text content of their existing notes.\n-   **FR-008: Delete Note:** Logged-in users must be able to permanently delete their existing notes, with a confirmation step.\n-   **FR-009: Note Ownership & Access Control:** The system must ensure that users can only view, create, edit, or delete notes that they own. Unauthorized access attempts must be prevented and result in appropriate error messages.\n-   **FR-010 (Phase 3): Search Notes:** The system should allow users to search their notes by keywords present in the title or content.\n-   **FR-011 (Phase 3): Categorization/Tagging:** The system should allow users to categorize or tag their notes for better organization and filtering.\n\n## 7. Non-Functional Requirements\nThe application will adhere to the following non-functional requirements, based on `analysis_document.md` and `architecture_document.md`:\n\n-   **NFR-001: Performance:**\n    -   The application (both frontend and backend) must be responsive, with note lists and individual notes loading within acceptable timeframes (e.g., API calls < 500ms, page loads < 2 seconds).\n    -   Initial application load time must be minimized through techniques like lazy loading.\n-   **NFR-002: Security:**\n    -   User credentials (passwords) must be stored securely using strong hashing algorithms (e.g., bcrypt) and unique salts.\n    -   All data in transit between the frontend and backend must be encrypted via HTTPS/TLS.\n    -   User authentication must be robust (e.g., JWT-based) and authorization checks must prevent unauthorized access to other users' notes (FR-009).\n    -   Backend endpoints must implement input validation to mitigate common web vulnerabilities.\n    -   Rate limiting must be applied to authentication endpoints to prevent brute-force attacks.\n-   **NFR-003: Usability:**\n    -   The user interface, built on the Clarity Design System, must be intuitive, easy to navigate, and consistent across different sections.\n    -   The application must be fully responsive across various screen sizes (desktop, tablet, mobile).\n    -   Users should receive clear and immediate feedback for their actions (e.g., loading indicators, success/error messages).\n-   **NFR-004: Scalability:**\n    -   The architecture (Dockerized frontend, FastAPI backend, PostgreSQL database) must support a growing number of users and notes without significant performance degradation.\n    -   The backend should be stateless to facilitate easy horizontal scaling.\n    -   Database queries must be optimized with appropriate indexing for efficient retrieval of data.\n-   **NFR-005: Reliability:**\n    -   The application must maintain data integrity and be available during expected operational hours.\n    -   Robust error handling must be implemented on both frontend and backend, providing graceful degradation.\n    -   Automated backups for the PostgreSQL database must be configured.\n    -   Comprehensive monitoring and logging must be in place to track application health and identify issues.\n-   **NFR-006: Maintainability:**\n    -   The codebase must be well-structured, modular, and adhere to best practices for Angular and FastAPI development.\n    -   Code should be well-commented, and comprehensive documentation (API docs, architectural diagrams) should be available.\n    -   Dependency management should be consistent to ensure reproducible builds.\n\n## 8. Epic Stories\n\n### Epic 1: User Authentication & Account Management\n**Epic Description:** This epic encompasses all functionality related to user account creation, secure login, and basic mechanisms for password recovery. It forms the secure gateway to the application, ensuring that only authenticated users can access their personalized notes.\n**Business Value:** Provides a secure and personalized experience for users, protecting their private data and establishing trust in the application. It is a fundamental requirement for any multi-user application.\n**Acceptance Criteria:**\n-   Users can successfully register new accounts and log in.\n-   User credentials are securely handled and stored.\n-   Users can initiate a basic process to recover forgotten passwords.\n\n**User Stories:**\n-   **US-001:** Register New Account\n  -   **As a** new user\n  -   **I want to** register for an account with my email and a secure password\n  -   **So that** I can securely store and access my personal notes.\n  -   **Acceptance Criteria:**\n    -   [ ] Given I am on the registration page, when I enter a unique, valid email and a strong password (confirmed), then my account is created, and I am automatically logged in.\n    -   [ ] Given I try to register with an email that is already in use, then I receive an error message indicating the email is taken.\n    -   [ ] Given I submit invalid input (e.g., weak password, invalid email format), then I receive clear validation errors.\n  -   **Story Points:** 5\n  -   **Priority:** High\n\n-   **US-002:** Log In to Account\n  -   **As a** registered user\n  -   **I want to** log in with my credentials\n  -   **So that** I can access my notes and other personalized features.\n  -   **Acceptance Criteria:**\n    -   [ ] Given I am on the login page, when I enter my correct registered email and password, then I am successfully logged in and redirected to my notes dashboard.\n    -   [ ] Given I enter incorrect credentials (email or password), then I receive an "Invalid credentials" error message.\n    -   [ ] Given my session expires, when I attempt to access a protected resource, then I am prompted to log in again.\n  -   **Story Points:** 3\n  -   **Priority:** High\n\n-   **US-003:** Initiate Password Reset\n  -   **As a** registered user\n  -   **I want to** initiate a password reset process\n  -   **So that** I can regain access to my account if I forget my password.\n  -   **Acceptance Criteria:**\n    -   [ ] Given I am on the login page, when I click "Forgot Password" and provide my registered email, then the system acknowledges my request and informs me that instructions have been sent (MVP: console log/placeholder message).\n    -   [ ] Given I provide an unregistered email for password reset, then the system informs me that the email is not found or handles it gracefully without revealing user existence.\n  -   **Story Points:** 5\n  -   **Priority:** High\n\n### Epic 2: Core Note Management (CRUD)\n**Epic Description:** This epic covers the fundamental functionalities allowing authenticated users to create new notes, view their existing notes (individually or as a list), make modifications, and permanently delete notes. It represents the core value proposition of the application.\n**Business Value:** Directly enables users to capture, organize, and manage their personal information, directly contributing to their productivity and ensuring reliable storage of their thoughts and data.\n**Acceptance Criteria:**\n-   Users can perform all CRUD operations on notes that they own.\n-   Notes are securely stored and retrieved, always associated with the correct user.\n-   The user interface for note management is intuitive and responsive.\n\n**User Stories:**\n-   **US-004:** Create New Note\n  -   **As a** logged-in user\n  -   **I want to** create a new note with a title and rich-text content\n  -   **So that** I can capture and save new information.\n  -   **Acceptance Criteria:**\n    -   [ ] Given I am on the notes dashboard, when I click a "Create New Note" button, then a new note editor interface appears.\n    -   [ ] When I enter a title and content into the rich-text editor, and click "Save", then the note is saved successfully and appears in my list of notes.\n    -   [ ] Given I leave the title blank, then the note saves with a default title (e.g., \"Untitled Note\").\n    -   [ ] The rich-text editor provides basic formatting options (bold, italic, lists).\n  -   **Story Points:** 8\n  -   **Priority:** High\n\n-   **US-005:** View List of Notes\n  -   **As a** logged-in user\n  -   **I want to** view a list of all my notes\n  -   **So that** I can quickly browse and select a specific note.\n  -   **Acceptance Criteria:**\n    -   [ ] Given I am logged in and navigate to the notes dashboard, then I see a paginated list of my notes, each displaying its title and a short snippet of its content.\n    -   [ ] I can sort the list of notes by creation date (newest first by default) and last modified date.\n    -   [ ] The list clearly indicates which notes are mine.\n  -   **Story Points:** 5\n  -   **Priority:** High\n\n-   **US-006:** View Single Note Detail\n  -   **As a** logged-in user\n  -   **I want to** view the full content of a specific note\n  -   **So that** I can read and review my detailed information.\n  -   **Acceptance Criteria:**\n    -   [ ] Given I am viewing the note list, when I click on a note's title, then I am directed to a dedicated page showing the full title and rich-text content of that note.\n    -   [ ] The content is rendered preserving the rich-text formatting applied during creation/editing.\n    -   [ ] There is an option to navigate back to the note list.\n  -   **Story Points:** 3\n  -   **Priority:** High\n\n-   **US-007:** Edit Existing Note\n  -   **As a** logged-in user\n  -   **I want to** modify the title and content of an existing note\n  -   **So that** I can update my information as needed.\n  -   **Acceptance Criteria:**\n    -   [ ] Given I am viewing a specific note, when I click an \"Edit\" button, then the note content becomes editable within a rich-text editor interface.\n    -   [ ] When I make changes to the title or content and click \"Save\", then the changes are saved to the database and are reflected upon subsequent viewing of the note.\n    -   [ ] If I discard changes (e.g., click \"Cancel\"), then the note reverts to its last saved state.\n  -   **Story Points:** 5\n  -   **Priority:** High\n\n-   **US-008:** Delete Note\n  -   **As a** logged-in user\n  -   **I want to** permanently delete an unwanted or outdated note\n  -   **So that** I can keep my notes organized and remove unnecessary information.\n  -   **Acceptance Criteria:**\n    -   [ ] Given I am viewing a specific note, when I click a \"Delete\" button, then a confirmation dialog appears asking me to confirm the deletion.\n    -   [ ] When I confirm the deletion, then the note is permanently removed from my notes list and the database.\n    -   [ ] When I cancel the deletion, then the note remains unchanged.\n  -   **Story Points:** 3\n  -   **Priority:** High\n\n### Epic 3: Search & Organization (Future Phase)\n**Epic Description:** This epic outlines features to enhance the discoverability and structured organization of notes, moving beyond simple chronological lists to powerful search and categorization capabilities.\n**Business Value:** Significantly improves user efficiency and information retrieval, especially for users with a large volume of notes, thereby increasing long-term user satisfaction and engagement.\n**Acceptance Criteria:**\n-   Users can search for notes based on keywords across titles and content.\n-   Users can assign categories or tags to their notes and filter their view accordingly.\n\n**User Stories:**\n-   **US-009:** Search Notes by Keyword\n  -   **As a** logged-in user\n  -   **I want to** search my notes by keywords\n  -   **So that** I can quickly find specific information within my growing collection of notes.\n  -   **Acceptance Criteria:**\n    -   [ ] Given a search bar is available, when I enter a search term and submit it, then a filtered list of notes is displayed where the title or content matches the search term.\n    -   [ ] Search results highlight the matching keywords (optional).\n  -   **Story Points:** 8\n  -   **Priority:** Medium\n\n-   **US-010:** Categorize/Tag Notes\n  -   **As a** logged-in user\n  -   **I want to** categorize or tag my notes\n  -   **So that** I can organize them logically and filter my notes based on these classifications.\n  -   **Acceptance Criteria:**\n    -   [ ] Given I am creating or editing a note, when I add one or more tags or assign it to a category, then these associations are saved with the note.\n    -   [ ] I can view a list of my tags/categories and filter my main notes list to show only notes associated with a selected tag/category.\n  -   **Story Points:** 8\n  -   **Priority:** Medium\n\n## 9. User Interface Requirements\n-   **Design System:** The UI will strictly adhere to the VMware Clarity Design System for consistency, accessibility, and professional aesthetics, building upon the boilerplate's foundation.\n-   **Responsiveness:** The application layout and components must be fully responsive, adapting seamlessly to various screen sizes (desktop, tablet, mobile) to ensure an optimal user experience across devices.\n-   **Navigation:** Intuitive and consistent navigation using Clarity's header and sidebar components. Clear pathways for user authentication and note management will be prioritized.\n-   **Feedback Mechanisms:** Implement real-time user feedback, including loading indicators for API calls, success/error toasts or messages for operations (e.g., note saved, login failed), and clear form validation errors.\n-   **Rich-Text Editor:** A user-friendly rich-text editor will be integrated for note content, supporting common formatting options (bold, italic, lists, links).\n-   **Accessibility:** Ensure compliance with WCAG 2.1 guidelines where possible, leveraging Clarity's built-in accessibility features (e.g., keyboard navigation, ARIA attributes).\n\n## 10. Technical Requirements\n-   **Frontend:**\n    -   **Framework:** Angular (v16+).\n    -   **Language:** TypeScript.\n    -   **UI:** VMware Clarity Design System (`@clr/angular`, `@clr/ui`, `@cds/core`).\n    -   **State Management:** Angular Services and RxJS for reactive programming.\n    -   **Communication:** Angular `HttpClient` for RESTful API calls.\n    -   **Modularity:** Utilize Angular Core, Shared, and lazy-loaded Feature Modules (Auth, Notes) as per `architecture_document.md`.\n-   **Backend:**\n    -   **Language:** Python (v3.9+).\n    -   **Framework:** FastAPI for high-performance RESTful API.\n    -   **ORM:** SQLAlchemy with `asyncpg` for asynchronous PostgreSQL interactions.\n    -   **Authentication:** JWT (PyJWT) for stateless API authentication; `passlib` (bcrypt) for password hashing.\n    -   **Validation:** Pydantic models for request/response data validation.\n-   **Database:**\n    -   **Primary:** PostgreSQL (v14+) for relational data storage.\n    -   **Schema:** `Users` table and `Notes` table with a one-to-many relationship (`User` to `Note`).\n    -   **Migrations:** Alembic for managing database schema changes.\n-   **API Design:** RESTful API following specified endpoints (`/auth`, `/notes`) as per `architecture_document.md`.\n    -   JSON for requests/responses.\n    -   Standard HTTP status codes for error handling.\n-   **Infrastructure:**\n    -   **Containerization:** Docker for all services (frontend, backend, PostgreSQL).\n    -   **Local Orchestration:** Docker Compose for local development environment setup.\n    -   **Deployment Target:** Cloud-agnostic design, suitable for AWS, Azure, GCP managed services.\n-   **Security:** HTTPS/TLS, input validation, JWT, password hashing, note ownership enforcement (NFR-002).\n\n## 11. Success Metrics & KPIs\n-   **User Engagement:**\n    -   **User Acquisition Rate:** Number of new registrations per month.\n    -   **Monthly Active Users (MAU):** Number of unique users logging in at least once a month.\n    -   **Note Creation Rate:** Average number of new notes created per active user per week.\n-   **Performance & Reliability:**\n    -   **API Response Time (P90):** 90th percentile of API call response times < 500ms for critical endpoints.\n    -   **Frontend Page Load Time:** Average page load time for key views < 2 seconds.\n    -   **Application Uptime:** Percentage of time the application is accessible and functional (target > 99.9%).\n    -   **Error Rate:** Number of server-side errors per 1000 requests < 1%.\n-   **Security:**\n    -   **Successful Login Rate:** Percentage of login attempts that succeed.\n    -   **Security Audit Scores:** Results from periodic vulnerability assessments.\n\n## 12. Risk Assessment\n\n-   **Security Vulnerabilities:**\n    -   **Risk:** Data breaches, unauthorized access, or manipulation of user data due to weak authentication, authorization flaws, or injection attacks.\n    -   **Mitigation:** Strict implementation of JWT, bcrypt for password hashing, comprehensive input validation, robust authorization checks on all note operations, regular security audits, HTTPS-only communication, and adherence to OWASP top 10 best practices.\n-   **Performance Bottlenecks:**\n    -   **Risk:** Slow API response times or sluggish UI, especially with growing data volumes or user loads, leading to poor user experience.\n    -   **Mitigation:** Frontend lazy loading, optimized Angular change detection, efficient database queries with proper indexing, backend caching (future consideration), load testing, and continuous performance monitoring.\n-   **Scope Creep:**\n    -   **Risk:** Addition of unplanned features extending project timeline and budget, potentially delaying MVP delivery.\n    -   **Mitigation:** Strict adherence to the defined MVP scope, ruthless prioritization of features, clear communication of what is and isn't included in each phase, and proactive scope management.\n-   **Data Integrity Issues:**\n    -   **Risk:** Corruption or loss of user note data.\n    -   **Mitigation:** Database transaction management, robust error handling, regular automated database backups, and data validation at multiple layers.\n-   **Third-Party Dependency Issues:**\n    -   **Risk:** Vulnerabilities or breaking changes in libraries (Angular, FastAPI, Clarity, rich-text editor).\n    -   **Mitigation:** Keep dependencies updated, careful review of release notes, and automated dependency scanning.\n\n## 13. Timeline & Milestones\n\n### Overall Project Timeline: Phased Approach\n-   **Phase 1: Minimum Viable Product (MVP) - Core Functionality:** ~8-10 weeks (e.g., Q1 2026)\n-   **Phase 2: Enhancements & Refinements:** ~4-6 weeks (e.g., Q2 2026)\n-   **Phase 3: Advanced Features (Search & Organization):** ~6-8 weeks (e.g., Q3 2026)\n\n### Major Milestones (MVP Focus):\n-   **M1: Core Authentication & Infrastructure Complete**\n    -   **Description:** User registration, login, and basic password reset are fully functional and secure. The core Angular application is integrated with the FastAPI backend and PostgreSQL database.\n    -   **Target Date:** End of Week 4 (of Phase 1)\n-   **M2: Core Note Management Complete**\n    -   **Description:** All CRUD operations for notes (create, view list, view detail, edit, delete) are fully functional, secure, and integrated between frontend and backend.\n    -   **Target Date:** End of Week 8 (of Phase 1)\n-   **M3: MVP Launch Readiness**\n    -   **Description:** The application is stable, thoroughly tested (unit, integration, basic E2E for core flows), deployed to a staging environment, and ready for initial user adoption. All critical non-functional requirements are met.\n    -   **Target Date:** End of Week 10 (of Phase 1)\n\n## 14. Dependencies & Assumptions\n\n**Dependencies:**\n-   **Active Development Team:** Availability of frontend (Angular/TypeScript), backend (Python/FastAPI), and DevOps resources.\n-   **Stable Technology Stack:** Continued stability and support for Angular, FastAPI, PostgreSQL, Clarity Design System, and other chosen libraries.\n-   **Containerization Environment:** Docker and Docker Compose for consistent local development and production deployment.\n-   **Third-Party Rich-Text Editor:** Reliance on a suitable Angular-compatible rich-text editor for note content (e.g., `ngx-quill`).\n-   **Cloud Infrastructure:** For production deployment, access to and configuration of appropriate cloud resources (e.g., for hosting, database, monitoring).\n\n**Assumptions:**\n-   **User Technical Proficiency:** Target users possess basic web literacy and familiarity with common application interfaces.\n-   **Frontend Boilerplate Suitability:** The existing Angular Clarity boilerplate provides a solid and adaptable foundation for the new application's UI requirements.\n-   **Rich-Text Editor Features:** The selected rich-text editor will adequately meet the formatting needs for note content without extensive custom development for MVP.\n-   **API Design Stability:** Initial API contracts between frontend and backend will be well-defined and relatively stable during MVP development.\n-   **Development Tools:** Developers have access to and proficiency with the specified development tools (VS Code, Angular CLI, Poetry/Pipenv).\n\n**Constraints:**\n-   **Initial Budget/Time:** The initial project phase is constrained by a budget and time-to-market goal focused on delivering a viable MVP.\n-   **Resource Availability:** Limited team size may impact the parallel development of features and phases.\n-   **Technology Stack:** The project must adhere to the defined technology stack (Angular, FastAPI, PostgreSQL).\n",
  "project_plan": "### Project Plan\n\n### Generated: 2025-10-06T07:45:00Z\n\n## Project Title: Working Notes Application\n\n## Overall Goal\nTo design, develop, and deploy a secure, intuitive, and highly functional Minimum Viable Product (MVP) of a personal notes application, followed by iterative enhancements and advanced features, leveraging a modern web technology stack.\n\n## Project Phases & Key Activities\n\n### Phase 1: Minimum Viable Product (MVP) - Core Functionality\n-   **Objective:** Deliver the essential user authentication and core note Create, Read, Update, Delete (CRUD) capabilities, establishing a secure and functional foundation.\n-   **Estimated Duration:** 8-10 weeks\n-   **Key Activities:**\n    -   **Week 1-2: Setup & Frontend Foundation**\n        -   Initialize backend FastAPI project, configure database connection to PostgreSQL.\n        -   Integrate backend with frontend boilerplate services.\n        -   Setup Docker/Docker Compose for local development environment.\n        -   Implement core routing for Auth and Notes modules in Angular.\n    -   **Week 3-4: User Authentication Implementation**\n        -   Develop frontend (AuthModule) for user registration, login, and basic password reset (US-001, US-002, US-003).\n        -   Implement backend API endpoints for user authentication (register, login, password reset initiation).\n        -   Integrate JWT-based authentication and secure password hashing.\n        -   Set up Angular `AuthService` and `AuthGuard`.\n        -   **Milestone:** M1: Core Authentication & Infrastructure Complete.\n    -   **Week 5-7: Core Note Management Implementation**\n        -   Develop backend API endpoints for Note CRUD operations (GET /notes, POST /notes, GET /notes/{id}, PUT /notes/{id}, DELETE /notes/{id}).\n        -   Implement Note ownership and authorization logic on the backend (FR-009).\n        -   Develop Angular `NotesModule` components: `NoteListComponent`, `NoteDetailComponent`, `NoteEditorComponent` (US-004, US-005, US-006, US-007, US-008).\n        -   Integrate a rich-text editor for note content creation/editing.\n    -   **Week 8-9: Testing & Refinement (MVP)**\n        -   Conduct comprehensive unit and integration testing for both frontend and backend.\n        -   Perform basic end-to-end (E2E) testing for critical user flows (registration, login, note CRUD).\n        -   Address identified bugs and UI/UX inconsistencies.\n        -   Ensure adherence to non-functional requirements (security, basic performance).\n        -   **Milestone:** M2: Core Note Management Complete.\n    -   **Week 10: MVP Deployment Preparation**\n        -   Finalize containerization configurations for production deployment.\n        -   Prepare deployment scripts/pipelines (e.g., GitHub Actions).\n        -   Perform final security and performance checks.\n        -   **Milestone:** M3: MVP Launch Readiness (Staging/Production).\n\n### Phase 2: Enhancements & Refinements\n-   **Objective:** Improve the application's user experience, security features, and overall robustness based on initial MVP feedback.\n-   **Estimated Duration:** 4-6 weeks (following MVP launch)\n-   **Key Activities:**\n    -   Implement full email-based password reset flow.\n    -   Develop user profile management (e.g., change email, password within app).\n    -   Refine UI/UX, accessibility, and feedback mechanisms.\n    -   Optimize frontend lazy loading and backend query performance.\n    -   Enhance global error handling and centralized logging for production.\n    -   Update and expand user and developer documentation.\n-   **Milestone:** M4: Phase 2 Feature Completion.\n\n### Phase 3: Advanced Features\n-   **Objective:** Introduce advanced organizational and discovery features to significantly enhance user productivity and information retrieval.\n-   **Estimated Duration:** 6-8 weeks\n-   **Key Activities:**\n    -   Implement full-text search capability for notes (FR-010, US-009).\n    -   Develop note categorization/tagging system (FR-011, US-010).\n    -   Integrate UI components for advanced search and filtering.\n    -   Explore and implement additional scalability optimizations (e.g., caching with Redis).\n    -   Consider optional features like note sharing or version history.\n-   **Milestone:** M5: Phase 3 Feature Completion.\n\n## Key Resources\n-   **Product Management:** 1 PM (io8Product Manager Agent).\n-   **Development Team:** Frontend (Angular), Backend (FastAPI/Python), DevOps.\n-   **Quality Assurance:** Dedicated QA for testing, or integrated developer testing.\n\n## Dependencies\n-   Consistent and stable API contracts between the frontend and backend teams.\n-   Availability of development and deployment infrastructure (Docker, cloud services).\n-   Timely feedback loops for iterative development and refinement.\n\n## Risks\n-   **Security Vulnerabilities:** Requires continuous vigilance, code reviews, and penetration testing.\n-   **Scope Creep:** Managed through strict adherence to phase objectives and agile backlog prioritization.\n-   **Performance Degradation:** Mitigated by continuous monitoring, profiling, and optimization efforts.\n-   **Technical Debt:** Managed through adherence to best practices, code reviews, and refactoring efforts.\n\n## Next Steps\n-   Conduct a detailed sprint planning session for the initial features of Phase 1 (MVP).\n-   Formalize API contract definitions for Auth and Notes modules.\n-   Begin parallel development on frontend and backend components for authentication.\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.
