|
# GitHub README Profile Generator Development Guidelines |
|
|
|
## 1. Project Overview |
|
|
|
### 1.1 Project Description |
|
A Hugging Face Space application that helps users generate personalized GitHub README profiles through AI interaction and template customization. |
|
|
|
### 1.2 Core Features |
|
- AI-powered profile content generation |
|
- Template-based README structure |
|
- Interactive markdown preview |
|
- Section-by-section copying |
|
- Bulk markdown export |
|
- Live preview of generated content |
|
|
|
## 2. Technical Stack |
|
|
|
### 2.1 Core Technologies |
|
- Frontend Framework: Streamlit |
|
- AI Model: LLaMA/BLOOM (Open Source LLM) |
|
- Markdown Processing: Python-markdown |
|
- Version Control: Git |
|
|
|
### 2.2 Required Dependencies |
|
```requirements.txt |
|
streamlit>=1.24.0 |
|
python-markdown>=3.4.0 |
|
requests>=2.28.0 |
|
python-dotenv>=0.19.0 |
|
transformers>=4.30.0 |
|
torch>=2.0.0 |
|
``` |
|
|
|
## 3. Project Structure |
|
``` |
|
readme-profile-generator/ |
|
βββ app.py # Main Streamlit application |
|
βββ src/ |
|
β βββ ai/ # AI interaction modules |
|
β βββ components/ # UI components |
|
β βββ templates/ # README templates |
|
β βββ utils/ # Helper functions |
|
βββ tests/ # Test files |
|
βββ .gitignore |
|
βββ requirements.txt |
|
βββ README.md |
|
``` |
|
|
|
## 4. Development Phases |
|
|
|
### Phase 1: MVP (Basic Foundation) |
|
**Objective**: Create basic working prototype |
|
|
|
**Features**: |
|
1. Single-page Streamlit interface |
|
2. Basic user input form |
|
3. Simple markdown preview |
|
4. Copy button for full content |
|
|
|
**Testing Criteria**: |
|
- UI renders correctly |
|
- Form captures all basic information |
|
- Preview displays formatted markdown |
|
- Copy function works correctly |
|
|
|
### Phase 2: AI Integration |
|
**Objective**: Implement AI-powered content generation |
|
|
|
**Features**: |
|
1. AI model integration |
|
2. Basic prompt engineering |
|
3. Content suggestion system |
|
4. Error handling for AI responses |
|
|
|
**Testing Criteria**: |
|
- AI responds within 5 seconds |
|
- Generated content is relevant |
|
- Error messages are clear |
|
- Content format is valid markdown |
|
|
|
### Phase 3: Template System |
|
**Objective**: Add template selection and customization |
|
|
|
**Features**: |
|
1. Multiple template options |
|
2. Template preview |
|
3. Section customization |
|
4. Template switching |
|
|
|
**Testing Criteria**: |
|
- All templates load correctly |
|
- Preview updates instantly |
|
- Customizations persist |
|
- Templates maintain formatting |
|
|
|
### Phase 4: Advanced Features |
|
**Objective**: Implement section management and advanced copying |
|
|
|
**Features**: |
|
1. Section-by-section editing |
|
2. Individual section copying |
|
3. Bulk export options |
|
4. Session management |
|
|
|
**Testing Criteria**: |
|
- Sections can be individually modified |
|
- Copy functions work for all sections |
|
- Export includes all content |
|
- Sessions persist correctly |
|
|
|
## 5. Coding Standards |
|
|
|
### 5.1 Python Code Style |
|
- Follow PEP 8 guidelines |
|
- Use type hints |
|
- Maximum line length: 88 characters |
|
- Use descriptive variable names |
|
|
|
### 5.2 File Organization |
|
- One class per file |
|
- Group related functionality in modules |
|
- Keep files under 500 lines |
|
- Use appropriate file naming conventions |
|
|
|
### 5.3 Comments and Documentation |
|
- Each function must have docstrings |
|
- Complex logic requires inline comments |
|
- Update README.md with new features |
|
- Document all configuration options |
|
|
|
## 6. Testing Guidelines |
|
|
|
### 6.1 Testing Levels |
|
1. Unit Testing |
|
- Test individual functions |
|
- Test UI components |
|
- Test markdown generation |
|
|
|
2. Integration Testing |
|
- Test AI integration |
|
- Test template system |
|
- Test data flow |
|
|
|
3. User Acceptance Testing |
|
- Test full user workflows |
|
- Test edge cases |
|
- Test error scenarios |
|
|
|
### 6.2 Test Cases Structure |
|
```python |
|
def test_feature(): |
|
# Setup |
|
# Action |
|
# Assert |
|
# Cleanup |
|
``` |
|
|
|
### 6.3 Testing Checklist |
|
- [ ] All new functions have unit tests |
|
- [ ] Integration tests pass |
|
- [ ] UI renders correctly |
|
- [ ] Error handling works |
|
- [ ] Performance meets requirements |
|
|
|
## 7. Deployment Guidelines |
|
|
|
### 7.1 Pre-deployment Checklist |
|
- [ ] All tests pass |
|
- [ ] Dependencies are updated |
|
- [ ] Environment variables are set |
|
- [ ] Documentation is updated |
|
|
|
### 7.2 Deployment Process |
|
1. Update requirements.txt |
|
2. Run full test suite |
|
3. Update Space secrets if needed |
|
4. Deploy to Hugging Face Space |
|
5. Verify deployment |
|
|
|
## 8. Version Control |
|
|
|
### 8.1 Branch Strategy |
|
- main: Production code |
|
- develop: Development branch |
|
- feature/*: New features |
|
- bugfix/*: Bug fixes |
|
|
|
### 8.2 Commit Guidelines |
|
- Use descriptive commit messages |
|
- Reference issue numbers |
|
- Keep commits focused |
|
- Follow conventional commits format |
|
|
|
## 9. Performance Requirements |
|
|
|
### 9.1 Response Times |
|
- Page load: < 3 seconds |
|
- AI response: < 5 seconds |
|
- Preview update: < 1 second |
|
- Copy operation: < 0.5 seconds |
|
|
|
### 9.2 Resource Usage |
|
- Memory usage < 512MB |
|
- CPU usage < 70% |
|
- Storage usage < 1GB |
|
|
|
## 10. Error Handling |
|
|
|
### 10.1 User Errors |
|
- Display clear error messages |
|
- Provide recovery suggestions |
|
- Maintain data integrity |
|
- Log user errors |
|
|
|
### 10.2 System Errors |
|
- Implement graceful degradation |
|
- Log detailed error information |
|
- Notify admin of critical errors |
|
- Provide fallback options |
|
|
|
## 11. Security Guidelines |
|
|
|
### 11.1 User Data |
|
- No sensitive data storage |
|
- Clear data usage policies |
|
- Implement rate limiting |
|
- Sanitize user inputs |
|
|
|
### 11.2 API Security |
|
- Use environment variables |
|
- Implement request validation |
|
- Monitor API usage |
|
- Handle token expiration |
|
|
|
## 12. Maintenance |
|
|
|
### 12.1 Regular Tasks |
|
- Update dependencies monthly |
|
- Review error logs weekly |
|
- Backup configurations |
|
- Monitor performance |
|
|
|
### 12.2 Documentation |
|
- Keep README updated |
|
- Document API changes |
|
- Update user guides |
|
- Maintain changelog |
|
|
|
## 13. Success Criteria |
|
|
|
### 13.1 Functional Requirements |
|
- All features work as specified |
|
- No critical bugs |
|
- Meets performance requirements |
|
- Passes all test cases |
|
|
|
### 13.2 User Experience |
|
- Intuitive interface |
|
- Clear feedback |
|
- Responsive design |
|
- Helpful error messages |
|
|
|
--- |
|
|
|
**Note**: This document should be treated as a living document and updated as the project evolves. Each phase should be completed and thoroughly tested before moving to the next phase. |