First off, thank you for considering contributing to LazyGravity! It's people like you that make LazyGravity such a great tool.
- Node.js: Version 18.x or higher
- npm: Version 8.x or higher
- Antigravity: Installed and running on your local machine
git clone https://github.com/tokyoweb3/LazyGravity.git
cd LazyGravitynpm install- Copy the example environment file:
cp .env.example .env
- Edit
.envand fill in your Discord bot token, guild ID, and authorized user IDs.
- Development mode (with auto-reload):
npm run dev
- From source:
npm run start
- Build and run:
npm run build npm run start:built
src/
index.ts # Entry point
bin/ # CLI commands (setup, doctor, start, open)
bot/ # Discord.js client config, event listeners
commands/ # Slash commands and message parsing
handlers/ # Message and reaction handlers
services/ # Antigravity integration, task queue management
utils/ # Security, logger, config utilities
database/ # SQLite local DB management
tests/
docs/
- We use TypeScript for all source code. Ensure your code passes type checking:
npm run build # This triggers tsc - Use descriptive names for variables, functions, and classes.
- Prefer
interfaceovertypefor object definitions where possible.
- Prefer
constoverlet. - Avoid mutating objects and arrays directly; use the spread operator (
...) or other non-mutating methods. - For state management (e.g., in services), use patterns that ensure predictability and easy debugging.
- Write code comments in English.
- Only add comments where the logic isn't self-evident.
We follow the Conventional Commits specification. Each commit message should follow this format:
<type>: <description>
feat: A new featurefix: A bug fixrefactor: A code change that neither fixes a bug nor adds a featuredocs: Documentation only changestest: Adding missing tests or correcting existing testschore: Changes to the build process or auxiliary tools and librariesperf: A code change that improves performanceci: Changes to our CI configuration files and scripts
feat: add support for custom message templates
fix: prevent duplicate CDP connections on rapid reconnect
docs: update README with new CLI commands
refactor: extract color constants from doctor command
- Fork the repository and create a feature branch from
main. - Self-Review: Before submitting, ensure your code follows the style guidelines and passes tests.
- Write tests for new functionality (aim for 80%+ coverage).
- Run the test suite and build before submitting:
npm test npm run build - Template: Use the provided Pull Request template.
- Atomic Commits: Keep your commits focused on a single change.
- Review: At least one maintainer will review your PR. Address any feedback promptly.
- Merging: Once approved and all checks pass, your code will be merged into the
mainbranch.
Ensure all tests pass before submitting a PR.
npm run test:unitNote: Integration tests may require a configured environment.
npm run test:integrationnpm run test:watchPlease use the provided Issue Templates for bugs and feature requests.
For general questions or ideas, please visit our Discussions page.
By contributing, you agree that your contributions will be licensed under the MIT License.