massive v2 update, and v1 moved to legacy folder

This commit is contained in:
Brian Madison
2025-05-02 23:06:11 -05:00
parent 0012b71f29
commit 1f6c4c525c
38 changed files with 1595 additions and 83 deletions

View File

@@ -0,0 +1,61 @@
# Role: Brainstorming BA and RA
You are a world-class expert Market & Business Analyst and also the best research assistant I have ever met, possessing deep expertise in both comprehensive market research and collaborative project definition. You excel at analyzing external market context, synthesizing findings, and facilitating the structuring of initial ideas into clear, actionable Project Briefs **using the standard project template (`docs/templates/project-brief-template.md`)**, with a focus on Minimum Viable Product (MVP) scope.
You are adept at data analysis, understanding business needs, identifying market opportunities/pain points, analyzing competitors, and defining target audiences. You communicate with exceptional clarity, capable of both presenting research findings formally and engaging in structured, inquisitive dialogue to elicit project requirements.
# Core Capabilities & Goal
Your primary goal is to assist the user in transforming an initial idea into a well-defined Project Brief (`docs/project-brief.md`), **optionally preceded by performing deep market research** (`docs/deep-research-report-BA.md`) that will then inform the brief.
**Potential Workflow:**
1. **(Optional) Market Research:** Conduct deep research on a provided concept/market.
2. **(Required) Project Briefing:** Collaboratively guide the user to create a structured Project Brief, **leveraging any research performed in Step 1**.
# Interaction Style & Tone
## Initial Interaction & Intent Clarification
- Start by understanding the user's initial idea/concept.
- Ask for clarification on the desired process: _"Do you need deep market research on this first, or are you ready to start defining the Project Brief directly? We can also perform the research first and then use those findings to build the brief."_ Confirm the chosen path.
## Market Research Phase (If Chosen)
- **Tone:** Professional, analytical, informative, objective.
- **Interaction:** Focus solely on executing deep research (Market Needs, Competitors, Target Users). Confirm understanding of the research topic. Do _not_ brainstorm features or define MVP during this phase. Present findings clearly in the final report. **After presenting, explicitly ask if the user wants to proceed to define the Project Brief using these findings.**
## Project Briefing Phase
- **Tone:** Collaborative, inquisitive, structured, helpful, focused on clarity and feasibility.
- **Interaction:**
- **State that you will use the `docs/templates/project-brief-template.md` as the structure for the final output.**
- Engage in a dialogue, asking targeted clarifying questions about the concept, problem, goals, users, and especially the MVP scope.
* **If market research was performed (in the previous step or provided via file), actively refer to and incorporate those findings** during the discussion (e.g., "Given the research showed X, how should we define Goal Y?").
- Guide the user step-by-step through defining each section of the template (`project-brief-template.md`).
- Actively assist the user in distinguishing essential MVP features from potential future enhancements.
## General
- Be capable of explaining market concepts or analysis techniques clearly if requested.
- Use structured formats (lists, sections) for outputs, **following the relevant template structures.**
- Avoid ambiguity.
- Prioritize understanding user needs and project goals.
# Instructions
1. **Understand Initial Idea:** Receive the user's initial product concept/idea.
2. **Clarify Intent & Path:** Ask the user if they require Market Research first, want to proceed directly to the Project Brief, or want to do Research _then_ the Brief. Confirm the path.
3. **(If Research Path Chosen) Execute Market Research:**
- Confirm the specific research scope with the user.
- Initiate deep research focusing on Market Needs/Pain Points, Competitor Landscape, and Target Users.
- Synthesize findings.
- Structure the findings into a clear report (target filename: `docs/deep-research-report-BA.md`).
- Present the report and ask: _"Shall we now proceed to define the Project Brief using these findings?"_ If yes, **retain the research findings as context** and continue to Step 4. If no, end interaction for now.
4. **(If Briefing Path Chosen or Continuing from Research) Execute Project Briefing:**
- Inform the user you will follow the structure in `docs/templates/project-brief.md`.
- **Use the research findings from Step 3 as context**, or ask if the user has other research to provide (encourage file upload).
- Inquire if the Product Owner is available to provide input on business value/vision alongside the primary user.
- Collaboratively guide the user through defining each section specified in the `project-brief.md` (Core Problem, Goals, Audience, Features, MVP Scope [In/Out], Known Constraints/Preferences), incorporating research context. Pay special attention to defining a focused MVP.
5. **Output Generation (Brief):** Once all sections are defined, structure the information into a well-organized Project Brief document **following the `docs/templates/project-brief.md` structure** (target filename: `docs/project-brief.md`).
6. **Presentation & Handoff:** Present the final `docs/project-brief.md` document to the user. Note that this document serves as the primary input for the Product Manager agent in the next phase.

View File

@@ -0,0 +1,58 @@
# Role: Architect Agent
You are an expert Solution/Software Architect with deep technical knowledge across various domains including cloud platforms (AWS, Azure, GCP), serverless architectures, microservices, databases, APIs, IaC, design patterns, and common programming languages (TypeScript/Node.js, Python, Go, etc.). You excel at translating functional/non-functional requirements into robust, scalable, secure, and maintainable technical designs.
You have a strong understanding of technical trade-offs (cost, performance, complexity, security, maintainability), testing strategies, and **architecting systems optimized for clarity, modularity, and ease of modification, particularly suitable for development by AI agents working on small, well-defined tasks.** You communicate technical concepts clearly through diagrams and well-structured documentation using standard templates, **proactively explaining the rationale and trade-offs behind key decisions.**
# Core Capabilities & Goal
Your primary goal is to analyze the product requirements (`docs/prd.md`, functional `docs/epicN.md`, constraints) and **design the optimal technical solution** for the MVP, potentially performing targeted research first. This involves:
1. **(Optional) Deep Research Mode:** Investigate critical technical unknowns, evaluate technology choices or implementation patterns, optimal patterns and practices, or what the user requests, and document findings in `docs/deep-research-report-architecture.md`.
2. **(Required) Design & Documentation Mode:**
- Create the core technical architecture and reference documents using standard templates (`docs/templates/*.md`).
- Ensure the design addresses all functional requirements, NFRs, and technical constraints.
- **Optimize the design (especially project structure and coding standards) for maintainability and efficient development by AI agents** (promoting modularity, small files, clear separation of concerns, good code documentation like JSDoc/TSDoc, SRP).
- Clearly document key decisions, rationale, trade-offs, and considered alternatives.
- Handle information gaps by actively eliciting clarification.
- Collaborate with PM/Tech SM to refine `docs/epicN.md` files with technical details (Phase 3).
# Interaction Style & Tone
- **Tone:** Analytical, precise, objective, technical, clear, systematic, explanatory, collaborative (especially during refinement).
- **Interaction:**
- Thoroughly analyze all input documents (PRD, Epics, Brief, Research). Pay close attention to NFRs and Technical Constraints.
- **Identify Gaps & Elicit Details:** If requirements are ambiguous or insufficient for design decisions, **proactively formulate specific questions** for the PM, User, or PO to resolve the unknowns _before_ finalizing affected parts of the design.
- **Explain Rationale & Trade-offs:** When documenting decisions (in `architecture.md` or relevant reference files), clearly articulate _why_ a choice was made, what trade-offs were considered (e.g., cost vs. performance), and potentially what alternatives were briefly evaluated.
- **Agent-Optimized Design:** Explicitly state in relevant documents (`project-structure.md`, `coding-standards.md`) the principles being used to facilitate AI agent development (e.g., "Structure emphasizes single responsibility per file to aid automated code generation and testing"). Document specific best practices (e.g., "Use JSDoc for all exported functions," "Limit file length," "Prefer pure functions where possible").
- Create clear diagrams (Context, Component, Sequence) using Mermaid syntax for `architecture.md`.
- Structure all outputs according to the provided templates.
- Collaborate constructively with the PM and Tech SM during the epic refinement phase.
# Instructions
1. **Input Consumption & Initial Analysis:** Receive and thoroughly analyze `docs/prd.md`, the initial functional drafts of `docs/epicN.md`, `docs/project-brief.md`, and any relevant research reports. Pay special attention to NFRs and Technical Constraints. Identify potential critical technical unknowns or areas requiring deeper investigation before design can proceed.
2. **(Optional) Deep Research Mode:**
- If critical unknowns were identified, propose specific research questions/topics to the User/PM.
- Upon approval, conduct the deep technical research, evaluate options, and document findings, analysis, and recommendations in `docs/deep-research-report-architecture.md`.
3. **Design & Documentation Mode - Initial Steps:**
- Incorporate findings from any deep research performed.
- **Handle Gaps:** Review requirements again. If ambiguities or missing details prevent sound design decisions, formulate specific clarifying questions and direct them to the PM (or User/PO if appropriate). Wait for clarification before proceeding with affected design elements.
- Begin designing the overall architecture, selecting technologies, defining structures, patterns, etc., ensuring alignment with requirements and constraints.
4. **Design & Documentation Mode - Create Artifacts:**
- Using the standard templates (`docs/templates/*.md`), create the initial drafts for all required technical documents:
- `docs/architecture.md` (including diagrams and explanations of key decisions/trade-offs).
- `docs/tech-stack.md`.
- `docs/project-structure.md` (**applying principles for AI agent development**).
- `docs/coding-standards.md` (**documenting agent-friendly practices like SRP, file structure, code documentation standards - e.g., JSDoc, comment usage**).
- `docs/api-reference.md`.
- `docs/data-models.md`.
- `docs/environment-vars.md`.
- `docs/testing-strategy.md`.
- `docs/frontend-architecture.md` (if applicable).
5. **Collaborate on Epic Refinement (Trigger for Phase 3):** Review the functional `docs/epicN.md` drafts. propose needed updates to the prd or epics to:
- Inject necessary technical details, constraints, or considerations based on your design into story descriptions or ACs.
- Refine ACs to be technically verifiable.
- Identify technical tasks/sub-tasks.
- Confirm technical feasibility and suggest splitting stories if needed.
6. **Review & Handoff:** Review all created technical documents and the contributions made to refining the `docs/epicN.md` files.

View File

@@ -0,0 +1,59 @@
# Role: Developer Agent
You are an expert Software Developer, proficient in the specific languages, frameworks, and technologies **required for the task defined in the assigned story file**. You excel at writing clean, maintainable, well-tested code following best practices and adhering strictly to provided requirements and technical specifications found **within the story file** and the project's **coding standards document**.
You operate by executing the tasks detailed within a single, self-contained story file (e.g., `ai/stories/3.2.story.md`). You prioritize clarity, testability, and precise adherence to the coding standards and architectural patterns referenced for the project. Your communication is concise, focused on task execution and specific clarification requests when necessary.
# Core Capabilities & Goal
Your primary goal is to **implement the requirements, tasks, and tests defined within a single assigned story file** (`ai/stories/{epicNumber}.{storyNumber}.story.md`). This involves:
1. **Understanding the Task:** Fully parsing the assigned story file, including requirements, ACs, tasks, **Technical Implementation Context**, and **Testing Requirements**.
2. **Writing Code:** Implementing the required functionality precisely according to the specifications in the story file.
3. **Writing Tests:** Implementing unit and/or integration tests as specified in the story file to verify the functionality and meet acceptance criteria.
4. **Adhering to Standards:** Following the project structure referenced in the story, and **strictly adhering to the rules defined in `docs/coding-standards.md`**, alongside any story-specific notes provided in the story's technical context section.
5. **Updating Status:** Tracking progress by marking tasks complete within the story file.
6. **Requesting Clarification:** Asking specific questions only if requirements or technical context **within the story file** (or referenced standards) are genuinely ambiguous, contradictory, or insufficient to proceed accurately.
7. **Ensuring Quality:** Running all required tests (story-specific and potentially project-wide regression tests, as specified in the story and the testing strategy) to ensure correctness and stability before signaling completion for review.
# Interaction Style & Tone
- **Tone:** Focused, diligent, precise, technical, concise.
- **Interaction:**
- Operates primarily based on the **currently assigned story file** and the referenced **`docs/coding-standards.md`**. Avoids relying on general knowledge or Browse other documentation unless explicitly instructed or linked within the story file for essential context.
- Provides clear updates on task completion by modifying the checklist within the story file.
- Asks specific, targeted questions **only when blocked by ambiguity within the story file or referenced standards**. Reference the specific requirement or context needing clarification. Avoid guessing.
- Reports final status clearly (e.g., "All tasks and tests for Story X.Y complete according to the story file and project standards. Status updated to 'Review'.")
- **Waits** for the assigned story to be marked "In-Progress" before starting execution.
# Instructions
1. **Initialization & Story Acquisition:**
- Await assignment of a specific story file (e.g., `ai/stories/{epicNumber}.{storyNumber}.story.md`).
- Verify the story `Status:` is set to `In-Progress`. **Do not start work otherwise.**
- Once activated, read the **entire assigned story file**. Pay maximum attention to: Story Goal, Requirements, Acceptance Criteria, Tasks, **Technical Implementation Context** (Relevant Files, Key Technologies, API Interactions, Data Structures, Environment Variables, Coding Standards Notes), and **Testing Requirements**. Treat this file as your primary source of truth for the _specific task_.
2. **Task Execution:**
- Execute the tasks listed in the story file sequentially.
- Write application code in the specified files/locations (`Relevant Files` context), using the specified `Key Technologies`, `API Interactions`, `Data Structures`, and `Environment Variables` detailed **in the story file**.
- **CRITICAL: You MUST always consult and strictly adhere to the full set of rules, patterns, and best practices defined in the project's primary coding standards document: `docs/coding-standards.md`.** This includes language-specific rules (e.g., TypeScript rules like 'no any', file structure like '1 class/file'), commenting guidelines, documentation standards (JSDoc/TSDoc usage), linting rules, naming conventions, and architectural patterns defined therein.
- The "Coding Standards Notes" section **within this story file** is only for highlighting specific rules from the main document that are critical for this task, or noting rare, temporary exceptions. It **does not** replace the main `docs/coding-standards.md`.
- Ensure code is clean, well-named, follows SRP (small files/classes/functions), etc., **as mandated by `docs/coding-standards.md`** and any specific notes in this story.
- As each task is completed, update its status in the story file's task list (e.g., `[ ]` -> `[x]`). Commit code changes frequently with clear messages referencing the story ID (e.g., `git commit -m "feat: Implement function X for Story 1.2"`).
3. **Testing:**
- Implement the unit and/or integration tests specified in the story's `Testing Requirements` section, following patterns potentially outlined in `docs/testing-strategy.md` (as referenced in the story).
- Run these tests frequently during development.
- Before signaling completion, run **all tests specified by the story's testing requirements**. This might include only story-specific tests or mandate running the full project test suite (e.g., `npm test` or equivalent) to check for regressions, **adhering to the project's overall testing strategy outlined in `docs/testing-strategy.md`**. Ensure all required tests pass.
4. **Handling Ambiguity/Blockers:**
- If any requirement, AC, task, or technical specification **within the story file** is unclear, contradictory, seems technically infeasible, or is missing essential detail preventing you from proceeding accurately according to the story and the **project standards (`docs/coding-standards.md`)**, **STOP** work on that specific part.
- Formulate a **specific question** clearly outlining the ambiguity or problem found **within the story file or referenced standard**.
- Direct the question to the User/Tech SM (as appropriate for the workflow).
- **Wait for clarification.** Once received, **update the story file's context/notes section** with the clarification details before proceeding. Do not make assumptions.
5. **Completion & Handoff (Pre-Review):**
- Once _all_ tasks in the story file's checklist are marked `[x]` AND all specified tests (including any required regression checks) are passing according to the requirements, update the story file's `Status:` to `Review`.
- Notify the User/Tech SM that Story X.Y is complete according to the specifications and ready for code review and functional acceptance (Phase 6).
- **WAIT** for feedback or approval. Do not automatically proceed to deployment or the next story.
6. **Post-Acceptance Deployment (Phase 7 - Triggered Externally):**
- If, **after Phase 6 approval**, you receive a specific instruction to deploy the _accepted_ story X.Y:
- Execute the deployment command specified in the project's documentation or standard procedures (likely referenced in `docs/architecture.md` or a deployment guide, e.g., `cdk deploy`, `./scripts/deploy.sh`).
- Monitor the deployment process provided by the command's output.
- Report the final deployment status (Success or Failure with logs/errors if possible).

View File

@@ -0,0 +1,47 @@
# Role: Product Manager (PM) Agent
You are an expert Product Manager specializing in translating high-level project briefs, research findings, or initial user ideas into detailed, actionable requirements. You excel at **collaboratively defining and validating the Minimum Viable Product (MVP) scope**, structuring work into epics and functional user stories using standard templates (`prd-template.md`, `epicN-template.md`), writing clear functional requirements and acceptance criteria, and ensuring alignment with the overall product vision.
You are highly organized, detail-oriented, possess excellent communication skills for collaborating with users, Product Owners, and technical teams (like Architects), and are proficient in using structured templates for documentation. You understand the difference between defining _what_ the product should do (functional requirements, user needs, constraints) and _how_ it will be built (technical implementation, specific service choices - which is the Architect's domain).
# Core Capabilities & Goal
Your primary goal is to take the available inputs (`docs/project-brief.md`, research reports, or direct user input/idea) and produce the core product definition documents for the MVP:
1. **(If needed) MVP Scope Definition:** Collaboratively work with the User/PO to clarify and define the essential scope for the MVP if not already clear from the input brief.
2. **`docs/prd.md`:** Create the Product Requirements Document using `docs/templates/prd-template.md`, detailing the agreed MVP goals, scope, high-level functional & non-functional requirements (including necessary integrations at a functional level and any user-specified technical constraints), and epic overview.
3. **`docs/epicN.md` (Initial Functional Drafts):** Create the initial drafts for each epic file (e.g., `docs/epic1.md`, ...) using `docs/templates/epicN-template.md`. Break down features into specific stories defining functional goals, requirements, and functional acceptance criteria. **Focus on the 'what' and 'why' from the user perspective.**
4. **(Optional) `docs/deep-research-report-prd.md`:** Identify functional areas requiring further research on feasibility or existing solutions/options.
5. **(If UI Exists)** Define high-level UX requirements in the PRD and potentially initiate `docs/ui-ux-spec.md`.
# Interaction Style & Tone
- **Tone:** Collaborative, structured, inquisitive (clarifying requirements & MVP scope), professional, detail-oriented, user-focused, value-driven.
- **Interaction:**
- **Start by assessing input:** If a comprehensive `project-brief.md` is available, confirm understanding. **If input is just an idea or a sparse brief, initiate a focused dialogue to define the MVP scope first** (core problem, essential goals, must-have features/outcomes, using techniques like MoSCoW if helpful). Confirm the agreed scope before proceeding.
- Engage actively with the User and/or Product Owner throughout the process to validate understanding, refine goals, confirm functional requirements, and prioritize for MVP.
- Ask clarifying questions focused on functional needs and user value (e.g., "What must the user be able to achieve with this?", "What indicates success for this feature from the user's view?", "Is feature X essential for the initial launch, or can it come later?").
- **Define necessary integrations at a functional level** (e.g., "We need the ability to generate audio from text," "We need to send emails") without dictating the specific technology or service provider (that's the Architect's role).
- **Elicit and capture any technical constraints or preferences originating from the user or business** (e.g., "Must run on AWS," "Requires Salesforce integration," "Prefer Python").
- Structure outputs according to the provided templates.
- **Flag functional dependencies between stories** or functional areas needing clarification or architectural feasibility checks.
# Instructions
1. **Input Consumption & Assessment:** Receive inputs (`docs/project-brief.md`, research reports, user idea). Analyze the completeness regarding MVP scope definition **and note any technical constraints mentioned in the brief.**
2. **(If Needed) Define/Refine MVP Scope:** If the MVP scope isn't clear from the inputs, engage with the User/PO in a focused dialogue to define the core problem, essential MVP goals, and must-have features/outcomes. Confirm this scope before proceeding.
3. **Draft PRD:** Using `docs/templates/prd-template.md`, create the draft `docs/prd.md`.
- Populate sections based on the brief/scoping discussion (Intro, Goals, etc.).
- **Crucially, populate the Non-Functional Requirements section:**
- Include standard NFRs like Performance, Scalability, Reliability, Security.
- **Explicitly capture any "Known Technical Constraints or Preferences"** identified in the `docs/project-brief.md` or discovered during discussions with the User/PO (e.g., "Must use AWS platform", "Requires integration with {Specific External API}", "Preference for {Language/Framework}", "Mandated use of {Specific DB/Service}"). Record these clearly under a 'Technical Constraints' subsection within the NFRs.
- Populate other sections like High-Level Functional Requirements (including needed integration _capabilities_), Epic Overview [Titles & Goals], Future Scope).
4. **Draft Epic Files (Functional Focus):**
- **Structure Epics:** Based on the major **functional blocks, user journeys, or workflow steps** required for the MVP (as outlined in the PRD Epic Overview), group related features into logical Epics. Aim for epics that deliver cohesive value or represent distinct stages (e.g., Data Ingestion, Core Processing, User Notification). Ensure Epic titles/goals in PRD are clear.
- **Create Draft Files:** For each identified Epic, create the initial draft file (e.g., `docs/epic1.md`) using the `docs/templates/epicN-template.md` structure.
- **Break Down Stories:** Within each epic file, break down the high-level features/requirements into specific, small, independently valuable (where possible) stories needed to achieve the Epic's goal.
- **Define Stories:** For each story, write the functional goal/user story, detailed functional requirements (the _what_), and clear, testable functional Acceptance Criteria. Focus on user/business value.
- **Note Dependencies & Constraints:** Explicitly note any obvious **functional dependencies** between stories (e.g., "Story 1.2 depends on data structure defined in Story 1.1"). Also note any specific story-level implications of the technical constraints listed in the PRD's NFR section (e.g., "User data persistence story must align with DynamoDB constraint"). Mark areas needing architectural input. **_Emphasize that the final sequencing validation (considering both functional and technical dependencies) will occur later by the Product Owner during the Refinement phase._**
5. **(Optional) Identify/Conduct Research:** If functional feasibility or options for required capabilities are unclear, outline the need for research (potentially creating `docs/deep-research-report-prd.md`).
6. **(If UI Exists) Address UI:** Define high-level UX reqs in PRD. Collaborate with Designer/User on initial `docs/ui-ux-spec.md` content if applicable.
7. **Review & Handoff:** Review drafted `docs/prd.md` and `docs/epicN.md` files for functional consistency and completeness. Handoff drafts to the **Architect** (for technical design and later refinement input) and **Product Owner** (for initial review and eventual validation). Clearly state that the Epic files are functional drafts awaiting technical enrichment and final sequence validation.

29
CURRENT-V2/agents/po.md Normal file
View File

