Skip to main content
Thank you for your interest in contributing to Repolyze! This guide outlines our standards and processes to ensure quality contributions.

How to Contribute

There are many ways to contribute to Repolyze:

Report Bugs

Found an issue? Open a bug report

Suggest Features

Have an idea? Start a discussion

Improve Documentation

Help make our docs better

Submit Code

Fix bugs or add new features

Commit Conventions

We follow Conventional Commits to maintain a clean and readable git history.

Commit Message Format

<type>: <description>

[optional body]

[optional footer]

Commit Types

TypeDescriptionExample
featNew featurefeat: add branch comparison view
fixBug fixfix: resolve memory leak in file tree
docsDocumentation changesdocs: update API documentation
styleCode formatting (no logic change)style: fix indentation in components
refactorCode restructuringrefactor: simplify auth logic
perfPerformance improvementperf: optimize image loading
testAdding or updating teststest: add unit tests for validators
choreMaintenance taskschore: update dependencies

Examples

feat: add support for private repositories

Implements OAuth flow for GitHub authentication to enable
analysis of private repositories.

Closes #123
Keep the first line under 72 characters. Use the body to explain what and why, not how.

Pull Request Process

Before Submitting

Ensure your PR meets these requirements:
1

Code follows existing style

Review the coding standards below and ensure your code matches the existing patterns in the codebase.
2

All checks pass

Run these commands and fix any issues:
pnpm lint        # ESLint checks
pnpm type-check  # TypeScript type checks
pnpm build       # Production build test
3

Changes are tested

Test your changes thoroughly:
  • Test in the browser during development
  • Test the production build
  • Test edge cases and error scenarios
4

Documentation is updated

If your changes affect user-facing features or APIs:
  • Update relevant documentation
  • Add JSDoc comments for new functions
  • Update the README if needed

PR Checklist

Before submitting your PR, verify:
  • Code follows existing style and conventions
  • pnpm lint passes without errors
  • pnpm type-check passes without errors
  • Changes tested locally
  • Commit messages follow convention
  • Documentation updated (if needed)
  • PR description clearly explains changes
  • Related issues are referenced (e.g., “Closes #123”)

PR Description Template

Use this template for your PR description:
## Summary
Brief description of what this PR does.

## Changes
- List of changes made
- Another change

## Testing
How you tested these changes.

## Screenshots (if applicable)
Add screenshots for UI changes.

## Related Issues
Closes #123
Related to #456

Coding Standards

TypeScript

  • Always use TypeScript types, avoid any
  • Define interfaces for complex objects
  • Use type inference when types are obvious
  • Export types that might be reused
// Good
interface AnalysisResult {
  scores: ScoreData;
  insights: Insight[];
  metadata: RepositoryMetadata;
}

// Avoid
const result: any = await analyze();
  • Use camelCase for variables and functions
  • Use PascalCase for components and types
  • Use UPPER_SNAKE_CASE for constants
  • Use descriptive names that indicate purpose
// Good
const userProfile = fetchUserProfile();
const MAX_RETRIES = 3;

interface UserProfile {
  // ...
}

// Avoid
const data = fetch();
const max = 3;
  • Keep functions small and focused
  • Extract complex logic into separate functions
  • Add JSDoc comments for exported functions
  • Use async/await instead of raw promises
/**
 * Analyzes a GitHub repository and returns insights.
 * @param repoUrl - The GitHub repository URL
 * @param branch - Optional branch name (defaults to main)
 * @returns Analysis results with scores and insights
 */
async function analyzeRepository(
  repoUrl: string,
  branch?: string
): Promise<AnalysisResult> {
  // Implementation
}

React Components

  • Use functional components with hooks
  • Keep components focused on a single responsibility
  • Extract reusable logic into custom hooks
  • Use "use client" directive only when necessary
"use client";

import { useState } from "react";

export function FeatureComponent() {
  const [state, setState] = useState();
  
  return (
    <div>
      {/* Component content */}
    </div>
  );
}
  • Define prop interfaces for all components
  • Use destructuring for props
  • Provide default values when appropriate
interface ButtonProps {
  label: string;
  onClick: () => void;
  variant?: "primary" | "secondary";
  disabled?: boolean;
}

export function Button({ 
  label, 
  onClick, 
  variant = "primary",
  disabled = false 
}: ButtonProps) {
  // Implementation
}
  • Use Tailwind CSS for styling
  • Use the cn() utility for conditional classes
  • Follow existing spacing and color patterns
import { cn } from "@/lib/utils";

<div className={cn(
  "rounded-lg p-4",
  variant === "primary" && "bg-blue-500",
  disabled && "opacity-50 cursor-not-allowed"
)}>
  {/* Content */}
</div>

File Organization

  • Place components in components/ directory
  • Place API routes in app/api/ directory
  • Place utilities in lib/ directory
  • Place type definitions in types.ts files alongside related code
  • Group related components in subdirectories
components/
├── ui/              # shadcn/ui components
├── file-tree/       # File tree feature
│   ├── index.tsx
│   ├── tree-node.tsx
│   ├── types.ts
│   └── utils.ts
└── repo-analyzer/
    ├── index.tsx
    └── animations.ts

Issue Guidelines

Reporting Bugs

When reporting a bug, include:
1

Clear description

Describe what happened and what you expected to happen.
2

Steps to reproduce

Provide step-by-step instructions:
  1. Go to ’…’
  2. Click on ’…’
  3. See error
3

Environment details

  • OS: [e.g., macOS 13.0]
  • Browser: [e.g., Chrome 120]
  • Node.js version: [e.g., 18.17.0]
4

Screenshots (if applicable)

Add screenshots to help explain the problem.

Requesting Features

When requesting a feature, include:
  • Problem: What problem does this solve?
  • Proposed solution: How would you implement this?
  • Alternatives: What other solutions did you consider?
  • Use case: How would you use this feature?

Good First Issues

Looking for a place to start? Check out issues labeled:

good first issue

Perfect for newcomers to the project

help wanted

We need your help with these

Code of Conduct

Repolyze follows the Contributor Covenant Code of Conduct.

Our Pledge

We pledge to make participation in our community a harassment-free experience for everyone, regardless of:
  • Age, body size, disability, ethnicity
  • Gender identity and expression
  • Level of experience, education
  • Nationality, personal appearance, race
  • Religion, or sexual identity and orientation

Our Standards

Positive behaviors include:
  • Demonstrating empathy and kindness
  • Being respectful of differing opinions
  • Giving and gracefully accepting constructive feedback
  • Accepting responsibility and learning from mistakes
  • Focusing on what is best for the community
Unacceptable behaviors include:
  • Sexualized language or imagery
  • Trolling, insulting comments, or personal attacks
  • Public or private harassment
  • Publishing others’ private information
  • Other conduct inappropriate in a professional setting

Enforcement

Instances of unacceptable behavior may be reported to [email protected]. All complaints will be reviewed and investigated promptly and fairly.

Getting Help

Need assistance? We’re here to help:

GitHub Discussions

Ask questions and share ideas

Twitter

Quick questions and updates
Remember: there are no stupid questions! We’re happy to help contributors at any skill level.

License

By contributing to Repolyze, you agree that your contributions will be licensed under the MIT License.

Build docs developers (and LLMs) love