Skip to content

feat(badges): add skills.sh badge support#124

Merged
jal-co merged 2 commits into
mainfrom
claude/skills-sh-badge-support-40fioq
Jun 9, 2026
Merged

feat(badges): add skills.sh badge support#124
jal-co merged 2 commits into
mainfrom
claude/skills-sh-badge-support-40fioq

Conversation

@jal-co

@jal-co jal-co commented Jun 9, 2026

Copy link
Copy Markdown
Owner

New /skills provider backed by the official skills.sh API (api/v1):
installs, all-time rank, trending, hot, and security audit badges,
addressed as /skills/{topic}/{owner}/{repo}/{skill}. Base badges
default to the Vercel logo, branded variant uses Vercel black.

  • Provider scans cached leaderboard pages for rank (top 1000) and
    trending/hot (top 500); optional SKILLS_SH_API_KEY raises the
    upstream rate limit
  • Docs page with sandboxes and examples, sidebar + API reference
    entries, Agent Skills showcase category, README and agent skill
    endpoint tables
  • Hero headline now reads 'The badges your readme and SKILL.md
    crave.' with the announcement pointing at the new docs page

https://claude.ai/code/session_01Hj2JcBwH1WDSx5HLfAhAWU

New /skills provider backed by the official skills.sh API (api/v1):
installs, all-time rank, trending, hot, and security audit badges,
addressed as /skills/{topic}/{owner}/{repo}/{skill}. Base badges
default to the Vercel logo, branded variant uses Vercel black.

- Provider scans cached leaderboard pages for rank (top 1000) and
  trending/hot (top 500); optional SKILLS_SH_API_KEY raises the
  upstream rate limit
- Docs page with sandboxes and examples, sidebar + API reference
  entries, Agent Skills showcase category, README and agent skill
  endpoint tables
- Hero headline now reads 'The badges your readme and SKILL.md
  crave.' with the announcement pointing at the new docs page

https://claude.ai/code/session_01Hj2JcBwH1WDSx5HLfAhAWU
@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
shieldcn Ready Ready Preview, Comment Jun 9, 2026 7:31pm

Request Review

@github-actions github-actions Bot added docs Documentation changes core labels Jun 9, 2026
Comment thread packages/core/src/providers/skills.ts Outdated
maxPages: number
): Promise<number | null> {
let position = 0
for (let page = 0; page < maxPages; page++) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The findRank function uses 0-based pagination for an API that expects 1-based pagination, causing it to fail or return incorrect data.
Severity: HIGH

Suggested Fix

Modify the findRank function's loop to use 1-based indexing for the page parameter. Change the loop from for (let page = 0; page < maxPages; page++) to for (let page = 1; page <= maxPages; page++) to align with the API's expected pagination.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: packages/core/src/providers/skills.ts#L116

Potential issue: The `findRank` function iterates through leaderboard pages starting
with `page = 0`. However, the skills.sh API uses 1-based indexing, where the first page
is `page=1`. Querying with `page=0` may return an empty list, causing the function to
terminate prematurely and return `null`. This would result in `getSkillsTrending` and
`getSkillsHot` always returning `null`, and `getSkillsRank` always showing "1000+". If
`page=0` is treated as a duplicate of `page=1`, the rank calculation will be inaccurate.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Verified — this is a false positive, and the comment is also outdated (the function was renamed findRankscanLeaderboard in a later commit).

The skills.sh leaderboard endpoint /api/skills/{view}/{page} is 0-based: page 0 is the first page and returns the top of the board, not an empty list. Confirmed across the real-world clients of this API:

  • 2lbj/auto-skill-downloader documents https://skills.sh/api/skills/all-time/0 as returning the top 200 skills.
  • derekross/onyx iterates for page in 0..pages (0-based).
  • mastra-ai/skills-api and pmiscn/skillsmcp both build .../all-time/{page} starting at 0.

So starting at page = 0 is correct; switching to 1-based would actually skip the top page. The scan also doesn't rely on a fixed page count — it stops on hasMore === false or an empty page — so it's robust to the per-page size too. No change needed.


Generated by Claude Code

… ids

The live deploy rendered every skills.sh badge as 'not found' for two
reasons, both fixed here:

- The provider hit the OIDC-authenticated /api/v1 tier, which a public
  badge service can't authenticate to. Switch to the public
  /api/skills/{view}/{page} leaderboard endpoint (no auth, confirmed
  envelope { skills: [{ source, skillId, name, installs }], hasMore }).
  Installs and rank both come from one cached all-time scan; trending
  and hot scan their own boards.
- Example/sandbox/showcase skill ids were wrong (frontend-design is
  under anthropics/skills, not vercel-labs/agent-skills). All examples
  now use real skills, primarily vercel-labs/agent-skills/vercel-react-best-practices.

Drop the audit badge (only available on the authenticated tier).
Add a provider test covering installs, multi-page rank, source+skillId
matching, trending/hot, and the not-found path.

https://claude.ai/code/session_01Hj2JcBwH1WDSx5HLfAhAWU
@jal-co jal-co merged commit 7197b7d into main Jun 9, 2026
2 of 3 checks passed
@jal-co jal-co deleted the claude/skills-sh-badge-support-40fioq branch June 9, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core docs Documentation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants