feat. Generate PRD #1103

Closed
opened 2025-10-14 16:51:39 -06:00 by navan · 0 comments
Owner

Originally created by @Zyra-V21 on 3/28/2025

Implement PRD Generation Workflow

Overview

This PR implements a complete PRD generation workflow as discussed in issue #37. The workflow, designed and implemented by Zyra-V23, provides a structured approach to transform raw ideas into comprehensive Product Requirement Documents through an AI-assisted process.

Features Added

  1. Complete PRD Generation Workflow:

    • ideate: Convert raw ideas into structured product concepts
    • round-table: Simulate expert discussions to refine concepts
    • refine-concept: Apply expert feedback to improve concepts
    • generate-prd-file: Create formal PRD documents
    • Seamless integration with existing parse-prd command
  2. API Improvements:

    • Added callAnthropicApi function for streaming API responses
    • Enhanced error handling for API connectivity issues
    • Added debug logging for troubleshooting
  3. Cross-Platform Support:

    • Workarounds for PowerShell command line limitations
    • Batch file examples for Windows users
    • Shell script template for Linux/macOS users
    • Comprehensive troubleshooting guide
  4. Documentation:

    • Updated README with detailed usage instructions
    • Step-by-step guides for Windows and Linux users
    • Updated CHANGELOG with version 0.9.30 entries
    • Added LICENSE clarification on copyright attribution

This PR introduces a modified MIT license with significant commercial use restrictions:

  • The PRD Generator functionality is copyright of Zyra
  • All commercial use requires explicit written permission from the copyright holder
  • The right to offer a SaaS version is exclusively reserved for Zyra-V23

Future SaaS Development

The PRD Generator is designed to eventually become available as a SaaS offering:

  • A future hosted service will provide the functionality via web interface and API
  • This service will offer premium features beyond the open source version
  • The open source version will continue to be maintained and improved

The license has been structured to protect these future plans while still contributing valuable functionality to the open source community.

This PR introduces a custom modified MIT license that clearly attributes:

  • The PRD Generator functionality (all commands and workflow) to Zyra
  • The Task Master core functionality remains with Eyal Toledano

This ensures proper attribution while maintaining a cohesive license for the entire project.

Testing

The implementation has been tested on:

  • Windows 10 with PowerShell
  • The workflow successfully generates a complete PRD from a raw idea
  • All intermediate files (concept, discussion, refined concept) are properly created
  • The final PRD is correctly parsed into tasks

Implementation Notes

  • PowerShell users may encounter command line length limitations, which are addressed with batch file workarounds
  • The .env file should contain the Anthropic API key for authentication
  • The workflow is designed to be modular, allowing users to run individual steps or the complete process

Quick Start Guide for Testing

Follow these steps to test the PRD generation workflow:

Setup

  1. Clone the repository:

    git clone https://github.com/eyaltoledano/claude-task-master.git
    cd claude-task-master
    
  2. Install dependencies:

    npm install
    
  3. Set up environment:
    Create a .env file with your Anthropic API key:

    ANTHROPIC_API_KEY=your-api-key-here
    MODEL=claude-3-7-sonnet-20250219
    MAX_TOKENS=4000
    TEMPERATURE=0.7
    DEBUG=true
    LOG_LEVEL=debug
    

Windows Testing Instructions

Create these batch files to simplify testing:

  1. Create the directory structure:

    mkdir -p prd
    
  2. Create run-ideate.bat:

    @echo off
    node scripts/dev.js ideate --idea="A task management app for remote teams" --output=prd/concept.txt
    
  3. Create run-roundtable.bat:

    @echo off
    node scripts/dev.js round-table --concept-file=prd/concept.txt --participants=product_manager,developer,designer --output=prd/discussion.txt
    
  4. Create run-refine-concept.bat:

    @echo off
    node scripts/dev.js refine-concept --concept-file=prd/concept.txt --discussion-file=prd/discussion.txt --output=prd/refined-concept.txt
    
  5. Create run-generate-prd.bat:

    @echo off
    node scripts/dev.js generate-prd-file --concept-file=prd/refined-concept.txt --output=prd/prd.txt --interactive
    
  6. Create run-parse-prd.bat:

    @echo off
    node scripts/dev.js parse-prd --input=prd/prd.txt
    
  7. Run each step in sequence:

    .\run-ideate.bat
    .\run-roundtable.bat
    .\run-refine-concept.bat
    .\run-generate-prd.bat
    .\run-parse-prd.bat
    

Linux/macOS Testing Instructions

  1. Create a shell script (create-prd.sh):

    #!/bin/bash
    
    # Make the directory if it doesn't exist
    mkdir -p prd
    
    # Step 1: Ideate
    echo "Step 1: Generating product concept..."
    node scripts/dev.js ideate --idea="A task management app for remote teams" --output=prd/concept.txt
    
    # Step 2: Round-table
    echo "Step 2: Simulating expert discussion..."
    node scripts/dev.js round-table --concept-file=prd/concept.txt --participants=product_manager,developer,designer --output=prd/discussion.txt
    
    # Step 3: Refine concept
    echo "Step 3: Refining concept with expert feedback..."
    node scripts/dev.js refine-concept --concept-file=prd/concept.txt --discussion-file=prd/discussion.txt --output=prd/refined-concept.txt
    
    # Step 4: Generate PRD
    echo "Step 4: Generating PRD document..."
    node scripts/dev.js generate-prd-file --concept-file=prd/refined-concept.txt --output=prd/prd.txt --interactive
    
    # Step 5: Parse PRD
    echo "Step 5: Parsing PRD into tasks..."
    node scripts/dev.js parse-prd --input=prd/prd.txt
    
    echo "PRD workflow complete! Check the prd directory for outputs and tasks/tasks.json for generated tasks."
    
  2. Make it executable and run it:

    chmod +x create-prd.sh
    ./create-prd.sh
    

Examining the Results

After running the workflow:

  1. Check the generated files:

    • prd/concept.txt - The initial structured concept
    • prd/discussion.txt - Simulated expert discussion
    • prd/refined-concept.txt - The refined concept with expert feedback
    • prd/prd.txt - The final PRD document
  2. Check the generated tasks:

    • tasks/tasks.json - The structured task list
    • Individual task files in the tasks/ directory
  3. Try different ideas:

    • Modify the --idea parameter in the first step to generate different PRDs
    • Try different expert participants in the round-table step

Sample Generated Files

You can find a complete set of example outputs in the prd/ directory of this PR.

Files Not Included

During development and testing, several temporary files were created but deliberately excluded from this PR:

  1. Temporary Batch Files:

    • run-ideate.bat, run-roundtable.bat, run-refine-concept.bat, etc.
    • These files were used to work around PowerShell command length limitations
    • The README contains examples for users to create their own batch files if needed
  2. Test Scripts:

    • test-concept.js, test-prd.js, scripts/test-round-table.js
    • These were used for isolated testing of individual workflow components
    • Unit and integration tests included in the standard test suite cover this functionality
  3. Temporary Documentation:

    • Development planning files like time-line.txt
    • Draft PR notes that have been consolidated into this PR description
  4. Example Output Files:

    • Example PRD outputs generated during testing
    • These are not included as they would add unnecessary files to the repo

The .gitignore file has been updated to exclude these temporary development files.

Closes #37

*Originally created by @Zyra-V21 on 3/28/2025* # Implement PRD Generation Workflow ## Overview This PR implements a complete PRD generation workflow as discussed in issue #37. The workflow, designed and implemented by Zyra-V23, provides a structured approach to transform raw ideas into comprehensive Product Requirement Documents through an AI-assisted process. ## Features Added 1. **Complete PRD Generation Workflow**: - `ideate`: Convert raw ideas into structured product concepts - `round-table`: Simulate expert discussions to refine concepts - `refine-concept`: Apply expert feedback to improve concepts - `generate-prd-file`: Create formal PRD documents - Seamless integration with existing `parse-prd` command 2. **API Improvements**: - Added `callAnthropicApi` function for streaming API responses - Enhanced error handling for API connectivity issues - Added debug logging for troubleshooting 3. **Cross-Platform Support**: - Workarounds for PowerShell command line limitations - Batch file examples for Windows users - Shell script template for Linux/macOS users - Comprehensive troubleshooting guide 4. **Documentation**: - Updated README with detailed usage instructions - Step-by-step guides for Windows and Linux users - Updated CHANGELOG with version 0.9.30 entries - Added LICENSE clarification on copyright attribution ## Copyright and Licensing This PR introduces a modified MIT license with significant commercial use restrictions: - The PRD Generator functionality is copyright of Zyra - All commercial use requires explicit written permission from the copyright holder - The right to offer a SaaS version is exclusively reserved for Zyra-V23 ### Future SaaS Development The PRD Generator is designed to eventually become available as a SaaS offering: - A future hosted service will provide the functionality via web interface and API - This service will offer premium features beyond the open source version - The open source version will continue to be maintained and improved The license has been structured to protect these future plans while still contributing valuable functionality to the open source community. ## Copyright Attribution This PR introduces a custom modified MIT license that clearly attributes: - The PRD Generator functionality (all commands and workflow) to Zyra - The Task Master core functionality remains with Eyal Toledano This ensures proper attribution while maintaining a cohesive license for the entire project. ## Testing The implementation has been tested on: - Windows 10 with PowerShell - The workflow successfully generates a complete PRD from a raw idea - All intermediate files (concept, discussion, refined concept) are properly created - The final PRD is correctly parsed into tasks ## Implementation Notes - PowerShell users may encounter command line length limitations, which are addressed with batch file workarounds - The `.env` file should contain the Anthropic API key for authentication - The workflow is designed to be modular, allowing users to run individual steps or the complete process ## Quick Start Guide for Testing Follow these steps to test the PRD generation workflow: ### Setup 1. **Clone the repository**: ```bash git clone https://github.com/eyaltoledano/claude-task-master.git cd claude-task-master ``` 2. **Install dependencies**: ```bash npm install ``` 3. **Set up environment**: Create a `.env` file with your Anthropic API key: ``` ANTHROPIC_API_KEY=your-api-key-here MODEL=claude-3-7-sonnet-20250219 MAX_TOKENS=4000 TEMPERATURE=0.7 DEBUG=true LOG_LEVEL=debug ``` ### Windows Testing Instructions Create these batch files to simplify testing: 1. **Create the directory structure**: ```bash mkdir -p prd ``` 2. **Create run-ideate.bat**: ``` @echo off node scripts/dev.js ideate --idea="A task management app for remote teams" --output=prd/concept.txt ``` 3. **Create run-roundtable.bat**: ``` @echo off node scripts/dev.js round-table --concept-file=prd/concept.txt --participants=product_manager,developer,designer --output=prd/discussion.txt ``` 4. **Create run-refine-concept.bat**: ``` @echo off node scripts/dev.js refine-concept --concept-file=prd/concept.txt --discussion-file=prd/discussion.txt --output=prd/refined-concept.txt ``` 5. **Create run-generate-prd.bat**: ``` @echo off node scripts/dev.js generate-prd-file --concept-file=prd/refined-concept.txt --output=prd/prd.txt --interactive ``` 6. **Create run-parse-prd.bat**: ``` @echo off node scripts/dev.js parse-prd --input=prd/prd.txt ``` 7. **Run each step in sequence**: ``` .\run-ideate.bat .\run-roundtable.bat .\run-refine-concept.bat .\run-generate-prd.bat .\run-parse-prd.bat ``` ### Linux/macOS Testing Instructions 1. **Create a shell script** (create-prd.sh): ```bash #!/bin/bash # Make the directory if it doesn't exist mkdir -p prd # Step 1: Ideate echo "Step 1: Generating product concept..." node scripts/dev.js ideate --idea="A task management app for remote teams" --output=prd/concept.txt # Step 2: Round-table echo "Step 2: Simulating expert discussion..." node scripts/dev.js round-table --concept-file=prd/concept.txt --participants=product_manager,developer,designer --output=prd/discussion.txt # Step 3: Refine concept echo "Step 3: Refining concept with expert feedback..." node scripts/dev.js refine-concept --concept-file=prd/concept.txt --discussion-file=prd/discussion.txt --output=prd/refined-concept.txt # Step 4: Generate PRD echo "Step 4: Generating PRD document..." node scripts/dev.js generate-prd-file --concept-file=prd/refined-concept.txt --output=prd/prd.txt --interactive # Step 5: Parse PRD echo "Step 5: Parsing PRD into tasks..." node scripts/dev.js parse-prd --input=prd/prd.txt echo "PRD workflow complete! Check the prd directory for outputs and tasks/tasks.json for generated tasks." ``` 2. **Make it executable and run it**: ```bash chmod +x create-prd.sh ./create-prd.sh ``` ### Examining the Results After running the workflow: 1. **Check the generated files**: - `prd/concept.txt` - The initial structured concept - `prd/discussion.txt` - Simulated expert discussion - `prd/refined-concept.txt` - The refined concept with expert feedback - `prd/prd.txt` - The final PRD document 2. **Check the generated tasks**: - `tasks/tasks.json` - The structured task list - Individual task files in the `tasks/` directory 3. **Try different ideas**: - Modify the `--idea` parameter in the first step to generate different PRDs - Try different expert participants in the round-table step ### Sample Generated Files You can find a complete set of example outputs in the `prd/` directory of this PR. ## Files Not Included During development and testing, several temporary files were created but deliberately excluded from this PR: 1. **Temporary Batch Files**: - `run-ideate.bat`, `run-roundtable.bat`, `run-refine-concept.bat`, etc. - These files were used to work around PowerShell command length limitations - The README contains examples for users to create their own batch files if needed 2. **Test Scripts**: - `test-concept.js`, `test-prd.js`, `scripts/test-round-table.js` - These were used for isolated testing of individual workflow components - Unit and integration tests included in the standard test suite cover this functionality 3. **Temporary Documentation**: - Development planning files like `time-line.txt` - Draft PR notes that have been consolidated into this PR description 4. **Example Output Files**: - Example PRD outputs generated during testing - These are not included as they would add unnecessary files to the repo The `.gitignore` file has been updated to exclude these temporary development files. ## Related Issue Closes #37
navan closed this issue 2025-10-14 16:51:48 -06:00
Sign in to join this conversation.
No labels
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:installation
area:installation
area:installation
area:installation
area:installation
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:vscode-extension
area:vscode-extension
area:vscode-extension
area:vscode-extension
area:vscode-extension
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
help wanted
help wanted
help wanted
help wanted
help wanted
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
integration request
integration request
integration request
integration request
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
low-priority
low-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
provider:anthropic
provider:anthropic
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:gemini-cli
provider:openai
provider:perplexity
question
question
question
question
question
question
question
question
question
question
question
question
question
question
refactor
refactor
wontfix
wontfix
wontfix
wontfix
wontfix
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/claude-task-master#1103
No description provided.