Skip to content

Commit fff512a

Browse files
committed
Adds AI-powered PRD generation with OpenAI integration
Enhances the issue PRD generator with GPT-4 capabilities for creating comprehensive product requirement documents. Introduces OpenAI API integration with configurable models and temperature settings. Adds PlantUML diagram generation for visual documentation and automatic PNG export when plantuml is available. Implements force regeneration mode to update existing PRDs and issue bodies. Updates all existing PRD files with hacktoberfest labels and AI-generated content that provides more detailed technical specifications, implementation approaches, and acceptance criteria. Includes OpenAI API key configuration in environment setup and comprehensive error handling for AI generation fallbacks.
1 parent d6bf221 commit fff512a

83 files changed

Lines changed: 3845 additions & 3421 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/web/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ PUBLIC_SUPABASE_ANON_KEY=your-anon-key-here
99
DATABASE_URL=postgresql://postgres:password@host:5432/postgres
1010
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key-here
1111

12+
OPENAI_API_KEY=your-openai-apikey
13+
1214
# Application Settings
1315
ORIGIN=https://your-service.up.railway.app
1416
PORT=8080

docs/PLANTUML_SETUP.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# PlantUML Setup Guide
2+
3+
This guide explains how to install PlantUML to enable automatic PNG generation from `.puml` diagram files.
4+
5+
## What is PlantUML?
6+
7+
PlantUML is an open-source tool that allows you to create diagrams from plain text descriptions. The PRD generator creates `.puml` files automatically, and with PlantUML installed, it can also generate `.png` images.
8+
9+
## Installation Options
10+
11+
### Option 1: Using Package Managers (Recommended)
12+
13+
#### macOS (Homebrew)
14+
```bash
15+
brew install plantuml
16+
```
17+
18+
#### Ubuntu/Debian
19+
```bash
20+
sudo apt-get update
21+
sudo apt-get install plantuml
22+
```
23+
24+
#### Arch Linux
25+
```bash
26+
sudo pacman -S plantuml
27+
```
28+
29+
#### Windows (Chocolatey)
30+
```bash
31+
choco install plantuml
32+
```
33+
34+
### Option 2: Manual Installation
35+
36+
1. **Install Java** (PlantUML requires Java 8 or higher)
37+
```bash
38+
# Check if Java is installed
39+
java -version
40+
41+
# If not installed, install Java
42+
# Ubuntu/Debian:
43+
sudo apt-get install default-jre
44+
45+
# macOS:
46+
brew install openjdk
47+
```
48+
49+
2. **Download PlantUML JAR**
50+
- Download from: https://plantuml.com/download
51+
- Save `plantuml.jar` to a convenient location (e.g., `/usr/local/bin/`)
52+
53+
3. **Create a wrapper script** (optional, for easier usage)
54+
```bash
55+
# Create script at /usr/local/bin/plantuml
56+
sudo nano /usr/local/bin/plantuml
57+
```
58+
59+
Add this content:
60+
```bash
61+
#!/bin/bash
62+
java -jar /usr/local/bin/plantuml.jar "$@"
63+
```
64+
65+
Make it executable:
66+
```bash
67+
sudo chmod +x /usr/local/bin/plantuml
68+
```
69+
70+
## Verify Installation
71+
72+
```bash
73+
plantuml -version
74+
```
75+
76+
You should see output like:
77+
```
78+
PlantUML version 1.2023.XX
79+
```
80+
81+
## Usage with PRD Generator
82+
83+
Once PlantUML is installed, the PRD generator will automatically:
84+
85+
1. Generate `.puml` source files
86+
2. Convert them to `.png` images
87+
3. Save both files to `docs/PRDs/`
88+
89+
### Generate PRDs with Diagrams
90+
91+
```bash
92+
# With PlantUML installed, this will create both .puml and .png files
93+
node scripts/generate-issue-prds.mjs --use-ai --diagrams --force
94+
```
95+
96+
### Manual PNG Generation
97+
98+
If you want to manually convert `.puml` files to PNG:
99+
100+
```bash
101+
# Convert a single file
102+
plantuml docs/PRDs/221-demo-workflows.puml
103+
104+
# Convert all .puml files in a directory
105+
plantuml docs/PRDs/*.puml
106+
107+
# Specify output format
108+
plantuml -tpng docs/PRDs/221-demo-workflows.puml
109+
plantuml -tsvg docs/PRDs/221-demo-workflows.puml
110+
```
111+
112+
## Alternative: Online PlantUML Editor
113+
114+
If you don't want to install PlantUML locally, you can:
115+
116+
1. Open the `.puml` file in a text editor
117+
2. Copy the content
118+
3. Paste it into the online editor: http://www.plantuml.com/plantuml/uml/
119+
4. Download the generated PNG/SVG
120+
121+
## Troubleshooting
122+
123+
### "plantuml: command not found"
124+
125+
This means PlantUML is not installed or not in your PATH. Follow the installation steps above.
126+
127+
### "Java not found"
128+
129+
PlantUML requires Java. Install Java first:
130+
```bash
131+
# Check Java version
132+
java -version
133+
134+
# Install if needed (Ubuntu/Debian)
135+
sudo apt-get install default-jre
136+
```
137+
138+
### Diagrams not rendering correctly
139+
140+
1. Check the `.puml` file syntax
141+
2. Try generating manually: `plantuml yourfile.puml`
142+
3. Check PlantUML documentation: https://plantuml.com/
143+
144+
## Benefits of PNG Generation
145+
146+
- **Visual Documentation**: Easy to view diagrams without special tools
147+
- **GitHub Integration**: PNG files display directly in GitHub
148+
- **Presentations**: Ready-to-use images for documentation and presentations
149+
- **Accessibility**: Anyone can view the diagrams without PlantUML
150+
151+
## Note
152+
153+
The PRD generator works perfectly fine without PlantUML installed. You'll still get:
154+
- ✅ Comprehensive PRD markdown files
155+
- ✅ PlantUML source files (`.puml`)
156+
- ❌ PNG images (requires PlantUML)
157+
158+
The `.puml` files can be:
159+
- Viewed in VS Code with PlantUML extensions
160+
- Converted to PNG later when needed
161+
- Shared with team members who have PlantUML installed
162+
- Used in the online PlantUML editor
Lines changed: 49 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,176 +1,109 @@
11
# PRD: Contributing guide
22

