port-from-bslib

port-from-bslib is a skill for Claude Code, Codex from posit-dev/py-shiny. It costs 0 tokens per session (5,092 once invoked), scanned A, original, MIT.

A development guide for rebuilding user-interface components from R's bslib package in py-shiny, the Python version of the Shiny web framework.

In plain words
What is it for?
Use it when converting a bslib component into Python code, browser-side bindings, tests, and documentation.
Why use it?
It explains how to keep Python and R versions of Shiny components aligned instead of working out the porting process from scratch.

Skill for Claude CodeCodex

About the project

Shiny for Python is a Python framework for building interactive web applications and data visualizations with reactive behavior. Data scientists and Python developers use it for prototypes as well as larger applications. Its bundled agent skills provide coding agents with Shiny documentation so they can create better Shiny applications.

posit-dev/py-shiny · 1,750 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/posit-dev/py-shiny/port-from-bslib
Any agent
npx skills add posit-dev/py-shiny --skill port-from-bslib
Clone the repo
git clone --depth 1 https://github.com/posit-dev/py-shiny

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for port-from-bslib

README.md
[![agentmods](https://agentmods.dev/badge/skills/posit-dev/py-shiny/port-from-bslib.svg)](https://agentmods.dev/skills/posit-dev/py-shiny/port-from-bslib)
Your own site
<a href="https://agentmods.dev/skills/posit-dev/py-shiny/port-from-bslib"><img src="https://agentmods.dev/badge/skills/posit-dev/py-shiny/port-from-bslib.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,092 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.05092
Opus 5 $0.00000 $0.02546
Sonnet 5 $0.00000 $0.01018
Haiku 4.5 $0.00000 $0.00509

Measured 5d ago against content hash a5104aa16fdc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

port-from-bslib scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/port-from-bslib/SKILL.md · 564 lines

How it starts

The opening of the file, as written. The whole thing — 564 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Porting Components from bslib to py-shiny

This guide explains how to port new UI components from the R bslib package to py-shiny. It assumes you're an experienced developer familiar with Python, R, and JavaScript/TypeScript, but may be new to the specifics of these repositories.

Background

The bslib R package serves as the primary development location for new Bootstrap 5 components in the Shiny ecosystem. Components developed in bslib are then ported to py-shiny to maintain feature parity between Shiny for R and Shiny for Python.

Key relationship: bslib provides both the R implementation and the compiled JavaScript/CSS assets that py-shiny vendors and uses directly.

Overview of the Porting Process

The porting process involves three main phases:

  1. Understanding the source - Study the bslib implementation (R, TypeScript, SCSS)
  2. Implementing the port - Create Python equivalents and add client-side bindings
  3. Testing and documentation - Ensure correctness with unit and end-to-end tests

Phase 1: Understanding the Source Implementation

Step 1.1: Locate the bslib PR

Find the bslib PR that introduced the feature. The py-shiny PR description should reference it (e.g., Related https://github.com/rstudio/bslib/pull/...).

Checklist:

  • Located the bslib PR
  • Reviewed the PR description and any design discussions

Step 1.2: Identify the core source files

In the bslib PR, locate these key files:

  1. R implementation: R/[feature-name].R - The main component function(s)
  2. TypeScript bindings: srcts/src/components/[featureName].ts - Client-side behavior
  3. SCSS styles: inst/components/scss/[feature_name].scss - Component styles
  4. Unit tests: tests/testthat/test-[feature-name].R - R unit tests

Note: Generated files (compiled JS/CSS, documentation) can be ignored - focus on source files.

Checklist:

  • Found the R implementation file(s)
  • Found the TypeScript source file(s)
  • Found the SCSS source file
  • Found the unit test file(s)
  • Reviewed how TypeScript is registered in srcts/src/components/index.ts

Read the full file on GitHub · 564 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 564 lines · 0 tokens per session scan A a5104aa16fdc

Subscribe to this mod's changes

port-from-bslib is a skill published in the GitHub repository posit-dev/py-shiny (1,750 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 5,092 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

Shade ShadCN install

Guardrails for running pnpm dlx shadcn@latest add in Shade — never overwrite existing components, fresh branch first, swap raw colours for semantic tokens after integrating. Trigger when the user proposes a shadcn add, or when a fresh ShadCN-shaped file lands in apps/shade/src/components/ui.

TryGhost/Ghost · 72 tokens

chakra-ui-builder

Build responsive, accessible UI components and layouts using Chakra UI v3, install or configure Chakra UI in new and existing projects, and design scalable themes using tokens, semantic tokens, recipes, and slot recipes. Use this skill whenever a user asks to build, create, or generate any UI component, page, form…

chakra-ui/chakra-ui · 214 tokens

frontend-visual-qa

Audits already-rendered web, landing-page, HTML deck/slide, browser tool/game, dashboard/admin, design-system, and desktop UIs using real-browser or native-app journeys, inspected screenshots, DOM geometry, responsive or projection viewports, and a bundled Playwright sweep. Use after UI implementation to find…

daymade/claude-code-skills · 145 tokens

prototype-web

可点击的功能性 Web 原型, 含导航、英雄区、特性区、CTA.

nexu-io/html-anything · 24 tokens

waitlist-page

【模板: 等候名单页 / Waitlist】 【意图】为新产品 / 早鸟内测做一张极简等候页。 【布局】.

nexu-io/html-anything · 25 tokens

design-frontend-dev

Clean Impeccable frontend design skill. Use when the user wants to design, redesign, critique, audit, polish, harden, optimize, adapt, clarify, colorize, animate, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, onboarding, empty states…

The-Vibe-Company/companion · 127 tokens