-
Notifications
You must be signed in to change notification settings - Fork 0
Milestone
Description
Summary
As a package developer, in order to give AI agents the ability to search and
rewrite R code by syntax in my package, I would like to install a pkgskills
search-codeskill with a single function call.
Proposed signature
use_skill_search_code(
target_dir = ".github",
use_skills_subdir = TRUE,
overwrite = TRUE,
open = rlang::is_interactive()
)Arguments
All arguments for use_skill_search_code() are already defined in
@R/aaa-shared_params.R.
target_dir(character(1)) — Directory where the skill will be installed,
relative to the project root. Defaults to".github".use_skills_subdir(logical(1)) — Whether to place thesearch-code
folder under askillssubdirectory oftarget_dir. Defaults toTRUE,
producing.github/skills/search-code/SKILL.md.overwrite(logical(1)) — Whether to overwrite an existing skill file.
Defaults toTRUE.open(logical(1)) — Whether to open the installed skill file in the
editor after creation. Defaults torlang::is_interactive().
Returns the path to the installed skill file, invisibly (following the
usethis convention and the convention in use_skill_create_issue()).
Behavior
- Validates all arguments using
stbl(following ther-codeskill
conventions). Arguments only need to be validated once; things passed to
.use_skill()without modification should be validated there. - Calls
.use_skill()to install the skill. - Returns the installed skill file path invisibly.
Under the hood, use_skill_search_code() delegates to .use_skill():
.use_skill(
"search-code",
target_dir = target_dir,
use_skills_subdir = use_skills_subdir,
overwrite = overwrite,
open = open
)Details
- Create
inst/templates/skills/search-code/SKILL.md: a copy of
.github/skills/search-code/SKILL.md. The file has no whisker template
variables. - Create
R/use_skill_search_code.Rcontaininguse_skill_search_code().
References
use_skill_document()in @R/use_skill_document.R — model for this function;
use_skill_search_code()has the same structure but without the
aaa-shared_params.Rbootstrap step..use_skill()in @R/use_skill.R — core implementation for installing skills.- Existing
.github/skills/search-code/SKILL.md— source for the template.
EOF 2>&1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels