Contributing to Hybrid
Thanks for your interest in contributing to Hybrid! This guide will help you get up and running quickly.
Quick Start
Prerequisites
- Node.js 22 (required)
- pnpm (package manager)
- Git
Setup
# 1. Fork and clone the repo
git clone https://github.com/YOUR_USERNAME/hybrid.git
cd hybrid
# 2. Install dependencies
pnpm install
# 3. Build all packages
pnpm build
# 4. Run tests to make sure everything works
pnpm testTesting Your Setup
Set up an example agent to test your changes:
cd examples/basic
# Create .env file
cat > .env << EOF
OPENROUTER_API_KEY=your_key_here
XMTP_ENV=dev
EOF
# Generate XMTP keys
pnpm hybrid keys --write
# Start the agent
pnpm devTest by sending a message to your agent at xmtp.chat.
Making Changes
Common Workflows
Working on core package:# Make your changes in packages/core/src/
cd packages/core
# Build and watch for changes
pnpm build:watch# Make your changes in packages/cli/src/
cd packages/cli
# Test CLI commands
pnpm build
cd ../../examples/basic
pnpm hybrid dev# Make your changes in packages/xmtp/src/
cd packages/xmtp
# Build and test
pnpm build:watchProject Structure
hybrid/
├── packages/
│ ├── core/ # Main framework (published as "hybrid")
│ ├── cli/ # CLI tool (bin: "hybrid")
│ ├── xmtp/ # XMTP integration (@hybrd/xmtp)
│ └── utils/ # Utilities (@hybrd/utils)
├── examples/
│ └── basic/ # Example agent for testing
└── site/ # DocumentationCode Guidelines
Style
We use Biome for formatting and linting. Just run:
pnpm lint:fixKey Patterns
- ✅ Use
interfacesovertypesfor object shapes - ❌ Never use
any- useunknowninstead - ❌ No
enums- use const objects withas const - Files/folders:
kebab-case - Classes/interfaces:
PascalCase - Functions/variables:
camelCase
Testing
Add tests for new features:
# Run all tests
pnpm test
# Run tests for a specific package
cd packages/core
pnpm testWe use Vitest. Put tests next to your code or in a test/ directory.
Submitting Your Changes
Before You Submit
# 1. Format and lint
pnpm lint:fix
# 2. Check types
pnpm typecheck
# 3. Run tests
pnpm test
# 4. Build everything
pnpm build
# 5. Test manually
cd examples/basic
pnpm devCreating a Pull Request
-
Branch naming:
feature/your-feature- New featuresfix/the-bug- Bug fixesdocs/what-changed- Documentation
-
Commit format:
feat(core): add new behavior system fix(xmtp): resolve connection timeout docs(readme): update quickstart guide -
PR description:
- What does this change?
- Why is it needed?
- How did you test it?
- Any breaking changes?
What Happens Next
- CI runs tests and type checks
- A maintainer will review your PR
- We might ask for changes
- Once approved, we'll merge it!
Reporting Issues
Found a bug? Open an issue with:
- What you expected to happen
- What actually happened
- Steps to reproduce
- Your environment (OS, Node version, Hybrid version)
Have an idea? Start a discussion first!
Getting Help
Need help contributing?
- Check the documentation
- Search existing issues
- Ask in GitHub Discussions
- Join our Discord (link in README)
Development Tips
Useful Commands
pnpm build # Build all packages
pnpm build:watch # Build in watch mode
pnpm build:packages # Build only packages (skip examples)
pnpm test # Run all tests
pnpm lint # Check code style
pnpm lint:fix # Fix code style
pnpm typecheck # Check TypeScript types
pnpm clean # Clean build artifacts
pnpm nuke # Nuclear option - delete all node_modulesWorking with the Monorepo
The project uses pnpm workspaces and Turbo. Changes to packages automatically rebuild dependent packages when using build:watch.
Testing Changes Locally
Link your local version to test in other projects:
cd packages/core
pnpm link --global
cd ~/your-project
pnpm link --global hybridEnvironment Variables
For testing, create .env in examples/basic/:
OPENROUTER_API_KEY=your_key
XMTP_WALLET_KEY=0x...
XMTP_DB_ENCRYPTION_KEY=...
XMTP_ENV=dev
PORT=8454Generate XMTP keys with: pnpm hybrid keys --write
Code of Conduct
Be respectful, inclusive, and constructive. We're building this together!
- Use welcoming and inclusive language
- Be respectful of differing viewpoints
- Accept constructive criticism gracefully
- Focus on what's best for the community
Recognition
Contributors are recognized in:
- Release notes
- CONTRIBUTORS.md
- Documentation credits
- Social media shoutouts
Next Steps
- Framework Architecture - Deep dive into core concepts
- Using Hybrid - Learn how to build agents
- Tools Documentation - Available tools and how to add new ones
Ready to contribute? Fork the repo and start hacking! 🚀