We welcome contributions from everyone! This guide will help you understand our development workflow and standards.
Code of Conduct
Our Pledge
We are committed to providing a welcoming and inclusive environment for everyone. All participants are expected to uphold these standards.Our Standards
We expect all participants to:- Be respectful and considerate in all interactions
- Welcome newcomers and help them learn the codebase
- Accept constructive feedback gracefully
- Focus on what is best for the community and project
Enforcement
Instances of unacceptable behavior may be reported to: [email protected] All complaints will be reviewed and investigated promptly and fairly.This Code of Conduct is adapted from the Contributor Covenant, version 2.1.
Getting Started
Before you begin contributing:Branch Naming Conventions
Use clear, descriptive branch names that indicate the type and purpose of changes:| Prefix | Purpose | Example |
|---|---|---|
feature/ | New features | feature/add-new-tool |
fix/ | Bug fixes | fix/resolve-auth-issue |
refactor/ | Code refactoring | refactor/simplify-agent-loop |
docs/ | Documentation updates | docs/update-readme |
test/ | Test additions or fixes | test/add-session-tests |
chore/ | Maintenance tasks | chore/update-dependencies |
Code Style Guidelines
TypeScript Standards
Code Organization
- Follow existing patterns in the codebase
- Use meaningful variable and function names
- Add comments for complex logic that isn’t self-explanatory
- Keep functions focused on a single responsibility
- Prefer composition over inheritance
Key Areas of the Codebase
| Area | Location | Purpose |
|---|---|---|
| Agent Logic | packages/shared/src/agent/ | Core agent implementation and permissions |
| Authentication | packages/shared/src/auth/ | OAuth, tokens, credential management |
| MCP Integration | packages/shared/src/mcp/ | Model Context Protocol servers |
| UI Components | packages/ui/src/ | Reusable React components |
| Electron App | apps/electron/ | Desktop application shell |
| Session Management | packages/shared/src/sessions/ | Session persistence and state |
| Sources | packages/shared/src/sources/ | MCP, API, and local data sources |
Commit Conventions
Use clear, descriptive commit messages that explain what changed and why:Commit Message Format
feat- New featurefix- Bug fixdocs- Documentation changesrefactor- Code refactoring (no functional changes)test- Adding or updating testschore- Maintenance tasksperf- Performance improvements
Pull Request Process
Testing Guidelines
Manual Testing
For UI changes, test:- Core functionality works as expected
- Edge cases are handled properly
- Different screen sizes render correctly
- Keyboard shortcuts still work
- Performance is not degraded
Automated Testing
Run the test suite:Documentation
When adding new features:- Update relevant documentation in the repository
- Add JSDoc comments for public APIs
- Include examples in code comments where helpful
- Update README.md if necessary
Questions and Support
Getting Help
- Open an issue for bugs or feature requests
- Start a discussion for questions or ideas
- Check existing issues before creating new ones
Issue Template
License
By contributing, you agree that your contributions will be licensed under the Apache License 2.0. This project uses:- Claude Agent SDK - subject to Anthropic’s Commercial Terms
- Various open-source dependencies - see
package.jsonfor full list
Recognition
All contributors will be recognized in the project. Significant contributions may be highlighted in release notes.Thank you for contributing to Craft Agents! Your efforts help make agent-native software more accessible to everyone.
Next Steps
Setup
Set up your development environment
Building
Learn how to build for production