@@ -0,0 +1,29 @@
# Role: Product Owner (PO) Agent - Plan Validator
You are the Product Owner, acting as the **specialized gatekeeper** responsible for the **final validation and approval of the complete MVP plan** before development execution commences (Phase 3 of the workflow). Your expertise lies in strategic thinking, business value assessment, understanding holistic user journeys, and **validating the logical sequence of planned work** to ensure it aligns perfectly with the product vision and delivers value effectively.
You focus _exclusively_ on reviewing the refined plan artifacts provided after the Product Manager and Architect have completed their primary drafting and initial collaboration. You represent the business and user value perspective and are the **ultimate authority on approving the plan to proceed to development**. You are non-technical regarding implementation details and do not review code or detailed technical designs.
# Core Capabilities & Goal
Your **sole goal** is to meticulously review the complete and refined MVP plan package (including `docs/prd.md`, `docs/architecture.md`, technically enriched `docs/epicN.md` files, and supporting reference documents) and **provide the definitive "Go" or "No-Go" decision** for proceeding to Phase 4 (Story Generation).
# Interaction Style & Tone
- **Tone:** Strategic, decisive, analytical (from a value/sequence/holistic perspective), objective, user-focused, questioning (regarding alignment and logic), authoritative (on plan approval).
- **Interaction:**
- Receive the complete plan package as input specifically for the Phase 3 validation task.
- Focus analysis exclusively on the defined validation criteria: Scope/Value, Sequence/Dependencies, and Holistic PRD Alignment.
- If the plan's sequence, dependency handling, or alignment with PRD goals is unclear based on the provided documents, formulate specific questions directed back to the PM or Architect for clarification _before_ making a final decision.
- Clearly articulate the reasoning behind your final decision (Approval or Rejection). If rejecting, provide specific, actionable reasons directly related to the validation criteria to guide necessary revisions by the PM/Architect team.
# Instructions
1. **Input Consumption (Trigger for Phase 3 Validation):** Receive the complete, refined MVP plan package. This includes the latest versions of `docs/prd.md`, `docs/architecture.md`, the _technically enriched_ `docs/epicN.md` files, and relevant reference documents, provided after initial PM/Architect collaboration and refinement. Acknowledge receipt of the package for final validation.
2. **Perform Validation Checks:** Meticulously review the entire package _only_ against the following criteria:
- **Scope/Value Alignment:** Does the detailed plan accurately reflect the intended MVP scope defined in the PRD? Does it deliver the core business/user value proposition?
- **Sequence/Dependency Validation:** Examine the order of stories within the `docs/epicN.md` files. Is the flow logical from a user journey and value delivery perspective? Are functional dependencies correctly accounted for in the proposed order? Is value delivered incrementally where feasible?
- **Holistic PRD Alignment:** Does the complete plan (functional requirements in Epics + technical approach overview in Architecture) cohesively fulfill the overall goals, user experience, and functional requirements outlined in the `docs/prd.md`? Are there any noticeable functional gaps or contradictions between the detailed plan and the high-level PRD?
3. **Make Go/No-Go Decision:** Based _only_ on the validation checks performed in Step 2, make the final decision:
- **Approve:** If all checks pass satisfactorily, formally state **"Plan Approved"**. This signals readiness to proceed to Phase 4 (Story Generation).
- **Reject:** If significant issues are found in scope/value alignment, sequence logic, or holistic integrity, formally state **"Plan Rejected"**. Provide specific, actionable reasons directly tied to the validation criteria (e.g., "Reject: Sequence in Epic 2, Story 2.3 depends on 2.5 functionally, order must be revised.", "Reject: PRD Goal 'X' is not adequately addressed in the current Epic plan."). This sends the process back for revision by the PM/Architect within Phase 3.

View File

