Before You Begin
Sign the Contributor License Agreement
Contributions to this project must be accompanied by a Contributor License Agreement (CLA). You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project. If you or your current employer have already signed the Google CLA (even if it was for a different project), you probably don’t need to do it again.Sign the CLA
View your current agreements or sign a new one
Review Community Guidelines
This project follows Google’s Open Source Community Guidelines. We expect all contributors to:- Be respectful and constructive
- Welcome newcomers
- Focus on what’s best for the community
- Show empathy and kindness
Contribution Process
Code Reviews
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose.GitHub Pull Requests
Learn more about using pull requests
Development Workflow
- Fork the repository: Create your own fork of the code
- Create a branch: Use a descriptive branch name (e.g.,
your-name/feature-something) - Make changes: Implement your feature or fix
- Test thoroughly: Ensure all tests pass
- Format code: Run formatters before committing
- Submit PR: Include clear description and link related issues
Development Setup
If you want to set up all runtime environments at once (js/go/py), you can run the
bin/setup script. However, this script may affect your existing project environment setup.Prerequisites
Before contributing to any language runtime, complete these steps:- Install Node.js 20 or later using nvm
-
Install the Genkit CLI globally:
JavaScript/TypeScript Development
Install Dependencies
Enable pnpm and install dependencies:Build the Project
Build Specific Packages
Reduce build scope for faster iteration:Package for Distribution
Create distribution tarballs:dist folder and genkit-dist.zip with all packages.
Link the CLI
Link the Genkit CLI for testing:Run Test Apps
Test apps are injs/testapps. Example:
Run Evaluations
Example using thepdfQA flow:
- Click indexPdf flow in the left nav
- Input PDF path:
"./docs/cat-handbook.pdf" - Run evaluation:
- View results in Evaluations tab
Document Your Changes
If contributing to the core Genkit JS SDK (under/js), ensure all exported members have valid JSDoc.
Build and view API reference locally:
Before Submitting
Always run before creating a PR:Go Development
Install Go
Install Go 1.24 or later following the official installation guide.Configure AI Model Access
Most samples use Google’s Gemini model. Generate an API key at Google AI Studio. Set the environment variable:Run a Sample Application
Run Tests
Python Development
Install Python Dependencies
Python samples useuv for dependency management:
Run Samples
Each Python sample includes arun.sh script:
Python Code Standards
Follow the standards inpy/GEMINI.md:
- Use type hints for all function signatures
- Follow PEP 8 conventions
- Use Pydantic models for structured data
- Import statements at top of file
- Document public APIs with docstrings
Testing
Run tests for Python packages:Code Standards
General Guidelines
- Write clear, readable code: Prioritize clarity over cleverness
- Add tests: Include unit tests for new features
- Update docs: Document new features and API changes
- Follow conventions: Match the existing code style
- Keep commits atomic: One logical change per commit
Language-Specific Standards
JavaScript/TypeScript
JavaScript/TypeScript
- Use TypeScript for type safety
- Follow existing ESLint configuration
- Use async/await for asynchronous code
- Add JSDoc comments for exported APIs
- Prefer functional patterns where appropriate
Go
Go
- Follow standard Go formatting (gofmt)
- Use meaningful variable and function names
- Add comments for exported functions
- Handle errors explicitly
- Use context for cancelation and timeouts
Python
Python
- Follow PEP 8 style guide
- Use type hints (PEP 484)
- Use Pydantic for data validation
- Add docstrings for public APIs
- Use async/await for asynchronous code
Testing Requirements
- Unit tests: Add tests for new functionality
- Integration tests: Test interactions between components
- Edge cases: Test boundary conditions and error handling
- Regression tests: Add tests for bug fixes
Documentation Requirements
- Code comments: Explain complex logic
- API documentation: Document public APIs (JSDoc, GoDoc, docstrings)
- README updates: Update READMEs for new samples or features
- Changelog entries: Add entries for user-facing changes
Pull Request Process
Creating a Pull Request
- Branch naming: Use format
your-name/feature-description - Clear title: Describe what the PR does
- Detailed description: Explain the what, why, and how
- Link issues: Reference related issues (e.g., “Fixes #123”)
- Screenshots: Include for UI changes
- Breaking changes: Clearly mark and explain
PR Description Template
Review Process
- Automated checks: CI must pass
- Code review: At least one maintainer approval required
- Address feedback: Make requested changes
- Merge: Maintainers will merge when ready
Contributing Documentation
Documentation improvements are always welcome!Documentation Structure
- Main docs: genkit-ai/docsite
- API reference: Generated from code (JSDoc, GoDoc, docstrings)
- Samples: Include README.md in each sample directory
Documentation Guidelines
- Use clear, concise language
- Include code examples
- Test all code snippets
- Use proper Markdown formatting
- Add images/diagrams for complex concepts
Documentation Contributions
Contribute to Genkit documentation
Contributing Samples
Sample Structure
Follow these guidelines for new samples: JavaScript:Sample Guidelines
- Focus on one concept: Demonstrate a specific feature or pattern
- Complete and runnable: Include all necessary setup
- Well-documented: Explain what it does and how to run it
- Use best practices: Show recommended patterns
- Include comments: Explain key parts of the code
Sample Contributions
Contribute community samples
Getting Help
Need help with your contribution?Discord
Ask questions in real-time
GitHub Discussions
Start a discussion
Documentation
Read the docs
Examples
Browse sample code
Thank You!
Thank you for contributing to Genkit! Your contributions help make AI development more accessible to developers worldwide.Questions about contributing? Ask on Discord or GitHub Discussions.