MCP HubMCP Hub
스킬 목록으로 돌아가기

scaffold-shiny-app

pjt222
업데이트됨 Yesterday
3 조회
17
2
17
GitHub에서 보기
메타designdata

정보

이 스킬은 새 Shiny 애플리케이션을 세 가지 프레임워크 옵션으로 구성합니다: 프로덕션 R 패키지를 위한 golem, 엔터프라이즈 프로젝트를 위한 rhino, 빠른 프로토타이핑을 위한 vanilla. 프로젝트 초기화를 처리하고 첫 번째 모듈을 생성하여 개발자가 인터랙티브 웹 앱, 대시보드 또는 데이터 탐색기를 신속하게 부트스트랩할 수 있도록 합니다. 적절한 도구와 체계적인 조직을 갖춘 구조화된 기반을 마련하여 모든 유형의 Shiny 프로젝트에 활용하세요.

빠른 설치

Claude Code

추천
기본
npx skills add pjt222/agent-almanac -a claude-code
플러그인 명령대체
/plugin add https://github.com/pjt222/agent-almanac
Git 클론대체
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/scaffold-shiny-app

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

Scaffold Shiny App

Create a new Shiny application with production-ready structure using golem, rhino, or vanilla scaffolding.

When to Use

  • Starting a new interactive web application in R
  • Creating a dashboard or data explorer prototype
  • Setting up a production Shiny app as an R package (golem)
  • Bootstrapping an enterprise Shiny project (rhino)

Inputs

  • Required: Application name
  • Required: Framework choice (golem, rhino, or vanilla)
  • Optional: Include module scaffolding (default: yes)
  • Optional: Use renv for dependency management (default: yes)
  • Optional: Deployment target (shinyapps.io, Posit Connect, Docker)

Procedure

Step 1: Choose Framework

Evaluate project requirements to select the framework:

FrameworkBest ForStructure
golemProduction apps shipped as R packagesR package with DESCRIPTION, tests, vignettes
rhinoEnterprise apps with JS/CSS build pipelinebox modules, Sass, JS bundling, rhino::init()
vanillaQuick prototypes and learningSingle app.R or ui.R/server.R pair

Got: Clear framework decision based on project scope and team needs.

If fail: If unsure, default to golem — provides the most structure and can be simplified later. Vanilla is only for throwaway prototypes.

Step 2: Scaffold the Project

Golem Path

golem::create_golem("myapp", package_name = "myapp")

This creates:

myapp/
├── DESCRIPTION
├── NAMESPACE
├── R/
│   ├── app_config.R
│   ├── app_server.R
│   ├── app_ui.R
│   └── run_app.R
├── dev/
│   ├── 01_start.R
│   ├── 02_dev.R
│   ├── 03_deploy.R
│   └── run_dev.R
├── inst/
│   ├── app/www/
│   └── golem-config.yml
├── man/
├── tests/
│   ├── testthat.R
│   └── testthat/
└── vignettes/

Rhino Path

rhino::init("myapp")

This creates:

myapp/
├── app/
│   ├── js/
│   ├── logic/
│   ├── static/
│   ├── styles/
│   ├── view/
│   └── main.R
├── tests/
│   ├── cypress/
│   └── testthat/
├── .github/
├── app.R
├── dependencies.R
├── rhino.yml
└── renv.lock

Vanilla Path

Create app.R:

library(shiny)
library(bslib)

ui <- page_sidebar(
  title = "My App",
  sidebar = sidebar(
    sliderInput("n", "Sample size", 10, 1000, 100)
  ),
  card(
    card_header("Output"),
    plotOutput("plot")
  )
)

server <- function(input, output, session) {
  output$plot <- renderPlot({
    hist(rnorm(input$n), main = "Random Normal")
  })
}

shinyApp(ui, server)

Got: Project directory created with all scaffolding files.

If fail: For golem, ensure golem is installed: install.packages("golem"). For rhino, install from GitHub: remotes::install_github("Appsilon/rhino"). For vanilla, ensure shiny and bslib are installed.

Step 3: Configure Dependencies

Golem/Vanilla

# Initialize renv
renv::init()

# Add core dependencies
usethis::use_package("shiny")
usethis::use_package("bslib")
usethis::use_package("DT")         # if using data tables
usethis::use_package("plotly")     # if using interactive plots

# Snapshot
renv::snapshot()

Rhino

Dependencies are managed in dependencies.R:

# dependencies.R
library(shiny)
library(bslib)
library(DT)

Got: All dependencies recorded in DESCRIPTION (golem) or dependencies.R (rhino) and locked with renv.

If fail: If renv::init() fails, check write permissions. If packages fail to install, check R version compatibility.

Step 4: Create First Module

Golem

golem::add_module(name = "dashboard", with_test = TRUE)

This creates R/mod_dashboard.R and tests/testthat/test-mod_dashboard.R.

Rhino

Create app/view/dashboard.R:

box::use(
  shiny[moduleServer, NS, tagList, h3, plotOutput, renderPlot],
)

#' @export
ui <- function(id) {
  ns <- NS(id)
  tagList(
    h3("Dashboard"),
    plotOutput(ns("plot"))
  )
}

#' @export
server <- function(id) {
  moduleServer(id, function(input, output, session) {
    output$plot <- renderPlot({
      plot(1:10)
    })
  })
}

Vanilla

Add module functions to a separate file R/mod_dashboard.R:

dashboardUI <- function(id) {
  ns <- NS(id)
  tagList(
    h3("Dashboard"),
    plotOutput(ns("plot"))
  )
}

dashboardServer <- function(id) {
  moduleServer(id, function(input, output, session) {
    output$plot <- renderPlot({
      plot(1:10)
    })
  })
}

Got: Module file created with UI and server functions using proper namespacing.

If fail: Ensure the module uses NS(id) for all input/output IDs in the UI function. Without namespacing, IDs collide when the module is used multiple times.

Step 5: Run the Application

# Golem
golem::run_dev()

# Rhino
shiny::runApp()

# Vanilla
shiny::runApp("app.R")

Got: Application launches in the browser without errors.

If fail: Check the R console for error messages. Common issues: missing packages (install them), port already in use (specify a different port with port = 3839), or syntax errors in UI/server code.

Validation

  • Application directory has correct structure for chosen framework
  • shiny::runApp() launches without errors
  • At least one module is scaffolded with UI and server functions
  • Dependencies recorded (DESCRIPTION or dependencies.R)
  • renv.lock captures all package versions
  • Module uses NS(id) for proper namespace isolation

Pitfalls

  • Choosing vanilla for production: Vanilla structure lacks testing infrastructure, documentation, and deployment tooling. Use golem or rhino for anything beyond prototypes.
  • Missing namespace in modules: Every inputId and outputId in a module UI must be wrapped with ns(). Forgetting this causes silent ID collisions.
  • golem without devtools workflow: golem apps are R packages. Use devtools::load_all(), devtools::test(), and devtools::document() — not source().
  • rhino without box: rhino uses box for module imports. Don't fall back to library() calls — use box::use() for explicit imports.

Related Skills

  • build-shiny-module — create reusable Shiny modules with proper namespace isolation
  • test-shiny-app — set up shinytest2 and testServer() tests
  • deploy-shiny-app — deploy to shinyapps.io, Posit Connect, or Docker
  • design-shiny-ui — bslib theming and responsive layout design
  • create-r-package — R package scaffolding (golem apps are R packages)
  • manage-renv-dependencies — detailed renv dependency management

GitHub 저장소

pjt222/agent-almanac
경로: i18n/caveman-lite/skills/scaffold-shiny-app
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

연관 스킬

content-collections

메타

이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.

스킬 보기

polymarket

메타

이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.

스킬 보기

creating-opencode-plugins

메타

이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.

스킬 보기

sglang

메타

SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.

스킬 보기