|
| 1 | +# Contributing to CompAi |
| 2 | + |
| 3 | +Thank you for your interest in contributing to CompAi! This document provides guidelines and best practices for contributing. |
| 4 | + |
| 5 | +## 🚀 Getting Started |
| 6 | + |
| 7 | +1. Fork the repository |
| 8 | +2. Clone your fork: `git clone https://github.com/your-username/compai.git` |
| 9 | +3. Create a branch: `git checkout -b feature/your-feature-name` |
| 10 | +4. Make your changes |
| 11 | +5. Test thoroughly |
| 12 | +6. Commit with a clear message (see guidelines below) |
| 13 | +7. Push to your fork: `git push origin feature/your-feature-name` |
| 14 | +8. Open a Pull Request |
| 15 | + |
| 16 | +## 📝 Commit Message Guidelines |
| 17 | + |
| 18 | +We follow [Conventional Commits](https://www.conventionalcommits.org/) specification: |
| 19 | + |
| 20 | +### Format |
| 21 | +``` |
| 22 | +<type>(<scope>): <subject> |
| 23 | +
|
| 24 | +<body> |
| 25 | +
|
| 26 | +<footer> |
| 27 | +``` |
| 28 | + |
| 29 | +### Types |
| 30 | +- **feat**: A new feature |
| 31 | +- **fix**: A bug fix |
| 32 | +- **docs**: Documentation only changes |
| 33 | +- **style**: Changes that don't affect code meaning (formatting, missing semicolons, etc.) |
| 34 | +- **refactor**: Code change that neither fixes a bug nor adds a feature |
| 35 | +- **perf**: A code change that improves performance |
| 36 | +- **test**: Adding missing tests or correcting existing tests |
| 37 | +- **chore**: Changes to build process or auxiliary tools |
| 38 | + |
| 39 | +### Examples |
| 40 | + |
| 41 | +**Good:** |
| 42 | +``` |
| 43 | +feat: add support for Vue.js component generation |
| 44 | +
|
| 45 | +- Add Vue.js to framework options |
| 46 | +- Update AI prompt for Vue syntax |
| 47 | +- Add Vue preview support in PreviewModal |
| 48 | +``` |
| 49 | + |
| 50 | +``` |
| 51 | +fix: resolve JSX compilation error in preview modal |
| 52 | +
|
| 53 | +The Babel transform was failing for arrow function components. |
| 54 | +Now handles both function declarations and arrow functions. |
| 55 | +``` |
| 56 | + |
| 57 | +``` |
| 58 | +docs: update installation instructions |
| 59 | +
|
| 60 | +Add Node.js version requirement and clarify API key setup. |
| 61 | +``` |
| 62 | + |
| 63 | +**Bad:** |
| 64 | +``` |
| 65 | +update code |
| 66 | +``` |
| 67 | + |
| 68 | +``` |
| 69 | +fix bug |
| 70 | +``` |
| 71 | + |
| 72 | +``` |
| 73 | +changes |
| 74 | +``` |
| 75 | + |
| 76 | +### Scope (Optional) |
| 77 | +- `components`: Changes to React components |
| 78 | +- `services`: Changes to API/services |
| 79 | +- `utils`: Changes to utility functions |
| 80 | +- `styles`: Changes to CSS/styling |
| 81 | +- `config`: Changes to configuration files |
| 82 | + |
| 83 | +## 🎨 Code Style |
| 84 | + |
| 85 | +- Use meaningful variable and function names |
| 86 | +- Add comments for complex logic |
| 87 | +- Follow existing code patterns |
| 88 | +- Keep functions small and focused |
| 89 | +- Use ES6+ features where appropriate |
| 90 | + |
| 91 | +## ✅ Pull Request Checklist |
| 92 | + |
| 93 | +- [ ] Code follows the project's style guidelines |
| 94 | +- [ ] Self-review completed |
| 95 | +- [ ] Comments added for complex code |
| 96 | +- [ ] Documentation updated (if needed) |
| 97 | +- [ ] No console.logs or debug code |
| 98 | +- [ ] Tests pass (if applicable) |
| 99 | +- [ ] Changes tested in browser |
| 100 | +- [ ] Commit messages follow guidelines |
| 101 | + |
| 102 | +## 🐛 Reporting Bugs |
| 103 | + |
| 104 | +When reporting bugs, please include: |
| 105 | +- Clear description of the issue |
| 106 | +- Steps to reproduce |
| 107 | +- Expected behavior |
| 108 | +- Actual behavior |
| 109 | +- Browser/OS information |
| 110 | +- Screenshots (if applicable) |
| 111 | + |
| 112 | +## 💡 Suggesting Features |
| 113 | + |
| 114 | +Feature suggestions are welcome! Please include: |
| 115 | +- Clear description of the feature |
| 116 | +- Use case/benefit |
| 117 | +- Potential implementation approach (if you have ideas) |
| 118 | + |
| 119 | +## 📚 Resources |
| 120 | + |
| 121 | +- [React Documentation](https://react.dev/) |
| 122 | +- [TailwindCSS Documentation](https://tailwindcss.com/docs) |
| 123 | +- [Conventional Commits](https://www.conventionalcommits.org/) |
| 124 | +- [GitHub Flow](https://guides.github.com/introduction/flow/) |
| 125 | + |
| 126 | +Thank you for contributing! 🙌 |
| 127 | + |
0 commit comments