Returns the conventional directory path where skills for a given agent are
stored. The path is not expanded (i.e., ~ is not resolved to the home
directory). Use base::path.expand() if you need an absolute path.
Usage
skill_path(agent = NULL, scope = c("project", "global"))Arguments
- agent
One of
"claude_code"(or its alias"claude"),"openclaw","codex","cursor","gemini_cli", or"github_copilot". IfNULL(the default), the agent is resolved in order: (1) theWF_AGENTenvironment variable, (2) a scan of the current working directory for a recognised agent config folder (.claude,.cursor, etc.), and (3) a final fallback to"claude_code". SetWF_AGENTin your.Renviron(e.g. withusethis::edit_r_environ()) to avoid passingagentevery time.- scope
One of
"project"(a path relative to the current working directory, suitable for committing to version control) or"global"(a path in the user's home directory, available across all projects).
Examples
skill_path('claude_code', 'project')
#> [1] ".claude/skills"
skill_path('claude', 'project') # alias for claude_code
#> [1] ".claude/skills"
skill_path('cursor', 'global')
#> [1] "~/.cursor/skills"
skill_path() # auto-detects from WF_AGENT, dir scan, or falls back to claude_code
#> [1] ".claude/skills"
