npx claudepluginhub choxos/rpkgagent --plugin r-package-developmentThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Implements structured self-debugging workflow for AI agent failures: capture errors, diagnose patterns like loops or context overflow, apply contained recoveries, and generate introspection reports.
This skill covers submitting packages to Bioconductor, which has additional requirements beyond CRAN. Bioconductor is the primary repository for computational biology and bioinformatics R packages.
Submit to Bioconductor if your package:
Submit to CRAN if your package:
Note: Packages can be on both, but start with one.
Bioconductor uses a specific version numbering system:
# Initial development
0.99.0 -> Start here for new packages
0.99.1 -> Bug fixes during review
0.99.2 -> More fixes
# First release (Bioconductor assigns this)
1.0.0 -> First Bioc release version
# Development continues
1.1.0 -> Devel version after 1.0.0 release
# Next release cycle
1.2.0 -> Next Bioc release (even y)
1.3.0 -> Devel version after 1.2.0
# Bug fixes
1.2.1 -> Bug fix for release
1.3.1 -> Bug fix for devel
# Start new package
Version: 0.99.0
# During review, bump z for fixes
Version: 0.99.1
Version: 0.99.2
# After acceptance, Bioconductor core sets
Version: 1.0.0 # For next release
# You continue development
Version: 1.1.0 # Devel version
Critical: Don't manually set version to 1.0.0 - Bioconductor does this.
Package: MyBiocPackage
Title: Analysis of Single-Cell RNA Sequencing Data
Version: 0.99.0
Authors@R: c(
person("First", "Last",
email = "email@institution.edu",
role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-2345-6789")),
person("Second", "Author",
role = "aut",
comment = c(ORCID = "0000-0001-2345-6780"))
)
Description: Provides methods for analyzing single-cell RNA sequencing
data. Implements novel clustering algorithms and visualization
techniques. Integrates with Bioconductor infrastructure including
SingleCellExperiment and other core data structures.
License: Artistic-2.0
Encoding: UTF-8
LazyData: false
Depends:
R (>= 4.4.0)
Imports:
BiocGenerics,
S4Vectors,
SummarizedExperiment,
SingleCellExperiment,
methods,
stats,
graphics
Suggests:
BiocStyle,
knitr,
rmarkdown,
testthat (>= 3.0.0),
scRNAseq
biocViews: Software, SingleCell, RNASeq, Clustering, Visualization,
DimensionReduction, GeneExpression
VignetteBuilder: knitr
RoxygenNote: 7.3.0
Roxygen: list(markdown = TRUE)
URL: https://github.com/username/MyBiocPackage
BugReports: https://github.com/username/MyBiocPackage/issues
Every Bioconductor package must have appropriate biocViews terms:
# Find appropriate terms
BiocManager::install("biocViews")
library(biocViews)
# Browse available terms
data(biocViewsVocab)
biocViewsVocab
# Common top-level categories
# Software - computational tools
# AnnotationData - annotation packages
# ExperimentData - example/experiment data packages
# Workflow - workflow packages
Software packages:
biocViews: Software, RNASeq, GeneExpression, Transcriptomics,
DifferentialExpression, Sequencing, Coverage, Alignment
By technology:
By analysis type:
By data type:
Bioconductor prefers open-source licenses:
# Set license
usethis::use_mit_license()
# Or manually in DESCRIPTION
License: Artistic-2.0
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("BiocCheck")
# Basic check
BiocCheck::BiocCheck()
# More detailed
BiocCheck::BiocCheck(".", new.package = TRUE)
# For package updates
BiocCheck::BiocCheck(".", new.package = FALSE)
BiocCheck reports three levels:
Problem:
ERROR: Version number must be 0.99.0 for new packages
Fix:
# In DESCRIPTION
Version: 0.99.0
Problem:
ERROR: Package must have biocViews
Fix:
# Add to DESCRIPTION
biocViews: Software, Sequencing, RNASeq
Problem:
WARNING: Vignette chunks should not use eval=FALSE
Fix: Make vignettes actually run:
# Bad
```{r, eval=FALSE}
result <- analyze_data(data)
data("example_dataset")
result <- analyze_data(example_dataset)
#### 4. Non-BiocStyle Vignette
**Problem**:
NOTE: Consider using BiocStyle package
**Fix**:
```yaml
---
title: "Package Vignette"
author: "Your Name"
output: BiocStyle::html_document
vignette: >
%\VignetteIndexEntry{Package Vignette}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r style, echo=FALSE, results='asis'}
BiocStyle::markdown()
#### 5. install.packages() in Documentation
**Problem**:
WARNING: Use BiocManager::install() not install.packages()
**Fix**:
```r
# Bad
#' Install with: install.packages("MyPackage")
# Good
#' Install with: BiocManager::install("MyPackage")
Problem:
NOTE: Lines should be <= 80 characters
Fix: Break long lines:
# Use styler
styler::style_pkg()
# Or manually
result <- my_function(
argument1 = value1,
argument2 = value2,
argument3 = value3
)
Problem:
NOTE: Consider adding NEWS file
Fix:
usethis::use_news_md()
Content:
# MyBiocPackage 0.99.0
* Initial Bioconductor submission
* Implements core functionality for X
* Includes vignette demonstrating Y
Problem:
WARNING: Package size is X MB
Fix:
Problem:
WARNING: Don't use .Rbuildignore excessively
Fix: Only ignore truly unnecessary files:
^.*\.Rproj$
^\.Rproj\.user$
^\.github$
^_pkgdown\.yml$
^docs$
^pkgdown$
Problem:
ERROR: All exported functions must have runnable examples
Fix:
#' My Function
#'
#' @examples
#' # Load example data
#' data("example_data")
#'
#' # Run analysis
#' result <- my_function(example_data)
#'
#' @export
my_function <- function(x) {
# implementation
}
Bioconductor strongly encourages S4 for complex data structures:
#' MyData Class
#'
#' @slot counts matrix of counts
#' @slot metadata data.frame of sample metadata
#' @slot features data.frame of feature metadata
#'
#' @export
setClass("MyData",
slots = c(
counts = "matrix",
metadata = "data.frame",
features = "data.frame"
)
)
#' Create MyData Object
#'
#' @param counts matrix of counts
#' @param metadata data.frame of metadata
#' @param features data.frame of features
#'
#' @return MyData object
#'
#' @examples
#' counts <- matrix(rpois(100, 10), nrow=10)
#' metadata <- data.frame(sample=paste0("S", 1:10))
#' features <- data.frame(gene=paste0("G", 1:10))
#' obj <- MyData(counts, metadata, features)
#'
#' @export
MyData <- function(counts, metadata, features) {
new("MyData",
counts = counts,
metadata = metadata,
features = features
)
}
#' @export
setGeneric("getCounts", function(x) standardGeneric("getCounts"))
#' @export
setMethod("getCounts", "MyData", function(x) x@counts)
#' @export
setMethod("show", "MyData", function(object) {
cat("MyData object\n")
cat(" Samples:", ncol(object@counts), "\n")
cat(" Features:", nrow(object@counts), "\n")
})
---
title: "Introduction to MyBiocPackage"
author:
- name: Your Name
affiliation: Institution
email: email@institution.edu
date: "`r Sys.Date()`"
output:
BiocStyle::html_document:
toc: true
toc_depth: 2
vignette: >
%\VignetteIndexEntry{Introduction to MyBiocPackage}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE)
BiocStyle::markdown()
This vignette demonstrates the basic usage of r Biocpkg("MyBiocPackage").
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("MyBiocPackage")
library(MyBiocPackage)
# Load example data
data("example_data")
# Run analysis
result <- analyze(example_data)
sessionInfo()
### Using Example Data
Create example data for vignettes:
```r
# In R/data.R
#' Example Single-Cell Dataset
#'
#' @description
#' A subset of single-cell RNA-seq data for demonstration.
#'
#' @format A SingleCellExperiment object with 100 cells and 500 genes
#' @examples
#' data("example_sce")
#' example_sce
"example_sce"
# Create and save data
# In data-raw/example_sce.R
library(SingleCellExperiment)
set.seed(123)
counts <- matrix(rpois(50000, 5), nrow=500, ncol=100)
rownames(counts) <- paste0("Gene", 1:500)
colnames(counts) <- paste0("Cell", 1:100)
example_sce <- SingleCellExperiment(
assays = list(counts = counts)
)
usethis::use_data(example_sce, overwrite = TRUE)
R CMD check with no errors, warnings, or notesBiocCheck::BiocCheck() with no errors# Ensure package is on GitHub
usethis::use_github()
# Add required files
usethis::use_readme_md()
usethis::use_news_md()
# Add GitHub Actions
usethis::use_github_action("check-bioc")
## Package Name
MyBiocPackage
## Submitter Name
Your Name
## Submitter Email
your.email@institution.edu
## Package Source
https://github.com/username/MyBiocPackage
## Confirmation
- [x] I understand that Bioconductor has a 6-month release cycle
- [x] I will maintain this package
- [x] I have read the package guidelines
- [x] My package passes BiocCheck
## Additional Information
This package provides methods for analyzing single-cell RNA-seq data.
It implements novel algorithms for clustering and visualization.
Timeline:
Reviewers will comment on your issue. For each comment:
Example response:
@reviewer-name I've addressed this by:
- Adding more detailed documentation to `my_function()`
- Including an additional example
- Fixing the typo in the vignette
Commit: abc1234
Documentation:
Code quality:
Examples:
Dependencies:
After acceptance:
# Bioconductor will:
# 1. Fork your repository to their GitHub
# 2. Set up build servers
# 3. Assign version 1.0.0 for next release
# 4. Add to Bioconductor package list
# You continue development:
# 1. Push changes to YOUR GitHub repository
# 2. Changes propagate to Bioconductor every 24 hours
# 3. Monitor build reports
# 4. Respond to user issues
Most common type:
Provide biological annotations:
Provide example or published datasets:
Step-by-step analysis workflows:
# Structure
MyExperimentData/
DESCRIPTION
R/
data.R
data/
dataset1.rda
dataset2.rda
vignettes/
overview.Rmd
man/
dataset1.Rd
DESCRIPTION:
Package: MyExperimentData
Title: Example Data for MyBiocPackage
Version: 0.99.0
biocViews: ExperimentData, RNASeqData, SingleCellData
License: Artistic-2.0
For very large data (>50 MB):
# Create metadata
library(ExperimentHub)
# In inst/extdata/metadata.csv
# See ExperimentHub documentation
# Users download with:
library(ExperimentHub)
eh <- ExperimentHub()
mydata <- eh[["EH12345"]]
Problem: Using 1.0.0 for initial submission
Fix: Always use 0.99.0 for new packages
Problem: Vignette chunks use eval=FALSE
Fix: Provide real example data and make vignettes run
Problem: Forgot to add biocViews to DESCRIPTION
Fix: Add appropriate terms from biocViews vocabulary
Problem: Documentation says install.packages()
Fix: Use BiocManager::install() everywhere
Problem: Using S3 for complex data structures
Fix: Use S4 classes for anything non-trivial
Problem: Ignoring build reports after acceptance
Fix: Check build reports daily, fix issues promptly
Problem: Importing 30+ packages
Fix: Only import what you actually need
Problem: Including large datasets in main package
Fix: Create separate ExperimentData package
Problem: Vignette takes 10+ minutes to build
Fix: Use smaller example datasets, cache results
Problem: Not addressing all comments
Fix: Address every single comment, ask for clarification if needed
# Development tools
BiocManager::install("BiocCheck")
BiocManager::install("BiocStyle")
# Check package
BiocCheck::BiocCheck()
# Test locally
BiocManager::valid()
| Feature | CRAN | Bioconductor |
|---|---|---|
| Version scheme | x.y.z (any) | y even=release, odd=devel |
| Submission | Web form | GitHub issue |
| Review | Automated mostly | Human reviewer |
| Build cycle | On submission | Daily |
| Release cycle | Anytime | Every 6 months |
| Dependencies | Any CRAN package | Bioc or CRAN |
| Data structures | Any | S4 preferred |
| Vignette style | Any | BiocStyle preferred |
This guide should help you successfully submit your package to Bioconductor!