Golem add function

From ThinkR-open/golem · View interactive version

Golem add function is an AI agent skill from the GitHub repository ThinkR-open/golem. Add functions to a golem Shiny application. Triggers on: - "add a function" - "create a helper function" - "add a utility function" Do not trigger on: - when the user is not working inside a golem app

How to use this skill

Skill file

Add Function

You are helping a user add functions to their golem Shiny application.

Creating Functions

Use the appropriate golem::add_*() function based on where the code belongs:

Function Types

Factory Functions (`R/fct_*.R`)

Utility Functions (`R/utils_*.R`)

Documentation

All functions MUST be documented with roxygen2.

In almost all cases, the internal functions do no need to be exported.

They are only useful inside the app.

If ever you have a doubt, ask the user.

#' Function Title
#'
#' Function description
#'
#' @param x Parameter description
#'
#' @return What the function returns
#'
#' @examples
#' my_func(x = 1)
#'
#' @importFrom pkg_name func_name
#'
#' @export
my_func <- function(x) {
  # function body
}

Important Rules

Testing

Code Quality

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.