# Repository Guidelines
## Project Structure & Module Organization
- `src/`: TypeScript source. Entry point is `src/index.ts`. Server wiring lives in `src/server.ts`, configuration in `src/config.ts`, schemas in `src/schemas.ts`, policies in `src/policy.ts`.
- `src/tools/`: MCP tool implementations.
- `src/utils/`: Shared helpers and utility functions.
- `tests/`: Vitest suites (e.g., `send-message.test.ts`).
- `docs/`: Project documentation and design notes.
- `dist/`: Build output (generated by `pnpm build`).
## Build, Test, and Development Commands
- `pnpm install`: Install dependencies.
- `pnpm dev`: Run the server from TypeScript using `tsx` (`src/index.ts`).
- `pnpm build`: Compile TypeScript to `dist/`.
- `pnpm start`: Run the compiled server (`dist/index.js`).
- `pnpm lint`: ESLint with zero warnings.
- `pnpm format`: Prettier check (use `pnpm format:write` to fix).
- `pnpm typecheck`: TypeScript checks for app + tests.
- `pnpm test`: Run Vitest in CI mode.
## Coding Style & Naming Conventions
- TypeScript with strict typing; avoid `any`.
- Formatting is enforced by Prettier; do not hand-format.
- ESLint must pass with `--max-warnings 0`.
- Naming: `camelCase` for variables/functions, `PascalCase` for types/classes, `kebab-case` for test filenames (e.g., `verify-account.test.ts`).
## Testing Guidelines
- Framework: Vitest.
- Tests live in `tests/` and must end with `.test.ts`.
- Use Arrange-Act-Assert and prefer data-driven cases for protocol edge paths.
- Run all tests with `pnpm test`; keep suites deterministic and fast.
## Commit & Pull Request Guidelines
- Git history is not available in this checkout; use concise, imperative commit subjects (e.g., “Add SMTP retry guardrails”).
- Keep commits scoped to one logical change.
- PRs should include: summary, test results (`pnpm test`), and any new config/env keys.
## Configuration & Security Notes
- Treat SMTP credentials as secrets; never commit them.
- Prefer environment variables or local-only config for account details.