Skip to content

Revert "feat: Add ai-skills federated content and data" - #48146

Closed
jeremenichelli wants to merge 1 commit into
masterfrom
revert-48045-jeremias/docs-1189-pre-fetch-ai-skills-data-to-markdown
Closed

jeremenichelli wants to merge 1 commit into
masterfrom
revert-48045-jeremias/docs-1189-pre-fetch-ai-skills-data-to-markdown

Conversation

@jeremenichelli

@jeremenichelli jeremenichelli commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Reverts #48045

Summary by CodeRabbit

  • New Features

    • AI skills documentation now loads directly from the upstream skills repository.
    • Skills are displayed in a scrollable table with names, descriptions, and installation commands.
    • Added one-click copying for installation commands, with visual confirmation.
  • Bug Fixes

    • Improved handling of unavailable or malformed skills data while keeping the documentation page usable.

@jeremenichelli
jeremenichelli requested a review from awaseem July 21, 2026 13:40
@jeremenichelli
jeremenichelli requested a review from a team as a code owner July 21, 2026 13:40
@linear-code

linear-code Bot commented Jul 21, 2026

Copy link
Copy Markdown

Issue reopened: DOCS-1189 Pre-fetch ai-skills data to markdown

@supabase

supabase Bot commented Jul 21, 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 21, 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 1:45pm
6 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 21, 2026 1:45pm
design-system Skipped Skipped Jul 21, 2026 1:45pm
studio-self-hosted Skipped Skipped Jul 21, 2026 1:45pm
studio-staging Skipped Skipped Jul 21, 2026 1:45pm
ui-library Skipped Skipped Jul 21, 2026 1:45pm
zone-www-dot-com Skipped Skipped Open in v0 Jul 21, 2026 1:45pm

Request Review

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 21, 2026
@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

AI skills now load from the upstream GitHub repository, parse SKILL.md metadata, and render in a sortable-style table with linked names and copyable install commands. The previous generated JSON and federated fetch pipeline are removed.

Changes

AI skills integration

Layer / File(s) Summary
Fetch and parse upstream skills
apps/docs/app/guides/getting-started/ai-skills/AiSkills.utils.ts
GitHub contents API responses are used to load and parse each skill’s SKILL.md, build summaries, validate directory listings, and sort by name.
Render copyable skill commands
apps/docs/app/guides/getting-started/ai-skills/AiSkillsIndex.tsx, apps/docs/app/guides/getting-started/ai-skills/CopyButton.tsx
The page renders a table with GitHub links, descriptions, and install commands; CopyButton copies commands and displays temporary feedback.
Remove generated skills pipeline
apps/docs/internals/generate-guides-markdown.ts, apps/docs/internals/markdown-schema/AiSkillsIndex.ts, apps/docs/scripts/federated-content/fetch-federated-content.ts
AI skills are removed from markdown schema processing and federated-content fetching, including deletion of the former markdown schema module.

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

Possibly related PRs

Suggested labels: ai

Suggested reviewers: awaseem

Sequence Diagram(s)

sequenceDiagram
  participant AiSkillsIndex
  participant getAiSkills
  participant GitHub
  participant CopyButton
  participant Clipboard
  AiSkillsIndex->>getAiSkills: load skill summaries
  getAiSkills->>GitHub: list skills and fetch SKILL.md files
  GitHub-->>getAiSkills: skill metadata
  getAiSkills-->>AiSkillsIndex: sorted skills
  AiSkillsIndex-->>CopyButton: render install command
  CopyButton->>Clipboard: write command text
  Clipboard-->>CopyButton: copy completed
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is far below the required template and only links the reverted PR, missing the requested sections. Fill in the template sections: CONTRIBUTING acknowledgment, change type, current behavior, new behavior, and additional context.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects that this PR reverts the ai-skills federated content/data feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 revert-48045-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.

🧹 Nitpick comments (3)
apps/docs/app/guides/getting-started/ai-skills/AiSkillsIndex.tsx (1)

25-27: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Enhance table accessibility with scope attributes.

Consider adding scope="col" to the table headers to explicitly associate them with their respective columns, which improves screen reader navigation.

