Create a new skill for your project using interactive guidance. If launched in app or console mode, this task will start an interactive chat session to guide you through the process of creating a skill that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Usage
btw_task_create_skill(
...,
name = NULL,
client = NULL,
mode = c("app", "console", "client", "tool"),
tools = "docs"
)Arguments
- ...
Additional context to provide to the AI. This can be any text or R objects that can be converted to text using
btw().- name
Optional skill name. If provided, the AI will skip the naming step and use this name directly.
- client
An ellmer::Chat client, or a
provider/modelstring to be passed toellmer::chat()to create a chat client, or an alias to a client setting in yourbtw.mdfile (see "Multiple Providers" section). Defaults toellmer::chat_anthropic(). You can use thebtw.clientoption to set a default client for newbtw_client()calls, or use abtw.mdproject file for default chat client settings, like provider and model. We check theclientargument, then thebtw.clientR option, and finally thebtw.mdproject file (falling back to user-levelbtw.mdif needed), using only the client definition from the first of these that is available.- mode
The mode to run the task in, which affects what is returned from this function.
"app"and"console"modes launch interactive sessions, while"client"and"tool"modes return objects for programmatic use.- tools
Optional list or character vector of tools to allow the task to use when creating the skill. By default documentation tools are included to allow the task to help create package-based skills. You can include additional tools as needed.
Because the task requires file tools to create skills with resources, tools for listing, reading and writing files are always included.
Value
When mode is "app" or "console", this function launches an
interactive session in the browser or the R console, respectively. The
ellmer chat object with the conversation history is returned invisibly
when the session ends.
When mode is "client", this function returns the configured ellmer
chat client object. When mode is "tool", this function returns an
ellmer tool object that can be used in other chat instances.
See also
Other task and agent functions:
btw_task(),
btw_task_create_btw_md(),
btw_task_create_readme()
Examples
withr::with_envvar(list(ANTHROPIC_API_KEY = "example"), {
btw_task_create_skill(mode = "tool", client = "anthropic")
})
#> Using model = "claude-sonnet-4-5-20250929".
#> # <ellmer::ToolDef> btw_task_create_skill(prompt, name)
#> # @name: btw_task_create_skill
#> # @description: Create a new skill for your project with interactive guidance.
#> # @convert: TRUE
#> #
#> function (prompt, name = NULL)
#> btw_task_create_skill_tool(prompt, name)
#> <bytecode: 0x557c9f88d7e0>
#> <environment: 0x557c9f88df50>
