Thank you for your interest in contributing to Delego! We welcome contributions from everyone and are excited to have you join our community.
- Getting Started
- Development Workflow
- Code Standards
- Project Areas
- Testing Guidelines
- Documentation
- Pull Request Process
- Reporting Issues
- Security
- Community Guidelines
Before you begin contributing, ensure you have the following installed:
- Node.js >= 20.0.0
- pnpm >= 9.0.0
- Git (for version control)
- A GitHub token with read access to the
DelegoLabspackages on GitHub Packages
-
Fork the Repository
# Fork the repository on GitHub # Then clone your fork git clone https://github.com/YOUR_USERNAME/delego.git cd delego
-
Install Dependencies
pnpm install
-
Configure Environment
cp .env.example .env.local # Edit .env.local with your local configuration -
Start Development Server
pnpm dev
Note: This repo contains only the web application and UI package. The backend services and smart contracts live in DelegoLabs/Delego-backend and DelegoLabs/Delego-contracts. For a full local setup, also run the backend repo and point
NEXT_PUBLIC_API_URLat its gateway.
- Browse GitHub Issues for open issues
- Look for issues labeled
good first issueif you're new to the project - Comment on the issue to claim it and ask questions if needed
- Create a new issue if you've found a bug or have a feature request
# Ensure your main branch is up to date
git checkout main
git pull upstream main
# Create a feature branch
git checkout -b feat/your-feature-name
# or
git checkout -b fix/your-bug-fixBranch Naming Convention:
feat/- New featuresfix/- Bug fixesdocs/- Documentation changesrefactor/- Code refactoringtest/- Test additions or changeschore/- Maintenance tasks
- Write clear, focused commits
- Follow the Conventional Commits specification
- Add tests for new functionality
- Update documentation as needed
Commit Message Format:
type(scope): subject
body
footer
Examples:
feat(delegations): add delegation creation form
Adds a form to create new agent delegations with spending limits.
Includes validation and submission to the delegations API.
Closes #123
fix(orders): correct status timeline sorting
Fixed the status timeline rendering out of order when multiple
events share the same timestamp.
Fixes #456
# Run type checking
pnpm typecheck
# Run linting
pnpm lint
# Run tests
pnpm test
# Run tests in watch mode
pnpm --filter @delegolabs/web exec vitest- Push your branch to your fork
- Open a pull request against the
mainbranch - Use the PR template and provide a detailed description
- Link related issues
- Request review from maintainers
- Strict Mode: All TypeScript projects use strict mode
- No
any: Avoid usinganytype without justification - Type Safety: Leverage TypeScript's type system fully
- Interfaces: Use interfaces for object shapes
- Enums: Use enums for fixed sets of values
- Null Checks: Enable strict null checks
- Naming: Use camelCase for variables, PascalCase for types/classes
// Good
interface User {
id: string;
name: string;
email: string;
}
function getUserById(id: string): Promise<User | null> {
// Implementation
}
// Bad
function getUserById(id: any): any {
// Implementation
}- Use functional components with hooks
- Follow the React Hooks rules (no conditional hooks)
- Use the shared components from
@delegolabs/uiwhere possible - Keep components focused and reusable
- Follow accessibility best practices (semantic HTML, labels, keyboard navigation)
- TODO Comments: Mark incomplete logic with
// TODO:and link to an issue when possible - Code Comments: Add comments for complex logic, not obvious code
- Function Length: Keep functions focused and reasonably short
- File Organization: Group related functionality together
- Imports: Organize imports logically (external, internal, relative)
Note: This repository contains the web application and shared UI package. The backend microservices and smart contracts live in separate repositories: DelegoLabs/Delego-backend and DelegoLabs/Delego-contracts.
Tech Stack: Next.js, React, TypeScript, Tailwind CSS
Good First Issues:
- UI component improvements
- React hooks development
- Page layout enhancements
- Form validation
- State management
Key Files:
app/- Next.js App Router routescomponents/- React componentshooks/- Custom React hookslib/api.ts- API client
Tech Stack: React, TypeScript
Good First Issues:
- Component design and implementation
- Accessibility improvements
- Testing
- Theming and styling
Key Files:
src/- Components and hooks
The SDK, types, and utils packages are not developed in this repo; they are published to GitHub Packages (see DelegoLabs/Delego-backend).
- Aim for high test coverage on critical paths
- Write unit tests for individual functions and components
- Write component tests with Vitest and Testing Library
// Component test example
import { render, screen } from '@testing-library/react';
describe('DelegationCard', () => {
it('renders the delegation status', () => {
render(<DelegationCard status="active" />);
expect(screen.getByText('Active')).toBeDefined();
});
});# Run all tests
pnpm test
# Run tests for a specific package
pnpm --filter @delegolabs/web test
pnpm --filter @delegolabs/ui test
# Run in watch mode
pnpm --filter @delegolabs/web exec vitest- Adding new features or pages
- Changing existing APIs
- Modifying architecture
- Updating configuration
- Adding new commands or scripts
- README.md: Project overview and quick start
- CONTRIBUTING.md: Contribution guidelines (this file)
- docs/: Detailed documentation
docs/architecture/system-design.md: System designdocs/vision.md: Product visiondocs/grant-deliverables.md: Grant deliverables
- Use clear, concise language
- Include code examples
- Provide step-by-step instructions
- Use proper formatting (headings, lists, code blocks)
- Keep documentation up to date with code changes
-
Code Quality
-
pnpm typecheckpasses -
pnpm lintpasses -
pnpm testpasses - No console.log statements left in production code
-
-
Testing
- Tests added for new functionality
- All tests pass
- Test coverage maintained or improved
-
Documentation
- README updated if adding a new page or component
- Comments added for complex logic
-
Commit Messages
- Follows Conventional Commits specification
- Clear and descriptive
- Links to related issues
- Title: Use a clear, descriptive title following Conventional Commits
- Description: Provide a detailed description of changes
- Related Issues: Link to related issues using
Closes #123orFixes #123 - Screenshots: Include screenshots for UI changes
- Checklist: Complete the PR template checklist
- Maintainers will review your PR
- Address feedback in a timely manner
- Be open to suggestions and improvements
- Keep discussions focused and constructive
- Delete your feature branch
- Celebrate your contribution! 🎉
When reporting a bug, include:
- Clear Title: Descriptive title for the issue
- Description: Detailed description of the problem
- Reproduction Steps: Steps to reproduce the issue
- Expected Behavior: What you expected to happen
- Actual Behavior: What actually happened
- Environment Details:
- OS: [e.g., macOS, Ubuntu, Windows]
- Node version: [e.g., 20.0.0]
- Browser (if applicable): [e.g., Chrome 120]
Example:
Title: Delegation list does not update after approving an order
Description:
After approving an order in the approvals page, the delegations list
on the home page still shows the old spending totals.
Steps to Reproduce:
1. Create a delegation with a spending limit
2. Approve an agent-initiated order against it
3. Navigate to the home page
4. Observe the delegation spending total is stale
Expected Behavior:
The delegation spending total reflects the approved order.
Actual Behavior:
The total only updates after a full page reload.
Environment:
- OS: Ubuntu 22.04
- Node: 20.0.0
When requesting a feature, include:
- Clear Title: Descriptive title for the feature
- Description: Detailed description of the feature
- Use Case: Why this feature is needed
- Proposed Solution: How you envision the feature working
- Alternatives: Any alternative solutions considered
- Additional Context: Any other relevant information
Do not open public issues for security vulnerabilities.
To report a security vulnerability:
- Email us at: security@delego.dev
- Include details and reproduction steps
- We will respond promptly and coordinate disclosure
- We will work with you to fix the issue
- We will coordinate the public disclosure timeline
- Never commit secrets or API keys
- Use environment variables for sensitive configuration
- Review dependencies for known vulnerabilities
- Follow secure coding practices
- Test security-related functionality thoroughly
Please read and follow our Code of Conduct.
- Be respectful and constructive in all communications
- Welcome newcomers and help them get started
- Focus on what is best for the community
- Show empathy towards other community members
- Check existing documentation first
- Search GitHub Issues for similar problems
- Ask questions in GitHub Discussions
- Join our community chat (link coming soon)
Contributors will be recognized in release notes and project documentation.
- GitHub Issues: For bugs and feature requests
- GitHub Discussions: For questions and general discussion
- Security: security@delego.dev (for security issues only)
Thank you for contributing to Delego! Your contributions help make AI-powered delegated commerce more accessible and secure for everyone.