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

build-parameterized-report

pjt222
업데이트됨 5 days ago
11 조회
17
2
17
GitHub에서 보기
메타automationdesign

정보

이 스킬은 개발자가 다양한 입력값으로 렌더링하여 여러 변형을 생성할 수 있는 매개변수화된 Quarto 또는 R Markdown 보고서를 작성할 수 있게 합니다. 매개변수 정의, 프로그래밍 방식 렌더링, 반복적인 보고 작업 자동화를 위한 배치 생성 방법을 다룹니다. 단일 템플릿으로 부서별, 고객별, 기간별 또는 데이터 하위 집합별로 동일한 보고서 구조를 생성해야 할 때 사용하세요.

빠른 설치

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/build-parameterized-report

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

문서

建參之報

建受參之報,以諸入自一範生諸變。

用時

  • 為異部、區、時段生同報
  • 自範建客特之報
  • 建篩至特子集之盤
  • 以異入自動化週期報

  • 必要:報範(Quarto 或 R Markdown)
  • 必要:參定(名、類、默)
  • 可選:批生之參值列
  • 可選:輸出報之目

第一步:於 YAML 定參

Quarto(report.qmd):

---
title: "Sales Report: `r params$region`"
params:
  region: "North America"
  year: 2025
  include_forecast: true
format:
  html:
    toc: true
---

R Markdown(report.Rmd):

---
title: "Sales Report"
params:
  region: "North America"
  year: 2025
  include_forecast: true
output: html_document
---

得: YAML 頭含 params: 塊,諸名參各有正類之默值。

敗則: 若渲失以「object 'params' not found」,確 params: 塊正縮於 YAML 頭。Quarto 中 params 必居 YAML 頂級,非嵌 format: 下。

第二步:於碼用參

```{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)
```

得: 碼塊以 params$name 引參,條件塊用 #| eval: !expr params$flag(Quarto)。內聯 R 表如 `r params$region` 生動文。

敗則:params$name 返 NULL,驗參名於 YAML 與碼引全合(別大小)。察默值之類正。

第三步:以自訂參渲

單渲:

# 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"
)

得: 單報以自訂參值覆 YAML 默而成渲。輸出檔建於所指之路。

敗則: Quarto 敗者,察 quarto CLI 已裝且於 PATH。R Markdown 敗者,驗 rmarkdown 已裝。確 execute_params(Quarto)或 params(R Markdown)中參名全合 YAML 定。

第四步:批渲諸報

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
  )
})

得: 每區年之合生一 HTML 檔。

敗則: 察 YAML 與碼間參名全合。確諸參值有效。

第五步:加參之驗

#| 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
)

得: 驗碼塊於各渲之始行,若參逾範或類誤則以明錯止。

敗則:stopifnot() 之錯言不明,改為明 if (!cond) stop("message") 以清診。

第六步:組輸出

# 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"))
)

得: 輸出檔書於日戳之子目,含述名(如 reports/2025-06/report-europe.html)。

敗則:dir.create() 敗,察父目存而可書。Windows 上驗路不過 260 字。

  • 報以默參成渲
  • 報以諸自訂參集成渲
  • 參於處前已驗
  • 輸出檔以述名名之
  • 條件段依參正渲
  • 批生於諸合皆畢

  • 參名不合:YAML 名必全合碼中 params$name 之引
  • 型強轉:YAML 或解 year: 2025 為整而碼望字。宜明
  • 條件估:Quarto 用 #| eval: !expr params$flag,非 eval = params$flag
  • 檔覆寫:無獨輸名,每渲覆前
  • 批模之記:久批或累記。考用 callr::r() 以隔

  • create-quarto-report - 基 Quarto 檔立
  • generate-statistical-tables - 適參之表
  • format-apa-report - 參之學報

GitHub 저장소

pjt222/agent-almanac
경로: i18n/wenyan/skills/build-parameterized-report
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을 선택하십시오.

스킬 보기