pub struct Agent { /* private fields */ }Expand description
A coding agent that reads skills from a known directory.
The built-in agents mirror the directories used by gh skill install.
Implementations§
Source§impl Agent
impl Agent
Sourcepub const GITHUB_COPILOT: Self
pub const GITHUB_COPILOT: Self
GitHub Copilot.
Sourcepub const CLAUDE_CODE: Self
pub const CLAUDE_CODE: Self
Claude Code, which relocates its whole configuration with
CLAUDE_CONFIG_DIR.
Sourcepub const ANTIGRAVITY: Self
pub const ANTIGRAVITY: Self
Antigravity.
Sourcepub fn builtins() -> Vec<Self>
pub fn builtins() -> Vec<Self>
Every built-in agent, in the order gh skill install documents them.
The constants above and this list are two places, and the table in
tests/agent.rs is what holds them together: it names every agent, its
title and its project directory, and asserts the length, so an agent
added to one and not the other is a failing test rather than an agent
--agent all never reaches.
Sourcepub fn new(
name: impl Into<String>,
title: impl Into<String>,
project_dir: impl Into<String>,
) -> Self
pub fn new( name: impl Into<String>, title: impl Into<String>, project_dir: impl Into<String>, ) -> Self
An agent this library does not know about.
project_dir is relative to the project root and separated with /. A
project install that would land outside the project root is refused
whoever wrote the path, so this is not a way around that bound;
Installer::with_project_root and --dir are.
Sourcepub fn with_user_dir(
self,
f: impl Fn() -> Result<PathBuf> + Send + Sync + 'static,
) -> Self
pub fn with_user_dir( self, f: impl Fn() -> Result<PathBuf> + Send + Sync + 'static, ) -> Self
Sets where user scope writes. Without one the agent has project scope alone.
Sourcepub fn project_dir(&self) -> &str
pub fn project_dir(&self) -> &str
The skills directory relative to the project root, separated with /.
Sourcepub fn dir(&self, scope: Scope, project_root: Option<&Path>) -> Result<PathBuf>
pub fn dir(&self, scope: Scope, project_root: Option<&Path>) -> Result<PathBuf>
Resolves the skills directory for a scope.
project_root applies to Scope::Project alone, and None means
the working directory.
§Errors
Fails when the home directory is not known, or when the agent has no user scope directory.