Thank you for your interest in contributing to Vibe Coder 3D! We welcome contributions from the community and are excited to have you here.
- Code of Conduct
- Getting Started
- Development Setup
- Project Structure
- Development Workflow
- Coding Guidelines
- Testing
- Documentation
- Submitting Changes
- Reporting Bugs
- Requesting Features
- WORKFLOW.md - Detailed Git Flow branching model and PR process
- CODE_OF_CONDUCT.md - Community guidelines
- SECURITY.md - Security policy and vulnerability reporting
This project adheres to a Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/vibe-coder-3d.git cd vibe-coder-3d - Add the upstream repository:
git remote add upstream https://github.com/ORIGINAL-OWNER/vibe-coder-3d.git
- Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name
- Node.js >= 20.0.0
- Yarn 1.22+
- Rust 1.75+ (for native engine development)
- Git for version control
# Install dependencies
yarn install
# Start development server
yarn dev
# Run tests
yarn test
# Type checking
yarn typecheck
# Linting
yarn lintCopy .env.example to .env and configure as needed:
cp .env.example .envSee .env.example for all available configuration options.
vibe-coder-3d/
├── src/
│ ├── core/ # Core engine (ECS, systems, components)
│ ├── editor/ # Editor UI and tools
│ └── game/ # Game-specific code (scenes, scripts, assets)
├── rust/
│ ├── engine/ # Rust native engine
│ └── game/ # Rust game runtime
├── docs/ # Documentation
├── scripts/ # Build and utility scripts
└── tests/ # Test files
src/core/: Pure engine logic, no UI dependenciessrc/editor/: Editor UI components and toolssrc/game/: Game-specific implementationsrust/engine/: Native Rust engine implementationdocs/: Comprehensive documentation (50+ files)
📚 For detailed Git Flow workflow documentation, see WORKFLOW.md
This section provides a quick overview. For comprehensive guides on feature development, releases, hotfixes, and common scenarios, refer to the WORKFLOW.md document.
git fetch upstream
git checkout master
git merge upstream/masterUse descriptive branch names:
git checkout -b feature/add-particle-system
git checkout -b fix/physics-collision-bug
git checkout -b docs/update-scripting-guide- Write clean, readable code
- Follow the coding guidelines (see below)
- Add tests for new functionality
- Update documentation as needed
# Run all tests
yarn test
# Type checking
yarn typecheck
# Linting
yarn lint
# Run all verification
yarn verify
# For Rust changes
yarn rust:test
cd rust/engine && cargo clippyWe use conventional commits for clear history:
git add .
git commit -m "feat: add particle system component"Commit Message Format:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringperf: Performance improvementstest: Adding or updating testschore: Build process or auxiliary tool changesci: CI/CD changes
Examples:
feat(physics): add particle collision system
fix(editor): resolve camera rotation bug
docs(scripting): update API reference
refactor(ecs): improve component registration
perf(renderer): optimize mesh batching
git push origin feature/your-feature-name- Go to your fork on GitHub
- Click "New Pull Request"
- Select your feature branch
- Fill out the PR template with:
- Clear description of changes
- Related issue numbers
- Screenshots/GIFs for UI changes
- Test results
- Import via TS path aliases (see tsconfig.json):
import { Entity } from '@core/lib/ecs/Entity'; import { EditorPanel } from '@editor/components/Panel';
- Use Yarn only (not npm)
- Use Tailwind for CSS (no inline styles)
- Follow SRP / DRY / KISS principles
- Prefix interfaces with
I:interface IComponent { ... }
- Keep components small (< 200 lines)
- Put logic in hooks, not components
- Named exports only (no default exports)
- Declare components inline:
export const MyComponent: React.FC<IProps> = ({ ... }) => { ... }
- Use React.memo for expensive renders
- No
anytypes - use proper TypeScript types - Use Zod for validation
- Use Zustand for state management
Use structured logging via @core/lib/logger:
import { Logger } from '@core/lib/logger';
const logger = Logger.create('ComponentName');
// Instead of console.log
logger.debug('Debug info', { detail: value });
logger.info('Scene loaded', { entities: count });
logger.warn('Performance warning', { fps: currentFps });
logger.error('Error occurred', { error: err });Never use console.log/warn/error in production code!
- Focus on hook usage
- Prevent unnecessary re-rendering
- Use
useCallbackanduseMemoappropriately - Minimize
useEffectdependencies - Clean up effects properly
- Follow Rust naming conventions
- Use
cargo fmtfor formatting - Run
cargo clippyfor linting - Add documentation comments for public APIs
- Use workspace crates for modularity
- Follow the existing architecture patterns
- Components:
ComponentName.tsx - Hooks:
useHookName.ts - Types:
types.tsorITypeName.ts - Tests:
ComponentName.test.ts - Utils:
utilityName.ts
- One component per file
- Group related files in directories
- Use index files sparingly (no barrel exports)
- Keep file structure flat when possible
All new features should include tests:
import { describe, it, expect } from 'vitest';
import { YourComponent } from './YourComponent';
describe('YourComponent', () => {
it('should render correctly', () => {
// Test implementation
});
it('should handle user interaction', () => {
// Test implementation
});
});# Run all tests
yarn test
# Run tests in watch mode
yarn test:watch
# Run specific test file
yarn test:file path/to/test.ts
# Generate coverage report
yarn test:coverage
# Rust tests
yarn rust:test- Aim for > 80% coverage for new code
- All public APIs must have tests
- Critical paths require integration tests
- Add JSDoc comments for public APIs:
/** * Creates a new entity with the specified components * @param components - Array of component definitions * @returns The created entity ID */ export function createEntity(components: IComponent[]): EntityId { // Implementation }
- Update relevant docs in
docs/directory - Follow existing documentation structure
- Use clear, concise language
- Include code examples where helpful
Update README.md if your changes:
- Add new features
- Change installation process
- Modify available scripts
- Update requirements
-
Ensure all tests pass:
yarn verify
-
Update documentation as needed
-
Verify no linting errors:
yarn lint:fix
-
Test your changes in both TypeScript editor and Rust engine
-
Rebase on latest master:
git fetch upstream git rebase upstream/master
- Fill out the PR template completely
- Link related issues using keywords (Fixes #123, Closes #456)
- Include screenshots/GIFs for visual changes
- Describe testing performed
- List any breaking changes
- Keep PRs focused - one feature/fix per PR
- Respond to review feedback promptly
- Automated checks must pass (CI, linting, tests)
- Code review by maintainer(s)
- Address feedback and make changes
- Final approval and merge
- Check existing issues for duplicates
- Test with latest version
- Verify it's reproducible
Use the bug report template and include:
- Clear, descriptive title
- Steps to reproduce
- Expected vs actual behavior
- Environment (OS, Node version, browser)
- Screenshots/logs if applicable
- Minimal reproduction code
Do not open public issues for security vulnerabilities!
See SECURITY.md for responsible disclosure process.
- Check existing issues and discussions
- Consider if it fits project vision
- Think about implementation approach
Use the feature request template and include:
- Clear description of the feature
- Use case and motivation
- Proposed implementation (if you have ideas)
- Alternative solutions considered
- Willingness to contribute implementation
- Check the documentation
- Search GitHub Issues
- Start a GitHub Discussion
Contributors are recognized in:
- GitHub contributors page
- Release notes for significant contributions
- Project acknowledgments
Thank you for contributing to Vibe Coder 3D!