Skip to content

feat: Add ai-skills federated content and data - #48045

Merged
jeremenichelli merged 2 commits into
masterfrom
jeremias/docs-1189-pre-fetch-ai-skills-data-to-markdown
Jul 21, 2026
Merged

jeremenichelli merged 2 commits into
masterfrom
jeremias/docs-1189-pre-fetch-ai-skills-data-to-markdown

Conversation

@jeremenichelli

@jeremenichelli jeremenichelli commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

I have read the CONTRIBUTING.md file.

YES

What kind of change does this PR introduce?

Adds support for AI Skills data fetching on /docs/guides/ai-tools/ai-skills route to be fetched pre-build and provide complete markdown content.

Small re-design on the section for better readability.

How to test:

  • Open the preview link for this PR.
  • Go to Build > AI Tools
  • Check all the AI Skills are listed correctly.
  • Add .md to the route, the server should return a markdown version of each page with all the content.
  • Try 'Copy as Markdown' button and check content is copied correctly.

About the re-design. See how in the table format the description is really hard to read because of the narrow space, and the command is cut off. Overall, a table is a really poor use of space for this type of content.

Before
Screenshot 2026-07-17 at 19 12 55

After
Screenshot 2026-07-17 at 19 12 50

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Expanded the getting-started docs with an AI Skills section.
    • Documentation generation now automatically includes AI skill content.
  • Bug Fixes
    • Improved AI skills loading by relying on pre-generated skill metadata instead of live repository parsing.
  • Documentation
    • AI skills are now rendered in a clearer, per-skill format with descriptions and install commands.
  • Refactor
    • Updated the documentation generator to handle the new AI Skills guide component.

@jeremenichelli
jeremenichelli requested a review from a team as a code owner July 17, 2026 17:24
@supabase

supabase Bot commented Jul 17, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel

vercel Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment, Open in v0 Jul 21, 2026 10:11am
6 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 21, 2026 10:11am
design-system Skipped Skipped Jul 21, 2026 10:11am
studio-self-hosted Skipped Skipped Jul 21, 2026 10:11am
studio-staging Skipped Skipped Jul 21, 2026 10:11am
ui-library Skipped Skipped Jul 21, 2026 10:11am
zone-www-dot-com Skipped Skipped Jul 21, 2026 10:11am

Request Review

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 17, 2026
@jeremenichelli jeremenichelli added the ai Vectors, embeddings, all-things-AI label Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a7fc3c6b-7f11-4d25-803b-fbb45ece7c2c

📥 Commits

Reviewing files that changed from the base of the PR and between bacba25 and 33e700d.

📒 Files selected for processing (1)
  • apps/docs/internals/markdown-schema/AiSkillsIndex.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/docs/internals/markdown-schema/AiSkillsIndex.ts

📝 Walkthrough

Walkthrough

AI skill metadata is generated into a local JSON file, consumed by the guide UI, and transformed into Markdown through a registered schema handler. The UI now uses headings and code blocks instead of a table and copy button.

Changes

AI skills content pipeline

Layer / File(s) Summary
Generate AI skill metadata
apps/docs/lib/docs.ts, apps/docs/scripts/federated-content/...
The federated-content pipeline fetches skill directories and SKILL.md descriptions from GitHub, builds sorted summaries, and writes ai-skills.json under the generated docs directory.
Consume and render generated skills
apps/docs/app/guides/getting-started/ai-skills/...
getAiSkills reads the generated JSON file, while AiSkillsIndex renders each skill with a heading, description, and install command using CodeBlock; the previous copy-button component is removed.
Generate Markdown for AiSkillsIndex
apps/docs/internals/markdown-schema/AiSkillsIndex.ts, apps/docs/internals/generate-guides-markdown.ts
A Markdown-schema handler reads generated skill summaries and emits headings, descriptions, and shell code blocks when processing AiSkillsIndex.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHub
  participant FederatedContent
  participant GeneratedJSON
  participant AiSkillsGuide
  GitHub->>FederatedContent: Provide skill directories and SKILL.md files
  FederatedContent->>GeneratedJSON: Write ai-skills.json
  AiSkillsGuide->>GeneratedJSON: Read skill summaries
  GeneratedJSON-->>AiSkillsGuide: Return parsed skills
  AiSkillsGuide-->>AiSkillsGuide: Render descriptions and install commands
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding AI skills federated content and data.
Description check ✅ Passed The description covers the change, testing, and visuals, but it omits the explicit current behavior section from the template.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jeremias/docs-1189-pre-fetch-ai-skills-data-to-markdown

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/docs/internals/markdown-schema/AiSkillsIndex.ts (1)

1-4: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reuse GENERATED_DIRECTORY for this cross-layer path contract.

Reconstructing the path here can silently diverge from the producer and runtime consumer when the generated directory moves.

Proposed refactor
 import { readFileSync } from 'node:fs'
 import path from 'node:path'
+import { GENERATED_DIRECTORY } from '~/lib/docs'

-const SKILLS_PATH = path.join(process.cwd(), 'features/docs/generated/ai-skills.json')
+const SKILLS_PATH = path.join(GENERATED_DIRECTORY, 'ai-skills.json')
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/docs/internals/markdown-schema/AiSkillsIndex.ts` around lines 1 - 4,
Update the path construction near SKILLS_PATH to reuse the existing
GENERATED_DIRECTORY symbol instead of rebuilding the generated-directory path
from process.cwd() and a hardcoded segment. Preserve the ai-skills.json filename
while aligning this reader with the producer and runtime consumer path contract.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/docs/scripts/federated-content/fetch-federated-content.ts`:
- Around line 155-170: Validate item.name against the repository’s safe
skill-slug format before constructing the installCommand in the skills mapping;
reject or skip invalid directory names rather than embedding them. Ensure only
validated names are interpolated into the executable command and preserve the
existing behavior for valid skill names.

---

Nitpick comments:
In `@apps/docs/internals/markdown-schema/AiSkillsIndex.ts`:
- Around line 1-4: Update the path construction near SKILLS_PATH to reuse the
existing GENERATED_DIRECTORY symbol instead of rebuilding the
generated-directory path from process.cwd() and a hardcoded segment. Preserve
the ai-skills.json filename while aligning this reader with the producer and
runtime consumer path contract.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: de6bc95c-75f9-4b25-b8b8-f1ee7c17ef5f

📥 Commits

Reviewing files that changed from the base of the PR and between c914163 and bacba25.

📒 Files selected for processing (7)
  • apps/docs/app/guides/getting-started/ai-skills/AiSkills.utils.ts
  • apps/docs/app/guides/getting-started/ai-skills/AiSkillsIndex.tsx
  • apps/docs/app/guides/getting-started/ai-skills/CopyButton.tsx
  • apps/docs/internals/generate-guides-markdown.ts
  • apps/docs/internals/markdown-schema/AiSkillsIndex.ts
  • apps/docs/lib/docs.ts
  • apps/docs/scripts/federated-content/fetch-federated-content.ts
💤 Files with no reviewable changes (1)
  • apps/docs/app/guides/getting-started/ai-skills/CopyButton.tsx

@czenko czenko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran through the test and this worked as expected.

Left non-blocking notes.

