scaffold-shiny-app
정보
이 스킬은 R에서 새로운 Shiny 애플리케이션을 세 가지 프레임워크 옵션으로 구성합니다: 프로덕션 패키지를 위한 golem, 기업용 애플리케이션을 위한 rhino, 빠른 프로토타입을 위한 vanilla. 이는 프레임워크 선택, 프로젝트 초기화를 처리하며 첫 번째 모듈을 생성할 수 있습니다. 대화형 R 웹 앱, 대시보드 프로토타입 또는 프로덕션 준비가 된 Shiny 애플리케이션을 시작할 때 사용하세요.
빠른 설치
Claude Code
추천npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/scaffold-shiny-appClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Scaffold Shiny App
Create new Shiny w/ prod-ready structure → golem|rhino|vanilla.
Use When
- New interactive R web app
- Dashboard|data explorer proto
- Prod Shiny as R pkg (golem)
- Enterprise Shiny (rhino)
In
- Required: App name
- Required: Framework (golem|rhino|vanilla)
- Optional: Module scaffold (default yes)
- Optional: renv (default yes)
- Optional: Deploy target (shinyapps.io|Posit Connect|Docker)
Do
Step 1: Choose Framework
| Framework | Best For | Structure |
|---|---|---|
| golem | Production apps shipped as R packages | R package with DESCRIPTION, tests, vignettes |
| rhino | Enterprise apps with JS/CSS build pipeline | box modules, Sass, JS bundling, rhino::init() |
| vanilla | Quick prototypes and learning | Single app.R or ui.R/server.R pair |
→ Clear decision by scope + team needs.
If err: unsure → default golem (most structure, can simplify). Vanilla only for throwaway protos.
Step 2: Scaffold
Golem
golem::create_golem("myapp", package_name = "myapp")
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
rhino::init("myapp")
Creates:
myapp/
├── app/
│ ├── js/
│ ├── logic/
│ ├── static/
│ ├── styles/
│ ├── view/
│ └── main.R
├── tests/
│ ├── cypress/
│ └── testthat/
├── .github/
├── app.R
├── dependencies.R
├── rhino.yml
└── renv.lock
Vanilla
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)
→ Project dir created w/ all scaffold files.
If err: golem → install.packages("golem"). Rhino → remotes::install_github("Appsilon/rhino"). Vanilla → ensure shiny+bslib installed.
Step 3: Configure Deps
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
Deps managed in dependencies.R:
# dependencies.R
library(shiny)
library(bslib)
library(DT)
→ All deps recorded in DESCRIPTION (golem) | dependencies.R (rhino) + renv-locked.
If err: renv::init() fails → check write perms. Pkg install fails → check R ver compat.
Step 4: First Module
Golem
golem::add_module(name = "dashboard", with_test = TRUE)
Creates R/mod_dashboard.R + 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 to 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)
})
})
}
→ Module file w/ UI+server using proper namespacing.
If err: ensure NS(id) for all input/output IDs in UI fn. Without → IDs collide on multi-use.
Step 5: Run
# Golem
golem::run_dev()
# Rhino
shiny::runApp()
# Vanilla
shiny::runApp("app.R")
→ App launches in browser w/o errs.
If err: check R console. Common: missing pkgs (install), port in use (port = 3839), syntax errs in UI/server.
Check
- App dir has correct structure for framework
-
shiny::runApp()launches w/o errs - ≥1 module w/ UI+server
- Deps recorded (DESCRIPTION|dependencies.R)
- renv.lock captures vers
- Module uses
NS(id)for namespace isolation
Traps
- Vanilla for prod: Lacks tests, docs, deploy tooling. Use golem|rhino beyond protos.
- Missing namespace in modules: Every
inputId+outputIdmust wrapns(). Forget → silent ID collisions. - golem w/o devtools: golem apps are R pkgs. Use
devtools::load_all(),test(),document()— notsource(). - rhino w/o box: rhino uses box for imports. Don't fall back to
library()— usebox::use().
→
build-shiny-module— reusable modules w/ namespace isolationtest-shiny-app— shinytest2 + testServer() testsdeploy-shiny-app— deploy to shinyapps.io, Posit Connect, Dockerdesign-shiny-ui— bslib theming + responsivecreate-r-package— R pkg scaffold (golem apps are R pkgs)manage-renv-dependencies— detailed renv mgmt
GitHub 저장소
연관 스킬
executing-plans
디자인executing-plans 스킬은 검토 체크포인트가 포함된 통제된 배치로 실행할 완전한 구현 계획이 있을 때 사용합니다. 이 스킬은 계획을 불러와 비판적으로 검토한 후, 소규모 배치(기본값 3개 작업)로 작업을 실행하면서 각 배치 사이에 진행 상황을 아키텍트 검토를 위해 보고합니다. 이를 통해 내재된 품질 관리 체크포인트를 갖춘 체계적인 구현이 보장됩니다.
requesting-code-review
디자인이 스킬은 코드 변경 사항을 요구 사항에 따라 분석하기 위해 코드 리뷰어 하위 에이전트를 호출합니다. 작업 완료 후, 주요 기능 구현 후, 또는 메인 브랜치에 병합하기 전에 사용해야 합니다. 이 리뷰는 현재 구현체와 원래 계획을 비교하여 문제를 조기에 발견하는 데 도움이 됩니다.
connect-mcp-server
디자인이 스킬은 개발자들이 HTTP, stdio 또는 SSE 전송 방식을 통해 MCP 서버를 Claude Code에 연결하는 포괄적인 가이드를 제공합니다. GitHub, Notion 및 사용자 정의 API와 같은 외부 서비스를 통합하기 위한 설치, 구성, 인증 및 보안을 다룹니다. MCP 통합 설정, 외부 도구 구성 또는 Claude의 모델 컨텍스트 프로토콜 작업 시 활용하세요.
web-cli-teleport
디자인이 스킬은 작업 분석을 기반으로 개발자가 Claude Code 웹 인터페이스와 CLI 인터페이스 중 선택할 수 있도록 돕고, 두 환경 간 원활한 세션 텔레포트를 가능하게 합니다. 웹, CLI 또는 모바일 환경 전환 시 세션 상태와 컨텍스트를 관리하여 워크플로를 최적화합니다. 다양한 단계에서 서로 다른 도구가 필요한 복잡한 프로젝트에 사용하세요.
