Acerca de
Esta habilidad estructura una nueva aplicación Shiny en R, ofreciendo una elección entre marcos de trabajo listos para producción (golem), modulares (rhino) o simples (vanilla). Configura la estructura del proyecto, los componentes básicos de interfaz de usuario y servidor, y verifica la ejecución local. Úsala al iniciar una nueva aplicación Shiny o al seleccionar entre diferentes enfoques de estructuración.
Instalación rápida
Claude Code
Recomendadonpx 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-appCopia y pega este comando en Claude Code para instalar esta habilidad
Documentación
name: scaffold-shiny-app description: > Shiny-App mit golem (produktionsreif), rhino (modularer Ansatz) oder Vanilla-Shiny (einfach) erstellen. Behandelt Projektstruktur, grundlegendes UI/Server-Setup und Verifikation der lokalen Ausführung. Verwenden, wenn eine neue Shiny-App gestartet oder zwischen Scaffolding-Frameworks gewählt werden soll. license: MIT locale: de source_locale: en source_commit: 6f65f316 translator: claude-opus-4-6 translation_date: 2026-03-16 allowed-tools: Read Write Edit Bash Grep Glob metadata: author: Philipp Thoss version: "1.0" domain: shiny complexity: basic language: R tags: shiny, golem, rhino, scaffold, r-packages
Shiny-App scaffolden
Eine neue Shiny-Anwendung mit dem geeigneten Framework für den Produktionsfall scaffolden.
Wann verwenden
- Start einer neuen Shiny-App
- Wahl zwischen Scaffolding-Frameworks (golem, rhino, Vanilla)
- Einrichten einer standardisierten Projektstruktur für ein Team
- Schnelles Prototypen einer datengesteuerten Web-App in R
Eingaben
- Erforderlich: App-Name (gültiger R-Paketname)
- Erforderlich: Framework-Wahl:
golem,rhinoodervanilla - Optional: Autor-Informationen für DESCRIPTION (bei golem/rhino)
- Optional: Ziel-Verzeichnis (Standard: aktuelles Verzeichnis)
Vorgehensweise
Schritt 1: Framework auswählen
Das richtige Scaffolding-Framework basierend auf Projektanforderungen auswählen.
| Framework | Wann verwenden |
|---|---|
golem | Produktions-Apps, R-Paket-Struktur, CRAN-Deployment |
rhino | Modulare Apps, box-Module, JavaScript-Assets |
vanilla | Schnelle Prototypen, einfache Apps, kein Framework-Overhead |
Erwartet: Framework-Auswahl stimmt mit Projektkomplexität und Team-Expertise überein.
Bei Fehler: Wenn unsicher, mit vanilla beginnen und später auf golem/rhino migrieren, wenn die App wächst.
Schritt 2: Projekt scaffolden
Das gewählte Framework installieren und das Projekt initialisieren.
Für golem:
install.packages("golem")
golem::create_golem("myapp")
Für rhino:
install.packages("rhino")
rhino::init("myapp")
Für Vanilla Shiny:
install.packages("shiny")
# Projektstruktur manuell erstellen
dir.create("myapp")
dir.create("myapp/R")
dir.create("myapp/www")
# App-Dateien erstellen
file.create("myapp/app.R")
file.create("myapp/R/ui.R")
file.create("myapp/R/server.R")
Erwartet: Projektverzeichnis mit Framework-spezifischer Struktur erstellt.
Bei Fehler: Wenn Package-Installation fehlschlägt, prüfen ob CRAN erreichbar ist: options(repos = c(CRAN = "https://cran.rstudio.com/")). Für golem auf GitHub: remotes::install_github("Thinkr-open/golem").
Schritt 3: Basis-UI und Server einrichten
Grundlegende UI- und Server-Komponenten implementieren.
Für golem (R/app_ui.R und R/app_server.R):
# R/app_ui.R
app_ui <- function(request) {
tagList(
golem_add_external_resources(),
fluidPage(
titlePanel("My App"),
sidebarLayout(
sidebarPanel(
selectInput("dataset", "Choose a dataset:",
choices = c("iris", "mtcars"))
),
mainPanel(
tableOutput("table")
)
)
)
)
}
# R/app_server.R
app_server <- function(input, output, session) {
output$table <- renderTable({
get(input$dataset)
})
}
Für Vanilla Shiny (app.R):
library(shiny)
ui <- fluidPage(
titlePanel("My App"),
sidebarLayout(
sidebarPanel(
selectInput("dataset", "Choose a dataset:",
choices = c("iris", "mtcars"))
),
mainPanel(
tableOutput("table")
)
)
)
server <- function(input, output, session) {
output$table <- renderTable({
get(input$dataset)
})
}
shinyApp(ui, server)
Erwartet: UI und Server ohne Syntaxfehler definiert. App startet ohne Laufzeitfehler.
Bei Fehler: Wenn get(input$dataset) Fehler erzeugt, sicherstellen, dass Datensatznamen mit R-Basisumgebung zugänglichen Datensätzen übereinstimmen (iris, mtcars, etc.).
Schritt 4: Lokal verifizieren
Die App lokal ausführen und grundlegende Funktionalität prüfen.
Für golem:
golem::run_dev()
Für Vanilla:
# Im Projektverzeichnis
shiny::runApp("myapp")
# Oder wenn bereits in myapp/
shiny::runApp()
App öffnet sich im Standard-Browser oder zeigt die URL an:
Listening on http://127.0.0.1:PORT
Erwartet: App startet ohne Fehler. Basis-UI rendert korrekt. Dropdown-Auswahl ändert Tabelleninhalt.
Bei Fehler: Wenn Port belegt ist, anderen Port angeben: shiny::runApp(port = 3838). Wenn App mit Fehler abbricht, Konsolen-Fehlerausgabe für Paket-fehlende oder Syntaxfehler prüfen.
Schritt 5: Projektstruktur dokumentieren
README.md und grundlegende Konfiguration hinzufügen.
# README.md erstellen
writeLines(c(
"# My App",
"",
"## Overview",
"Brief description of the app.",
"",
"## Setup",
"```r",
"install.packages('shiny')",
"shiny::runApp()",
"```",
"",
"## Structure",
"- `R/` — App-Logik (UI, Server, Module)",
"- `www/` — Statische Assets (CSS, JS, Bilder)",
"- `tests/` — App-Tests"
), "myapp/README.md")
Erwartet: README erklärt App-Zweck und Setup-Schritte.
Bei Fehler: Wenn README-Erstellung fehlschlägt, manuell im Texteditor erstellen.
Validierung
- Projektverzeichnis mit korrekter Framework-Struktur erstellt
- Basis-UI und Server ohne Syntaxfehler definiert
- App startet lokal ohne Fehler
- UI rendert korrekt im Browser
- Basis-Interaktivität (Input → Output) funktioniert
- README mit Setup-Anweisungen vorhanden
Haeufige Stolperfallen
- Golem vs Plain Shiny: golem erzwingt R-Paket-Struktur (DESCRIPTION, NAMESPACE).
devtools::check()laufen lassen, um Paket-Konformität sicherzustellen. - Namespace-Kollisionen: Wenn mehrere Pakete Funktion
select()exportieren, stetspkg::function()verwenden (z. B.dplyr::select()). - Reaktive Kontexte:
input$*-Werte nur innerhalb reaktiver Kontexte (reactive(),observe(),render*()). Außerhalb schlägt dies fehl. - Shiny-App vs Funktion: In golem ist
run_app()die Entry-Point-Funktion. In Vanilla istshinyApp(ui, server)der Entry-Point. - Port-Konflikte: Wenn mehrere Apps gleichzeitig laufen, für jede explizite Ports setzen.
www/-Verzeichnis: Statische Dateien müssen inwww/liegen. Auf sie wird mit relativem Pfad ohnewww/-Präfix zugegriffen.
Verwandte Skills
build-shiny-module— wiederverwendbare Shiny-Module erstellentest-shiny-app— App mit shinytest2 testendeploy-shiny-app— App auf shinyapps.io oder Posit Connect deployendesign-shiny-ui— UI mit bslib und modernen Themes gestalten
Repositorio GitHub
Frequently asked questions
What is the scaffold-shiny-app skill?
scaffold-shiny-app is a Claude Skill by pjt222. Skills package instructions and resources that Claude loads on demand, so Claude can perform scaffold-shiny-app-related tasks without extra prompting.
How do I install scaffold-shiny-app?
Use the install commands on this page: add scaffold-shiny-app to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.
What category does scaffold-shiny-app belong to?
scaffold-shiny-app is in the Design category, tagged design.
Is scaffold-shiny-app free to use?
Yes. scaffold-shiny-app is listed on AIMCP and free to install. It runs inside Claude, so no separate service account is required to use the skill itself.
Habilidades relacionadas
Utilice la habilidad executing-plans cuando tenga un plan de implementación completo para ejecutar en lotes controlados con puntos de revisión. Esta habilidad carga y revisa críticamente el plan, luego ejecuta tareas en pequeños lotes (por defecto 3 tareas) mientras reporta el progreso entre cada lote para la revisión del arquitecto. Esto asegura una implementación sistemática con puntos de control de calidad integrados.
Esta habilidad despacha un subagente revisor de código para analizar los cambios en el código frente a los requisitos antes de proceder. Debe usarse después de completar tareas, implementar funciones principales o antes de fusionar con la rama principal. La revisión ayuda a detectar problemas de forma temprana al comparar la implementación actual con el plan original.
Esta habilidad proporciona una guía integral para que los desarrolladores conecten servidores MCP a Claude Code mediante transportes HTTP, stdio o SSE. Cubre la instalación, configuración, autenticación y seguridad para integrar servicios externos como GitHub, Notion y APIs personalizadas. Úsala al configurar integraciones MCP, al configurar herramientas externas o al trabajar con el Protocolo de Contexto del Modelo de Claude.
Esta habilidad ayuda a los desarrolladores a elegir entre las interfaces web y CLI de Claude Code mediante el análisis de tareas, y luego permite la teletransportación fluida de sesiones entre estos entornos. Optimiza el flujo de trabajo gestionando el estado y el contexto de la sesión al cambiar entre web, CLI o móvil. Úsala para proyectos complejos que requieren diferentes herramientas en varias etapas.
