Contributing Guide¶
Thank you for your interest in Open Claude Code! This document explains how to participate in project development.
Code of Conduct¶
We are committed to providing a friendly, safe, and welcoming development environment. All participants should respect and be inclusive of each other.
Ways to Contribute¶
1. Reporting Bugs¶
Pre-submission Checklist¶
- [ ] Search existing Issues to confirm the bug hasn't been reported
- [ ] Check if the issue still exists in the latest version
- [ ] Prepare clear reproduction steps
Issue Template¶
## Description
Clearly describe the problem.
## Steps to Reproduce
1. ...
2. ...
3. ...
## Expected Behavior
What should happen.
## Actual Behavior
What actually happened.
## Environment Information
- Operating System: [e.g., Linux, macOS, Windows]
- Bun Version: [output of `bun --version`]
- Project Version: [e.g., v1.0.0]
- Node.js Version: [e.g., 20.0.0]
## Additional Information
Any other relevant information.
2. Suggesting Features¶
Issue Template¶
## Feature Description
Clearly describe the feature you want.
## Use Case
Explain the use case and value of this feature.
## Suggested Implementation
(Optional) Explain how you think it should be implemented.
## Alternative Options
Are there other ways to solve this problem?
3. Submitting Code¶
Development Workflow¶
-
Fork the repository
# Fork the project on GitHub -
Clone your Fork
git clone https://github.com/your-username/open-claude-code.git cd open-claude-code -
Add upstream repository
git remote add upstream https://github.com/original-owner/open-claude-code.git -
Create a branch
git checkout -b feature/your-feature-name -
Make changes
# Edit files # Run tests bun run test -
Commit changes
git add . git commit -m "feat: add your feature" -
Push to your Fork
git push origin feature/your-feature-name -
Create Pull Request
- Open PR on GitHub
- Fill in PR template
- Wait for review
Commit Message Convention¶
Use Conventional Commits format:
<type>(<scope>): <subject>
<body>
<footer>
Types:
- feat: New feature
- fix: Bug fix
- docs: Documentation update
- style: Code style (doesn't affect logic)
- refactor: Refactoring (doesn't affect functionality)
- perf: Performance optimization
- test: Test-related
- chore: Build, dependencies, etc.
Example:
feat(commands): add new advisor command
This adds a new advisor command that helps users with code review.
Fixes #123
Code Style¶
TypeScript Style Guide¶
-
Naming Conventions
// Constants: SCREAMING_SNAKE_CASE const MAX_RETRIES = 3 // Functions and variables: camelCase function processData() {} let isLoading = false // Classes and types: PascalCase class UserService {} type UserConfig = {} // Interfaces: PascalCase, usually prefixed with I interface IUserRepository {} -
Type Annotations
// Always specify return types explicitly function getUserName(id: number): string { return "John" } // Use interfaces for complex objects interface User { id: number name: string } -
Arrow Functions
// Simple one-liner const add = (a: number, b: number) => a + b // Multi-line needs braces and return const process = (data: string) => { const result = data.trim() return result }
Code Quality Tools¶
# ESLint check
bun run lint
# Auto-fix
bun run lint --fix
# Code formatting
bun run format
# Type checking
bun run typecheck
Testing¶
Writing Tests¶
import { describe, it, expect } from "bun:test"
describe("UserService", () => {
it("should get user by id", () => {
const user = getUserById(1)
expect(user.name).toBe("John")
})
it("should handle missing user", () => {
const user = getUserById(999)
expect(user).toBeNull()
})
})
Test Coverage¶
# Run tests with coverage
bun run test --coverage
# Minimum coverage standards
# Statements: 80%
# Branches: 75%
# Functions: 80%
# Lines: 80%
Test Types¶
- Unit Tests (
tests/unit/) - Test individual functions or modules
- Should execute quickly
-
Mock external dependencies
-
Integration Tests (
tests/integration/) - Test interaction between multiple components
-
May involve real databases
-
End-to-End Tests (
tests/e2e/) - Test complete user flows
- Simulate real scenarios
Documentation¶
Updating Documentation¶
If your changes involve new features or API changes, please:
- Update relevant documentation
- Add or modify files in the
docs/directory -
Update
mkdocs.ymlnavigation (if needed) -
Add code examples
## Example \`\`\`typescript import { MyFeature } from "@open-claude-code/core" const feature = new MyFeature() await feature.initialize() \`\`\` -
Local preview
mkdocs serve
PR Review Process¶
Review Standards¶
Your PR needs:
- [ ] Pass all CI/CD checks
- [ ] At least one maintainer approval
- [ ] Code coverage not below 80%
- [ ] All tests passing
- [ ] Consistent code style
- [ ] Complete documentation updates
Common Feedback¶
| Feedback | How to Handle |
|---|---|
| "Please add tests" | Write unit or integration tests for your code |
| "Type check failed" | Run bun run typecheck and fix |
| "Please update docs" | Add relevant documentation in docs/ |
| "Performance concerns" | Check performance with bun run test --benchmark |
Release Process¶
Version Number Convention¶
Use Semantic Versioning:
- MAJOR: Incompatible API changes
- MINOR: Backward-compatible new features
- PATCH: Backward-compatible bug fixes
Example: 1.2.3 (major.minor.patch)
Release Steps¶
- Update
CHANGELOG.md - Update version number in
package.json - Create Git tag:
git tag v1.2.3 - Push to GitHub
- Publish in GitHub Releases
Getting Help¶
- Discussions: GitHub Discussions
- Issues: GitHub Issues
- Community: Follow the project's Discord/Slack community (if exists)
Related Resources¶
Thank you for your contribution!