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

write-vignette

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

정보

이 스킬은 R 개발자가 튜토리얼과 복잡한 워크플로우 문서 작성을 위해 R 마크다운이나 Quarto를 사용해 패키지 비네트를 만들 수 있도록 돕습니다. 설정, YAML 구성, 빌드, 그리고 CRAN 요구사항을 다룹니다. 사용자 지침서, 시작하기 튜토리얼, 또는 CRAN 제출용 문서가 필요할 때 활용하세요.

빠른 설치

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/write-vignette

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

문서

Write Vignette

Create long-form documentation vignettes for R packages.

When Use

  • Adding "Getting Started" tutorial for package
  • Documenting complex workflows that span multiple functions
  • Creating domain-specific guides (e.g., statistical methodology)
  • CRAN submission needs user-facing documentation beyond function help

Inputs

  • Required: R package with functions to document
  • Required: Vignette title and topic
  • Optional: Format (R Markdown or Quarto, default: R Markdown)
  • Optional: Whether vignette needs external data or APIs

Steps

Step 1: Create Vignette File

usethis::use_vignette("getting-started", title = "Getting Started with packagename")

Got: vignettes/getting-started.Rmd created with YAML frontmatter. knitr and rmarkdown added to DESCRIPTION Suggests field. vignettes/ directory exists.

If err: usethis::use_vignette() fails? Verify working directory is package root (contains DESCRIPTION). knitr not installed? Run install.packages("knitr") first. For manual creation, create vignettes/ directory and file by hand. Ensure YAML frontmatter includes all three %\Vignette* entries.

Step 2: Write Vignette Content

---
title: "Getting Started with packagename"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Getting Started with packagename}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

## Introduction

Brief overview of what the package does and who it's for.

## Installation

```r
install.packages("packagename")
library(packagename)

Basic Usage

Walk through the primary workflow:

# Load example data
data <- example_data()

# Process
result <- main_function(data, option = "default")

# Inspect
summary(result)

Advanced Features

Cover optional or advanced functionality.

Conclusion

Summarize and point to other vignettes or resources.


**Got:** Vignette Rmd file contains Introduction, Installation, Basic Usage, Advanced Features, Conclusion sections. Code examples use package's exported functions and produce visible output.

**If err:** Examples fail to run? Verify package installed with `devtools::install()`. Ensure examples use package name in `library()` calls (not `devtools::load_all()`). For functions requiring external resources, use `eval=FALSE` to show code without execution.

### Step 3: Configure Code Chunks

Use chunk options for different purposes:

```r
# Standard evaluated chunk
{r example-basic}
result <- compute_something(1:10)
result

# Show code but don't run (for illustrative purposes)
{r api-example, eval=FALSE}
connect_to_api(key = "your_key_here")

# Run but hide code (show only output)
{r hidden-setup, echo=FALSE}
library(packagename)

# Set global options
{r setup, include=FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.width = 7,
  fig.height = 5
)

Got: Setup chunk with include=FALSE sets global options (collapse, comment, fig.width, fig.height). Chunks configured appropriate: eval=FALSE for illustrative code, echo=FALSE for hidden setup, standard chunks for interactive examples.

If err: Chunk options not taking effect? Verify syntax uses {r chunk-name, option=value} format (comma-separated, no quotes around logical values). Check setup chunk runs first by placing at top of document.

Step 4: Handle External Dependencies

For vignettes that need network access or optional packages:

{r check-available, include=FALSE}
has_suggested <- requireNamespace("optionalpkg", quietly = TRUE)

{r use-suggested, eval=has_suggested}
optionalpkg::special_function()

For long-running computations, pre-compute and save results:

# Save pre-computed results to vignettes/
saveRDS(expensive_result, "vignettes/precomputed.rds")

# Load in vignette
{r load-precomputed}
result <- readRDS("precomputed.rds")

Got: External dependencies handled gracefully — optional packages conditionally loaded with requireNamespace(), network-dependent code uses eval=FALSE or tryCatch(), expensive computations use pre-computed .rds files.

If err: Vignette fails on CRAN due to unavailable optional packages? Wrap those sections with conditional variable (e.g., eval=has_suggested). For pre-computed results, ensure .rds file included in vignettes/ directory and referenced with relative path.

Step 5: Build and Test Vignette

# Build single vignette
devtools::build_vignettes()

# Build and check (catches vignette issues)
devtools::check()

Got: Vignette builds without errors. HTML output readable.

If err:

  • Missing pandoc: Set RSTUDIO_PANDOC in .Renviron
  • Package not installed: Run devtools::install() first
  • Missing Suggests: Install packages listed in DESCRIPTION Suggests

Step 6: Verify in Package Check

devtools::check()

Vignette-related checks: builds correctly, doesn't take too long, no errors.

Got: devtools::check() passes with no vignette-related errors or warnings. Vignette builds within CRAN time limits (typically under 60 seconds).

If err: Vignette causes check failures? Common fixes: add missing Suggests packages to DESCRIPTION, reduce build time with eval=FALSE on slow chunks, ensure VignetteIndexEntry matches title. Run devtools::build_vignettes() separately to isolate vignette-specific errors.

Check

  • Vignette builds without errors via devtools::build_vignettes()
  • All code chunks execute correctly
  • VignetteIndexEntry matches title
  • devtools::check() passes with no vignette warnings
  • Vignette appears in pkgdown site articles (if applicable)
  • Build time reasonable (< 60 seconds for CRAN)

Pitfalls

  • VignetteIndexEntry mismatch: Index entry in YAML must match what you want users to see in vignette(package = "pkg")
  • Missing vignette YAML block: All three %\Vignette* lines required
  • Vignette too slow for CRAN: Pre-compute results or use eval=FALSE for expensive operations
  • Pandoc not found: Ensure RSTUDIO_PANDOC environment variable set
  • Self-referencing package: Use library(packagename) not devtools::load_all() in vignettes

See Also

  • write-roxygen-docs - function-level docs complement vignette tutorials
  • build-pkgdown-site - vignettes appear as articles on pkgdown site
  • submit-to-cran - CRAN has specific vignette requirements
  • create-quarto-report - Quarto as alternative to R Markdown vignettes

GitHub 저장소

pjt222/agent-almanac
경로: i18n/caveman/skills/write-vignette
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을 선택하십시오.

스킬 보기