3-
**Issue:** [#194](https://github.com/profullstack/meshhook/issues/194)
4-
**Milestone:** Phase 8: Documentation
5-
**Labels:** developer-documentation
6-
**Phase:** Phase 8
7-
**Section:** Developer Documentation
3+
**Issue:** [#194](https://github.com/profullstack/meshhook/issues/194)
4+
**Milestone:** Phase 8: Documentation
5+
**Labels:** developer-documentation, hacktoberfest
86

97
---
108

11-
## Overview
12-
13-
This task is part of Phase 8 in the Developer Documentation section of the MeshHook project.
9+
# PRD: Contributing Guide
1410

15-
**MeshHook** is a webhook-first, deterministic, Postgres-native workflow engine that delivers n8n's visual simplicity and Temporal's durability without restrictive licensing.
11+
**Issue:** [#194: Contributing guide](https://github.com/profullstack/meshhook/issues/194)
12+
**Milestone:** Phase 8: Documentation
13+
**Labels:** developer-documentation, hacktoberfest
14+
**Phase:** Phase 8
15+
**Section:** Developer Documentation
1616

17-
**Task Objective:** Contributing guide
17+
## Overview
1818

19-
This implementation should align with the project's core goals of providing:
20-
- Webhook triggers with signature verification
21-
- Visual DAG builder using SvelteKit/Svelte 5
22-
- Durable, replayable runs via event sourcing
23-
- Live logs via Supabase Realtime
24-
- Multi-tenant RLS security
19+
The objective of this task is to develop a comprehensive Contributing Guide for the MeshHook project. This guide aims to standardize the contribution process, making it easier for developers to understand how they can contribute to the project effectively. Aligning with MeshHook's core goals, this document should facilitate contributions that enhance the project's webhook triggers, visual DAG builder, durability, live logging capabilities, and security features.
2520

2621
## Requirements
2722

2823
### Functional Requirements
2924

30-
1. Implement the core functionality described in the task: "Contributing guide"
31-
2. Create reusable Svelte 5 components
32-
3. Implement responsive design for mobile and desktop
33-
4. Follow project UI/UX patterns and styling
34-
5. Document all public APIs and interfaces
35-
6. Follow project coding standards and best practices
36-
25+
1. **Guide Structure:** Structure the guide to include introduction, setup instructions, contribution process, coding standards, and how to submit a pull request.
26+
2. **Setup Instructions:** Provide detailed setup instructions for local development, including required software and environment setup.
27+
3. **Contribution Process:** Outline the steps for making contributions, including branching strategies, commit message conventions, and pull request guidelines.
28+
4. **Coding Standards:** Document coding standards specific to SvelteKit/Svelte 5, Postgres, and other technologies used in the project.
29+
5. **Testing Guidelines:** Include guidelines for writing tests, along with how to run and verify them before submission.
30+
6. **Documentation Standards:** Set expectations for documenting new features or changes to the API and codebase.
3731

3832
### Non-Functional Requirements
3933

40-
- **Performance:** Maintain sub-second response times for user-facing operations
41-
- **Reliability:** Ensure 99.9% uptime with proper error handling and recovery
42-
- **Security:** Follow project security guidelines (RLS, secrets management, audit logging)
43-
- **Maintainability:** Write clean, well-documented code following project conventions
34+
- **Usability:** The guide should be clear, concise, and easy to follow for contributors with various levels of experience.
35+
- **Accessibility:** Ensure the contributing guide is accessible to a diverse group of developers, including those using assistive technologies.
36+
- **Maintainability:** The guide should be easy to update as project standards and technologies evolve.
4437

4538
## Technical Specifications
4639

4740
### Architecture Context
4841

49-
- **SvelteKit (SSR/API)**: webhook intake, workflow CRUD, publish versions, run console.
50-
- **Supabase**: Postgres (data + queues), Realtime (log streaming), Storage (artifacts), Edge (cron/timers).
51-
- **Workers**: Orchestrator (state machine + scheduling) and HTTP Executor (robust HTTP with retries/backoff).
42+
The Contributing Guide does not directly impact the architecture of MeshHook but is crucial for maintaining the project's overall quality and consistency. It should align with the technical stack of MeshHook, including SvelteKit/Svelte 5 for the frontend, Postgres for data storage, and Supabase for real-time capabilities.
5243

5344
### Implementation Approach
5445

55-
The implementation should follow these steps:
56-
57-
1. **Analysis:** Review existing codebase and identify integration points
58-
2. **Design:** Create detailed technical design considering:
59-
- Data structures and schemas
60-
- API contracts and interfaces
61-
- Component architecture
62-
- Error handling strategies
63-
3. **Implementation:** Write code following TDD approach:
64-
- Write tests first
65-
- Implement minimal code to pass tests
66-
- Refactor for clarity and performance
67-
4. **Integration:** Ensure seamless integration with existing components
68-
5. **Testing:** Comprehensive testing at all levels
69-
6. **Documentation:** Update relevant documentation
70-
7. **Review:** Code review and feedback incorporation
71-
72-
**Key Considerations:**
73-
- Maintain backward compatibility where applicable
74-
- Follow event sourcing patterns for state changes
75-
- Use Postgres for durable storage
76-
- Implement proper error handling and logging
77-
- Consider rate limiting and resource constraints
46+
1. **Research:** Review contributing guides from similar open-source projects to identify best practices.
47+
2. **Drafting:** Start with a basic structure and iteratively add sections focusing on setup, contribution process, coding standards, testing, and documentation.
48+
3. **Feedback Loop:** Share drafts with the core development team to gather feedback and make adjustments.
49+
4. **Finalization:** Incorporate all feedback, ensuring the guide is comprehensive and aligns with project goals.
50+
5. **Publishing:** Make the guide available in the project's repository and ensure it's easily discoverable for new contributors.
7851

7952
### Data Model
8053

81-
No new data model changes required for this task. If data model changes are needed during implementation, update `schema.sql` and document changes here.
54+
N/A
8255

83-
### API Endpoints (if applicable)
56+
### API Endpoints
8457

85-
No new API endpoints required for this task.
58+
N/A
8659

8760
## Acceptance Criteria
8861

89-
- [ ] Core functionality implemented and working as described
90-
- [ ] All tests passing (unit, integration, e2e where applicable)
91-
- [ ] Code follows project conventions and passes linting
92-
- [ ] Documentation updated (code comments, README, API docs)
93-
- [ ] Security considerations addressed (RLS, input validation, etc.)
94-
- [ ] Performance requirements met (response times, resource usage)
95-
- [ ] Error handling implemented with clear error messages
96-
- [ ] Changes reviewed and approved by team
97-
- [ ] No breaking changes to existing functionality
98-
- [ ] Database migrations created if schema changes made
99-
- [ ] Manual testing completed in development environment
100-
101-
**Definition of Done:**
102-
- Code merged to main branch
103-
- All CI/CD checks passing
104-
- Documentation complete and accurate
105-
- Ready for deployment to production
62+
- [ ] Contributing guide includes all sections as outlined in the functional requirements.
63+
- [ ] The guide is reviewed and approved by the project's core development team.
64+
- [ ] The guide is committed to the project's repository in an easily discoverable location.
65+
- [ ] The guide meets usability and accessibility standards, ensuring it is clear and easy to follow.
10666

10767
## Dependencies
10868

109-
### Technical Dependencies
110-
111-
- Existing codebase components
112-
- Database schema (see schema.sql)
113-
- External services: Supabase (Postgres, Realtime, Storage)
114-
115-
### Prerequisite Tasks
116-
117-
- Previous phase tasks completed
118-
- Dependencies installed and configured
119-
- Development environment ready
120-
- Access to required services (Supabase, etc.)
69+
- **Technical Dependencies:** Familiarity with the project's existing documentation structure and standards.
70+
- **Prerequisite Tasks:** None.
12171

12272
## Implementation Notes
12373

12474
### Development Guidelines
12575

126-
1. Follow ESM module system (Node.js 20+)
127-
2. Use modern JavaScript (ES2024+) features
128-
3. Implement comprehensive error handling
129-
4. Write tests before implementation (TDD)
130-
5. Ensure code passes ESLint and Prettier checks
76+
- Use Markdown format for the guide to ensure it's readable both in plaintext and rendered on GitHub.
77+
- Include examples where applicable, especially for complex setup instructions or contribution steps.
78+
- Ensure all instructions are tested to prevent errors or confusion.
13179

13280
### Testing Strategy
13381

134-
- **Unit Tests:** Test individual functions and modules
135-
- **Integration Tests:** Test component interactions
136-
- **E2E Tests:** Test complete user workflows (where applicable)
82+
- **Peer Review:** Have multiple project contributors follow the guide to set up their development environment and make a sample contribution.
83+
- **Iteration:** Use feedback from the testing phase to refine and update the guide.
13784

13885
### Security Considerations
13986

140-
- RLS by `project_id`.
141-
- Secrets AES-GCM with KEK rotation.
142-
- Audit log for admin actions & secret access.
143-
- PII redaction rules.
87+
- Highlight security practices contributors should follow, especially regarding handling secrets or sensitive information.
88+
- Include guidelines for responsible disclosure of security vulnerabilities.
14489

14590
### Monitoring & Observability
14691

147-
- Add appropriate logging for debugging
148-
- Track key metrics (response times, error rates)
149-
- Set up alerts for critical failures
150-
- Use Supabase Realtime for live updates where needed
92+
N/A
15193

15294
## Related Documentation
15395

154-
- [Main PRD](../PRD.md)
96+
- [MeshHook — PRD](../PRD.md)
15597
- [Architecture](../Architecture.md)
156-
- [Security Guidelines](../Security.md)
157-
- [Operations Guide](../Operations.md)
98+
- [Security & Multi-Tenancy](../Security.md)
15899

159100
## Task Details
160101

161-
**Original Task Description:**
162-
Contributing guide
102+
**Original Task Description:** Contributing guide
163103

164-
**Full Issue Body:**
165-
**Phase:** Phase 8
166-
**Section:** Developer Documentation
167-
168-
**Task:** Contributing guide
169-
170-
---
171-
_Auto-generated from TODO.md_
104+
*This PRD was carefully crafted to ensure that the Contributing Guide will be an invaluable resource for new and existing contributors, fostering a collaborative and productive development environment for the MeshHook project.*
172105

173106
---
174107

175-
*This PRD was auto-generated from GitHub issue #194*
176-
*Last updated: 2025-10-10*
108+
*This PRD was AI-generated using gpt-4-turbo-preview from GitHub issue #194*
109+
*Generated: 2025-10-10*

0 commit comments

Comments
 (0)