Skip to content

Latest commit

 

History

History
160 lines (116 loc) · 3.13 KB

CONTRIBUTING.md

File metadata and controls

160 lines (116 loc) · 3.13 KB

Contributing to claudetree

Thank you for your interest in contributing!

Development Setup

# Clone the repository
git clone https://github.com/wonjangcloud9/claude-tree.git
cd claude-tree

# Install dependencies
pnpm install

# Build all packages
pnpm build

# Run tests
pnpm test

# Link CLI globally for development
cd packages/cli && pnpm link --global

Project Structure

packages/
├── cli/      # CLI tool (@claudetree/cli) - 33+ commands
├── core/     # Domain + Infrastructure (@claudetree/core)
├── shared/   # Shared types (@claudetree/shared)
├── mcp/      # MCP Server (@claudetree/mcp) - 14 tools
└── web/      # Next.js 16 dashboard (@claudetree/web) - i18n (en/ko/ja/zh)

Branch Strategy

main      ← stable releases (triggers npm publish)
  ↑
develop   ← integration branch (PRs target here)
  ↑
feature/* ← your work

Starting New Work

# Start from develop
git checkout develop
git pull origin develop

# Create your branch
git checkout -b feature/my-feature
# or: fix/bug-name, docs/update, refactor/cleanup

Development Workflow

1. TDD Approach

We follow Test-Driven Development:

  1. Write a failing test
  2. Implement minimal code to pass
  3. Refactor while keeping tests green

2. Running Tests

# Run all tests
pnpm test

# Run tests in watch mode
pnpm test -- --watch

# Run specific package tests
pnpm --filter @claudetree/core test:run
pnpm --filter @claudetree/cli test
pnpm --filter @claudetree/mcp test:run

3. Building

# Build all packages
pnpm build

# Build specific package
pnpm --filter @claudetree/cli build

Recording Changes (Changesets)

We use Changesets for versioning.

After completing your work:

pnpm changeset
  1. Select packages that changed
  2. Choose bump type:
    • patch: Bug fixes (0.0.X)
    • minor: New features (0.X.0)
    • major: Breaking changes (X.0.0)
  3. Write a summary of changes

This creates a file in .changeset/ that will be used to generate CHANGELOG.

Code Style

  • TypeScript strict mode
  • Functions under 30 lines
  • Clear, descriptive naming
  • Early returns preferred

Commit Messages

Format: <type>(<scope>): <description>

Types:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation
  • refactor: Code refactoring
  • test: Adding tests
  • chore: Maintenance

Examples:

feat(cli): add GitHub issue integration
fix(core): handle empty worktree list
docs: update README with new commands

Pull Request Process

  1. Fork the repository
  2. Create a feature branch from develop
  3. Make your changes with tests
  4. Run pnpm changeset to record changes
  5. Ensure all tests pass: pnpm test:run
  6. Submit PR to develop branch
  7. After review, maintainers merge to develop
  8. Periodically, develop is merged to main for release

Release Process (Maintainers)

When develop is stable:

  1. Create PR from develop to main
  2. Merge triggers Release workflow
  3. GitHub Action creates "Release PR" with version bumps
  4. Merge Release PR to publish to npm

Questions?

Open an issue or start a discussion!