---
name: ipv6-code-review
description: >
  Use when reviewing a PR or diff, auditing a service for IPv6 readiness, or before
  claiming dual-stack or IPv6-only support. Walks code for listen/bind, resolution,
  destination selection, storage, runtime, test, and ICMPv6 pitfalls and reports
  structured findings.
---

# IPv6 code review

## Process

1. Scope the diff or service surfaces that touch networking, config listen addresses, DNS, IP fields, health checks, or docs/examples.
2. Walk the checklist below (intent matters: listen vs dial, intentional legacy shims).
3. Emit the output template. Severity: **blocker** (breaks IPv6-only or dual-stack), **major**, **nit**.
4. For each finding, point to a sibling skill for the fix.
5. Intentional IPv4-only behavior needs a documented rationale and ticket (e.g. `# ipv6-readiness: ignore-next-line -- see TICKET-123`).

## Checklist

- [ ] Listen/bind: no IPv4-only `127.0.0.1` / `0.0.0.0` where dual-stack or IPv6-local clients matter (`ipv6-localhost-bind`)
- [ ] Resolution: no legacy one-address APIs; full candidate list or Happy Eyeballs (`ipv6-name-resolution`)
- [ ] Destination selection: not trusting DNS/`getaddrinfo` order alone; no cross-family shuffle (`ipv6-destination-selection`)
- [ ] Storage/parsing: no `CHAR(15)` / 32-bit IP / split-on-`.` (`ipv6-address-storage`)
- [ ] Language/runtime: no `gethostbyname`, Java `getByName`-only paths, Node single-address lookup defaults
- [ ] Process config: no `java.net.preferIPv4Stack=true`, forced `ipv4first` DNS order, or IPv4-only probe flags without a ticket (`ipv6-runtime-config`)
- [ ] Tests: dual-stack **and** IPv6-Only-Strict (and NAT64 if in scope) per `ipv6-app-testing`, not dual-stack CI alone
- [ ] Terminology: claims of “IPv6-only” state scope and whether IPv4aaS/NAT64 is present (`ipv6-app-testing`)
- [ ] Docs/examples: prefer `2001:db8::` / `3fff::`, not RFC1918 as the default teaching form; validation accepts GUA/ULA/NAT64 WKP/link-local+zone
- [ ] Health/config: probes match listener family; no IPv4-only connectivity pre-check for IPv6-only apps
- [ ] Allow/deny lists include IPv6 before enabling AAAA on the server
- [ ] ICMPv6: do not block types required for PMTUD / Neighbor Discovery; allow required types; **do not** disable firewalls wholesale

## Output template

```markdown
## IPv6 readiness review

**Verdict:** pass | findings

### Findings
- **[severity]** `path:line`: issue
  - Fix: …
  - Skill: `ipv6-…`

### Intentional exceptions
- `path:line`: rationale / ticket
```

## Gotchas

- Regex scanners miss intent (listen vs connect). Prefer this review over Semgrep-only conclusions.
- Paid or gated blog posts are not the procedure source; use the public IETF draft and these skills.
- "IPv6 preferred" slogan skills may over-correct client `127.0.0.1` dials; follow `#localhost-pitfalls`.

## Sibling skills

- `ipv6-ready-coding`
- `ipv6-app-testing`
- `ipv6-name-resolution`
- `ipv6-destination-selection`
- `ipv6-localhost-bind`
- `ipv6-runtime-config`
- `ipv6-address-storage`

## Source

- Hub: https://www.peachymango.org/ipv6
- https://datatracker.ietf.org/doc/draft-martin-deploying-ipv6-data-center/
- https://datatracker.ietf.org/doc/draft-ietf-v6ops-ipv6-app-testing/ (failure modes §5)
- https://datatracker.ietf.org/doc/draft-ietf-v6ops-ipv6-only/
