Skip to content

README badges for GitHub profiles - #30

Merged
nannndev merged 1 commit into
mainfrom
claude/exciting-bell-qakqv7
Oct 1, 2026
Merged

nannndev merged 1 commit into
mainfrom
claude/exciting-bell-qakqv7

Conversation

@nannndev

@nannndev nannndev commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Badge endpoint. /b/<userId> (a rewrite to /api/og/<id>?kind=badge, so no new function) returns an SVG badge that keeps itself up to date.
    • It shows best code WPM, division, run count and streak, plus the player's own Kap in their Wardrobe look.
    • Styles: card (the default, 440×120, with Kap) and flat (a 20 px shields-style pill). Themes: dark and light.
    • Only shapes and system fonts, with Kap nested inline, because GitHub's camo proxy blocks outside resources. All text is XML-escaped.
    • Cached for 30 minutes with stale-while-revalidate, so the badge catches up as you practice.
  • Share profile dialog. For your own profile it now has a "Badge for your GitHub README" section:
    • live previews;
    • Card/Flat and Auto/Dark/Light pickers;
    • a Copy button. Auto copies <picture> HTML that follows the reader's GitHub theme; a fixed theme copies Markdown.

Test plan

  • vitest: 215 tests pass. New ones check escaping, no outside URLs, flat and new-player variants, and the snippet and URL builders.
  • tsc -b, the API typecheck and the build pass.
  • Rendered every variant on GitHub-like light and dark backgrounds.
  • Browser check of the dialog with the badge images mocked.

🤖 Generated with Claude Code

https://claude.ai/code/session_018xNjY7412Rp5bFuw5h69yu


Generated by Claude Code

/b/<userId> (served by /api/og with kind=badge, no new function) returns
an SVG badge that keeps itself up to date: best code WPM, division, runs and
streak, with the player's own Kap. Two styles, a card and a shields-sized
flat pill, each in dark and light. It uses only shapes and system fonts,
since GitHub's image proxy blocks outside resources, and caches for half
an hour so the badge catches up as you practice.

Share profile now has a README badge section: a live preview, style and
theme pickers, and a snippet to copy (Markdown, or <picture> HTML that
follows the reader's GitHub theme).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018xNjY7412Rp5bFuw5h69yu
@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
codetype Ready Ready Preview Oct 1, 2026 9:01am UTC

@nannndev
nannndev merged commit 1cab1fc into main Oct 1, 2026
2 checks passed

This branch was successfully deployed

1 active deployment
Preview — 7573e484 Deployed Oct 1, 2026 by vercel[bot]
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.

2 participants