Catalogue / github-widget-setup
github-widget-setup
Older skill: source not recordedSignedGuides an agent through adding GitHub display components from the third-party, MIT-licensed Elements registry to a project that already uses shadcn — repository cards, profile cards, contribution heatmaps and graphs, language charts, star count buttons, and standalone star counters. The agent transl…--- name: github-widget-setup description: > Guides an agent through adding GitHub display components from the third-party, MIT-licensed Elements registry to a project that already uses shadcn — repository cards, profile cards, contribution heatmaps and graphs, language charts, star count buttons, and standalone star counters. The agent translates the request into exact registry slugs, checks the shadcn configuration, hands the user one precise install command to run themselves, then verifies the installed files and reads their real exported symbols and props before any page code is written. Use when the user wants GitHub data shown on a portfolio, documentation, or landing page, or asks for a repo card, GitHub profile, activity or contributions calendar, star count, star button, or language breakdown. Not for bootstrapping shadcn in a new project, GitHub API scripting, authentication or tokens, Actions workflows, or components unrelated to GitHub. ---
GitHub Widgets from the Elements Registry
The Elements registry, browsable at https://tryelements.dev/docs/github, is a third-party, MIT-licensed collection of components that render GitHub data, delivered through shadcn's installer. Keep the labor split strict: you translate the request, verify what landed, and wire the page; the user is the only party who runs the command that pulls third-party code across the network into their project. Never cross that line, however routine the install appears.
Pin down the subject and the facts before anything else
Two questions decide every later step, so ask them up front:
- Account or repository? A page about a person calls for account-scoped widgets; a page about a project calls for repository-scoped ones. This choice determines which props each component needs.
- Which facts matter? Identity, picture, activity history, popularity, or the language mix of a codebase — choose the smallest set that answers the user's actual request.
Translate the request into registry slugs
These seven slugs are the only ones you know verbatim:
| Widget | Slug | Displays | Data about | | --- | --- | --- | --- | | Repo card | @elements/github-repo-card | Repository name, description, star and fork totals | One repository | | Profile card | @elements/github-profile-card | Handle, avatar, user or organization details | One account | | Activity calendar | @elements/github-activity-calendar | Daily contribution heatmap | One account | | Contributions | @elements/github-contributions | Broader contribution history graph | One account | | Languages | @elements/github-languages | Chart of one codebase's language mix | One repository | | Star button | @elements/github-star-button | Button showing a repository's star count | One repository | | Stars | @elements/github-stars | Read-only star count | One repository |
The registry documents the star button only as a count display. It promises nothing about starring a repository by clicking, so do not claim that behavior to the user; if it matters, read the installed file after the install and report what the code actually implements.
Placement is unrestricted — account-scoped and repository-scoped widgets can share a page. But name the target repository explicitly for every repo-scoped widget: a languages chart on a personal site still describes one named codebase, not the person's overall skills.
Confirm shadcn is already configured
Look for components.json at the project root; the registry tooling depends on that shadcn configuration. If it is missing, stop and state plainly that this skill does not cover initializing shadcn in a fresh project — ask the user to configure it first and come back.
Settle the final slug list with the user
Three rules govern the list you propose:
- Never invent a slug. Guessed variations on the
github-prefix fail at install time. When a request matches no row above, point the user to the registry's GitHub documentation page to find the widget and paste its literal slug back to you; from then on, treat that pasted slug exactly like the seven you know. - Install only what was asked for. Suggesting a companion widget is fine; nothing joins the list without the user's explicit yes.
- Surface name collisions. Before finalizing, scan the configured components directory for existing files whose names resemble the planned widgets. This skill promises nothing about the installer's file behavior — it may write one file per component or several, and it may or may not overwrite a matching existing file. Because that outcome is unknown, report every collision and obtain the user's explicit confirmation for that slug first; overwriting their customizations without consent is not something you can undo.
Hand over the single install command
Assemble the line from the confirmed slugs and give it to the user to run in their own terminal, then wait for their report. The documented pattern:
npx shadcn@latest add @elements/github-{name}Several slugs may share one invocation. You must never execute, script, or automate the installer yourself in any form, regardless of which package runner the project prefers, and do not route around this by pulling registry files in through some side channel — remote code enters the project only through the user's hands.
Inspect what landed and read its real interface
When the user confirms the install finished, open the components directory their shadcn configuration points to and check that the expected components appeared. Do not assume a specific file count per slug — match on the component code you find, and read every relevant file.
From each file, record the symbol it exports and the props it declares: exact names, which are required versus optional, and what any defaults do. Do this on every engagement, even for widgets you have wired before — registry contents can change between versions, and builds break on prop names recalled from memory. Expect export names that differ from the slug strings.
Render strictly through the interface each file declares
The registry's documented baseline is a starting point, not a spec: most of these components accept an owner and a repo prop to fetch live public GitHub data, and several additionally expose static data props so server-rendered pages or offline demos can pass values in without a network call at render time. Confirm in each installed file:
- whether that component takes both props at all — a profile card has no repository, and a bare count may need only the repository identified;
- the exact prop names it declares, which vary between components;
- which are optional and what the defaults do.
Write the JSX only from what the file in front of you declares.
Two brief walkthroughs
Developer portfolio. Tomas wants his site to show who he is and the rhythm of his activity — two account-scoped widgets, one repository-free command:
npx shadcn@latest add @elements/github-profile-card @elements/github-activity-calendar
After he confirms, read both installed files, then render with their actual symbols and props — something shaped like:
// symbol and prop names must come from the installed files, not memory <GithubProfileCard owner="tomas-keller" /> <GithubActivityCalendar owner="tomas-keller" />
Tool documentation page. The docs site for northbeam/ledgerline needs the project summary beside its language mix — two repository-scoped widgets sharing one invocation:
npx shadcn@latest add @elements/github-repo-card @elements/github-languages
Both need the owner and repository identified; verify in each file whether it declares both props or a subset before writing the JSX.
MIT notice obligations when the components travel
The registry's components are third-party MIT-licensed code, and that license's conditions attach to every form of redistribution: publishing the project under an open license, shipping the components inside a library, and distributing them within a closed-source commercial product all count equally. In each case the complete MIT notice — the copyright line together with the full permission grant — must accompany the redistributed copies. Meet that duty as follows:
- Installed files may arrive with the notice in a header comment. Treat a header as satisfying the requirement only after confirming it contains the entire notice, not a bare attribution remark; a short header that omits part of the grant does not discharge it.
- Where no adequate header exists, or as a belt-and-braces measure, place the complete notice in the project's third-party notices or license file.
- Keep any notice present in installed files intact through your edits to imports and props; never delete or truncate one.
- Do not paste license text into files the installer left clean, but never remove or bury a required notice either; when the right placement is unclear, ask the user.
Tell the user what you did about notices whenever redistribution is in play. Separately, this skill draws on MIT-licensed registry documentation whose notice ships with the skill package, so nothing on that account needs to appear in user pages.
Out of scope
This skill does not cover bootstrapping shadcn, GitHub API scripting, OAuth or other authentication, or Actions workflows — route those requests elsewhere. The widgets read public data only and need no credentials, so never ask for, read, log, or transmit GitHub tokens or any other secrets while doing this work.
| File | Size | SHA-256 |
|---|---|---|
| SKILL.md | 9.6 kB | afcbac0698a8 |
| THIRD_PARTY_NOTICES.md | 1.4 kB | b6646e611968 |
| examples.json | 1.7 kB | e6e415310d59 |
Published verbatim from the pinned commit. Nothing is rewritten.
| Version | Pinned commit | Signed | |
|---|---|---|---|
| 1.0.0 Current | Not recorded | 12 Oct 2026 |
Locking a skill to one version needs Pro.