Thank you for your interest in contributing to Pika! This guide provides everything you need to know to start contributing to the project.
Code of Conduct
Section titled “Code of Conduct”This project follows the Pika Framework Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
Getting Started
Section titled “Getting Started”Prerequisites
Section titled “Prerequisites”- Node.js 22.0.0 or higher
- pnpm (recommended) or npm
- Git
- Basic knowledge of TypeScript
- AWS account (for testing deployment features)
First-time Setup
Section titled “First-time Setup”Fork the repository
Fork the repo on GitHub, then clone your fork:
Terminal window git clone https://github.com/YOUR_USERNAME/pika.gitcd pikaInstall dependencies
Terminal window pnpm installBuild the project
Terminal window pnpm buildVerify installation
Terminal window # Run testspnpm test# Check typespnpm run check-types
Development Workflow
Section titled “Development Workflow”Feature Development
Section titled “Feature Development”Create a feature branch
Terminal window git checkout -b feature/your-feature-nameMake your changes
- Write code following our style guide
- Add tests for new functionality
- Update documentation as needed
Test your changes
Terminal window pnpm testpnpm lintpnpm buildCommit your changes
Use Conventional Commits format:
Terminal window git commit -m "feat: add new feature"git commit -m "fix: resolve issue with X"git commit -m "docs: update README"
Bug Fixes
Section titled “Bug Fixes”Create a bugfix branch
Terminal window git checkout -b fix/bug-descriptionWrite a failing test (if applicable)
Fix the bug
Ensure tests pass
Submit a pull request
Project Structure
Section titled “Project Structure”Understanding the monorepo structure:
pika/├── apps/│ ├── pika-chat/ # Main chat application│ └── pika-docs/ # Documentation site├── packages/│ ├── pika-cli/ # CLI tool│ ├── pika-serverless/ # Serverless plugin│ ├── pika-ux/ # UI component library│ └── shared/ # Shared utilities and types└── services/ ├── pika/ # Core service infrastructure └── samples/ # Example implementationsKey Areas for Contribution
Section titled “Key Areas for Contribution”Core Framework (services/pika/)
- Agent execution logic
- Session management
- AWS infrastructure
CLI Tool (packages/pika-cli/)
- Project scaffolding
- Sync system
- Command implementations
UI Components (packages/pika-ux/)
- Reusable components
- Chat interface
- Admin panels
Documentation (apps/pika-docs/)
- Guides and tutorials
- API reference
- Examples
Code Style
Section titled “Code Style”We use ESLint and Prettier for consistent code formatting.
Style Guidelines
Section titled “Style Guidelines”- Use TypeScript for all code
- Prefer
constoverletwhen possible - Use meaningful variable and function names
- Add JSDoc comments for public APIs
- Keep functions small and focused
- Use async/await over Promises
- Use proper TypeScript imports/exports (ESM style)
Example Code Style
Section titled “Example Code Style”/** * Creates a new Pika project with the specified configuration. * * @param projectName - Name of the project to create * @param options - Configuration options for the project * @returns Promise that resolves when the project is created */export async function createProject( projectName: string, options: CreateProjectOptions): Promise<void> { const spinner = logger.startSpinner('Creating project...');
try { await validateProjectName(projectName); await setupProjectStructure(projectName, options); await installDependencies(projectName);
logger.stopSpinner(true, 'Project created successfully'); } catch (error) { logger.stopSpinner(false, 'Failed to create project'); throw error; }}Linting
Section titled “Linting”# Check code stylepnpm lint
# Fix issues automaticallypnpm lint:fixTesting
Section titled “Testing”Test Categories
Section titled “Test Categories”- Unit Tests - Test individual functions and classes
- Integration Tests - Test command flows and interactions
- E2E Tests - Test the complete experience
Running Tests
Section titled “Running Tests”# Run all testspnpm test
# Run specific test filepnpm test logger.test.ts
# Run tests with coveragepnpm test:coverage
# Watch mode for developmentpnpm test:watchTest Guidelines
Section titled “Test Guidelines”- Write tests for all new functionality
- Maintain or improve code coverage
- Use descriptive test names
- Mock external dependencies
- Test both success and error cases
Commit Guidelines
Section titled “Commit Guidelines”We follow Conventional Commits for consistent commit messages.
Commit Format
Section titled “Commit Format”<type>[optional scope]: <description>
[optional body]
[optional footer(s)]feat- New featurefix- Bug fixdocs- Documentation changesstyle- Code style changes (formatting, etc.)refactor- Code refactoringtest- Adding or modifying testschore- Maintenance tasksbreaking- Breaking changes
Examples
Section titled “Examples”feat: add component validation commandfix: resolve sync conflict with custom authdocs: update README with new examplestest: add integration tests for create-appchore: update dependenciesbreaking: refactor tag system to use usageModePull Request Process
Section titled “Pull Request Process”Before Submitting
Section titled “Before Submitting”Ensure all tests pass
Terminal window pnpm testpnpm lintpnpm buildUpdate documentation if needed
Test manually with various scenarios
Rebase on latest main
Terminal window git fetch origingit rebase origin/main
PR Description Template
Section titled “PR Description Template”When creating a PR, use this template:
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix (non-breaking change)- [ ] New feature (non-breaking change)- [ ] Breaking change (fix or feature causing existing functionality to change)- [ ] Documentation update
## Testing
- [ ] Tests pass locally- [ ] Added tests for new functionality- [ ] Manual testing completed
## Checklist
- [ ] Code follows style guidelines- [ ] Self-review completed- [ ] Documentation updated- [ ] No new warnings or errorsReview Process
Section titled “Review Process”- Automated checks must pass
- Code review by maintainers
- Manual testing may be required
- Address feedback and update PR
- Final approval and merge
Areas for Contribution
Section titled “Areas for Contribution”We welcome contributions in these areas:
High Priority
Section titled “High Priority”- New Authentication Providers - Add support for more auth systems
- Template Improvements - Enhance existing templates or add new ones
- Documentation - Improve guides and examples
- Testing - Increase test coverage
- Performance - Optimize framework performance
Medium Priority
Section titled “Medium Priority”- Error Handling - Improve error messages and recovery
- Logging - Enhanced debug and logging capabilities
- Configuration - More configuration options
- Migration Scripts - Tools for framework updates
Ideas Welcome
Section titled “Ideas Welcome”- Plugin System - Allow third-party extensions
- GUI Interface - Web-based project setup
- Docker Integration - Container-based development
- CI/CD Templates - Deployment automation
Community Guidelines
Section titled “Community Guidelines”Getting Help
Section titled “Getting Help”- Check existing documentation
- Search existing issues
- Ask questions in discussions
- Join our Community
Reporting Issues
Section titled “Reporting Issues”When reporting bugs:
- Use the issue template
- Provide minimal reproduction steps
- Include environment information
- Add relevant logs or screenshots
Suggesting Features
Section titled “Suggesting Features”When suggesting new features:
- Check if it already exists
- Describe the use case
- Explain the expected behavior
- Consider implementation complexity
Recognition
Section titled “Recognition”Contributors will be recognized in:
- README acknowledgments
- Release notes
- GitHub contributors page
- Community highlights
Need Help?
Section titled “Need Help?”- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Community: Community Page
Thank you for contributing to Pika! 🐦