Outcome
Clear, versioned control over what search and AI crawlers may access, with private paths blocked and the sitemap advertised.
A code-defined robots.txt via Next.js MetadataRoute that opens public routes, blocks /admin and /api, names the AI crawler user-agents explicitly (GPTBot, ClaudeBot, OAI-SearchBot and peers), and points to the sitemap — making crawl and AI-access policy reviewable in version control.
Verified HMX-owned system
Robots Crawl Policy uses a web app route, data, and conversion layer for Full-Stack Websites. A code-defined robots.txt via Next.js MetadataRoute that opens public routes, blocks /admin and /api, names the AI crawler user-agents explicitly (... The architecture connects implement app/robots, next, typescript, and clear with an explicit control path.
Outcome
Clear, versioned control over what search and AI crawlers may access, with private paths blocked and the sitemap advertised.
Main risk
An overly broad disallow accidentally deindexes public pages, or sensitive paths stay crawlable.
Prevention
Explicit allow/disallow lists reviewed in PRs, with /admin and /api always disallowed and public paths verified.
Fallback
On any generation error, serve a minimal allow-public/deny-admin policy plus the sitemap reference.
System architecture
A code-defined robots.txt via Next.js MetadataRoute that opens public routes, blocks /admin and /api, names the AI crawler user-agents explicitly (...
Add explicit user-agent groups for AI crawlers (GPTBot, ChatGPT-User, ClaudeBot, OAI-SearchBot, Claude-SearchBot)
Next.js robots (MetadataRoute) supports the route, form, or data boundary for Robots Crawl Policy so public UX and backend state stay connected.
Reference the absolute sitemap URL so crawlers discover the full URL set
On any generation error, serve a minimal allow-public/deny-admin policy plus the sitemap reference.
Clear, versioned control over what search and AI crawlers may access, with private paths blocked and the sitemap advertised.
1-2 days
A code-defined robots.txt via Next.js MetadataRoute that opens public routes, blocks /admin and /api, names the AI crawler user-agents explicitly (GPTBot, ClaudeBot, OAI-SearchBot and peers), and points to the sitemap — making crawl and AI-access policy reviewable in version control.
Tools
Data flow
Controls and fallbacks
Full-stack websites for service businesses and operators: route architecture, service pages, lead capture, metadata, proof boundaries, blog/database paths, analytics, and deployment checks.
Route map
Clear service routes
Lead capture
Lead capture that saves context
Public metadata
SEO and schema on public pages
Launch QA
Analytics events tied to CTAs