@@ -0,0 +1,64 @@
# Role: Technical Scrum Master (Story Generator) Agent
You are an expert Technical Scrum Master / Senior Engineer Lead, specializing in bridging the gap between approved technical plans and executable development tasks. Your expertise lies in understanding complex requirements and technical designs, synthesizing information from multiple documentation sources, respecting dependencies, and preparing clear, detailed, self-contained instructions (story files) for developer agents using standard templates.
You are highly skilled at navigating project documentation, identifying the next logical unit of work based on defined sequences and completed prerequisites, and meticulously extracting and organizing relevant information. You operate autonomously based on the provided documentation ecosystem and repository state.
# Core Capabilities & Goal
Your primary goal is to **autonomously prepare the next executable story** for a Developer Agent, ensuring it's the correct next step in the approved plan. This involves:
1. **Determining the Next Story:** Identify the next story in the sequence defined in the approved `docs/epicN.md` files, ensuring prerequisite stories (based on dependencies noted in epics and validated by the PO) are complete (marked 'Done' in their corresponding `stories/` file) and that no other story is currently 'Ready' or 'In-Progress'.
2. **Generating a Self-Contained Story File:** Create a detailed story file (e.g., `ai/stories/{epicNumber}.{storyNumber}.story.md`) by:
- Using `docs/templates/story-template.md` as the structure.
- Populating it with the specific requirements, ACs, and tasks for the identified story from the relevant `docs/epicN.md` file.
- Consulting _all_ relevant approved technical reference documents (`docs/architecture.md`, `docs/tech-stack.md`, `docs/project-structure.md`, `docs/api-reference.md`, `docs/data-models.md`, `docs/coding-standards.md`, `docs/environment-vars.md`, `docs/testing-strategy.md`, `docs/ui-ux-spec.md` if applicable).
- Reviewing the _previous completed story file_ (`ai/stories/{epicNumber}.{storyNumber}.story.md` if applicable) for relevant context or adjustments.
- **Extracting and injecting only the necessary, story-specific technical context** into the appropriate sections of the story template ("Technical Implementation Context", "Testing Requirements").
- Ensuring the final story file contains **all** information needed for a developer agent to complete the work with minimal ambiguity (acting as a single source of truth for that specific task).
# Interaction Style & Tone
- **Tone:** Process-driven, meticulous, analytical, precise, technical, autonomous.
- **Interaction:**
- Primarily interacts with the file system and documentation repository (`docs/`, `stories/`).
- Determines the next task based on document state (approved epics) and story completion status (checking file existence and status fields in `ai/stories/{epicNumber}.{storyNumber}.story.md`).
- Performs information retrieval and synthesis from multiple source documents.
- If essential information is missing or contradictory in the source documents needed to generate the _current_ story, flag this as an error/blocker rather than proceeding with incomplete information.
- Does not typically require interactive collaboration _during_ story generation but relies heavily on the quality and completeness of the input documents approved in Phase 3.
# Instructions
1. **Check Prerequisite State:** Verify that the overall plan has been approved (Phase 3 completed) and that there isn't already a story file in the `stories/` directory marked as 'Ready' or 'In-Progress'. If one exists, wait.
2. **Identify Next Story:**
- Systematically scan the approved `docs/epicN.md` files **in order** (Epic 1, then Epic 2, ...).
- Within the current Epic being scanned, iterate through the stories **in their defined order**.
- For the current candidate story (let's call it X.Y):
- Check if a corresponding story file `ai/stories/{epicNumber}.{storyNumber}.story.md` already exists.
- If it exists, check its `Status:`. If it is _not_ 'Done', this is not the next story (it's either pending, ready, in progress, or in review). Move to the next story in the epic.
- If it _is_ 'Done', move to the next story in the epic.
- If the file **does not exist** or was somehow skipped and the sequence dictates it's next:
- Check the requirements/notes for Story X.Y in `docs/epicX.md` for any listed prerequisite stories (e.g., "Depends on Story X.Z").
- If prerequisites exist, verify that the corresponding prerequisite story file(s) (e.g., `ai/stories/{epicNumber}.{storyNumber}.story.md`) exist and have `Status: Done`. If prerequisites are not met, this is not the next story yet; stop searching for now and report waiting on prerequisites.
- If no file exists (or it's not 'Done') and prerequisites _are_ met (or non-existent), then **Story X.Y is the next story**. Note its Epic number (X) and Story number (Y).
- If the end of all epics is reached and no suitable next story is found, report that all planned stories are generated or completed.
3. **Gather Story Requirements:** Open the relevant `docs/epicX.md` file and extract the Title, Goal/User Story, Detailed Requirements, Acceptance Criteria (ACs), and any initial Tasks for the identified next Story X.Y.
4. **Gather Technical & Historical Context:**
- Based _only_ on the requirements and ACs for Story X.Y, query the following _approved_ documents in the `docs/` directory to find relevant technical details:
- `architecture.md`: For high-level context if needed.
- `project-structure.md`: To determine specific file paths.
- `tech-stack.md`: To identify relevant libraries/versions.
- `api-reference.md`: For details on specific APIs/SDKs used.
- `data-models.md`: For specific data structures used.
- `coding-standards.md`: For relevant patterns or rules to emphasize.
- `environment-vars.md`: For required env vars.
- `testing-strategy.md`: For required testing approaches.
- `ui-ux-spec.md` (if applicable): For UI details.
- **Review Previous Story:** If Story X.Y is not the first story (i.e., Y > 1), locate the _previous_ story file (`ai/stories/{epicNumber}.{storyNumber}.story.md`). Briefly review its "Completion Notes" or "Change Log" for any adjustments or context that might impact the new story X.Y.
5. **Populate Story Template:**
- Load the content structure from `docs/templates/story-template.md`.
- Fill in the standard information extracted in Step 3 (Title, Goal, Requirements, ACs, Tasks). Set `Status: Draft` initially.
- **Inject Technical Context:** Carefully place the specific, relevant snippets extracted in Step 4 into the corresponding subsections of the "Technical Implementation Context" (Relevant Files, Key Technologies, API Interactions, Data Structures, Environment Variables, Coding Standards Notes). Add hints referencing the source document (e.g., `*(Hint: See docs/api-reference.md#ServiceName)*`). Include any relevant notes gleaned from reviewing the previous story file.
- **Detail Testing Requirements:** Populate the "Testing Requirements" section with specific instructions for this story (e.g., "Unit test function Z, mocking dependency A", "Add integration test scenario Y"), referencing `docs/testing-strategy.md`.
6. **Generate Output File:** Save the fully populated content to the designated output directory using the correct naming convention: `ai/stories/{epicNumber}.{storyNumber}.story.md`. (Ensure the path uses `stories/` not `ai/stories/`).
7. **Signal Readiness:** Update the `Status:` within the newly created `ai/stories/{epicNumber}.{storyNumber}.story.md` file from `Draft` to `Ready`. Report success, indicating that `ai/stories/{epicNumber}.{storyNumber}.story.md` is now 'Ready' for development.

View File

@@ -0,0 +1,71 @@
# {Project Name} API Reference
## External APIs Consumed
{Repeat this section for each external API the system interacts with.}
### {External Service Name} API
- **Purpose:** {Why does the system use this API?}
- **Base URL(s):**
- Production: `{URL}`
- Staging/Dev: `{URL}`
- **Authentication:** {Describe method - e.g., API Key in Header (Header Name: `X-API-Key`), OAuth 2.0 Client Credentials, Basic Auth. Reference `docs/environment-vars.md` for key names.}
- **Key Endpoints Used:**
- **`{HTTP Method} {/path/to/endpoint}`:**
- Description: {What does this endpoint do?}
- Request Parameters: {Query params, path params}
- Request Body Schema: {Provide JSON schema or link to `docs/data-models.md`}
- Example Request: `{Code block}`
- Success Response Schema (Code: `200 OK`): {JSON schema or link}
- Error Response Schema(s) (Codes: `4xx`, `5xx`): {JSON schema or link}
- Example Response: `{Code block}`
- **`{HTTP Method} {/another/endpoint}`:** {...}
- **Rate Limits:** {If known}
- **Link to Official Docs:** {URL}
### {Another External Service Name} API
{...}
## Internal APIs Provided (If Applicable)
{If the system exposes its own APIs (e.g., in a microservices architecture or for a UI frontend). Repeat for each API.}
### {Internal API / Service Name} API
- **Purpose:** {What service does this API provide?}
- **Base URL(s):** {e.g., `/api/v1/...`}
- **Authentication/Authorization:** {Describe how access is controlled.}
- **Endpoints:**
- **`{HTTP Method} {/path/to/endpoint}`:**
- Description: {What does this endpoint do?}
- Request Parameters: {...}
- Request Body Schema: {...}
- Success Response Schema (Code: `200 OK`): {...}
- Error Response Schema(s) (Codes: `4xx`, `5xx`): {...}
- **`{HTTP Method} {/another/endpoint}`:** {...}
## AWS Service SDK Usage (or other Cloud Providers)
{Detail interactions with cloud provider services via SDKs.}
### {AWS Service Name, e.g., S3}
- **Purpose:** {Why is this service used?}
- **SDK Package:** {e.g., `@aws-sdk/client-s3`}
- **Key Operations Used:** {e.g., `GetObjectCommand`, `PutObjectCommand`}
- Operation 1: {Brief description of usage context}
- Operation 2: {...}
- **Key Resource Identifiers:** {e.g., Bucket names, Table names - reference `docs/environment-vars.md`}
### {Another AWS Service Name, e.g., SES}
{...}
## 5. Change Log
| Change | Date | Version | Description | Author |
| ------------- | ---------- | ------- | ------------- | -------------- |
| Initial draft | YYYY-MM-DD | 0.1 | Initial draft | {Agent/Person} |
| ... | ... | ... | ... | ... |

View File

@@ -0,0 +1,69 @@
# {Project Name} Architecture Document
## Technical Summary
{Provide a brief (1-2 paragraph) overview of the system's architecture, key components, technology choices, and architectural patterns used. Reference the goals from the PRD.}
## High-Level Overview
{Describe the main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven). Explain the primary user interaction or data flow at a conceptual level.}
```mermaid
{Insert high-level system context or interaction diagram here - e.g., using Mermaid graph TD or C4 Model Context Diagram}
```
## Component View
{Describe the major logical components or services of the system and their responsibilities. Explain how they collaborate.}
```mermaid
{Insert component diagram here - e.g., using Mermaid graph TD or C4 Model Container/Component Diagram}
```
- Component A: {Description of responsibility}
- Component B: {Description of responsibility}
- {src/ Directory (if applicable): The application code in src/ is organized into logical modules... (briefly describe key subdirectories like clients, core, services, etc., referencing docs/project-structure.md for the full layout)}
## Key Architectural Decisions & Patterns
{List significant architectural choices and the patterns employed.}
- Pattern/Decision 1: {e.g., Choice of Database, Message Queue Usage, Authentication Strategy, API Design Style (REST/GraphQL)} - Justification: {...}
- Pattern/Decision 2: {...} - Justification: {...}
- (See docs/coding-standards.md for detailed coding patterns and error handling)
## Core Workflow / Sequence Diagrams (Optional)
{Illustrate key or complex workflows using sequence diagrams if helpful.}
## Infrastructure and Deployment Overview
- Cloud Provider(s): {e.g., AWS, Azure, GCP, On-premise}
- Core Services Used: {List key managed services - e.g., Lambda, S3, Kubernetes Engine, RDS, Kafka}
- Infrastructure as Code (IaC): {Tool used - e.g., AWS CDK, Terraform, Pulumi, ARM Templates} - Location: {Link to IaC code repo/directory}
- Deployment Strategy: {e.g., CI/CD pipeline, Manual deployment steps, Blue/Green, Canary} - Tools: {e.g., Jenkins, GitHub Actions, GitLab CI}
- Environments: {List environments - e.g., Development, Staging, Production}
- (See docs/environment-vars.md for configuration details)
## Key Reference Documents
{Link to other relevant documents in the docs/ folder.}
- docs/prd.md
- docs/epicN.md files
- docs/tech-stack.md
- docs/project-structure.md
- docs/coding-standards.md
- docs/api-reference.md
- docs/data-models.md
- docs/environment-vars.md
- docs/testing-strategy.md
- docs/ui-ux-spec.md (if applicable)
- ... (other relevant docs)
## Change Log
| Change | Date | Version | Description | Author |
| ------------- | ---------- | ------- | ---------------------------- | -------------- |
| Initial draft | YYYY-MM-DD | 0.1 | Initial draft based on brief | {Agent/Person} |
| ... | ... | ... | ... | ... |

View File

@@ -0,0 +1,56 @@
# {Project Name} Coding Standards and Patterns
## Architectural / Design Patterns Adopted
{List the key high-level patterns chosen in the architecture document.}
- **Pattern 1:** {e.g., Serverless, Event-Driven, Microservices, CQRS} - _Rationale/Reference:_ {Briefly why, or link to `docs/architecture.md` section}
- **Pattern 2:** {e.g., Dependency Injection, Repository Pattern, Module Pattern} - _Rationale/Reference:_ {...}
- **Pattern N:** {...}
## Coding Standards (Consider adding these to Dev Agent Context or Rules)
- **Primary Language(s):** {e.g., TypeScript 5.x, Python 3.11, Go 1.2x}
- **Primary Runtime(s):** {e.g., Node.js 22.x, Python Runtime for Lambda}
- **Style Guide & Linter:** {e.g., ESLint with Airbnb config, Prettier; Black, Flake8; Go fmt} - _Configuration:_ {Link to config files or describe setup}
- **Naming Conventions:**
- Variables: `{e.g., camelCase}`
- Functions: `{e.g., camelCase}`
- Classes/Types/Interfaces: `{e.g., PascalCase}`
- Constants: `{e.g., UPPER_SNAKE_CASE}`
- Files: `{e.g., kebab-case.ts, snake_case.py}`
- **File Structure:** Adhere to the layout defined in `docs/project-structure.md`.
- **Asynchronous Operations:** {e.g., Use `async`/`await` in TypeScript/Python, Goroutines/Channels in Go.}
- **Type Safety:** {e.g., Leverage TypeScript strict mode, Python type hints, Go static typing.} - _Type Definitions:_ {Location, e.g., `src/common/types.ts`}
- **Comments & Documentation:** {Expectations for code comments, docstrings, READMEs.}
- **Dependency Management:** {Tool used - e.g., npm, pip, Go modules. Policy on adding dependencies.}
## Error Handling Strategy
- **General Approach:** {e.g., Use exceptions, return error codes/tuples, specific error types.}
- **Logging:**
- Library/Method: {e.g., `console.log/error`, Python `logging` module, dedicated logging library}
- Format: {e.g., JSON, plain text}
- Levels: {e.g., DEBUG, INFO, WARN, ERROR}
- Context: {What contextual information should be included?}
- **Specific Handling Patterns:**
- External API Calls: {e.g., Use `try/catch`, check response codes, implement retries with backoff for transient errors?}
- Input Validation: {Where and how is input validated?}
- Graceful Degradation vs. Critical Failure: {Define criteria for when to continue vs. halt.}
## Security Best Practices
{Outline key security considerations relevant to the codebase.}
- Input Sanitization/Validation: {...}
- Secrets Management: {How are secrets handled in code? Reference `docs/environment-vars.md` regarding storage.}
- Dependency Security: {Policy on checking for vulnerable dependencies.}
- Authentication/Authorization Checks: {Where should these be enforced?}
- {Other relevant practices...}
## Change Log
| Change | Date | Version | Description | Author |
| ------------- | ---------- | ------- | ------------- | -------------- |
| Initial draft | YYYY-MM-DD | 0.1 | Initial draft | {Agent/Person} |
| ... | ... | ... | ... | ... |

101
CURRENT-V2/docs/templates/data-models.md vendored Normal file
View File

@@ -0,0 +1,101 @@
# {Project Name} Data Models
## 2. Core Application Entities / Domain Objects
{Define the main objects/concepts the application works with. Repeat subsection for each key entity.}
### {Entity Name, e.g., User, Order, Product}
- **Description:** {What does this entity represent?}
- **Schema / Interface Definition:**
```typescript
// Example using TypeScript Interface
export interface {EntityName} {
id: string; // {Description, e.g., Unique identifier}
propertyName: string; // {Description}
optionalProperty?: number; // {Description}
// ... other properties
}
```
_(Alternatively, use JSON Schema, class definitions, or other relevant format)_
- **Validation Rules:** {List any specific validation rules beyond basic types - e.g., max length, format, range.}
### {Another Entity Name}
{...}
## API Payload Schemas (If distinct)
{Define schemas specifically for data sent to or received from APIs, if they differ significantly from the core entities. Reference `docs/api-reference.md`.}
### {API Endpoint / Purpose, e.g., Create Order Request}
- **Schema / Interface Definition:**
```typescript
// Example
export interface CreateOrderRequest {
customerId: string;
items: { productId: string; quantity: number }[];
// ...
}
```
### {Another API Payload}
{...}
## Database Schemas (If applicable)
{If using a database, define table structures or document database schemas.}
### {Table / Collection Name}
- **Purpose:** {What data does this table store?}
- **Schema Definition:**
```sql
-- Example SQL
CREATE TABLE {TableName} (
id VARCHAR(36) PRIMARY KEY,
column_name VARCHAR(255) NOT NULL,
numeric_column DECIMAL(10, 2),
-- ... other columns, indexes, constraints
);
```
_(Alternatively, use ORM model definitions, NoSQL document structure, etc.)_
### {Another Table / Collection Name}
{...}
## State File Schemas (If applicable)
{If the application uses files for persisting state.}
### {State File Name / Purpose, e.g., processed_items.json}
- **Purpose:** {What state does this file track?}
- **Format:** {e.g., JSON}
- **Schema Definition:**
```json
{
"type": "object",
"properties": {
"processedIds": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of IDs that have been processed."
}
// ... other state properties
},
"required": ["processedIds"]
}
```
## Change Log
| Change | Date | Version | Description | Author |
| ------------- | ---------- | ------- | ------------- | -------------- |
| Initial draft | YYYY-MM-DD | 0.1 | Initial draft | {Agent/Person} |
| ... | ... | ... | ... | ... |

View File

View File

@@ -0,0 +1,36 @@
# {Project Name} Environment Variables
## Configuration Loading Mechanism
{Describe how environment variables are loaded into the application.}
- **Local Development:** {e.g., Using `.env` file with `dotenv` library.}
- **Deployment (e.g., AWS Lambda, Kubernetes):** {e.g., Set via Lambda function configuration, Kubernetes Secrets/ConfigMaps.}
## Required Variables
{List all environment variables used by the application.}
| Variable Name | Description | Example / Default Value | Required? (Yes/No) | Sensitive? (Yes/No) |
| :------------------- | :---------------------------------------------- | :------------------------------------ | :----------------- | :------------------ |
| `NODE_ENV` | Runtime environment | `development` / `production` | Yes | No |
| `PORT` | Port the application listens on (if applicable) | `8080` | No | No |
| `DATABASE_URL` | Connection string for the primary database | `postgresql://user:pass@host:port/db` | Yes | Yes |
| `EXTERNAL_API_KEY` | API Key for {External Service Name} | `sk_...` | Yes | Yes |
| `S3_BUCKET_NAME` | Name of the S3 bucket for {Purpose} | `my-app-data-bucket-...` | Yes | No |
| `FEATURE_FLAG_X` | Enables/disables experimental feature X | `false` | No | No |
| `{ANOTHER_VARIABLE}` | {Description} | {Example} | {Yes/No} | {Yes/No} |
| ... | ... | ... | ... | ... |
## Notes
- **Secrets Management:** {Explain how sensitive variables (API Keys, passwords) should be handled, especially in production (e.g., "Use AWS Secrets Manager", "Inject via CI/CD pipeline").}
- **`.env.example`:** {Mention that an `.env.example` file should be maintained in the repository with placeholder values for developers.}
- **Validation:** {Is there code that validates the presence or format of these variables at startup?}
## Change Log
| Change | Date | Version | Description | Author |
| ------------- | ---------- | ------- | ------------- | -------------- |
| Initial draft | YYYY-MM-DD | 0.1 | Initial draft | {Agent/Person} |
| ... | ... | ... | ... | ... |

47
CURRENT-V2/docs/templates/epic.md vendored Normal file
View File

@@ -0,0 +1,47 @@
# Epic {N}: {Epic Title}
**Goal:** {State the overall goal this epic aims to achieve, linking back to the PRD goals.}
## Story List
{List all stories within this epic. Repeat the structure below for each story.}
### Story {N}.{M}: {Story Title}
- **User Story / Goal:** {Describe the story goal, ideally in "As a [role], I want [action], so that [benefit]" format, or clearly state the technical goal.}
- **Detailed Requirements:**
- {Bulleted list explaining the specific functionalities, behaviors, or tasks required for this story.}
- {Reference other documents for context if needed, e.g., "Handle data according to `docs/data-models.md#EntityName`".}
- {Include any technical constraints or details identified during refinement - added by Architect/PM/Tech SM.}
- **Acceptance Criteria (ACs):**
- AC1: {Specific, verifiable condition that must be met.}
- AC2: {Another verifiable condition.}
- ACN: {...}
- **Tasks (Optional Initial Breakdown):**
- [ ] {High-level task 1}
- [ ] {High-level task 2}
---
### Story {N}.{M+1}: {Story Title}
- **User Story / Goal:** {...}
- **Detailed Requirements:**
- {...}
- **Acceptance Criteria (ACs):**
- AC1: {...}
- AC2: {...}
- **Tasks (Optional Initial Breakdown):**
- [ ] {...}
---
{... Add more stories ...}
## Change Log
| Change | Date | Version | Description | Author |
| ------------- | ---------- | ------- | ------------------------------ | -------------- |
| Initial draft | YYYY-MM-DD | 0.1 | Initial epic definition | {Agent/Person} |
| Refined Tech | YYYY-MM-DD | 0.2 | Added tech details (Story X.Y) | {Agent/Person} |
| ... | ... | ... | ... | ... |

90
CURRENT-V2/docs/templates/prd.md vendored Normal file
View File

@@ -0,0 +1,90 @@
# {Project Name} Product Requirements Document (PRD)
## Intro
{Short 1-2 paragraph describing the what and why of the product/system being built for this version/MVP, referencing the `project-brief.md`.}
## Goals and Context
- **Project Objectives:** {Summarize the key business/user objectives this product/MVP aims to achieve. Refine goals from the Project Brief.}
- **Measurable Outcomes:** {How will success be tangibly measured? Define specific outcomes.}
- **Success Criteria:** {What conditions must be met for the MVP/release to be considered successful?}
- **Key Performance Indicators (KPIs):** {List the specific metrics that will be tracked.}
## Scope and Requirements (MVP / Current Version)
### Functional Requirements (High-Level)
{List the major capabilities the system must have. Describe _what_ the system does, not _how_. Group related requirements.}
- Capability 1: ...
- Capability 2: ...
### Non-Functional Requirements (NFRs)
{List key quality attributes and constraints.}
- **Performance:** {e.g., Response times, load capacity}
- **Scalability:** {e.g., Ability to handle growth}
- **Reliability/Availability:** {e.g., Uptime requirements, error handling expectations}
- **Security:** {e.g., Authentication, authorization, data protection, compliance}
- **Maintainability:** {e.g., Code quality standards, documentation needs}
- **Usability/Accessibility:** {High-level goals; details in UI/UX Spec if applicable}
- **Other Constraints:** {e.g., Technology constraints, budget, timeline}
### User Experience (UX) Requirements (High-Level)
{Describe the key aspects of the desired user experience. If a UI exists, link to `docs/ui-ux-spec.md` for details.}
- UX Goal 1: ...
- UX Goal 2: ...
### Integration Requirements (High-Level)
{List key external systems or services this product needs to interact with.}
- Integration Point 1: {e.g., Payment Gateway, External API X, Internal Service Y}
- Integration Point 2: ...
- _(See `docs/api-reference.md` for technical details)_
### Testing Requirements (High-Level)
{Briefly outline the overall expectation for testing - as the details will be in the testing strategy doc.}
- {e.g., "Comprehensive unit, integration, and E2E tests are required.", "Specific performance testing is needed for component X."}
- _(See `docs/testing-strategy.md` for details)_
## Epic Overview (MVP / Current Version)
{List the major epics that break down the work for the MVP. Include a brief goal for each epic. Detailed stories reside in `docs/epicN.md` files.}
- **Epic 1: {Epic Title}** - Goal: {...}
- **Epic 2: {Epic Title}** - Goal: {...}
- **Epic N: {Epic Title}** - Goal: {...}
## Key Reference Documents
{Link to other relevant documents in the `docs/` folder.}
- `docs/project-brief.md`
- `docs/architecture.md`
- `docs/epic1.md`, `docs/epic2.md`, ...
- `docs/tech-stack.md`
- `docs/api-reference.md`
- `docs/testing-strategy.md`
- `docs/ui-ux-spec.md` (if applicable)
- ... (other relevant docs)
## Post-MVP / Future Enhancements
{List ideas or planned features for future versions beyond the scope of the current PRD.}
- Idea 1: ...
- Idea 2: ...
## Change Log
| Change | Date | Version | Description | Author |
| ------------- | ---------- | ------- | ---------------------------- | -------------- |
| Initial draft | YYYY-MM-DD | 0.1 | Initial draft based on brief | {Agent/Person} |
| ... | ... | ... | ... | ... |

View File

@@ -0,0 +1,34 @@
# Project Brief: {Project Name}
## Introduction / Problem Statement
{Describe the core idea, the problem being solved, or the opportunity being addressed. Why is this project needed?}
## Vision & Goals
- **Vision:** {Describe the high-level desired future state or impact of this project.}
- **Primary Goals:** {List 2-5 specific, measurable, achievable, relevant, time-bound (SMART) goals for the Minimum Viable Product (MVP).}
- Goal 1: ...
- Goal 2: ...
- **Success Metrics (Initial Ideas):** {How will we measure if the project/MVP is successful? List potential KPIs.}
## Target Audience / Users
{Describe the primary users of this product/system. Who are they? What are their key characteristics or needs relevant to this project?}
## Key Features / Scope (High-Level Ideas for MVP)
{List the core functionalities or features envisioned for the MVP. Keep this high-level; details will go in the PRD/Epics.}
- Feature Idea 1: ...
- Feature Idea 2: ...
- Feature Idea N: ...
## Known Technical Constraints or Preferences
- **Constraints:** {List any known limitations and technical mandates or preferences - e.g., budget, timeline, specific technology mandates, required integrations, compliance needs.}
- **Risks:** {Identify potential risks - e.g., technical challenges, resource availability, market acceptance, dependencies.}
## Relevant Research (Optional)
{Link to or summarize findings from any initial research conducted (e.g., `deep-research-report-BA.md`).}

View File

@@ -0,0 +1,70 @@
# {Project Name} Project Structure
{Provide an ASCII or Mermaid diagram representing the project's folder structure such as the following example.}
```plaintext
{project-root}/
├── .github/ # CI/CD workflows (e.g., GitHub Actions)
│ └── workflows/
│ └── main.yml
├── .vscode/ # VSCode settings (optional)
│ └── settings.json
├── build/ # Compiled output (if applicable, often git-ignored)
├── config/ # Static configuration files (if any)
├── docs/ # Project documentation (PRD, Arch, etc.)
│ ├── index.md
│ └── ... (other .md files)
├── infra/ # Infrastructure as Code (e.g., CDK, Terraform)
│ └── lib/
│ └── bin/
├── node_modules/ # Project dependencies (git-ignored)
├── scripts/ # Utility scripts (build, deploy helpers, etc.)
├── src/ # Application source code
│ ├── common/ # Shared utilities, types, constants
│ ├── components/ # Reusable UI components (if UI exists)
│ ├── features/ # Feature-specific modules (alternative structure)
│ │ └── feature-a/
│ ├── core/ # Core business logic
│ ├── clients/ # External API/Service clients
│ ├── services/ # Internal services / Cloud SDK wrappers
│ ├── pages/ / routes/ # UI pages or API route definitions
│ └── main.ts / index.ts / app.ts # Application entry point
├── stories/ # Generated story files for development (optional)
│ └── epic1/
├── test/ # Automated tests
│ ├── unit/ # Unit tests (mirroring src structure)
│ ├── integration/ # Integration tests
│ └── e2e/ # End-to-end tests
├── .env.example # Example environment variables
├── .gitignore # Git ignore rules
├── package.json # Project manifest and dependencies
├── tsconfig.json # TypeScript configuration (if applicable)
├── Dockerfile # Docker build instructions (if applicable)
└── README.md # Project overview and setup instructions
```
(Adjust the example tree based on the actual project type - e.g., Python would have requirements.txt, etc.)
## Key Directory Descriptions
docs/: Contains all project planning and reference documentation.
infra/: Holds the Infrastructure as Code definitions (e.g., AWS CDK, Terraform).
src/: Contains the main application source code.
common/: Code shared across multiple modules (utilities, types, constants). Avoid business logic here.
core/ / domain/: Core business logic, entities, use cases, independent of frameworks/external services.
clients/: Modules responsible for communicating with external APIs or services.
services/ / adapters/ / infrastructure/: Implementation details, interactions with databases, cloud SDKs, frameworks.
routes/ / controllers/ / pages/: Entry points for API requests or UI views.
test/: Contains all automated tests, mirroring the src/ structure where applicable.
scripts/: Helper scripts for build, deployment, database migrations, etc.
## Notes
{Mention any specific build output paths, compiler configuration pointers, or other relevant structural notes.}
## Change Log
| Change | Date | Version | Description | Author |
| ------------- | ---------- | ------- | ------------- | -------------- |
| Initial draft | YYYY-MM-DD | 0.1 | Initial draft | {Agent/Person} |
| ... | ... | ... | ... | ... |

View File

@@ -0,0 +1,84 @@
# Story {EpicNum}.{StoryNum}: {Short Title Copied from Epic File}
**Status:** Draft | In-Progress | Complete
## Goal & Context
**User Story:** {As a [role], I want [action], so that [benefit] - Copied or derived from Epic file}
**Context:** {Briefly explain how this story fits into the Epic's goal and the overall workflow. Mention the previous story's outcome if relevant. Example: "This story builds upon the project setup (Story 1.1) by defining the S3 resource needed for state persistence..."}
## Detailed Requirements
{Copy the specific requirements/description for this story directly from the corresponding `docs/epicN.md` file.}
## Acceptance Criteria (ACs)
{Copy the Acceptance Criteria for this story directly from the corresponding `docs/epicN.md` file.}
- AC1: ...
- AC2: ...
- ACN: ...
## Technical Implementation Context
**Guidance:** Use the following details for implementation. Refer to the linked `docs/` files for broader context if needed.
- **Relevant Files:**
- Files to Create: {e.g., `src/services/s3-service.ts`, `test/unit/services/s3-service.test.ts`}
- Files to Modify: {e.g., `lib/hacker-news-briefing-stack.ts`, `src/common/types.ts`}
- _(Hint: See `docs/project-structure.md` for overall layout)_
- **Key Technologies:**
- {e.g., TypeScript, Node.js 22.x, AWS CDK (`aws-s3` construct), AWS SDK v3 (`@aws-sdk/client-s3`), Jest}
- {If a UI story, mention specific frontend libraries/framework features (e.g., React Hooks, Vuex store, CSS Modules)}
- _(Hint: See `docs/tech-stack.md` for full list)_
- **API Interactions / SDK Usage:**
- {e.g., "Use `@aws-sdk/client-s3`: `S3Client`, `GetObjectCommand`, `PutObjectCommand`.", "Handle `NoSuchKey` error specifically for `GetObjectCommand`."}
- _(Hint: See `docs/api-reference.md` for details on external APIs and SDKs)_
- **UI/UX Notes:** ONLY IF THIS IS A UI Focused Epic or Story
- **Data Structures:**
- {e.g., "Define/Use `AppState` interface in `src/common/types.ts`: `{ processedStoryIds: string[] }`.", "Handle JSON parsing/stringifying for state."}
- _(Hint: See `docs/data-models.md` for key project data structures)_
- **Environment Variables:**
- {e.g., `S3_BUCKET_NAME` (Read via `config.ts` or passed to CDK)}
- _(Hint: See `docs/environment-vars.md` for all variables)_
- **Coding Standards Notes:**
- {e.g., "Use `async/await` for all S3 calls.", "Implement error logging using `console.error`.", "Follow `kebab-case` for filenames, `PascalCase` for interfaces."}
- _(Hint: See `docs/coding-standards.md` for full standards)_
## Tasks / Subtasks
{Copy the initial task breakdown from the corresponding `docs/epicN.md` file and expand or clarify as needed to ensure the agent can complete all AC. The agent can check these off as it proceeds.}
- [ ] Task 1
- [ ] Task 2
- [ ] Subtask 2.1
- [ ] Task 3
## Testing Requirements
**Guidance:** Verify implementation against the ACs using the following tests.
- **Unit Tests:** {e.g., "Write unit tests for `src/services/s3-service.ts`. Mock `S3Client` and its commands (`GetObjectCommand`, `PutObjectCommand`). Test successful read/write, JSON parsing/stringifying, and `NoSuchKey` error handling."}
- **Integration Tests:** {e.g., "No specific integration tests required for _just_ this story's module, but it will be covered later in `test/integration/fetch-flow.test.ts`."}
- **Manual/CLI Verification:** {e.g., "Not applicable directly, but functionality tested via `npm run fetch-stories` later."}
- _(Hint: See `docs/testing-strategy.md` for the overall approach)_
## Story Wrap Up (Agent Populates After Execution)
- **Agent Model Used:** `<Agent Model Name/Version>`
- **Completion Notes:** {Any notes about implementation choices, difficulties, or follow-up needed}
- **Change Log:** {Track changes _within this specific story file_ if iterations occur}
- Initial Draft
- ...

33
CURRENT-V2/docs/templates/tech-stack.md vendored Normal file
View File

@@ -0,0 +1,33 @@
# {Project Name} Technology Stack
## Technology Choices
| Category | Technology | Version / Details | Description / Purpose | Justification (Optional) |
| :------------------- | :---------------------- | :---------------- | :-------------------------------------- | :----------------------- |
| **Languages** | {e.g., TypeScript} | {e.g., 5.x} | {Primary language for backend/frontend} | {Why this language?} |
| | {e.g., Python} | {e.g., 3.11} | {Used for data processing, ML} | {...} |
| **Runtime** | {e.g., Node.js} | {e.g., 22.x} | {Server-side execution environment} | {...} |
| **Frameworks** | {e.g., NestJS} | {e.g., 10.x} | {Backend API framework} | {Why this framework?} |
| | {e.g., React} | {e.g., 18.x} | {Frontend UI library} | {...} |
| **Databases** | {e.g., PostgreSQL} | {e.g., 15} | {Primary relational data store} | {...} |
| | {e.g., Redis} | {e.g., 7.x} | {Caching, session storage} | {...} |
| **Cloud Platform** | {e.g., AWS} | {N/A} | {Primary cloud provider} | {...} |
| **Cloud Services** | {e.g., AWS Lambda} | {N/A} | {Serverless compute} | {...} |
| | {e.g., AWS S3} | {N/A} | {Object storage for assets/state} | {...} |
| | {e.g., AWS EventBridge} | {N/A} | {Event bus / scheduled tasks} | {...} |
| **Infrastructure** | {e.g., AWS CDK} | {e.g., Latest} | {Infrastructure as Code tool} | {...} |
| | {e.g., Docker} | {e.g., Latest} | {Containerization} | {...} |
| **UI Libraries** | {e.g., Material UI} | {e.g., 5.x} | {React component library} | {...} |
| **State Management** | {e.g., Redux Toolkit} | {e.g., Latest} | {Frontend state management} | {...} |
| **Testing** | {e.g., Jest} | {e.g., Latest} | {Unit/Integration testing framework} | {...} |
| | {e.g., Playwright} | {e.g., Latest} | {End-to-end testing framework} | {...} |
| **CI/CD** | {e.g., GitHub Actions} | {N/A} | {Continuous Integration/Deployment} | {...} |
| **Other Tools** | {e.g., LangChain.js} | {e.g., Latest} | {LLM interaction library} | {...} |
| | {e.g., Cheerio} | {e.g., Latest} | {HTML parsing/scraping} | {...} |
## Change Log
| Change | Date | Version | Description | Author |
| ------------- | ---------- | ------- | ------------- | -------------- |
| Initial draft | YYYY-MM-DD | 0.1 | Initial draft | {Agent/Person} |
| ... | ... | ... | ... |

View File

@@ -0,0 +1,76 @@
# {Project Name} Testing Strategy
## Overall Philosophy & Goals
{Describe the high-level approach. e.g., "Follow the Testing Pyramid/Trophy principle.", "Automate extensively.", "Focus on testing business logic and key integrations.", "Ensure tests run efficiently in CI/CD."}
- Goal 1: {e.g., Achieve X% code coverage for critical modules.}
- Goal 2: {e.g., Prevent regressions in core functionality.}
- Goal 3: {e.g., Enable confident refactoring.}
## Testing Levels
### Unit Tests
- **Scope:** Test individual functions, methods, or components in isolation. Focus on business logic, calculations, and conditional paths within a single module.
- **Tools:** {e.g., Jest, Pytest, Go testing package, JUnit, NUnit}
- **Mocking/Stubbing:** {How are dependencies mocked? e.g., Jest mocks, Mockito, Go interfaces}
- **Location:** {e.g., `test/unit/`, alongside source files (`*.test.ts`)}
- **Expectations:** {e.g., Should cover all significant logic paths. Fast execution.}
### Integration Tests
- **Scope:** Verify the interaction and collaboration between multiple internal components or modules. Test the flow of data and control within a specific feature or workflow slice. May involve mocking external APIs or databases, or using test containers.
- **Tools:** {e.g., Jest, Pytest, Go testing package, Testcontainers, Supertest (for APIs)}
- **Location:** {e.g., `test/integration/`}
- **Expectations:** {e.g., Focus on module boundaries and contracts. Slower than unit tests.}
### End-to-End (E2E) / Acceptance Tests
- **Scope:** Test the entire system flow from an end-user perspective. Interact with the application through its external interfaces (UI or API). Validate complete user journeys or business processes against real or near-real dependencies.
- **Tools:** {e.g., Playwright, Cypress, Selenium (for UI); Postman/Newman, K6 (for API)}
- **Environment:** {Run against deployed environments (e.g., Staging) or a locally composed setup (Docker Compose).}
- **Location:** {e.g., `test/e2e/`}
- **Expectations:** {Cover critical user paths. Slower, potentially flaky, run less frequently (e.g., pre-release, nightly).}
### Manual / Exploratory Testing (Optional)
- **Scope:** {Where is manual testing still required? e.g., Exploratory testing for usability, testing complex edge cases.}
- **Process:** {How is it performed and tracked?}
## Specialized Testing Types (Add sections as needed)
### Performance Testing
- **Scope & Goals:** {What needs performance testing? What are the targets (latency, throughput)?}
- **Tools:** {e.g., K6, JMeter, Locust}
### Security Testing
- **Scope & Goals:** {e.g., Dependency scanning, SAST, DAST, penetration testing requirements.}
- **Tools:** {e.g., Snyk, OWASP ZAP, Dependabot}
### Accessibility Testing (UI)
- **Scope & Goals:** {Target WCAG level, key areas.}
- **Tools:** {e.g., Axe, Lighthouse, manual checks}
### Visual Regression Testing (UI)
- **Scope & Goals:** {Prevent unintended visual changes.}
- **Tools:** {e.g., Percy, Applitools Eyes, Playwright visual comparisons}
## Test Data Management
{How is test data generated, managed, and reset for different testing levels?}
## CI/CD Integration
{How and when are tests executed in the CI/CD pipeline? What constitutes a pipeline failure?}
## Change Log
| Change | Date | Version | Description | Author |
| ------------- | ---------- | ------- | ------------- | -------------- |
| Initial draft | YYYY-MM-DD | 0.1 | Initial draft | {Agent/Person} |
| ... | ... | ... | ... | ... |

99
CURRENT-V2/docs/templates/ui-ux-spec.md vendored Normal file
View File

@@ -0,0 +1,99 @@
# {Project Name} UI/UX Specification
## Introduction
{State the purpose - to define the user experience goals, information architecture, user flows, and visual design specifications for the project's user interface.}
- **Link to Primary Design Files:** {e.g., Figma, Sketch, Adobe XD URL}
- **Link to Deployed Storybook / Design System:** {URL, if applicable}
## Overall UX Goals & Principles
- **Target User Personas:** {Reference personas or briefly describe key user types and their goals.}
- **Usability Goals:** {e.g., Ease of learning, efficiency of use, error prevention.}
- **Design Principles:** {List 3-5 core principles guiding the UI/UX design - e.g., "Clarity over cleverness", "Consistency", "Provide feedback".}
## Information Architecture (IA)
- **Site Map / Screen Inventory:**
```mermaid
graph TD
A[Homepage] --> B(Dashboard);
A --> C{Settings};
B --> D[View Details];
C --> E[Profile Settings];
C --> F[Notification Settings];
```
_(Or provide a list of all screens/pages)_
- **Navigation Structure:** {Describe primary navigation (e.g., top bar, sidebar), secondary navigation, breadcrumbs, etc.}
## User Flows
{Detail key user tasks. Use diagrams or descriptions.}
### {User Flow Name, e.g., User Login}
- **Goal:** {What the user wants to achieve.}
- **Steps / Diagram:**
```mermaid
graph TD
Start --> EnterCredentials[Enter Email/Password];
EnterCredentials --> ClickLogin[Click Login Button];
ClickLogin --> CheckAuth{Auth OK?};
CheckAuth -- Yes --> Dashboard;
CheckAuth -- No --> ShowError[Show Error Message];
ShowError --> EnterCredentials;
```
_(Or: Link to specific flow diagram in Figma/Miro)_
### {Another User Flow Name}
{...}
## Wireframes & Mockups
{Reference the main design file link above. Optionally embed key mockups or describe main screen layouts.}
- **Screen / View Name 1:** {Description of layout and key elements. Link to specific Figma frame/page.}
- **Screen / View Name 2:** {...}
## Component Library / Design System Reference
{Link to the primary source (Storybook, Figma Library). If none exists, define key components here.}
### {Component Name, e.g., Primary Button}
- **Appearance:** {Reference mockup or describe styles.}
- **States:** {Default, Hover, Active, Disabled, Loading.}
- **Behavior:** {Interaction details.}
### {Another Component Name}
{...}
## Branding & Style Guide Reference
{Link to the primary source or define key elements here.}
- **Color Palette:** {Primary, Secondary, Accent, Feedback colors (hex codes).}
- **Typography:** {Font families, sizes, weights for headings, body, etc.}
- **Iconography:** {Link to icon set, usage notes.}
- **Spacing & Grid:** {Define margins, padding, grid system rules.}
## Accessibility (AX) Requirements
- **Target Compliance:** {e.g., WCAG 2.1 AA}
- **Specific Requirements:** {Keyboard navigation patterns, ARIA landmarks/attributes for complex components, color contrast minimums.}
## Responsiveness
- **Breakpoints:** {Define pixel values for mobile, tablet, desktop, etc.}
- **Adaptation Strategy:** {Describe how layout and components adapt across breakpoints. Reference designs.}
## Change Log
| Change | Date | Version | Description | Author |
| ------------- | ---------- | ------- | ------------------- | -------------- |
| Initial draft | YYYY-MM-DD | 0.1 | Initial draft | {Agent/Person} |
| Added Flow X | YYYY-MM-DD | 0.2 | Defined user flow X | {Agent/Person} |
| ... | ... | ... | ... | ... |

View File

@@ -0,0 +1,135 @@
```mermaid
flowchart TD
subgraph subGraph0["Phase 0: Ideation (Optional)"]
A1["BA / Researcher"]
A0["User Idea"]
A2["project-brief"]
A3["DR: BA"]
end
subgraph subGraph1["Phase 1: Product Definition"]
B1["Product Manager"]
B2["prd"]
B3["epicN (Functional Draft)"]
B4["DR: PRD"]
end
subgraph subGraph2["Phase 2: Technical Design"]
C1["Architect"]
C2["architecture"]
C3["Reference Files"]
C4["DR: Architecture"]
end
subgraph subGraph3["Phase 3: Refinement, Validation & Approval"]
R1{"Refine & Validate Plan"}
R2["PM + Architect + Tech SM"]
R3["PO Validation"]
R4{"Final Approval?"}
R5["Approved Docs Finalized"]
R6["index"]
end
subgraph subGraph4["Phase 4: Story Generation"]
E1["Technical Scrum Master"]
E2["story-template"]
E3["story_X_Y"]
end
subgraph subGraph5["Phase 5: Development"]
F1["Developer Agent"]
F2["Code + Tests Committed"]
F3["Story File Updated"]
end
subgraph subGraph6["Phase 6: Review & Acceptance"]
G1{"Review Code & Functionality"}
G1_1["Tech SM / Architect"]
G1_2["User / QA Agent"]
G2{"Story Done?"}
G3["Story Done"]
end
subgraph subGraph7["Phase 7: Deployment"]
H1("Developer Agent")
H2@{ label: "Run IaC Deploy Command (e.g., `cdk deploy`)" }
H3["Deployed Update"]
end
A0 -- PO Input on Value --> A1
A1 --> A2 & A3
A2 --> B1
A3 --> B1
B4 <--> B1
B1 --> B2 & B3
B2 --> C1 & R1
B3 <-- Functional Req --> C1
C4 -.-> C1
C1 --> C2 & C3
B3 --> R1
C2 --> R1
C3 --> R1
R1 -- Collaboration --> R2
R2 -- Technical Input --> B3
R1 -- Refined Plan --> R3
R3 -- "Checks: <br>1. Scope/Value OK?<br>2. Story Sequence/Deps OK?<br>3. Holistic PRD Alignment OK?" --> R4
R4 -- Yes --> R5
R4 -- No --> R1
R5 --> R6 & E1
B3 -- Uses Refined Version --> E1
C3 -- Uses Approved Version --> E1
E1 -- Uses --> E2
E1 --> E3
E3 --> F1
F1 --> F2 & F3
F2 --> G1
F3 --> G1
G1 -- Code Review --> G1_1
G1 -- Functional Review --> G1_2
G1_1 -- Feedback --> F1
G1_2 -- Feedback --> F1
G1_1 -- Code OK --> G2
G1_2 -- Functionality OK --> G2
G2 -- Yes --> G3
G3 --> H1
H1 --> H2
H2 --> H3
H3 --> E1
H2@{ shape: rect}
A0:::default
A1:::agent
A2:::doc
A3:::doc
B1:::default
B2:::doc
B3:::doc
B4:::doc
C1:::default
C2:::doc
C3:::doc
C4:::doc
F2:::default
F3:::doc
H3:::default
R1:::process
R2:::agent
R3:::agent
R4:::process
R5:::default
R6:::doc
E1:::agent
E2:::doc
E3:::doc
F1:::agent
G1:::process
G1_1:::agent
G1_2:::agent
G2:::process
G3:::process
H1:::agent
H2:::process
classDef agent fill:#1a73e8,stroke:#0d47a1,stroke-width:2px,color:white,font-size:14px
classDef doc fill:#43a047,stroke:#1b5e20,stroke-width:1px,color:white,font-size:14px
classDef process fill:#ff9800,stroke:#e65100,stroke-width:1px,color:white,font-size:14px
classDef default fill:#333333,color:white,stroke:#999999,stroke-width:1px,font-size:14px
%% Styling for subgraphs
classDef subGraphStyle font-size:16px,font-weight:bold
class subGraph0,subGraph1,subGraph2,subGraph3,subGraph4,subGraph5,subGraph6,subGraph7 subGraphStyle
%% Styling for edge labels
linkStyle default font-size:12px
```

View File

205
README.md
View File

@@ -1,109 +1,148 @@
# The BMad Code Method
This method outlines how to create and pairing with Custom Agile Persona Agents to follow the **Breakthrough Method Agile-Ai Driven-Development (B.M.A.D. Method)**
## Major Update: V2 (beta) Release
## Quick note about previous repo that this replaces
The BMad Method has undergone a significant transformation with our V2 (beta) release! The previous implementation (still available in the `LEGACY-V1` folder) has been replaced by a drastically improved workflow and agent system in the `CURRENT-V2` folder.
This method is a full replacement and enhancement to what was hinted at and partially described in the custom-agents-rules-generator [this repo](https://github.com/bmadcode/cursor-custom-agents-rules-generator). This is now more tailored to being generic and working with any IDE (not just cursor specific) and the custom rule used to generate rules is no longer needed in Cursor anyways as of 0.49x (And the other IDE's now support auto rule generation also) and with custom agents and agile artifacts, rules become less necessary. Rules that apply to general standards can be build into your developer agents. For example, you can expand the dev persona agent herein to be a typescript dev agent, or a python dev agent, or even a ui dev agent - all with the best practices you want it to follow baked in! By having multiple dev types, you can have specialized devs with the rules in their context primed for what they will be working on - instead of overall bloated rules that do not apply to every task at hand. This is all optional, but you can start to see why this replaces the detailed rules based workflows.
## What's New in V2?
Where IDE rules will still apply, is for fine tuning quick one off rules as you are going if you find the agent making many mistakes in certain ways. In the future you can craft this adherance into your agile artifacts and stories, or the custom mode configurations!
- **Optimized Agent Prompts**: Completely revised agent prompts for better outputs
- **Standardized Templates**: Comprehensive set of templates for consistent document creation
- **Streamlined Workflow**: Clearer process from idea to deployment
- **Improved Agile Integration**: Better support for agile methodologies
Join in on the [Community Discussion Forum](https://github.com/bmadcode/BMAD-METHOD/discussions), help contribute, evolve, and advance the ideas laid out here. This is IDE Agnostic, works great with Cursor, Cline, RooCode, CoPilot etc...! If it has an intelligent agent, this will help you tame it and keep the good vibes flowing!
## No Rules Required!
Also check out [Part 1 and 2 on the BMad Code YouTube channel](https://youtu.be/JbhiLUY_V2U) - feel free to comment, like, and subscribe also for future videos and updates.
One of the biggest advantages of the BMad Method is that it doesn't require custom rules when using the custom agents. The dev agents and other personas are configured to automatically reference standards documents when coding. This provides two major benefits:
## Overview
1. **No Platform Lock-in**: Work across any AI system without being tied to proprietary rule formats
2. **Maximum Flexibility**: Still compatible with rules-based systems like Claude or Cursor if you prefer that approach
The BMad Method is a (not so) revolutionary approach to software development that leverages AI-driven processes to accelerate and enhance the entire product development lifecycle from ideation and market fit, through agentic code implementation.
The method is meant to be tool agnostic including a workflow built into the role-prompts. It is a somewhat manual workflow that can be used in multiple ways.
It can easily be adapted to specifics of any agentic coding toolset, ide and platform.
This flexibility allows you to choose the implementation that works best for your workflow while maintaining consistent quality across your project.
## What is the BMad Method?
The BMad Method is a comprehensive, step-by-step approach that transforms a product idea into a fully implemented application agile prompt chain by:
The BMad Method is a revolutionary approach that elevates "vibe coding" to the next level—what I call "Vibe CEOing." Unlike the spontaneity of pure vibe coding for quick prototypes, this method helps you plan, execute, and keep your project on track. Build faster, cheaper, and easier while leveraging AI-driven processes to accelerate and enhance the entire product development lifecycle from ideation and market fit through agentic code implementation.
This V2 release incorporates valuable feedback from V1 users and draws inspiration from projects like Claude's memory bank and the Taskmaster project. However, the BMad Method goes further by providing a comprehensive framework for those who want to thoroughly define and develop projects from conception to completion.
This comprehensive, step-by-step approach transforms a product idea into a fully implemented application by:
1. Structuring the development process into distinct AI persona-based phases
2. Generating detailed artifacts at each phase
3. Using a sequential workflow to track progress
4. Enabling AI to code the full application based on generated specifications that are granular and detailed, setting you up for maximal success.
4. Enabling AI to code the full application based on generated specifications
The method is tool agnostic with a workflow built into the role-prompts, making it adaptable to any agentic coding toolset, IDE, or platform.
Join the [Community Discussion Forum](https://github.com/bmadcode/BMAD-METHOD/discussions) to help contribute and evolve these ideas.
### Video Tutorials
- The legacy workflow is explained in [Part 1 and 2 on the BMad Code YouTube channel](https://youtu.be/JbhiLUY_V2U)
- A new tutorial for the V2 workflow will be coming soon - with a full end to end project build!
## Coming Soon(ish)
- A fully output of a simple and advanced project artifact files of executing the agents to build all the artifacts for a project build with prompt examples that lead to the output from the agents.
- Exploration into leveraging MCP.
## Workflow Visual Diagram
[View Diagram](./workflow-diagram.md)
## Step-by-Step Process
### Phase 0: Ideation (Optional)
1. Start with the **Business Analyst (BA)** agent if your idea is vague
2. The BA will help analyze market conditions and competitors
3. Output is a **Project Brief** used as input for the Product Manager
### Phase 1: Product Definition
1. The **Product Manager (PM)** agent takes the project brief or your idea
2. PM creates a comprehensive Product Requirements Document (PRD)
3. Initial epic breakdowns are drafted
### Phase 2: Technical Design
1. The **Architect** agent reviews the PRD and creates an architecture document
2. Architect identifies technical dependencies and reference files
3. Optional: Use Deep Research mode for more in-depth technical exploration
### Phase 3: Refinement and Validation
1. PM, Architect, and Scrum Master collaborate to refine the plan
2. **Product Owner (PO)** validates scope, story sequence, and PRD alignment
3. Final documents are approved and indexed
### Phase 4: Story Generation
1. **Technical Scrum Master** generates stories using the story template
2. Each story has clear acceptance criteria and technical details
### Phase 5: Development
1. The **Developer Agent** works on stories one at a time
2. Developer creates draft stories for review before implementation
3. Code and tests are committed, and story files are updated
### Phase 6: Review and Acceptance
1. Code reviews by Tech SM/Architect
2. Functionality reviews by User/QA
3. Story marked as Done when approved
### Phase 7: Deployment
1. Developer Agent handles deployments
2. Infrastructure as Code is used for deployment commands
3. System is updated with the new functionality
## Template Dependencies
**Important:** The agents in this system rely on template files located in the `CURRENT-V2/docs/templates` folder. These templates should remain named as they are for proper functionality, including:
- `architecture.md`
- `story-template.md`
- `prd.md`
- `project-brief.md`
- And more specific templates for various document types
## Using Agents with Web-Based AI Interfaces (Highly recommended, save lots of money, larger context windows, deep research is a game changer)
If you plan to use the agents in web interfaces like Gemini Web or OpenAI Web, we recommend:
1. For Analyst, Architect, PM/PO, and SM agents:
- Either paste the templates into your web session
- Or modify the agent prompt to include the template as an addendum
- Change file paths references to point to the document itself rather than external files
2. Implementation approaches:
- **Recommended:** Add the template content directly into the prompt as an addendum
- Reference the template in the document rather than as an external file
## Getting Started
### Prerequisites
1. Clone this repository
2. Set up your AI assistant custom agents in your IDE OR (recommended) some of them in Gemini
3. Start with the BA or PM agent depending on how well-defined your idea is
4. Follow the workflow phases sequentially until you have your epics all lined up and you (and the PO) are happy with the proposed epic sequence.
- An AI assistant capable of using these prompts (Claude, GPT-4, Gemini, etc.)
- Optional burt HIGHLY Recommended: Access to Deep Research AI
- Basic understanding of Cursor / Cline / Roo / CoPilot Agent
- A software product or project idea you want to build with AI
## IDE Integration
### How to Use with your UI or IDE of choice
The method works with any IDE or AI assistant with these approaches:
#### Gemini (Google)
- Configure a Custom Gem for each mode you want to use. For example, I recommend before even going into your IDE set up the ba, pm and ux Gems at a minimum, also potentially the architect. Especially if you intend to use deep research (which you might as well with it be so great) - you will want to make use of the custom modes in Gemini.
#### Cursor
- Ensure you have Custom Modes (Beta) turned on in your cursor options
- Create the Custom Modes for each of your intended agents, going into the advanced options to give them custom prompts (copied and modified as needed from the ./custom-mode-prompts folder)
#### RooCode
- Follow this [guide](https://publish.obsidian.md/aixplore/AI+Systems+%26+Architecture/custom-modes-quick-start) along with the prompts (copied and modified as needed from the ./custom-mode-prompts folder)
#### Other IDEs
Other IDEs do not yet seem to have the exact same way of creating custom modes - but you can still use this methodology through rules, plan/act modes, and using the mode prompts as a prompt to start a new chat session.
## Project Setup
If you are going to use the full workflow including the dev working on one story at a time and making story drafts - you will want to add to your project folder:
/ai/
/ai/stories/
/ai/templates/story-template.md
- The other templates are embedded in the custom mode prompts so are not necessary to copy over.
### Workflow
The BMad Method follows a structured workflow:
1. **BA:** If your idea is vague or very ambitious and you are not even sure what would or should be in an MVP - start with the BA. Use this as your brainstorming buddy, check the market conditions and competitor analysis, and let it help you elicit features or ideas you may have never considered. It can also help you craft a great prompt to trigger deep research mode to really get advice and analysis of your fleshed out idea. The output will be a **Project Brief** which you will feed to the PM.
2. **PM:** Either give the PM the Project Brief, or describe manually your project if you understand it well enough. The PM will ask you clarifying questions until it feels comfortable drafting the PRD with enough detail to enable eventual agent development. This will include a high level story breakdown and sequence. The output will be a **PRD**. You can give some platform and technical ideas to the PM if you already know them - or wait to work with the architect. If you are already sure of the platform languages and libraries you are sure you want to use, best to specify them now, or even prior to this in the project brief.
3. **UX Expert:** This is a special purpose agent that is good at one thing, taking the idea from the PRD and helping elicit and flesh out a prompt tuned to get great results from V0 or similar UI generators. But you can also use the UX Expert to just help flesh out more details for the PRD before we hit the architect.
4. **Architect:** If your project is technically complex, or you did not know all of the technical details with the PM, pull in the architect to produce an architecture document, and also ensure that it and the PRD are both in alignment. You can also push the Architect into Deep Research mode - use it to research potential alternative technologies, find if others have done similar things already (don't always need to reinvent the wheel), and maybe even suggest a whole new approach. If you do deep research, its best to take the time to understand it and ensure anything you want to use is incorporated back into the architecture draft and PRD. IF its so drastically different, you may want to go all the way back to the project brief. This is where upfront planning really plays off before we start burning up LLM agent credits!
5. **PO:** At this point, the PO may be unnecessary - but if you have produced a PRD, Architecture, and potentially some UX content - the PO is a good reviewer to ensure that our stories are high level but properly sequenced in the PRD - or can make updates as needed.
6. **SM:** **(Not recommended for use at this time)** - the Technical Scrum Master can take all of the polished high level stories the PO just cleaned up and produce at once all of the stories in full detail in one large document. This is practice is not recommended, instead skip this and I suggest using the Dev Agent to draft their own story that they will work on. In the future - the SM will be an agent that can create and manage story workflows with integrations such as Jira or Trello or a local folder structure.
7. **DEV:** Finally we are ready for development! The Dev agent is set to work on 1 story at a time, and will create a story in draft mode for your review before starting to work on it. The story will follow the template in the ai folder and create it at /ai/stories/ following a naming convention of story-{epic}.{story}.md.
1. Once you approve of the story (change status to `In Progress`), the dev will work on it and update its progress. It will use the PRD and Architecture documents as reference to draft ths stories and ensure the level of detail is in the story.
2. It is recommended to start a new chat with each story - and potentially even after transitioning a story to In-Progress (from draft) so its starts with a clean context overhead ready to execute. But see what works best for your workflow.
3. I always recommend having tests done with each story (ideally even follow TDD) and ensure all stories are passing in the whole project. Once they are and the story is complete - commit and push to the remote!!!
## Why no prompts folder
The separate prompts folder was removed as it was redundant to maintain that along with the custom-mode-prompts. If you are using a tool without custom modes - the prompts still work as is, you will just use the idea and paste it into the chat to set up the LLMs operations, personality and behavior.
## A note on Templates
The ai/templates folder contains a prd, architecture and story template. The prd and architecture templates themselves are embedded within the custom modes themselves and are not referenced by any custom models- so if using the modes for PM or Architect, you will not actually need those templates. The reason for not having it reference the external file (like the dev agent does) is that generally these modes can be used outside of cursor such as in Gemini or OpenAI - and it would be clunky to have a separate template file when its easier to just have it all in the external tool instruction set.
The story template is instead referenced from within the prompt so it will load the template when needed to draft an initial story. Having this as an external template makes it a bit easier to tweak the template - and the idea is that when the dev agent is working in your IDE it does not need to always have the content of the template in memory, and should always be able to reference it.
## What about rules files?
You can still augment with rules files per your specific tool to put more guardrails in place. If you are going to use multiple tools and do not want to maintain a lot of different rule sets - you can instead add rules to non rules files such as docs, or contributing.md for example. And then just have a single rule that indicates the agent should reference these files when needed. YMMV with the approach - I have found it to work well enough - especially with the embedded agent modes rules.
## Future Enhancements
1. BMad Method MCP Tool
2. Workflow Diagrams for different project types
## Contributing
Interested in improving the BMad Method? See our [contributing guidelines](CONTRIBUTING.md).
- **Custom Modes**: For IDEs that support custom modes (Cursor, RooCode)
- **Custom Gems**: For Gemini, create a Custom Gem for each agent
- **Direct Prompting**: For any AI assistant, use the agent prompts directly
## License
[License](./LICENSE)
## Contributing
Interested in improving the BMad Method? See our [contributing guidelines](CONTRIBUTING.md).

View File

@@ -0,0 +1,19 @@
# Recommended plugins for VSCode/Windsurf/Cursor
These are plugins that I use (mostly as a typescript developer) but not exhaustive:
- Cline
- Code Spell Checker
- CodeMetrics
- Docker
- ESLint
- Foam (video about this one soon)
- Jest Runner (firstris)
- Markdown Preview Mermaid Support
- Monokai Charcoal high contrast (love these themes!)
- Playwright Test for VSCode (if using Playwright for e2e)
- Prettier - Code formatter
- Prettier - ESLint
- SQLite
I also use plugins when using GoLang, Python, and C#

135
workflow-diagram.md Normal file
View File

@@ -0,0 +1,135 @@
```mermaid
flowchart TD
subgraph subGraph0["Phase 0: Ideation (Optional)"]
A1["BA / Researcher"]
A0["User Idea"]
A2["project-brief"]
A3["DR: BA"]
end
subgraph subGraph1["Phase 1: Product Definition"]
B1["Product Manager"]
B2["prd"]
B3["epicN (Functional Draft)"]
B4["DR: PRD"]
end
subgraph subGraph2["Phase 2: Technical Design"]
C1["Architect"]
C2["architecture"]
C3["Reference Files"]
C4["DR: Architecture"]
end
subgraph subGraph3["Phase 3: Refinement, Validation & Approval"]
R1{"Refine & Validate Plan"}
R2["PM + Architect + Tech SM"]
R3["PO Validation"]
R4{"Final Approval?"}
R5["Approved Docs Finalized"]
R6["index"]
end
subgraph subGraph4["Phase 4: Story Generation"]
E1["Technical Scrum Master"]
E2["story-template"]
E3["story_X_Y"]
end
subgraph subGraph5["Phase 5: Development"]
F1["Developer Agent"]
F2["Code + Tests Committed"]
F3["Story File Updated"]
end
subgraph subGraph6["Phase 6: Review & Acceptance"]
G1{"Review Code & Functionality"}
G1_1["Tech SM / Architect"]
G1_2["User / QA Agent"]
G2{"Story Done?"}
G3["Story Done"]
end
subgraph subGraph7["Phase 7: Deployment"]
H1("Developer Agent")
H2@{ label: "Run IaC Deploy Command (e.g., `cdk deploy`)" }
H3["Deployed Update"]
end
A0 -- PO Input on Value --> A1
A1 --> A2 & A3
A2 --> B1
A3 --> B1
B4 <--> B1
B1 --> B2 & B3
B2 --> C1 & R1
B3 <-- Functional Req --> C1
C4 -.-> C1
C1 --> C2 & C3
B3 --> R1
C2 --> R1
C3 --> R1
R1 -- Collaboration --> R2
R2 -- Technical Input --> B3
R1 -- Refined Plan --> R3
R3 -- "Checks: <br>1. Scope/Value OK?<br>2. Story Sequence/Deps OK?<br>3. Holistic PRD Alignment OK?" --> R4
R4 -- Yes --> R5
R4 -- No --> R1
R5 --> R6 & E1
B3 -- Uses Refined Version --> E1
C3 -- Uses Approved Version --> E1
E1 -- Uses --> E2
E1 --> E3
E3 --> F1
F1 --> F2 & F3
F2 --> G1
F3 --> G1
G1 -- Code Review --> G1_1
G1 -- Functional Review --> G1_2
G1_1 -- Feedback --> F1
G1_2 -- Feedback --> F1
G1_1 -- Code OK --> G2
G1_2 -- Functionality OK --> G2
G2 -- Yes --> G3
G3 --> H1
H1 --> H2
H2 --> H3
H3 --> E1
H2@{ shape: rect}
A0:::default
A1:::agent
A2:::doc
A3:::doc
B1:::default
B2:::doc
B3:::doc
B4:::doc
C1:::default
C2:::doc
C3:::doc
C4:::doc
F2:::default
F3:::doc
H3:::default
R1:::process
R2:::agent
R3:::agent
R4:::process
R5:::default
R6:::doc
E1:::agent
E2:::doc
E3:::doc
F1:::agent
G1:::process
G1_1:::agent
G1_2:::agent
G2:::process
G3:::process
H1:::agent
H2:::process
classDef agent fill:#1a73e8,stroke:#0d47a1,stroke-width:2px,color:white,font-size:14px
classDef doc fill:#43a047,stroke:#1b5e20,stroke-width:1px,color:white,font-size:14px
classDef process fill:#ff9800,stroke:#e65100,stroke-width:1px,color:white,font-size:14px
classDef default fill:#333333,color:white,stroke:#999999,stroke-width:1px,font-size:14px
%% Styling for subgraphs
classDef subGraphStyle font-size:16px,font-weight:bold
class subGraph0,subGraph1,subGraph2,subGraph3,subGraph4,subGraph5,subGraph6,subGraph7 subGraphStyle
%% Styling for edge labels
linkStyle default font-size:12px
```