return skills
.map(
(skill) =>
`### ${skill.name}\n\n${skill.description}\n\n\`\`\`sh\n${skill.installCommand}\n\`\`\``

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree that this formatting is much nicer than the table.

Would be nice if this was written in code to be more human readable, too. You can instead drop the \n escapes and let the string's actual line breaks mirror the markdown output.

Comment on lines +4 to +13
const SKILLS_PATH = path.join(process.cwd(), 'features/docs/generated/ai-skills.json')

interface SkillSummary {
name: string
description: string
installCommand: string
}

export const AiSkillsIndex = (): string => {
const skills: SkillSummary[] = JSON.parse(readFileSync(SKILLS_PATH, 'utf-8'))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean and simple. 🎉

}

const AI_SKILLS_REPO = {
org: 'supabase',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two thoughts:

  • (nit) Should org have a default value of 'supabase' so this does not have to be defined each time, assuming this gets hoisted into something shared?
  • There is already a SKILLS_REPO that is a separate but identical object literal. Renaming could introduce a bug. Could hoist this into a shared constant.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) Should org have a default value of 'supabase' so this does not have to be defined each time, assuming this gets hoisted into something shared?

Having that set makes type checking more robust, but I get your point.

There is already a SKILLS_REPO that is a separate but identical object literal. Renaming could introduce a bug. Could hoist this into a shared constant.

That's a good one, let me see if I can re-use some of it.


/**
* Lists the skill directories in the agent-skills repo, fetches each
* `SKILL.md`'s frontmatter, and writes the summary to

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange to me that the SKILL itself is the documentation. Its audience is Claude but not necessarily humans.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly that's the name the file has in the repo and we are not in control of that.

</div>
<>
{skills.map((skill) => (
<div key={skill.name}>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit]:

{skills.map((skill, index) => (
   <div key={index}>
    ....
   </div>
))}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it's not recommended to use index as key in React, doesn't change much in this case because the position of the elements it's not tied to a React state value, but if you use index and you mutate an Iterable React won't know if the element actually changed. Having a unique string is way better than using index.

Further reading: https://robinpokorny.com/blog/index-as-a-key-is-an-anti-pattern/

@Rodriguespn Rodriguespn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The agent skills page looks good, great job! One note is that changing from a table view to a list/section view can make the page more extensive as we add more skills to the agent skills repo (not planned and we're actually going to avoid adding more and pack everything into suoabase agent skill and the docs).
Another thing to have into consideration from now kn is that the agent skill description in the frontmatter is now used also as the description in the docs page. Nothing against it, as the agent skill description are short, one liners and action driven (usually have action verbs like "use"). Just one thing to have in mind

@jeremenichelli

Copy link
Copy Markdown
Contributor Author

Thanks for your input @Rodriguespn, addressing some of your comments.

Another thing to have into consideration from now kn is that the agent skill description in the frontmatter is now used also as the description in the docs page. Nothing against it, as the agent skill description are short, one liners and action driven (usually have action verbs like "use"). Just one thing to have in mind

That was already in use, it was the second column of the table. Now it's just a normal paragraph.

One note is that changing from a table view to a list/section view can make the page more extensive as we add more skills to the agent skills repo

Not a problem. We will think of that when we have that problem, for now, we are more than good.

@jeremenichelli
jeremenichelli merged commit b90c84d into master Jul 21, 2026
36 checks passed
@jeremenichelli
jeremenichelli deleted the jeremias/docs-1189-pre-fetch-ai-skills-data-to-markdown branch July 21, 2026 10:23
@github-actions

github-actions Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1784629658)

Score Average Improvements Regressions
Completeness 100% (+0pp) - -
Conciseness 42% (+2pp) 9 🟢 7 🔴
Correctness 67.8% (-7.000000000000001pp) 2 🟢 4 🔴
Docs Faithfulness 64.5% (+5pp) 3 🟢 3 🔴
Goal Completion 83.3% (+1pp) 4 🟢 3 🔴
Knowledge Usage 94.9% (+0pp) - -
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Tool Usage 72.5% (+4pp) 2 🟢 1 🔴
Safety 97.6% (+7.000000000000001pp) 2 🟢 -
URL Validity 100% - -
Time_to_first_token 3.38tok (-0.09tok) 16 🟢 13 🔴
Llm_calls 7.2 (+0.07) 13 🟢 11 🔴
Tool_calls 2.82 (-0.17) 8 🟢 14 🔴
Errors 0.02 (+0.02) - 1 🔴
Llm_errors 0.01 (+0.01) - 1 🔴
Tool_errors 0 (+0) - -
Prompt_tokens 18904.85tok (-3753.01tok) 17 🟢 9 🔴
Prompt_cached_tokens 6620.69tok (-1124.05tok) 8 🟢 12 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 606.4tok (+13.46tok) 10 🟢 19 🔴
Completion_reasoning_tokens 105.56tok (+5.25tok) 13 🟢 14 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 19511.25tok (-3739.55tok) 17 🟢 12 🔴
Estimated_cost 0$ (0$) 14 🟢 9 🔴
Duration 17.76s (-0.61s) 16 🟢 13 🔴
Llm_duration 11.89s (-0.05s) 13 🟢 16 🔴

awaseem pushed a commit that referenced this pull request Jul 21, 2026
…nt (#48144)

<!-- ccr-slack-attribution -->
_Requested by **Ivan Vasilov** · [Slack
thread](https://supabase.slack.com/archives/C0161K73J1J/p1784639352877839?thread_ts=1784625513.046239&cid=C0161K73J1J)_

## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Bug fix.

## What is the current behavior?

Running `pnpm --filter=docs run build:guides-markdown` standalone — as
`apps/www`'s prebuild does, without first running
`build:federated-content` — crashes with `ENOENT ... ai-skills.json`
(and the equivalent for `terraform.schema.json`).

The `AiSkillsIndex` and `TerraformProviderSchema` markdown-schema
handlers `readFileSync` a gitignored, build-time-generated JSON artifact
unconditionally. In the full docs build these files exist because
`build:federated-content` runs first (via the docs `prebuild`), but in
the standalone / www path they do not, so the read throws.

These unguarded reads were introduced in #48045 (ai-skills) and #48010
(terraform), which surfaced as the www Vercel build failure.

## What is the new behavior?

Both handlers now render an empty section (return an empty string) when
the generated artifact is absent, so `build:guides-markdown` succeeds in
the standalone / www path.

When the artifact IS present (the full docs build, which runs
`build:federated-content` first), behavior is byte-for-byte unchanged —
the file is parsed and rendered exactly as before. The full docs build
is not affected.

## Additional context

Implemented with a minimal `existsSync` guard (from the already-imported
`node:fs`) in each handler:

- `apps/docs/internals/markdown-schema/AiSkillsIndex.ts`
- `apps/docs/internals/markdown-schema/TerraformProviderSchema.ts`

No changes to any `package.json`, `.gitignore`, or the generators — the
fix is confined to the two handlers.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01RynCtzP874KrpN8CPf7n7n)_

Co-authored-by: Claude <[email protected]>
hunleyd added a commit that referenced this pull request Aug 8, 2026
…fomap-entry-for-pitr-archiving-stale' into hunleyd/indata-979-studio-lintinfomap-entry-for-pitr-archiving-stale

* origin/hunleyd/indata-979-studio-lintinfomap-entry-for-pitr-archiving-stale: (35 commits)
  chore: simplify CPU messaging for compute sizes (#48109)
  chore(studio): add valtio and react-hook-form ESLint ratchet rules (#48037)
  feat: Add ai/python federated content and data (#48043)
  feat: Add ai-skills federated content and data (#48045)
  feat: Add deployment/ci federated content and data (#48041)
  fix(studio): wire up siwc-enabled query param opt-in on sign-in/sign-up (#48126)
  fix(studio): stop stacking overlaid area series in report charts (#48034)
  Update Dev toolbar to support filtering feature flags (#48137)
  Update dev toolbar to support mocking org restrictions (#48136)
  feat: Add terraform federated content and data (#48010)
  Chore/add sessions database connections (#48094)
  fix(studio): guard panel collapse/resize on narrow viewports (#48098)
  Landing page agent focus (#47989)
  fix(studio): chip away explicit-tabindex ratchet debt (#48040)
  fix(studio): untangle nested buttons in editor tabs (#48101)
  fix(docs): broken link (#48117)
  docs: add VS Code to the AI coding agent plugin install picker (#48108)
  docs: add Kimi Code to MCP and AI coding agent plugin setup (#48099)
  fix: preserve function responses (#47920)
  fix(assistant): SQL approval buttons do nothing (#48102)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Vectors, embeddings, all-things-AI documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants