BillionMail Agent Skills & AI Rules

GitHub

BillionMail gives you open-source MailServer, NewsLetter, Email Marketing โ€” fully self-hosted, dev-friendly, and free from monthly fees. Join the discord:

RAW Rules
1 Discovered Rules โ€ข ~732 Estimated Tokens
Quick:
Loading skill content...

Claude Agent Guidelines & System Prompt

CLAUDE.md claude-rule ~732 tokens
Raw
# BillionMail

Open-source email marketing platform & mail server. Handles bulk sending, campaigns, contact management, warmup, and analytics.

## Project Structure

```
core/
โ”œโ”€โ”€ internal/
โ”‚   โ”œโ”€โ”€ cmd/            # CLI entry points
โ”‚   โ”œโ”€โ”€ controller/     # HTTP handlers (16+ domains)
โ”‚   โ”œโ”€โ”€ service/        # Business logic (batch_mail, domains, rbac, maillog_stat, warmup, contact, etc.)
โ”‚   โ”œโ”€โ”€ dao/            # Data access layer
โ”‚   โ”œโ”€โ”€ model/entity/   # ORM entities
โ”‚   โ””โ”€โ”€ consts/         # Constants
โ”œโ”€โ”€ api/                # API route definitions
โ”œโ”€โ”€ frontend/src/
โ”‚   โ”œโ”€โ”€ views/          # Page components
โ”‚   โ”œโ”€โ”€ components/     # Reusable UI components
โ”‚   โ”œโ”€โ”€ store/          # Pinia store modules
โ”‚   โ”œโ”€โ”€ api/modules/    # API client modules
โ”‚   โ”œโ”€โ”€ router/         # Vue Router + module routes
โ”‚   โ”œโ”€โ”€ hooks/          # Composables
โ”‚   โ”œโ”€โ”€ utils/          # Utilities (base, data, time, storage)
โ”‚   โ”œโ”€โ”€ features/       # Feature-specific components (EmailEditor)
โ”‚   โ””โ”€โ”€ i18n/           # Internationalization (en, zh, ja)
โ”œโ”€โ”€ template/           # Email templates
โ””โ”€โ”€ manifest/           # Config/deployment
conf/                   # Mail service configs (postfix, dovecot, rspamd, redis)
Dockerfiles/            # Container definitions
```

## Stack

- **Backend:** Go 1.22, GoFrame v2, PostgreSQL, Redis
- **Frontend:** Vue 3, TypeScript, Pinia, Naive UI, Vitest, pnpm
- **Mail:** Postfix, Dovecot, Rspamd
- **Deploy:** Docker Compose

## Organization Rules

- Controllers โ†’ `core/internal/controller/`, one dir per domain
- Services โ†’ `core/internal/service/`, one dir per domain
- API routes โ†’ `core/api/`, one dir per domain
- Frontend views โ†’ `core/frontend/src/views/`, one dir per feature
- Tests โ†’ next to source files (`*_test.go`, `*.test.ts`)
- Single responsibility per file, descriptive names

## Code Quality

After editing ANY file, run:

```bash
# Go
cd core && go vet ./... && gofmt -l .

# Frontend
cd core/frontend && pnpm run lint
```

Fix ALL errors before continuing.

## Testing

```bash
# Go (short mode, no DB required)
cd core && go test -count=1 -short ./internal/service/...

# Frontend
cd core/frontend && pnpm test

# Both
cd core && go test -count=1 -short ./internal/service/... && cd frontend && pnpm test
```

## Bug Memory Rules

- NEVER use bare domain for mail infrastructure (DNS, certs, DKIM, dedicated IPs). Always use `public.FormatMX(domain)` to get the mail hostname (e.g., `mail.example.com`).
- When adding new controllers, add the module name to the RBAC `modules` list in `core/internal/service/middlewares/rbac.go`.

## Commands

- `/test` - Run full test suite
- `/fix` - Lint + typecheck + auto-fix with parallel agents
- `/commit` - Quality checks + AI commit + push
- `/update-app` - Update deps + fix deprecations