Skip to content

feat: advertise and serve agent skills from .well-known - #44878

Merged
Rodriguespn merged 3 commits into
masterfrom
feat/agent-skill-discovery
May 22, 2026
Merged

feat: advertise and serve agent skills from .well-known#44878
Rodriguespn merged 3 commits into
masterfrom
feat/agent-skill-discovery

Conversation

@gregnr

@gregnr gregnr commented Apr 14, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds apps/www/scripts/fetchAgentSkills.mjs — at build time (pnpm content:build) fetches the latest index.json from supabase/agent-skills release assets and writes it verbatim to public/.well-known/agent-skills/index.json
  • Skill URLs are absolute GitHub Release asset URLs, embedded by the agent-skills repo at release time (feat: embed absolute GitHub Release URLs in index.json agent-skills#87) — no URL rewriting needed on this side

How it works

  1. Fetches latest release from supabase/agent-skills via GitHub API
  2. Downloads index.json from the release assets
  3. Writes it verbatim to public/.well-known/agent-skills/index.json

Clients discover and install skills from supabase.com/.well-known/agent-skills/index.json and fetch tarballs directly from GitHub Release assets.

Dependency

Requires supabase/agent-skills#87 to be merged and released so the published index.json contains absolute URLs.

@gregnr gregnr added the do-not-merge Not ready to be merged yet; pending other dependencies label Apr 14, 2026
@vercel

vercel Bot commented Apr 14, 2026

Copy link
Copy Markdown

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

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

Request Review

@supabase

supabase Bot commented Apr 14, 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 ↗︎.

@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

A new build-time script is added to fetch the latest supabase/agent-skills GitHub Release, rewrite skill metadata URLs to absolute asset links, and publish the result to public/.well-known/agent-skills/index.json. The content:build script in package.json is updated to run this new fetch step as part of the content generation pipeline.

Changes

Agent Skills Fetching Integration

Layer / File(s) Summary
Agent skills fetch and rewrite script
apps/www/scripts/fetchAgentSkills.mjs, apps/www/package.json
New script fetches the latest agent-skills release from GitHub, rewrites skill URLs to absolute release asset URLs, and writes the index to public/.well-known/agent-skills/index.json. The content:build script is extended to run this fetch step after static content and LLM pricing generation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • supabase/supabase#45641: Extends the same content:build script and fetches the supabase/agent-skills release to populate the public well-known agent-skills directory.

Poem

🐰 A rabbit hops through GitHub's release hall,
Fetching agent skills, rewriting URLs with glee,
The build pipeline now chains them all,
From release assets to the well-known decree,
Well-formed and ready for agents to see! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description does not follow the required template structure from the repository. Restructure the description to include all required template sections: acknowledgment of CONTRIBUTING.md, type of change, current behavior, new behavior, and additional context.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: advertise and serve agent skills from .well-known' clearly and concisely summarizes the main change: implementing agent skills discovery by serving them from the .well-known directory.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feat/agent-skill-discovery

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 and usage tips.

Rodriguespn added a commit that referenced this pull request May 15, 2026
…45641)

## Summary

This PR makes `fetchAgentSkills.mjs` a spec-compliant client of the
[agent-skills `.well-known` URI
spec](agentskills/agentskills#254), and updates
the script to match the current release structure in
[`supabase/agent-skills`](https://github.com/supabase/agent-skills).

---

## 1. Spec-compliant URL resolution and digest verification

`fetchAgentSkills.mjs` acts as a client consuming the `.well-known`
discovery index. The [agent-skills `.well-known`
spec](agentskills/agentskills#254) is explicit
on two points:

**URL resolution** — skill artifact URLs in `index.json` must be
resolved per [RFC 3986
§5.2.2](https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.2)
using the index URL as the base URI:

> "The `url` field specifies where to fetch the skill artifact. URLs are
resolved per RFC 3986 Section 5 using the index URL as the base URI."

This means `skill.url` can be relative (`supabase.tar.gz`),
path-absolute (`/.well-known/agent-skills/supabase.tar.gz`), or fully
absolute (e.g. a CDN URL like
`https://cdn.example.com/supabase.tar.gz`). The previous implementation
extracted a filename with `.split('/').pop()` which happened to work for
bare relative URLs but was not doing RFC 3986 resolution.

**Digest verification** — clients must verify artifact integrity before
use:

> "Clients **must** verify downloaded content against the `digest` in
the index. A mismatch indicates the content is corrupted or tampered
with — clients **must not** use unverified content."

The updated script uses `new URL(skill.url, githubReleaseIndexUrl)` for
compliant resolution, verifies each artifact's SHA-256 digest from the
in-memory buffer before any disk writes, and only writes to
`public/.well-known/agent-skills/` once all digests pass.

**Acknowledged overhead**: since Supabase owns both the publisher
([`scripts/build-release.ts`](https://github.com/supabase/agent-skills/blob/main/scripts/build-release.ts)
in `supabase/agent-skills`) and this consumer, the practical risk of
non-compliant URL handling is currently low — the publisher always emits
bare relative filenames. However, being spec-compliant here gives us
full flexibility to change how skills are packaged or hosted in
`supabase/agent-skills` in the future (e.g. moving artifacts to a CDN)
without needing to update this script.

---

## 2. Semver release tags

#44878 referenced `supabase/agent-skills#66` (date+SHA tags).
[supabase/agent-skills#77](supabase/agent-skills#77)
has since merged, moving releases to semver tags managed by Release
Please. `/releases/latest` works for both formats — no code change
needed, just a rebase.

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@Rodriguespn
Rodriguespn marked this pull request as ready for review May 19, 2026 09:47
@Rodriguespn
Rodriguespn requested a review from a team as a code owner May 19, 2026 09:47
gregnr and others added 2 commits May 19, 2026 10:49
…45641)

## Summary

This PR makes `fetchAgentSkills.mjs` a spec-compliant client of the
[agent-skills `.well-known` URI
spec](agentskills/agentskills#254), and updates
the script to match the current release structure in
[`supabase/agent-skills`](https://github.com/supabase/agent-skills).

---

## 1. Spec-compliant URL resolution and digest verification

`fetchAgentSkills.mjs` acts as a client consuming the `.well-known`
discovery index. The [agent-skills `.well-known`
spec](agentskills/agentskills#254) is explicit
on two points:

**URL resolution** — skill artifact URLs in `index.json` must be
resolved per [RFC 3986
§5.2.2](https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.2)
using the index URL as the base URI:

> "The `url` field specifies where to fetch the skill artifact. URLs are
resolved per RFC 3986 Section 5 using the index URL as the base URI."

This means `skill.url` can be relative (`supabase.tar.gz`),
path-absolute (`/.well-known/agent-skills/supabase.tar.gz`), or fully
absolute (e.g. a CDN URL like
`https://cdn.example.com/supabase.tar.gz`). The previous implementation
extracted a filename with `.split('/').pop()` which happened to work for
bare relative URLs but was not doing RFC 3986 resolution.

**Digest verification** — clients must verify artifact integrity before
use:

> "Clients **must** verify downloaded content against the `digest` in
the index. A mismatch indicates the content is corrupted or tampered
with — clients **must not** use unverified content."

The updated script uses `new URL(skill.url, githubReleaseIndexUrl)` for
compliant resolution, verifies each artifact's SHA-256 digest from the
in-memory buffer before any disk writes, and only writes to
`public/.well-known/agent-skills/` once all digests pass.

**Acknowledged overhead**: since Supabase owns both the publisher
([`scripts/build-release.ts`](https://github.com/supabase/agent-skills/blob/main/scripts/build-release.ts)
in `supabase/agent-skills`) and this consumer, the practical risk of
non-compliant URL handling is currently low — the publisher always emits
bare relative filenames. However, being spec-compliant here gives us
full flexibility to change how skills are packaged or hosted in
`supabase/agent-skills` in the future (e.g. moving artifacts to a CDN)
without needing to update this script.

---

## 2. Semver release tags

#44878 referenced `supabase/agent-skills#66` (date+SHA tags).
[supabase/agent-skills#77](supabase/agent-skills#77)
has since merged, moving releases to semver tags managed by Release
Please. `/releases/latest` works for both formats — no code change
needed, just a rebase.

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

@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: 2

🤖 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/www/scripts/fetchAgentSkills.mjs`:
- Around line 40-55: The script currently only writes index.json but doesn't
download the per-skill tarball artifacts, so clients expecting site-hosted
archives will fail; update the logic after computing assetUrls and rewritten to
iterate over (index.skills ?? []) and for each skill whose url maps to an asset
(assetUrls[skill.url] exists) fetch the asset from assetUrls[skill.url] and
write the downloaded bytes into OUT_DIR using the asset filename (use the same
key from assetUrls, e.g., release.assets names), ensuring you create OUT_DIR
(already done) and handle fetch errors (log/throw) so the per-skill .tar.gz
files are present alongside index.json; reference variables/functions:
assetUrls, release.assets, index.skills, OUT_DIR, rewritten.
- Around line 43-50: The current rewrite uses exact asset-name lookup
(assetUrls[skill.url]) which fails for relative or path/absolute URLs; change
the logic in the rewritten.skills mapping to resolve skill.url per RFC3986 using
the URL constructor against a sensible base (e.g. index.url or the release
HTML/base URL), then normalize and attempt to match assets by normalized
pathname or basename (derive each asset's URL pathname via new
URL(asset.browser_download_url).pathname or path.basename) and substitute with
the matched asset.browser_download_url; if URL construction throws or no asset
matches, fall back to the original skill.url. Ensure you update the code that
builds assetUrls and the mapping inside rewritten.skills to use the resolved URL
and pathname-based matching rather than a raw key lookup of skill.url.
🪄 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: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: df4dd813-b7e1-4b4e-ae13-e6f79cdb9ceb

📥 Commits

Reviewing files that changed from the base of the PR and between cdbf14a and 3845043.

📒 Files selected for processing (2)
  • apps/www/package.json
  • apps/www/scripts/fetchAgentSkills.mjs

Comment thread apps/www/scripts/fetchAgentSkills.mjs Outdated
Comment thread apps/www/scripts/fetchAgentSkills.mjs Outdated
@Rodriguespn Rodriguespn self-assigned this May 19, 2026
@Rodriguespn
Rodriguespn force-pushed the feat/agent-skill-discovery branch from 3845043 to dfb297b Compare May 19, 2026 10:00
@Rodriguespn

Copy link
Copy Markdown
Contributor

Waiting for supabase/agent-skills#85 to be merged and supabase/agent-skills version v0.1.3 is published

Comment thread apps/www/scripts/fetchAgentSkills.mjs Outdated
Fetches the latest index.json from supabase/agent-skills release assets
and writes it to public/.well-known/agent-skills/index.json at build time.

Skill URLs are absolute GitHub Release asset URLs embedded by the
agent-skills repo at release time — no URL rewriting needed here.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gregnr

gregnr commented May 21, 2026

Copy link
Copy Markdown
Member Author

Looks good @Rodriguespn!

@Rodriguespn Rodriguespn removed the do-not-merge Not ready to be merged yet; pending other dependencies label May 22, 2026
@Rodriguespn
Rodriguespn merged commit cb19eea into master May 22, 2026
30 of 31 checks passed
@Rodriguespn
Rodriguespn deleted the feat/agent-skill-discovery branch May 22, 2026 11:33
@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1779449712)

Score Average Improvements Regressions
Completeness 96.2% (-1pp) 1 🟢 2 🔴
Conciseness 43.6% (+1pp) 6 🟢 4 🔴
Correctness 70.8% (+0pp) 2 🟢 2 🔴
Docs Faithfulness 62.2% (-2pp) 4 🟢 3 🔴
Goal Completion 76.9% (-1pp) 6 🟢 4 🔴
Knowledge Usage 100% (+0pp) - -
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 90.9% (-9pp) - 2 🔴
Tool Usage 75% (-2pp) - 1 🔴
Safety 85.7% (-10pp) - 2 🔴
URL Validity 100% (+0pp) - -
Time_to_first_token 0tok (0tok) 21 🟢 4 🔴
Llm_calls 6.79 (+0.13) 9 🟢 7 🔴
Tool_calls 3.18 (+0.09) 8 🟢 9 🔴
Errors 0 (-0.05) 2 🟢 -
Llm_errors 0 (-0.03) 2 🟢 -
Tool_errors 0 (+0) - -
Prompt_tokens 24841.28tok (+1724.08tok) 13 🟢 10 🔴
Prompt_cached_tokens 7378.05tok (+1391.59tok) 12 🟢 8 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 568.35tok (-11.87tok) 18 🟢 8 🔴
Completion_reasoning_tokens 99.05tok (+4.59tok) 13 🟢 10 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 25409.63tok (+1712.21tok) 15 🟢 11 🔴
Estimated_cost 0$ (+0$) 17 🟢 7 🔴
Duration 12.12s (-1.14s) 16 🟢 10 🔴
Llm_duration 8.9s (-0.42s) 15 🟢 11 🔴

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants