From 991e393b784e8fcf1e63d7576df992b2b3c0c851 Mon Sep 17 00:00:00 2001 From: Portal Code Bot Date: Wed, 19 Nov 2025 15:35:39 +0000 Subject: [PATCH 1/4] docs(ai): add consolidated AI tools page, Kapa guidance, and prose updates --- docusaurus/docs/ai-tools.md | 58 +++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 docusaurus/docs/ai-tools.md diff --git a/docusaurus/docs/ai-tools.md b/docusaurus/docs/ai-tools.md new file mode 100644 index 0000000000..d01416f500 --- /dev/null +++ b/docusaurus/docs/ai-tools.md @@ -0,0 +1,58 @@ +--- +title: AI tools in Strapi docs +description: One place to discover and use all AI-related helpers available on the Strapi documentation site. +tags: +- ai +- llms +- productivity +toc_max_heading_level: 3 +--- + + +Use this page to quickly find and use AI helpers across the Strapi docs: copy a page’s Markdown, open a chat prefilled with context, or download purpose‑built summaries for LLMs. + + +# AI tools in Strapi docs + +Strapi documentation includes a few AI‑oriented helpers designed to make it easier to ask questions about the docs, learn from code examples, and share focused context with an assistant. + +All AI options live in the AI toolbar at the top of each documentation page. From there, you can copy the current page as raw Markdown, open a new chat in your preferred assistant with the page prefilled as context, or open purpose‑built text files tailored for LLMs. + +Use Copy Markdown when you want an assistant to reason over the exact source of the page you are reading. This copies the raw Markdown to your clipboard so you can paste it into a chat or IDE assistant. + +When you need site‑wide context, prefer one of the LLMs files: +- LLMs.txt provides a concise, link‑rich overview of pages. Open `/llms.txt` to get a lightweight map of the docs that you can copy or share with an assistant as high‑level context. +- LLMs-full.txt contains the entire documentation in a single file. Open `/llms-full.txt` when full‑site context is required. The file is large. +- LLMs-code.txt extracts all code examples, grouped by page and section with language and file‑path hints. Open `/llms-code.txt` for code‑centric work (migrations, refactors, API discovery). Pair examples with their page URL for best results. + +To start a conversation without copy‑pasting, use the Open with LLM buttons in the toolbar. “Open with ChatGPT” and “Open with Claude” open a new tab and prefill a brief prompt that references the current page (often in your browser language). This is the fastest way to ask, “Read this page so I can ask questions about it.” + +## Tips for better results + +- Include the page URL: Reference the exact page (and section anchor, if relevant) so the assistant grounds its answer. +- Be explicit about Strapi version: Mention Strapi v5 (or your version) and plugin versions to avoid outdated code. +- Pair examples with context: If you share a code snippet from `/llms-code.txt`, also link the page it comes from. +- Ask for “explain first, then propose”: Request an explanation of the docs’ guidance before asking for code. + +## Guidance for IDE AI tools (Cursor, Copilot, etc.) + +If your IDE assistant struggles to generate correct Strapi code (for example, custom backend code or plugin services): + +- Start from docs: Provide the assistant with the page URL and a relevant code example from `/llms-code.txt`. +- Clarify the goal and constraints: Describe your use case, expected inputs/outputs, and that you are targeting Strapi v5. +- Prefer public extension points: Ask for solutions using documented APIs (controllers, services, middlewares, policies, and plugin extension points) instead of relying on private internals. +- Verify against the docs: Ask the assistant to cite the pages or sections it relied on. + +Related request: see the discussion about improving AI outcomes with Strapi code generation in the issue tracker. + +## Kapa chatbot + +The Strapi docs include an integrated Kapa chatbot to help you explore topics and code examples without leaving the page. + +- Sidebar entry point: Click Ask AI in the left sidebar (next to search) to open the Kapa panel and start a conversation about anything in the docs. +- Code‑block entry point: Hover any substantial code block and click Ask AI to ask for an explanation or adaptation of that snippet. +- Deep thinking mode: For more thorough answers, enable Kapa’s deep thinking mode (slower, but better for multi‑step reasoning or complex refactors). + +:::info Privacy note +When you copy or share documentation content with third‑party tools, ensure you handle data safely and follow your organization’s policies. +::: From e67d8024a2849ac64ae1352619a2d4eb6f66dac2 Mon Sep 17 00:00:00 2001 From: Portal Code Bot Date: Wed, 19 Nov 2025 16:36:20 +0000 Subject: [PATCH 2/4] ai-toolbar: place ChatGPT and Claude right after Copy Markdown --- .../AiToolbar/config/aiToolsConfig.js | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/docusaurus/src/components/AiToolbar/config/aiToolsConfig.js b/docusaurus/src/components/AiToolbar/config/aiToolsConfig.js index 4e06ebd52e..adf336d847 100644 --- a/docusaurus/src/components/AiToolbar/config/aiToolsConfig.js +++ b/docusaurus/src/components/AiToolbar/config/aiToolsConfig.js @@ -11,6 +11,29 @@ export const aiToolsConfig = { icon: 'copy', actionType: 'copy-markdown', }, + { + id: 'open-chatgpt', + label: 'Open with ChatGPT', + icon: 'open-ai-logo', + actionType: 'open-llm', + targetUrl: 'https://chat.openai.com/', + promptTemplate: 'Read from {{url}} so I can ask questions about it.', + localizedPromptTemplates: aiPromptTemplates, + promptParam: 'prompt', + openIn: '_blank', + }, + { + id: 'open-claude', + label: 'Open with Claude', + icon: 'chat-teardrop-text', + actionType: 'open-llm', + targetUrl: 'https://claude.ai/new', + promptTemplate: 'Read from {{url}} so I can ask questions about it.', + localizedPromptTemplates: aiPromptTemplates, + copyPromptToClipboard: true, + promptParam: 'q', + openIn: '_blank', + }, { id: 'view-llms', label: 'View LLMs.txt', @@ -35,28 +58,5 @@ export const aiToolsConfig = { actionType: 'navigate', url: '/llms-full.txt', }, - { - id: 'open-chatgpt', - label: 'Open with ChatGPT', - icon: 'open-ai-logo', - actionType: 'open-llm', - targetUrl: 'https://chat.openai.com/', - promptTemplate: 'Read from {{url}} so I can ask questions about it.', - localizedPromptTemplates: aiPromptTemplates, - promptParam: 'prompt', - openIn: '_blank', - }, - { - id: 'open-claude', - label: 'Open with Claude', - icon: 'chat-teardrop-text', - actionType: 'open-llm', - targetUrl: 'https://claude.ai/new', - promptTemplate: 'Read from {{url}} so I can ask questions about it.', - localizedPromptTemplates: aiPromptTemplates, - copyPromptToClipboard: true, - promptParam: 'q', - openIn: '_blank', - }, ], }; From f2f8f46104d250aca31885ff67f9f17790beafac Mon Sep 17 00:00:00 2001 From: Portal Code Bot Date: Wed, 19 Nov 2025 17:31:57 +0000 Subject: [PATCH 3/4] ci: allow committing llms*.txt in static/ via .gitignore exceptions --- docusaurus/.gitignore | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docusaurus/.gitignore b/docusaurus/.gitignore index fc6e0ad721..4192533a06 100644 --- a/docusaurus/.gitignore +++ b/docusaurus/.gitignore @@ -32,5 +32,10 @@ docs/node_modules/** # LLMs.txt files and related llms*.txt **/llm*.txt + +# Allow the generated public files under static/ to be committed by CI +!static/llms.txt +!static/llms-full.txt +!static/llms-code.txt pr-*.diff -*-results.json \ No newline at end of file +*-results.json From bf021726bca4f0ac78b75a56748b2d68c9ef99a7 Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Wed, 19 Nov 2025 18:48:42 +0100 Subject: [PATCH 4/4] Delete docusaurus/docs/ai-tools.md --- docusaurus/docs/ai-tools.md | 58 ------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 docusaurus/docs/ai-tools.md diff --git a/docusaurus/docs/ai-tools.md b/docusaurus/docs/ai-tools.md deleted file mode 100644 index d01416f500..0000000000 --- a/docusaurus/docs/ai-tools.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: AI tools in Strapi docs -description: One place to discover and use all AI-related helpers available on the Strapi documentation site. -tags: -- ai -- llms -- productivity -toc_max_heading_level: 3 ---- - - -Use this page to quickly find and use AI helpers across the Strapi docs: copy a page’s Markdown, open a chat prefilled with context, or download purpose‑built summaries for LLMs. - - -# AI tools in Strapi docs - -Strapi documentation includes a few AI‑oriented helpers designed to make it easier to ask questions about the docs, learn from code examples, and share focused context with an assistant. - -All AI options live in the AI toolbar at the top of each documentation page. From there, you can copy the current page as raw Markdown, open a new chat in your preferred assistant with the page prefilled as context, or open purpose‑built text files tailored for LLMs. - -Use Copy Markdown when you want an assistant to reason over the exact source of the page you are reading. This copies the raw Markdown to your clipboard so you can paste it into a chat or IDE assistant. - -When you need site‑wide context, prefer one of the LLMs files: -- LLMs.txt provides a concise, link‑rich overview of pages. Open `/llms.txt` to get a lightweight map of the docs that you can copy or share with an assistant as high‑level context. -- LLMs-full.txt contains the entire documentation in a single file. Open `/llms-full.txt` when full‑site context is required. The file is large. -- LLMs-code.txt extracts all code examples, grouped by page and section with language and file‑path hints. Open `/llms-code.txt` for code‑centric work (migrations, refactors, API discovery). Pair examples with their page URL for best results. - -To start a conversation without copy‑pasting, use the Open with LLM buttons in the toolbar. “Open with ChatGPT” and “Open with Claude” open a new tab and prefill a brief prompt that references the current page (often in your browser language). This is the fastest way to ask, “Read this page so I can ask questions about it.” - -## Tips for better results - -- Include the page URL: Reference the exact page (and section anchor, if relevant) so the assistant grounds its answer. -- Be explicit about Strapi version: Mention Strapi v5 (or your version) and plugin versions to avoid outdated code. -- Pair examples with context: If you share a code snippet from `/llms-code.txt`, also link the page it comes from. -- Ask for “explain first, then propose”: Request an explanation of the docs’ guidance before asking for code. - -## Guidance for IDE AI tools (Cursor, Copilot, etc.) - -If your IDE assistant struggles to generate correct Strapi code (for example, custom backend code or plugin services): - -- Start from docs: Provide the assistant with the page URL and a relevant code example from `/llms-code.txt`. -- Clarify the goal and constraints: Describe your use case, expected inputs/outputs, and that you are targeting Strapi v5. -- Prefer public extension points: Ask for solutions using documented APIs (controllers, services, middlewares, policies, and plugin extension points) instead of relying on private internals. -- Verify against the docs: Ask the assistant to cite the pages or sections it relied on. - -Related request: see the discussion about improving AI outcomes with Strapi code generation in the issue tracker. - -## Kapa chatbot - -The Strapi docs include an integrated Kapa chatbot to help you explore topics and code examples without leaving the page. - -- Sidebar entry point: Click Ask AI in the left sidebar (next to search) to open the Kapa panel and start a conversation about anything in the docs. -- Code‑block entry point: Hover any substantial code block and click Ask AI to ask for an explanation or adaptation of that snippet. -- Deep thinking mode: For more thorough answers, enable Kapa’s deep thinking mode (slower, but better for multi‑step reasoning or complex refactors). - -:::info Privacy note -When you copy or share documentation content with third‑party tools, ensure you handle data safely and follow your organization’s policies. -:::