> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Contributing

> Guidelines for contributing to 0 Finance

## Project structure

```
zero-finance/
├── packages/
│   ├── web/          # Next.js application
│   ├── cli/          # agent-bank package
│   └── docs/         # Public documentation site
├── scripts/          # Build and deployment scripts
└── deployments/      # Contract deployment manifests
```

***

## Development workflow

### 1. Create a feature branch

```bash theme={null}
git checkout -b feat/your-feature-name
```

### 2. Make changes

Follow the existing code style:

* TypeScript for all code
* Prettier formatting (2 spaces, single quotes)
* ESLint rules from `next/core-web-vitals`

### 3. Run quality checks

```bash theme={null}
pnpm typecheck
pnpm lint
pnpm --filter @zero-finance/web test
```

### 4. Commit and push

```bash theme={null}
git add .
git commit -m "feat: add your feature"
git push -u origin feat/your-feature-name
```

### 5. Create a pull request

PRs should include:

* Summary of changes
* Testing notes
* Screenshots (for UI changes)

***

## Code style

### TypeScript

* Prefer `const` over `let`
* Use explicit return types for exported functions
* Document complex logic with comments

### React

* Functional components with hooks
* PascalCase for components
* camelCase for hooks and utilities

### Tailwind

Order classes: layout → spacing → colors

```tsx theme={null}
// Good
<div className="flex items-center gap-4 p-4 bg-white text-gray-900">

// Avoid
<div className="bg-white p-4 flex text-gray-900 gap-4 items-center">
```

***

## Database changes

Use Drizzle migrations:

```bash theme={null}
# Generate migration
pnpm --filter @zero-finance/web db:generate

# Apply migration
pnpm --filter @zero-finance/web db:migrate
```

***

## Testing the CLI locally

Build and link the CLI:

```bash theme={null}
cd packages/cli
pnpm build
pnpm link --global
```

Point to your local server:

```bash theme={null}
zero auth login --api-key sk_test_xxx --base-url http://localhost:3050
```

***

## Useful scripts

| Script            | Description                  |
| ----------------- | ---------------------------- |
| `pnpm dev`        | Start all dev servers        |
| `pnpm dev:lite`   | Start with lite Docker stack |
| `pnpm build`      | Build all packages           |
| `pnpm lint`       | Run ESLint                   |
| `pnpm typecheck`  | Run TypeScript checks        |
| `pnpm format`     | Check Prettier formatting    |
| `pnpm format:fix` | Fix formatting issues        |

***

## Getting help

* Check existing issues on [GitHub](https://github.com/different-ai/zero-finance/issues)
* Ask in the team Slack/Discord
* Review the codebase — most patterns are self-documenting
