From 52bea541d3d891d189bf2ac386bbf2f7d9b3ec01 Mon Sep 17 00:00:00 2001 From: Ross Date: Tue, 24 Feb 2026 10:19:21 -0700 Subject: [PATCH 1/3] update URL on llms.txt page --- README.md | 2 ++ scripts/generateAiArtifacts.ts | 8 -------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5c0ca6343..af0976e19 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,8 @@ The build also generates AI-friendly artifacts that will be served by the hosted - `build/ai/docs.jsonl` (served as `/ai/docs.jsonl`) - `build/ai/raw/` (served as `/ai/raw/`) +Artifact URLs default to `https://docs.yearn.fi`. To generate artifacts against a preview deployment, set `DOCS_URL` explicitly (for example `DOCS_URL=https://`). + ## Configure .env The docs site pulls data from on-chain smart contracts, so an API key is necessary. The default is an Alchemy API key so the easiest thing to do is get a free api key from them at https://www.alchemy.com/pricing. diff --git a/scripts/generateAiArtifacts.ts b/scripts/generateAiArtifacts.ts index 098e69986..08fae9b25 100644 --- a/scripts/generateAiArtifacts.ts +++ b/scripts/generateAiArtifacts.ts @@ -100,14 +100,6 @@ function resolveSiteOrigin() { const explicit = process.env.DOCS_URL?.trim() if (explicit) return explicit.replace(/\/+$/, '') - const vercel = process.env.VERCEL_URL?.trim() - if (vercel) { - const withProto = vercel.startsWith('http://') || vercel.startsWith('https://') - ? vercel - : `https://${vercel}` - return withProto.replace(/\/+$/, '') - } - return 'https://docs.yearn.fi' } From 0ceb7c87ef2e23f3ea0f741c456e7a09cc40979d Mon Sep 17 00:00:00 2001 From: Ross Date: Tue, 24 Feb 2026 11:42:04 -0700 Subject: [PATCH 2/3] add easy to find llm entrypoint --- docs/getting-started/llm-friendly-docs.md | 51 +++++++++++++++++++++++ scripts/fetchedAddressData.json | 2 +- sidebars/sidebarsContributing.js | 5 +++ sidebars/sidebarsDeveloperDocs.js | 5 +++ sidebars/sidebarsUserDocs.js | 5 +++ 5 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 docs/getting-started/llm-friendly-docs.md diff --git a/docs/getting-started/llm-friendly-docs.md b/docs/getting-started/llm-friendly-docs.md new file mode 100644 index 000000000..625bc4c1f --- /dev/null +++ b/docs/getting-started/llm-friendly-docs.md @@ -0,0 +1,51 @@ +# LLM Friendly Documentation + +This page makes it easy to share Yearn docs with an LLM using machine-readable endpoints built from the docs site. + +## Canonical endpoints + +- https://docs.yearn.fi/llms.txt +- https://docs.yearn.fi/ai/manifest.json +- https://docs.yearn.fi/ai/docs.jsonl +- https://docs.yearn.fi/ai/raw/ + +## Example prompt + +```text +Use https://docs.yearn.fi/llms.txt as the entry point. Read the linked AI endpoints to answer my question, and cite canonical Yearn docs URLs from https://docs.yearn.fi in your response. +``` + +## Install the Yearn Docs Skill + +You can also install the Yearn docs skill, which is is published from this docs site and gives instructions to query the docs: + +- https://docs.yearn.fi/skills/yearn-docs-site-query/SKILL.md +- https://docs.yearn.fi/skills/yearn-docs-site-query/scripts/yearn_docs_query.py + +### Codex + +Give this to Codex as the steps to install: + +```bash +SKILL_DIR="${CODEX_HOME:-$HOME/.codex}/skills/yearn-docs-site-query" +mkdir -p "$SKILL_DIR/scripts" +curl -fsSL https://docs.yearn.fi/skills/yearn-docs-site-query/SKILL.md -o "$SKILL_DIR/SKILL.md" +curl -fsSL https://docs.yearn.fi/skills/yearn-docs-site-query/scripts/yearn_docs_query.py -o "$SKILL_DIR/scripts/yearn_docs_query.py" +chmod +x "$SKILL_DIR/scripts/yearn_docs_query.py" +``` + +Restart Codex after installation so the new skill is loaded. + +### Claude Code + +Give this to Claude as the steps to install: + +```bash +SKILL_DIR="$HOME/.claude/skills/yearn-docs-site-query" +mkdir -p "$SKILL_DIR/scripts" +curl -fsSL https://docs.yearn.fi/skills/yearn-docs-site-query/SKILL.md -o "$SKILL_DIR/SKILL.md" +curl -fsSL https://docs.yearn.fi/skills/yearn-docs-site-query/scripts/yearn_docs_query.py -o "$SKILL_DIR/scripts/yearn_docs_query.py" +chmod +x "$SKILL_DIR/scripts/yearn_docs_query.py" +``` + +In Claude Code, run `/help` and look for `/yearn-docs-site-query`. diff --git a/scripts/fetchedAddressData.json b/scripts/fetchedAddressData.json index 203de6e16..fca1bc2a2 100644 --- a/scripts/fetchedAddressData.json +++ b/scripts/fetchedAddressData.json @@ -1,5 +1,5 @@ { - "timeLastChecked": 1770347214, + "timeLastChecked": 1771957735, "addressesData": { "v3ContractAddresses": { "topLevel": { diff --git a/sidebars/sidebarsContributing.js b/sidebars/sidebarsContributing.js index b9136c027..cc0e3122d 100644 --- a/sidebars/sidebarsContributing.js +++ b/sidebars/sidebarsContributing.js @@ -92,5 +92,10 @@ module.exports = { 'documentation/writing-style-guide', ], }, + { + type: 'link', + label: 'LLM Friendly Documentation', + href: '/getting-started/llm-friendly-docs', + }, ], } diff --git a/sidebars/sidebarsDeveloperDocs.js b/sidebars/sidebarsDeveloperDocs.js index 70b9e8fc2..bd32141b4 100644 --- a/sidebars/sidebarsDeveloperDocs.js +++ b/sidebars/sidebarsDeveloperDocs.js @@ -340,6 +340,11 @@ export default { value: '
', className: 'divider', }, + { + type: 'link', + label: 'LLM Friendly Documentation', + href: '/getting-started/llm-friendly-docs', + }, { type: 'category', label: 'Deprecated Products', diff --git a/sidebars/sidebarsUserDocs.js b/sidebars/sidebarsUserDocs.js index 2fad869e0..90750fee4 100644 --- a/sidebars/sidebarsUserDocs.js +++ b/sidebars/sidebarsUserDocs.js @@ -219,6 +219,11 @@ module.exports = { label: 'FAQ', id: 'guides/user-faq', }, + { + type: 'doc', + label: 'LLM Friendly Documentation', + id: 'llm-friendly-docs', + }, { type: 'link', label: 'Token and Contract Addresses →', From a2084d5b0670256b65c0ecff3e59e6d8850f9525 Mon Sep 17 00:00:00 2001 From: Ross Date: Tue, 24 Feb 2026 14:48:04 -0700 Subject: [PATCH 3/3] fix typo --- docs/getting-started/llm-friendly-docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started/llm-friendly-docs.md b/docs/getting-started/llm-friendly-docs.md index 625bc4c1f..0b515be40 100644 --- a/docs/getting-started/llm-friendly-docs.md +++ b/docs/getting-started/llm-friendly-docs.md @@ -17,7 +17,7 @@ Use https://docs.yearn.fi/llms.txt as the entry point. Read the linked AI endpoi ## Install the Yearn Docs Skill -You can also install the Yearn docs skill, which is is published from this docs site and gives instructions to query the docs: +You can also install the Yearn docs skill, which is published from this docs site and gives instructions to query the docs: - https://docs.yearn.fi/skills/yearn-docs-site-query/SKILL.md - https://docs.yearn.fi/skills/yearn-docs-site-query/scripts/yearn_docs_query.py