Create a compelling, user-focused README file for your project. If launched in app or console mode, this task will start an interactive chat session to guide you through the process of creating a polished README that clearly communicates value and helps potential users make informed decisions.
This task focuses on creating READMEs for END USERS, not developers, with emphasis on clarity, accessibility, and authentic communication of value. The process involves exploring your project files, understanding your target audience and goals, proposing a structure, and then iteratively drafting each section with your input.
Usage
btw_task_create_readme(
...,
client = NULL,
mode = c("app", "console", "client", "tool")
)
Arguments
- ...
Additional context to provide to the AI. This can be any text or R objects that can be converted to text using
btw()
.- client
An ellmer::Chat client or a
provider/model
string to be passed toellmer::chat()
to create a chat client. Defaults toellmer::chat_anthropic()
. You can use thebtw.client
option to set a default client for newbtw_client()
calls, or use abtw.md
project file for default chat client settings, like provider and model. We check theclient
argument, then thebtw.client
R option, and finally thebtw.md
project file, 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.
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_create_btw_md()
Examples
withr::with_envvar(list(ANTHROPIC_API_KEY = "example"), {
btw_task_create_readme(mode = "tool", client = "anthropic")
})
#> Using model = "claude-sonnet-4-20250514".
#> # <ellmer::ToolDef> btw_task_create_readme(prompt)
#> # @name: btw_task_create_readme
#> # @description: Create a polished, user-focused README file for your project.
#> # @convert: TRUE
#> #
#> function (prompt = "")
#> {
#> this_client <- client$clone()
#> sys_prompt <- paste0(this_client$get_system_prompt(), "\n\n---\n\n",
#> "YOU ARE NOW OPERATING IN TOOL MODE. ", "The user cannot respond directly to you. ",
#> "Because you cannot talk to the user, you will need to make your own decisions using the information available to you and the best of your abilities. ",
#> "You may compensate by doing additional file exploration as needed.")
#> this_client$set_system_prompt(sys_prompt)
#> this_client$chat(prompt)
#> }
#> <bytecode: 0x556b216d73f8>
#> <environment: 0x556b216da3b8>