# Dual-registrar domain check — Compass checklist

**Purpose:** Compare availability and pricing across **OpenProvider** (Agora Domains / TLD Bazaar backend) and **Porkbun** before registering a domain. **Never purchase without explicit operator approval.**

---

## Before you start

- [ ] Normalize the domain: lowercase, no `https://`, single TLD (e.g. `mybrand.io`).
- [ ] Confirm intent: new registration vs transfer vs DNS-only.
- [ ] Run `node domain-check.mjs mybrand.io` for DNS hints (empty DNS ≠ guaranteed available).

---

## Step 1 — DNS pre-check

```bash
node domain-check.mjs mybrand.io
```

| Signal | Meaning |
|--------|---------|
| No A/NS records | Possibly available — verify with registrars |
| NS/MX present | Likely registered — check renewal, not purchase |

---

## Step 2 — OpenProvider path (Agora + TLD Bazaar)

Both storefronts use OpenProvider pricing via the factory `pricing-proxy`. **Do not hand-roll OpenProvider API calls** — use store search or documented proxy patterns.

### Agora Domains

```bash
curl -s "https://agoradomains.com/api/search?q=mybrand.io"
```

- Web: [agoradomains.com](https://agoradomains.com/?utm_source=agentstackkit&utm_medium=tool&utm_campaign=dual-registrar)
- Markup model: standard Agora markup on OpenProvider cost

### TLD Bazaar

```bash
curl -s "https://tldbazaar.com/api/search?q=mybrand.io"
```

- Web: [tldbazaar.com](https://tldbazaar.com/?utm_source=agentstackkit&utm_medium=tool&utm_campaign=dual-registrar)
- Markup model: ends-in-1 pricing rule on selected TLDs

**OpenProvider gotchas (from factory Compass):**

- DNS record names must be **relative** (`www`, not `www.domain.com`) on add/remove
- Full-name adds can create doubled `domain.domain` records
- Always verify with `GET /dns/zones/{domain}/records` after changes

---

## Step 3 — Porkbun path

Check NS on the domain — if nameservers are `*.porkbun.com`, registrar is Porkbun.

```bash
# WHOIS / DNS NS check (example)
nslookup -type=NS mybrand.io
```

- Web UI for manual search: [porkbun.com](https://porkbun.com/)
- API-driven registration: use factory `pricing-proxy` `_registrar_for(domain)` — routes Porkbun vs OpenProvider automatically
- **`.us` TLD:** Porkbun API may block; use web UI only for this account

---

## Step 4 — Compare and present to operator

Fill this table before any purchase:

| Domain | Agora price | Bazaar price | Porkbun price | DNS status | Recommended |
|--------|-------------|--------------|---------------|------------|-------------|
| mybrand.io | $ | $ | $ | available? | (wait for OK) |

**Required operator message template:**

```
Domain check: mybrand.io
- DNS: [empty / registered]
- Agora: $X.XX/yr — https://agoradomains.com/?q=mybrand.io
- Bazaar: $X.XX/yr — https://tldbazaar.com/?q=mybrand.io
- Porkbun: $X.XX/yr (if applicable)
Recommend: [registrar] at [price]
WAITING FOR OPERATOR OK before checkout.
```

---

## Step 5 — Hard rules

1. **Show exact URL and price** — wait for explicit **OK** before registering
2. **Never trust client-supplied price** at checkout (server must re-derive from registrar cost)
3. **Re-check availability** immediately before charge (409 if taken)
4. **Normalize domain** — strip stray dots (`name..com` double-charge risk)
5. **Fail closed** if availability API is down — do not charge unverified domains

---

## Related tools

- `domain-check.mjs` — DNS + CTA links
- `fetch-safe.mjs` — bounded fetch for search API responses
- Factory reference: `CLAUDE-UNIFIED` → Domain Stores + DNS standard method

---

## Exit criteria

- [ ] Both registrar paths checked (or documented why one skipped)
- [ ] Prices recorded in operator message
- [ ] **Operator OK received** before any purchase API call
