ワンクリックで
document
Document package functions. Use when asked to document functions.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Document package functions. Use when asked to document functions.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
Creates GitHub issues for the package repository. Use when asked to create, file, or open a GitHub issue, or when planning new features or functions that need to be tracked.
GitHub workflows using the `gh` CLI, including viewing issues/PRs and commit message conventions. Use when interacting with GitHub in any way, such as viewing, creating, or editing issues and pull requests, making commits, or running any `gh` command.
Implements a GitHub issue end-to-end. Use when asked to implement, work on, or fix a specific issue number.
Guide for writing R code. Use when writing new functions, designing APIs, or reviewing/modifying existing R code.
Search and rewrite R source code by syntax using astgrepr. Use when asked to find patterns in code, search for function calls, identify usage of specific arguments, locate structural patterns across R files, or perform find-and-replace on code structure.
Test-driven development workflow. Use when writing any R code (writing new features, fixing bugs, refactoring, or reviewing tests).
SOC 職業分類に基づく
| name | document |
| trigger | document functions |
| description | Document package functions. Use when asked to document functions. |
All R functions in R/ should be documented in roxygen2 #' style, including internal/unexported functions.
air format . then devtools::document() after changing any roxygen2 docs.R/import-standalone-*.R are imported from other packages and have their own conventions. Do not modify their documentation.devtools::document(roclets = c('rd', 'collate', 'namespace'))._pkgdown.yml exists and contains a reference section:
_pkgdown.yml.pkgdown::check_pkgdown() to check that all topics are included in the reference index.Parameters used in more than one function go in R/aaa-shared_params.R under @name .shared-params. Functions inherit them with @inheritParams .shared-params. See R/aaa-shared_params.R for current definitions (if it exists).
Shared params blocks: alphabetize parameters, use @name .shared-params (with leading dot), include @keywords internal, end with NULL.
Multiple shared-params groups (e.g. .shared-params-io, .shared-params-parsing) are appropriate when parameters are only shared within a file and closely related files.
#' @param param_name (`TYPE`) Brief description (usually 1-3 sentences. Can
#' include [cross_references()]. Additional details on continuation lines if
#' needed.
Function-specific @param definitions always appear before any @inheritParams lines. If all parameters are defined locally, omit @inheritParams entirely.
| Notation | Meaning |
|---|---|
(`character`) | Character vector |
(`character(1)`) | Single string |
(`logical(1)`) | Single logical |
(`integer`) | Integer vector |
(`integer(1)`) | Single integer |
(`double`) | Double vector |
(`vector(0)`) | A prototype (zero-length vector) |
(`vector`) | A vector of unspecified type |
(`list`) | List |
(`data.frame`) | Data frame or tibble |
(`function` or `NULL`) | A function or NULL |
(`my_class`) | A class-specific type (use the actual class name) |
(`any`) | Any type |
When a parameter takes one of a fixed set of values, document them with a bullet list:
#' @param method (`character(1)`) The aggregation method. Can be one of:
#' * `"mean"`: Arithmetic mean.
#' * `"median"`: Median value.
#' * `"sum"`: Total sum.
Use @returns (not @return). Include a type when it's informative:
#' @returns A summary tibble.
#' @returns (`logical(1)`) `TRUE` if `x` is a valid record.
#' @returns Either a tibble or a list, depending on the input.
#' @returns `NULL` (invisibly).
Structured returns with columns:
#' @returns A [tibble::tibble()] with columns:
#' - `name`: Record name.
#' - `value`: Numeric value.
#' - `status`: Status (`"active"` or `"inactive"`).
#' Title in sentence case
#'
#' Description paragraph providing context and details.
#'
#' @param param_name (`TYPE`) Description.
#' @inheritParams .shared-params
#'
#' @returns Description of return value.
#' @seealso [related_function()]
#' @export
#'
#' @examples
#' example_code()
#' lines separate: title/description, description/params, and @export/@examples.@seealso (optional) goes between @returns and @export.@details can supplement the description when needed.Internal helpers (identified by a dot prefix, e.g. .parse_response()) use abbreviated documentation. Mark them with @keywords internal and omit @export:
#' Title in sentence case
#'
#' @param one_off_param (`TYPE`) Description.
#' @inheritParams .shared-params
#' @returns (`TYPE`) What it returns.
#' @keywords internal
Description paragraph is optional (only include when usage isn't obvious), fewer blank #' lines, and no @examples.
@rdname groupingUse @rdname to group related functions under one help page. This applies to:
@rdname + @export.@rdname + @export.#' Format a summary object
#'
#' @param x (`any`) The object to format.
#' @param ... Additional arguments passed to methods.
#' @returns A formatted character string.
#' @keywords internal
.format_summary <- function(x, ...) {
UseMethod(".format_summary")
}
#' @rdname .format_summary
#' @export
.format_summary.data_summary <- function(x, ...) {
# method implementation
}
S3 methods we don't own (generic from another package) need standalone documentation:
#' Title describing the method
#'
#' @param x (`TYPE`) Description.
#' @param ... Additional arguments (ignored).
#' @returns Description.
#' @exportS3Method pkg::generic
method.class <- function(x, ...) { ... }
Cross-references: Use square brackets — [fetch_records()] (internal), [tibble::tibble()] (external), [topic_name] (topics).
Section comment headers optionally organize code within a file, lowercase with dashes to column 80:
# helpers ----------------------------------------------------------------------
Only use such headers in complex files. The need for section comment headers might indicate that the file should be split into multiple files.
Examples: Exported functions include @examples. Use @examplesIf interactive() for network-dependent or slow functions. Use section-style comments (# Section ---) to organize longer example blocks. Internal functions do not get examples.