Pull Request Naming
Monkeytype uses Conventional Commits for pull request titles and commit messages. Always include your GitHub username in parentheses at the end.Format
- type: The kind of change (see below)
- scope: Optional. The area affected (e.g., quotes, leaderboard, auth)
- description: Brief description of the change
- username: Your GitHub username
Types
Examples
For pull requests with multiple contributors, list all usernames separated by commas.
Code Standards
Formatting and Linting
Monkeytype uses Oxc (Oxfmt and Oxlint) for code formatting and linting.- Oxfmt: Automatic code formatting
- Oxlint: Fast TypeScript/JavaScript linter
TypeScript Guidelines
- Use strict type checking
- Avoid
anytypes when possible - Define interfaces for complex data structures
- Use descriptive variable and function names
- Add comments for complex logic
Code Style
- Follow existing code patterns in the file you’re editing
- Keep functions small and focused
- Use meaningful variable names
- Add JSDoc comments for public APIs
- Avoid deeply nested code
Theme Guidelines
Before submitting a theme, ensure:Requirements
- Your theme is unique and visually distinct from existing themes
- Text color is black, white, or very close to these colors
- Theme is added to the themes configuration file
- The
textColorproperty matches the theme’s main color - Theme is readable with both:
- “Flip test colors” enabled and disabled
- “Colorful mode” enabled and disabled
Testing Your Theme
Test your theme with different settings:- Default mode
- Flip test colors enabled
- Colorful mode enabled
- Both flip test colors and colorful mode enabled
Theme Properties
Each theme must define these color properties:Custom CSS
If your theme requires custom CSS:- Create a CSS file in
frontend/static/themes/ - Add
hasCss: trueto your theme configuration - Keep custom styles minimal and theme-specific
Pull Request
When submitting a theme PR:- Include screenshots showing:
- The theme in normal mode
- The theme with colorful mode
- The theme with flip test colors
- Use the PR naming format:
impr(themes): add [theme_name] (@username) - Describe the inspiration or design concept
Language Guidelines
Requirements
- No expletive or offensive words
- Valid JSON format (no trailing commas)
- Added to both
_listand_groupsfiles - File name matches word count:
language.json= 200 wordslanguage_1k.json= 1,000 wordslanguage_10k.json= 10,000 words
JSON Structure
Field Descriptions
Word Selection
- Use common, everyday words
- Avoid proper nouns unless commonly used
- Include words of varying lengths
- No profanity or offensive content
- Verify spelling accuracy
Pull Request
When submitting a language PR:- Use the format:
impr(languages): add [language] (@username) - Mention if the word list is ordered by frequency
- Note any special characteristics (RTL, ligatures, etc.)
- If applicable, credit the source of the word list
Quote Guidelines
Requirements
- No unlawful, abusive, or obscene content
- Valid JSON format (no trailing commas)
- Not a duplicate of existing quotes
- Correct
lengthproperty (character count) - Correctly incremented
idproperty - Minimum 60 characters in length
JSON Structure
Field Descriptions
Quote Selection
- Choose meaningful or interesting quotes
- Verify attribution accuracy
- Avoid controversial or sensitive content
- Check for duplicates in the existing file
- Ensure proper grammar and punctuation
Non-English Quotes
For quotes not in English:- Include translations in your PR description
- This helps maintainers verify the content
- Explain any cultural context if relevant
Pull Request
When submitting a quote PR:- Use the format:
impr(quotes): add [language] quotes (@username) - For non-English quotes, include translations in the description
- Mention the number of quotes added
- Verify all IDs are sequential
Layout Guidelines
If you want to contribute keyboard layouts:- Check the existing layouts in
frontend/static/layouts/ - Follow the same JSON structure as existing layouts
- Ensure accurate key mappings
- Test thoroughly with the typing test
General Best Practices
Before Submitting
- Test your changes thoroughly
- Run linting and formatting tools
- Verify all tests pass
- Check for console errors
- Update documentation if needed
- Take screenshots for visual changes
- Review your own PR first
Writing Good Descriptions
- Explain what changed and why
- Provide context for the change
- Link to related issues
- Add screenshots or GIFs for UI changes
- List any breaking changes
- Mention testing performed
Responding to Feedback
- Be receptive to suggestions
- Ask questions if feedback is unclear
- Make requested changes promptly
- Thank reviewers for their time
- Update your PR when ready for re-review
Multiple Contributors
If multiple people worked on the PR:- List all contributors in the PR title:
(@user1, @user2, @user3) - Credit specific contributions in the description
- Ensure all contributors are acknowledged
Asset Validation
Before submitting changes to languages, quotes, or themes, run validation:Commit Messages
While pull request titles follow Conventional Commits, individual commit messages should:- Be descriptive and clear
- Start with a lowercase verb (“add”, “fix”, “update”, etc.)
- Keep the first line under 72 characters
- Add more details in the body if needed
Good Commit Messages
Avoid
Documentation
If your change affects user-facing features:- Update relevant documentation
- Add code comments for complex logic
- Update API documentation if applicable
- Consider adding examples
Questions and Support
If you have questions about these guidelines:- Ask in the
#developmentchannel on Discord - Open a discussion on GitHub Discussions
- Contact maintainers on GitHub
Enforcement
These guidelines help maintain code quality and consistency. Pull requests that don’t follow these guidelines may be:- Requested to make changes
- Delayed in review
- Closed if changes aren’t made