提示詞內容 (Prompt Content)
# Role: Expert Next.js Architect & Technical SEO Specialist
# Task: SEO & AEO Infrastructure Setup
# Goal: Create production-ready robots.txt, sitemap.ts/xml, and llms.txt tailored for this specific project architecture.
---
## CONTEXT & INTAKE
I will provide you with snippets, file trees, or direct contents of my project files (e.g., package.json, next.config.js, and data-fetching utilities like Notion API clients or MDX parsers).
Do NOT generate the final files until you have completed Phase 1 and outputted your audit summary.
---
## PHASE 1 — ARCHITECTURE AUDIT (Execute First)
Analyze the provided project context and answer the following in a brief summary:
1. Framework & Routing Strategy:
- Confirm the Next.js routing paradigm (App Router app/ vs Pages Router `pages/`).
2. Production Domain:
- Identify the canonical domain from configs or .env. (Fallback: `https://YOUR_DOMAIN.com`).
3. Data Hydration & Schema:
- Identify how dynamic content is fetched (e.g., Notion API, local MDX).
- Map the exact utility functions used (e.g., `getNotionPosts()`) and the URL routing patterns (e.g., `/blog/[slug]`).
4. Static Topography:
- List all hardcoded static routes (e.g., /, `/about`).
5. Existing SEO Artifacts:
- Flag any existing robots.ts/txt, sitemap.ts/xml, or llms.txt files that need modification rather than creation.
6. Semantic Identity:
- Extract site name, author, and primary topics from layout.tsx, metadata configs, or root files.
Pause here. Output your Phase 1 summary and wait for my confirmation before proceeding to Phase 2.
---
## PHASE 2 — GENERATE INFRASTRUCTURE (Upon Confirmation)
Write the code for the following three files based strictly on the Phase 1 audit.
### FILE 1: robots.ts (or `.txt`)
- Placement: app/robots.ts (App Router) or public/robots.txt (Static/Pages).
- Rules:
- Allow all standard crawlers (`*`) to /.
- Disallow admin, draft, or internal API routes.
- Explicitly Allow AI crawlers: GPTBot, PerplexityBot, ClaudeBot, anthropic-ai, Applebot-Extended.
- Append the absolute URL to the sitemap.
### FILE 2: sitemap.ts (or `.xml`)
- Placement: app/sitemap.ts (App Router) or dynamic generation equivalent.
- Rules:
- Import and reuse existing data-fetching logic (Do NOT rewrite API calls).
- Map static routes with static lastModified dates.
- Map dynamic routes using the last_edited_time or equivalent from the CMS/API.
- Prioritize routing: Homepage (`1.0`), Category/Indexes (`0.9`), Individual Posts (`0.8`).
- Filter out draft or private states natively.
### FILE 3: llms.txt
- Placement: public/llms.txt.
- Rules: Write in clean, highly readable Markdown designed for LLM parsing. Include:
- Header: [Site Name] - [One-line description].
- Metadata: Author and Primary Language.
- Sitemap Equivalent: Bulleted list of core sections and their absolute URLs with 1-sentence contextual descriptions.
- Knowledge Domain: A concise list of the core topics, themes, and technical domains this site covers.
- AEO Policy: "This site welcomes indexing and citation by AI language models and search engines. All public content may be referenced with attribution to [Site Name] at [Domain]."
---
## PHASE 3 — STRICT CONSTRAINTS & VALIDATION
Before finalizing your output, ensure:
- [ ] No new NPM packages were introduced.
- [ ] TypeScript is strictly typed (`any` is forbidden).
- [ ] Existing routing and fetching logic was imported, not duplicated.
- [ ] Code is ready to be directly copy-pasted into the respective directories.