Contributing
Thank you for your interest in contributing to IntelliPen! This guide will help you get started.
Code of Conduct¶
We are committed to providing a welcoming and inclusive environment. Please:
- Be respectful and considerate
- Welcome newcomers and help them get started
- Focus on constructive feedback
- Respect differing viewpoints and experiences
- Accept responsibility and apologize for mistakes
Getting Started¶
Prerequisites¶
Before contributing, ensure you have:
- Node.js 16+ installed
- npm package manager
- Chrome 138+ for testing
- Git for version control
- Basic knowledge of JavaScript, Chrome Extensions, and AI APIs
Finding Issues to Work On¶
- Check GitHub Issues
- Look for issues labeled:
good first issue: Great for newcomershelp wanted: We need assistancebug: Something isn't workingenhancement: New feature or improvement- Comment on the issue to express interest
- Wait for maintainer approval before starting work
Development Setup¶
1. Fork and Clone¶
# Fork the repository on GitHub, then clone your fork
git clone https://github.com/YOUR_USERNAME/IntelliPen.git
cd IntelliPen
# Add upstream remote
git remote add upstream https://github.com/vietanhdev/IntelliPen.git
2. Install Dependencies¶
3. Install Chrome for Testing (for automated tests)¶
4. Build the Extension¶
# Development build with source maps
npm run dev
# Or use watch mode for automatic rebuilds
npm run build:watch
5. Run Tests¶
# Run all tests with visible browser
npm test
# Run tests in headless mode (faster)
npm run test:headless
See the Testing Guide for more details.
6. Load in Chrome¶
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the
distfolder
Development Workflow¶
1. Create a Branch¶
# Update your fork
git fetch upstream
git checkout main
git merge upstream/main
# Create a feature branch
git checkout -b feature/your-feature-name
2. Make Changes¶
- Write clean, readable code
- Follow existing code style
- Add comments for complex logic
- Update documentation if needed
3. Test Your Changes¶
# Rebuild the extension
npm run build
# Run automated tests
npm test
# Or run in headless mode (faster)
npm run test:headless
# Run specific test suite
npm test -- tests/e2e/editor.test.js
# Reload extension in Chrome
# Go to chrome://extensions/ and click reload
# Test thoroughly:
# - Test the specific feature you changed
# - Test related features
# - Test edge cases
# - Check console for errors
Automated Testing
IntelliPen includes comprehensive end-to-end tests. See the Testing Guide for detailed information about running and writing tests.
4. Commit Changes¶
# Stage your changes
git add .
# Commit with a descriptive message
git commit -m "Add feature: description of what you did"
Commit Message Guidelines: - Use present tense ("Add feature" not "Added feature") - Be descriptive but concise - Reference issue numbers when applicable
5. Push and Create Pull Request¶
Then: 1. Go to your fork on GitHub 2. Click "Compare & pull request" 3. Fill out the PR template 4. Submit the pull request
Coding Standards¶
JavaScript Style¶
// Use ES6+ features
const myFunction = async (param) => {
// Use const/let, not var
const result = await someAsyncOperation();
return result;
};
// Use descriptive names
const userInputText = document.getElementById('input').value;
// Add JSDoc comments for functions
/**
* Checks grammar in the provided text
* @param {string} text - Text to check
* @returns {Promise<Array>} Array of corrections
*/
async function checkGrammar(text) {
// Implementation
}
Best Practices¶
-
Error Handling:
-
Input Validation:
Submitting Changes¶
Pull Request Process¶
-
Run Tests:
-
Update Documentation:
- Update README.md if needed
- Add/update JSDoc comments
- Update relevant docs/ files
-
Add tests for new features
-
Create Pull Request:
- Use descriptive title
- Fill out PR template completely
- Reference related issues
- Add screenshots/videos if UI changes
-
Ensure CI tests pass
-
Code Review:
- Respond to feedback promptly
- Make requested changes
- Push updates to same branch
- Be open to suggestions
Continuous Integration
All pull requests automatically run tests via GitHub Actions. Ensure tests pass before requesting review.
Reporting Issues¶
Before Reporting¶
- Search existing issues
- Check if it's already fixed in main branch
- Verify it's reproducible
- Gather relevant information
Issue Template¶
## Description
Clear description of the issue
## Steps to Reproduce
1. Go to '...'
2. Click on '...'
3. See error
## Expected Behavior
What should happen
## Actual Behavior
What actually happens
## Environment
- Chrome Version: 138.x
- OS: Windows/Mac/Linux
- IntelliPen Version: 1.0.0
## Screenshots
(if applicable)
## Console Errors
(if any)
Community¶
Getting Help¶
- GitHub Discussions: Ask questions, share ideas
- GitHub Issues: Report bugs, request features
- Code Review: Learn from PR feedback
Recognition¶
Contributors will be: - Listed in CONTRIBUTORS.md - Mentioned in release notes - Credited in documentation
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.