♿ Proposed accessibility fix
-            <th className="text-left py-2 pr-4 text-foreground-lighter font-medium">Skill</th>
-            <th className="text-left py-2 pr-4 text-foreground-lighter font-medium">Description</th>
-            <th className="text-left py-2 text-foreground-lighter font-medium">Install command</th>
+            <th scope="col" className="text-left py-2 pr-4 text-foreground-lighter font-medium">Skill</th>
+            <th scope="col" className="text-left py-2 pr-4 text-foreground-lighter font-medium">Description</th>
+            <th scope="col" className="text-left py-2 text-foreground-lighter font-medium">Install command</th>
🤖 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/app/guides/getting-started/ai-skills/AiSkillsIndex.tsx` around
lines 25 - 27, Add scope="col" to each table header in the AiSkillsIndex table,
including the Skill, Description, and Install command headers, to explicitly
identify them as column headers. Preserve the existing styling and header text.
apps/docs/app/guides/getting-started/ai-skills/CopyButton.tsx (1)

10-14: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Clear overlapping timeouts and handle clipboard unavailability gracefully.

If the user clicks the copy button multiple times, multiple timeouts will overlap, causing the UI to reset prematurely. Also, in certain insecure contexts, navigator.clipboard might be undefined, which would trigger an unhandled promise rejection.

♻️ Proposed robust clipboard handling

Add useRef to your imports at the top:

import { useState, useRef } from 'react'

Then, update the copy handler:

-  const handleCopy = async () => {
-    await navigator.clipboard.writeText(text)
-    setCopied(true)
-    setTimeout(() => setCopied(false), 2000)
-  }
+  const timeoutRef = useRef<NodeJS.Timeout>(null)
+
+  const handleCopy = async () => {
+    try {
+      await navigator.clipboard?.writeText(text)
+      setCopied(true)
+      if (timeoutRef.current) clearTimeout(timeoutRef.current)
+      timeoutRef.current = setTimeout(() => setCopied(false), 2000)
+    } catch {
+      // Fallback or ignore if the clipboard API is blocked/unavailable
+    }
+  }
🤖 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/app/guides/getting-started/ai-skills/CopyButton.tsx` around lines
10 - 14, Update handleCopy to guard against navigator.clipboard being
unavailable and handle writeText failures without an unhandled rejection. Store
the timeout handle in a useRef, clear any existing timeout before scheduling a
new reset, and preserve the copied-state behavior after a successful write.
apps/docs/app/guides/getting-started/ai-skills/AiSkills.utils.ts (1)

40-57: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Handle individual file fetch errors to prevent cascading failures.

Currently, if a single skill directory is missing a SKILL.md file or its fetch fails, the Promise.all will reject, causing the entire AI skills table to fail to load. Catching errors per skill ensures that valid skills are still displayed.

🛡️ Proposed fix to allow partial successes
   const skills = await Promise.all(
     skillDirs.map(async (item) => {
-      const skillPath = `${SKILLS_REPO.path}/${item.name}/SKILL.md`
-      const rawContent = await getGitHubFileContents({
-        org: SKILLS_REPO.org,
-        repo: SKILLS_REPO.repo,
-        branch: SKILLS_REPO.branch,
-        path: skillPath,
-      })
-      const { data } = matter(rawContent) as { data: SkillMetadata }
-
-      return {
-        name: item.name,
-        description: data.description || '',
-        installCommand: `npx skills add supabase/agent-skills --skill ${item.name}`,
-      }
+      try {
+        const skillPath = `${SKILLS_REPO.path}/${item.name}/SKILL.md`
+        const rawContent = await getGitHubFileContents({
+          org: SKILLS_REPO.org,
+          repo: SKILLS_REPO.repo,
+          branch: SKILLS_REPO.branch,
+          path: skillPath,
+        })
+        const { data } = matter(rawContent) as { data: SkillMetadata }
+
+        return {
+          name: item.name,
+          description: data.description || '',
+          installCommand: `npx skills add supabase/agent-skills --skill ${item.name}`,
+        }
+      } catch (error) {
+        // Log error and return null to prevent failing the entire batch
+        console.error(`Failed to load skill metadata for ${item.name}:`, error)
+        return null
+      }
     })
   )
+
+  // Filter out failed skill loads
+  const validSkills = skills.filter((skill): skill is SkillSummary => skill !== null)

Make sure to adjust the final return statement to sort validSkills instead of skills:

  return validSkills.sort((a, b) => a.name.localeCompare(b.name))
🤖 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/app/guides/getting-started/ai-skills/AiSkills.utils.ts` around
lines 40 - 57, Update the skill mapping flow around Promise.all to catch fetch
or parsing errors for each individual skill, exclude failed entries, and retain
successful skills. Store the filtered results as validSkills and sort
validSkills in the final return statement instead of the rejected-prone skills
collection.
🤖 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.

Nitpick comments:
In `@apps/docs/app/guides/getting-started/ai-skills/AiSkills.utils.ts`:
- Around line 40-57: Update the skill mapping flow around Promise.all to catch
fetch or parsing errors for each individual skill, exclude failed entries, and
retain successful skills. Store the filtered results as validSkills and sort
validSkills in the final return statement instead of the rejected-prone skills
collection.

In `@apps/docs/app/guides/getting-started/ai-skills/AiSkillsIndex.tsx`:
- Around line 25-27: Add scope="col" to each table header in the AiSkillsIndex
table, including the Skill, Description, and Install command headers, to
explicitly identify them as column headers. Preserve the existing styling and
header text.

In `@apps/docs/app/guides/getting-started/ai-skills/CopyButton.tsx`:
- Around line 10-14: Update handleCopy to guard against navigator.clipboard
being unavailable and handle writeText failures without an unhandled rejection.
Store the timeout handle in a useRef, clear any existing timeout before
scheduling a new reset, and preserve the copied-state behavior after a
successful write.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9f61f884-42da-4854-b5e5-d2bc70ee8103

📥 Commits

Reviewing files that changed from the base of the PR and between da7a10b and 557ce65.

📒 Files selected for processing (6)
  • 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/scripts/federated-content/fetch-federated-content.ts
💤 Files with no reviewable changes (2)
  • apps/docs/internals/generate-guides-markdown.ts
  • apps/docs/internals/markdown-schema/AiSkillsIndex.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant