An intelligent Product Requirements Document (PRD) generator that leverages Apple Intelligence and Foundation Models to create comprehensive, implementation-ready specifications from conversational interactions.
AI PRD Builder transforms conversational descriptions into structured, detailed Product Requirements Documents that any GenAI model can use for implementation. It prioritizes privacy by using Apple's on-device Foundation Models and Private Cloud Compute before falling back to external providers.
- Privacy-First Architecture: Apple Foundation Models โ Private Cloud Compute โ External APIs (only when authorized)
- Multi-Model Integration: Seamlessly works with Apple Intelligence, Anthropic, OpenAI, and Gemini
- Intelligent Clarification System: Proactively identifies and collects missing requirements before generation
- Confidence-Based Generation: Evaluates input completeness and adjusts generation strategy accordingly
- Comprehensive PRD Generation: Creates complete specifications including:
- Product overview and target users
- User stories with acceptance criteria
- Feature specifications with prioritization
- API endpoints overview and usage patterns
- Test specifications for the Apple ecosystem
- Performance, security, and compatibility constraints
- Validation criteria and technical roadmap
- Advanced Reasoning: Multi-pass generation with assumption validation
- Smart Deduplication: Prevents redundant questions using Levenshtein distance and Jaccard similarity
- macOS 16.0+ (Required for Apple Foundation Models)
- Xcode 16.0+ (Required for latest Swift features)
- Swift 5.9+
- Apple Silicon Mac (Required - M1/M2/M3 or later)
git clone https://github.com/cdeust/ai-prd-builder.git
cd ai-prd-buildercd swift
swift build -c release# Copy to local bin
cp .build/release/AppleIntelligenceOrchestrator /usr/local/bin/ai-orchestrator
# Make executable
chmod +x /usr/local/bin/ai-orchestratorCreate a configuration file at ~/.ai-orchestrator/config.json:
{
"providers": {
"anthropic": {
"apiKey": "YOUR_ANTHROPIC_API_KEY"
},
"openai": {
"apiKey": "YOUR_OPENAI_API_KEY"
},
"gemini": {
"apiKey": "YOUR_GEMINI_API_KEY"
}
},
"privacy": {
"allowExternal": false
}
}# Start interactive mode
ai-orchestrator
# Generate a PRD
> prd
Describe what you want to build:
> I need a task management app with real-time collaboration...
# Chat with AI
> chat
Enter your message:
> How should I structure the authentication flow?# Allow external providers (when needed for complex tasks)
ai-orchestrator --allow-external
# Use specific provider
ai-orchestrator --provider anthropic
# Generate PRD directly
ai-orchestrator prd --input "Your product description"| Command | Description |
|---|---|
chat |
Start a conversational AI session |
prd |
Generate a Product Requirements Document |
session |
Manage chat sessions |
providers |
List available AI providers |
help |
Show help information |
exit |
Quit the application |
- Requirements Analysis: Evaluates input completeness and identifies gaps
- Technical Stack Discovery: Analyzes technical requirements and platform needs
- Clarification Collection: Intelligently collects missing information from users
- Confidence Evaluation: Determines generation strategy based on confidence levels
- Product Overview: Goals, target users, and context
- User Stories: Detailed stories with acceptance criteria
- Features: Comprehensive feature list with prioritization
- API Endpoints: Overview of required endpoints and usage patterns
- Test Specifications: Test cases aligned with implementation
- Constraints: Performance, security, and compatibility requirements
- Validation Criteria: Success metrics and acceptance conditions
- Technical Roadmap: Implementation timeline and CI/CD strategy
- <40%: Too vague - requires essential information collection
- 40-70%: Needs clarification for optimal results
- 70-85%: Good confidence, optional clarifications
- >85%: High confidence, proceed with generation
The tool operates in three privacy levels:
- On-Device Only: Uses Apple Foundation Models exclusively
- Private Cloud: Adds Apple Private Cloud Compute for complex tasks
- Extended (with
--allow-external): Enables external providers for maximum capability
ai-prd-builder/
โโโ swift/
โ โโโ Sources/
โ โ โโโ Orchestration/ # Core orchestration and routing
โ โ โโโ AIProvidersCore/ # Provider protocols and abstractions
โ โ โโโ AIProviderImplementations/ # Concrete provider implementations
โ โ โโโ PRDGenerator/ # PRD generation engine
โ โ โ โโโ Components/ # Modular generation components
โ โ โโโ SessionManagement/ # Session and state management
โ โ โโโ CLI/ # Command-line interface
โ โ โโโ DomainCore/ # Core domain models
โ โ โโโ CommonModels/ # Shared data structures
โ โ โโโ ThinkingCore/ # Reasoning and analysis
โ โโโ Tests/
โโโ Documentation/
- Orchestrator: Manages AI provider selection with privacy-first routing
- PRDGenerator: Coordinates the complete PRD generation pipeline
- SessionManager: Handles conversation sessions and state
- RequirementsAnalyzer: Orchestrates pre-generation analysis and clarification
- ConfidenceEvaluator: Evaluates input quality and determines strategy
- ClarificationCollector: Manages user interaction and deduplication
- AnalysisOrchestrator: Coordinates AI-based requirement analysis
- SectionGenerator: Generates individual PRD sections
- ValidationHandler: Validates and improves generated content
- Smart Deduplication: Uses Levenshtein distance (70% threshold) and Jaccard similarity (60% threshold)
- Confidence Filtering: Filters assumptions and clarifications based on confidence levels
- Parallel Analysis: Concurrent requirements and stack analysis for performance
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Run tests
swift test - Commit with descriptive message
git commit -m "Add amazing feature" - Push to your fork
git push origin feature/amazing-feature
- Open a Pull Request
- Follow Swift API Design Guidelines
- Use SwiftLint for code formatting
- Write unit tests for new features
- Update documentation as needed
- AIBridge: Core orchestration and service management
- AIProviders: Integration with various AI providers
- AppleIntelligenceOrchestrator: CLI application and user interface
- ImplementationGenius: Code analysis and implementation verification
- ThinkingFramework: Advanced reasoning and decision-making
# Debug build
swift build
# Run tests
swift test
# Generate Xcode project
swift package generate-xcodeproj- Implement
AIProviderprotocol inAIProviderImplementations/ - Add provider configuration to
Configurationstruct - Register in
Orchestratorinitialization - Add integration tests
- Update documentation
- Add new question categories to
PRDConstants - Extend
AnalysisOrchestratorfor domain-specific analysis - Update confidence thresholds if needed
- Test deduplication with new question patterns
# All tests
swift test
# Specific test
swift test --filter PRDGeneratorTests
# With coverage
swift test --enable-code-coverage- Unit Tests: Core logic and utilities
- Integration Tests: Provider integrations
- Performance Tests: Response time and memory usage
This project is licensed under the MIT License - see the LICENSE file for details.
- Apple for Foundation Models and Private Cloud Compute
- The Swift community for excellent tools and libraries
- Contributors and users who help improve this tool
- Issues: GitHub Issues
- Discussions: GitHub Discussions
PRDs generated by this tool require human review and validation. Always verify:
- API endpoint definitions against implementation requirements
- Test specifications with your testing framework
- Business logic against actual requirements
- Performance targets against realistic benchmarks
- Compliance with organizational standards
- Apple Foundation Models process data on-device
- Private Cloud Compute ensures verifiable privacy
- External providers are only used with explicit permission
- No data is stored or logged without user consent
The intelligent clarification system:
- Never asks duplicate questions: Uses advanced similarity algorithms
- Respects confidence levels: Only asks when truly needed
- Prioritizes user experience: Batches questions by category
- Improves generation quality: Better input leads to better PRDs
Built with โค๏ธ for the Apple Developer Community