Skip to content

Commit 1bb1bfe

Browse files
committed
docs: add llm-seo-readiness skill and sync CLAUDE.md
- Add project Cursor skill for LLM exports and SEO checklists\n- Align CLAUDE.md with agent guidelines (zh localization; no es maintenance)\n- Link skill from Resources Made-with: Cursor
1 parent 14fe1b6 commit 1bb1bfe

File tree

2 files changed

+56
-7
lines changed

2 files changed

+56
-7
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: llm-seo-readiness
3+
description: >-
4+
Validates Aptos docs changes for LLM consumption (llms.txt, curated feeds, Markdown exports, HTML→Markdown)
5+
and for SEO (metadata, sitemap, robots, structured data). Use when adding or restructuring docs, editing
6+
llms routes or curation, changing Head/meta/OG, updating robots.txt or sitemap behavior, or when the user
7+
mentions LLMs.txt, AI tool ingestion, crawlers, discoverability, or SEO.
8+
---
9+
10+
# LLM and SEO readiness (Aptos docs)
11+
12+
## LLM / machine-readable
13+
14+
- **Frontmatter**: Every new or renamed doc needs accurate `title` and `description` in English; they surface in `/llms.txt` and `.md` exports. Mirror updates in `src/content/docs/zh/` per agent guidelines (Spanish `es/` is out of scope for agent-maintained docs).
15+
- **Curated lists**: If a page should appear in the LLM index or early in full corpus, update `src/lib/llms-curated-ids.ts` (`LLMS_INDEX_SECTIONS`, `LLMS_SMALL_DOC_IDS`, `FULL_PRIORITY_DOC_IDS` as appropriate). Build fails if an id is missing from English non-draft docs.
16+
- **Index copy**: User-facing explanations live in `src/content/docs/llms-txt.mdx`, `src/content/docs/build/ai.mdx`, and the Chinese `zh/` counterparts—keep URLs and feed names aligned with `src/pages/llms-index.ts`.
17+
- **HTML → Markdown**: Shared logic is `src/lib/llms-html-sanitize.ts`. When minifying for `llms-small.txt`, collapse **spaces/tabs only**—never all `\s` (newlines must survive for fenced code and Markdown structure).
18+
- **Route wiring**: Custom handlers are swapped in via `src/integrations/llms-txt-index.ts`; endpoint implementations live under `src/pages/llms-index.ts`, `src/endpoints/llms-small.txt.ts`, `src/endpoints/llms-full.txt.ts`.
19+
- **Robots**: `public/robots.txt` should stay consistent with sitemap URL and, when feeds change, the commented LLMs.txt pointers at the bottom.
20+
21+
## SEO
22+
23+
- **Per-page metadata**: Starlight frontmatter `title` / `description` feed OG, Twitter, and schema in `src/starlight-overrides/Head.astro`—avoid empty or placeholder descriptions on public pages.
24+
- **Sitemap**: Produced by `@astrojs/sitemap` in `astro.config.mjs`; ensure new top-level routes or major URL changes still make sense for indexing.
25+
- **Hreflang / alternates**: Head override builds language alternates from `SUPPORTED_LANGUAGES`—new locales need config updates, not only content folders.
26+
- **Draft / hidden content**: Do not rely on curated LLM ids or public sitemap for content that must stay off production; follow existing draft filtering in the `.md` pipeline and curation tests.
27+
28+
## Verification
29+
30+
After substantive changes:
31+
32+
```bash
33+
pnpm test tests/llms-curated-ids.test.ts tests/llms-html-sanitize.test.ts
34+
pnpm lint && pnpm check
35+
```
36+
37+
For full coverage: `pnpm test` and a production `pnpm build` when touching routes or integrations.
38+
39+
## File map
40+
41+
| Area | Primary locations |
42+
|------|-------------------|
43+
| Curation | `src/lib/llms-curated-ids.ts`, `src/lib/llms.ts` |
44+
| llms.txt body | `src/pages/llms-index.ts` |
45+
| Feed endpoints | `src/endpoints/llms-small.txt.ts`, `src/endpoints/llms-full.txt.ts` |
46+
| Plugin override | `src/integrations/llms-txt-index.ts` |
47+
| Markdown export / sanitize | `src/lib/llms-html-sanitize.ts`, `src/pages/[...slug].md.ts` |
48+
| User docs | `src/content/docs/llms-txt.mdx`, `build/ai.mdx`, `zh/` |
49+
| SEO head | `src/starlight-overrides/Head.astro` |
50+
| Crawlers / sitemap hint | `public/robots.txt` |

CLAUDE.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This document provides essential guidelines for AI agents working on the Aptos D
44

55
## Project Overview
66

7-
This repository contains the official Aptos Developer Documentation, built using [Astro](https://astro.build/) and [Starlight](https://starlight.astro.build/). The documentation is available in English and Chinese (zh).
7+
This repository contains the official Aptos Developer Documentation, built using [Astro](https://astro.build/) and [Starlight](https://starlight.astro.build/). Published languages include English and Chinese (zh). Agent workflows here do **not** include creating or updating Spanish (`es`) documentation.
88

99
## Machine-readable documentation for agents
1010

@@ -50,6 +50,8 @@ src/
5050
└── assets/ # Site assets
5151
```
5252

53+
A legacy `docs/es/` tree or URLs may still exist for redirects; do not add or maintain Spanish doc content under these agent guidelines.
54+
5355
## Critical Guidelines
5456

5557
### 1. Linting and Formatting
@@ -65,7 +67,7 @@ Run these commands after making changes to ensure code quality.
6567

6668
### 2. Translation Requirements
6769

68-
**All documentation changes must be translated and verified in the Chinese version.**
70+
**Documentation changes that need localization must include the Chinese (`zh`) version.** Do not add or update Spanish (`es`) translations as part of agent work.
6971

7072
- **English docs:** `src/content/docs/`
7173
- **Chinese docs:** `src/content/docs/zh/`
@@ -74,11 +76,7 @@ When modifying documentation:
7476

7577
1. Make the change in the English version first
7678
2. Create or update the corresponding Chinese translation in `zh/`
77-
3. Ensure all internal links use the correct language prefix (e.g., `/zh/network/` for Chinese)
78-
79-
**No Spanish documentation tree:** Do not add pages under `src/content/docs/es/`. The site does not ship Spanish MDX/Markdown docs.
80-
81-
**Translated PDFs and external assets:** You may still link official non-English files when appropriate—for example the Spanish white paper PDF (`aptos-whitepaper_es.pdf`) from the [Aptos white paper](/network/blockchain/aptos-white-paper) page alongside other language PDFs.
79+
3. Ensure Chinese internal links use the `/zh/...` prefix (see Internal Links below)
8280

8381
### 3. Commit Message Requirements
8482

@@ -206,6 +204,7 @@ module example::hello {
206204

207205
## Resources
208206

207+
- [LLM and SEO readiness (Cursor skill)](.cursor/skills/llm-seo-readiness/SKILL.md) — checklists for `llms.txt`, curated feeds, `.md` exports, and metadata/crawlers
209208
- [Astro Documentation](https://docs.astro.build/)
210209
- [Starlight Documentation](https://starlight.astro.build/)
211210
- [MDX Documentation](https://mdxjs.com/)

0 commit comments

Comments
 (0)