|
| 1 | +# Contributing |
| 2 | + |
| 3 | +Contributions are welcome. This guide covers how to set up the project, run tests, and submit a pull request. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Node.js 18 or later |
| 8 | +- npm 9 or later |
| 9 | + |
| 10 | +## Setup |
| 11 | + |
| 12 | +```bash |
| 13 | +git clone https://github.com/oso95/domain-suite-mcp.git |
| 14 | +cd domain-suite-mcp |
| 15 | +npm install |
| 16 | +npm run build |
| 17 | +``` |
| 18 | + |
| 19 | +## Running Tests |
| 20 | + |
| 21 | +```bash |
| 22 | +npm test |
| 23 | +``` |
| 24 | + |
| 25 | +All 161 unit tests must pass before opening a pull request. |
| 26 | + |
| 27 | +## Type Checking |
| 28 | + |
| 29 | +```bash |
| 30 | +npm run typecheck |
| 31 | +``` |
| 32 | + |
| 33 | +The project uses TypeScript strict mode. No type errors are permitted. |
| 34 | + |
| 35 | +## Integration Testing |
| 36 | + |
| 37 | +Integration tests run against real provider APIs and are opt-in: |
| 38 | + |
| 39 | +```bash |
| 40 | +# Copy .env.example and fill in your API keys |
| 41 | +cp .env.example .env |
| 42 | + |
| 43 | +# Run the smoke test |
| 44 | +node scripts/smoke-test.mjs |
| 45 | +``` |
| 46 | + |
| 47 | +Integration tests require real credentials. Namecheap sandbox (`NAMECHEAP_SANDBOX=true`) and GoDaddy OTE (`GODADDY_SANDBOX=true`) environments are safe for testing without incurring costs. |
| 48 | + |
| 49 | +## Code Style |
| 50 | + |
| 51 | +- TypeScript strict mode throughout |
| 52 | +- ESM modules (`"type": "module"`) |
| 53 | +- No `any` types |
| 54 | +- All errors must be `AgentError` instances with a `code`, `message`, and `action` field |
| 55 | +- Error messages must be actionable: tell the agent what went wrong and exactly what to do next |
| 56 | + |
| 57 | +## Adding a Provider |
| 58 | + |
| 59 | +1. Create `src/providers/<name>/client.ts` implementing the `Provider` interface from `src/providers/types.ts` |
| 60 | +2. Add provider config to `src/config.ts` |
| 61 | +3. Register the provider in `src/registry.ts` |
| 62 | +4. Add notes to `src/tools/providers.ts` (`SUPPORTED_NOTES`, `UNSUPPORTED_NOTES`) |
| 63 | +5. Add provider setup instructions to `docs/PROVIDERS.md` |
| 64 | +6. Update the provider table in `README.md` |
| 65 | +7. Add unit tests in `tests/unit/` |
| 66 | + |
| 67 | +## Pull Request Guidelines |
| 68 | + |
| 69 | +- One logical change per PR |
| 70 | +- Add or update unit tests for any changed behaviour |
| 71 | +- Update `docs/TOOLS.md` and `docs/PROVIDERS.md` if tool schemas or provider capabilities change |
| 72 | +- Add a CHANGELOG entry under `[Unreleased]` |
| 73 | +- Titles follow conventional commits: `feat:`, `fix:`, `docs:`, `test:`, `refactor:`, `chore:` |
| 74 | + |
| 75 | +## Reporting Issues |
| 76 | + |
| 77 | +Open an issue with: |
| 78 | +- The tool name and input that caused the problem |
| 79 | +- The error output (sanitize any API keys) |
| 80 | +- The provider you are using |
0 commit comments