build-parameterized-report
정보
이 스킬은 개발자들이 배치 생성을 위해 다양한 입력값으로 프로그래밍 방식으로 렌더링할 수 있는 매개변수화된 Quarto 또는 R Markdown 보고서를 생성할 수 있게 합니다. 단일 템플릿으로부터 다양한 부서, 고객 또는 데이터 하위 집합을 위한 맞춤형 보고서 자동화를 위해 설계되었습니다. 주요 기능으로는 매개변수 정의, 프로그래밍적 렌더링, 그리고 변화하는 입력값을 통한 반복 보고서 자동화가 포함됩니다.
빠른 설치
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/build-parameterized-reportClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Build Parameterized Report
Create reports that accept parameters to generate multiple customized variations from a single template.
When to Use
- Generating the same report for different departments, regions, or time periods
- Creating client-specific reports from a template
- Building dashboards that filter to specific subsets
- Automating recurring reports with different inputs
Inputs
- Required: Report template (Quarto or R Markdown)
- Required: Parameter definitions (names, types, defaults)
- Optional: List of parameter values for batch generation
- Optional: Output directory for generated reports
Procedure
Step 1: Define Parameters in YAML
For Quarto (report.qmd):
---
title: "Sales Report: `r params$region`"
params:
region: "North America"
year: 2025
include_forecast: true
format:
html:
toc: true
---
For R Markdown (report.Rmd):
---
title: "Sales Report"
params:
region: "North America"
year: 2025
include_forecast: true
output: html_document
---
Got: The YAML header contains a params: block with named parameters, each having a default value of the correct type.
If fail: If rendering fails with "object 'params' not found", ensure the params: block is correctly indented under the YAML frontmatter. For Quarto, params must be at the top level of the YAML, not nested under format:.
Step 2: Use Parameters in Code
```{r}
#| label: filter-data
data <- full_dataset |>
filter(region == params$region, year == params$year)
nrow(data)
```
## Overview for `r params$region`
This report covers the `r params$region` region for `r params$year`.
```{r}
#| label: forecast
#| eval: !expr params$include_forecast
# This chunk only runs when include_forecast is TRUE
forecast_model <- forecast::auto.arima(data$sales)
forecast::autoplot(forecast_model)
```
Got: Code chunks reference parameters via params$name and conditional chunks use #| eval: !expr params$flag for Quarto. Inline R expressions like `r params$region` render dynamic text.
If fail: If params$name returns NULL, verify the parameter name matches exactly between the YAML definition and the code reference (case-sensitive). Check that default values are the correct type.
Step 3: Render with Custom Parameters
Single render:
# Quarto
quarto::quarto_render(
"report.qmd",
execute_params = list(region = "Europe", year = 2025)
)
# R Markdown
rmarkdown::render(
"report.Rmd",
params = list(region = "Europe", year = 2025),
output_file = "report-europe-2025.html"
)
Got: A single report renders successfully with custom parameter values overriding the YAML defaults. The output file is created at the specified path.
If fail: If Quarto render fails, check that quarto CLI is installed and on PATH. If R Markdown render fails, verify rmarkdown is installed. Ensure parameter names in execute_params (Quarto) or params (R Markdown) match the YAML definitions exactly.
Step 4: Batch Render Multiple Reports
regions <- c("North America", "Europe", "Asia Pacific", "Latin America")
years <- c(2024, 2025)
# Generate all combinations
combinations <- expand.grid(region = regions, year = years, stringsAsFactors = FALSE)
# Render each
purrr::pwalk(combinations, function(region, year) {
output_name <- sprintf("report-%s-%d.html",
tolower(gsub(" ", "-", region)), year)
quarto::quarto_render(
"report.qmd",
execute_params = list(region = region, year = year),
output_file = output_name
)
})
Got: One HTML file per region-year combination.
If fail: Check that parameter names match exactly between YAML and code. Ensure all parameter values are valid.
Step 5: Add Parameter Validation
#| label: validate-params
stopifnot(
"Region must be a valid region" = params$region %in% valid_regions,
"Year must be numeric" = is.numeric(params$year),
"Year must be reasonable" = params$year >= 2020 && params$year <= 2030
)
Got: The validation code chunk runs at the start of each render and stops with an informative error if any parameter is out of range or the wrong type.
If fail: If stopifnot() produces unhelpful error messages, switch to explicit if (!cond) stop("message") calls for clearer diagnostics.
Step 6: Organize Output
# Create output directory
output_dir <- file.path("reports", format(Sys.Date(), "%Y-%m"))
dir.create(output_dir, recursive = TRUE, showWarnings = FALSE)
# Render with output path
quarto::quarto_render(
"report.qmd",
execute_params = list(region = region),
output_file = file.path(output_dir, paste0("report-", region, ".html"))
)
Got: Output files are written to a date-stamped subdirectory with descriptive names (e.g., reports/2025-06/report-europe.html).
If fail: If dir.create() fails, check that the parent directory exists and is writable. On Windows, verify the path length does not exceed 260 characters.
Validation
- Report renders with default parameters
- Report renders with each set of custom parameters
- Parameters are validated before processing
- Output files are named descriptively
- Conditional sections render correctly based on parameters
- Batch generation completes for all combinations
Pitfalls
- Parameter name mismatch: YAML names must exactly match
params$namereferences in code - Type coercion: YAML may parse
year: 2025as integer but code expects character. Be explicit. - Conditional evaluation: Use
#| eval: !expr params$flagnoteval = params$flagin Quarto - File overwriting: Without unique output names, each render overwrites the previous
- Memory in batch mode: Long batch runs may accumulate memory. Consider using
callr::r()for isolation.
Related Skills
create-quarto-report- base Quarto document setupgenerate-statistical-tables- tables that adapt to parametersformat-apa-report- parameterized academic reports
GitHub 저장소
연관 스킬
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을 선택하십시오.
