Skip to main content

Crate agents_skills

Crate agents_skills 

Source
Expand description

agents-skills as a library: the high-level Manager facade over a private domain layer.

The library is pure data — it never prints to stdout/stderr and never calls process::exit. The CLI binary (see src/main.rs + src/commands) is responsible for rendering outcomes and deciding exit codes.

§Quick tour

use agents_skills::Manager;

// Point the manager at a scratch environment (hermetic, no real home access).
let manager = Manager::builder()
    .home("/tmp/home")
    .config("/tmp/config")
    .cwd("/tmp/project")
    .build()?;

// Install one skill — a local directory or the id `owner/repo/slug`
// (see [`Manager::add`] for a local example). Then list what's installed.
let skills = manager.list()?;

§Layering

The crate root exposes only the high-level Manager facade, its request/outcome types, the few data types the outcomes carry (Env, Source, Skill), and the unified error types. All domain logic (source parsing, agent directories, SKILL.md discovery, install, agent links) lives in the private core module — an implementation detail that may change without a breaking release.

Re-exports§

pub use manager::AddOutcome;
pub use manager::AddRequest;
pub use manager::AgentLinkResult;
pub use manager::AgentOutcome;
pub use manager::AgentRequest;
pub use manager::AgentStatus;
pub use manager::ListedSkill;
pub use manager::Manager;
pub use manager::ManagerBuilder;
pub use manager::SelectionOutcome;
pub use manager::SelectionRequest;
pub use error::Error;
pub use error::Result;
pub use error::SkillsError;

Modules§

error
Unified error types.
manager
High-level Manager facade: one-stop add/list/remove over an injectable Env.

Structs§

Env
Context for agent detection/dir resolution (owns data, easy to inject in tests).
Skill
A parsed skill.
Source
Parsed source.

Enums§

LinkOutcome
Outcome of linking one agent’s skills dir to the canonical dir.
SourceType
The kind of a parsed source.

Functions§

agent_names
Every known agent identifier, in table order (useful for rendering choices).
slugify
Make a skill name addressable: lowercase, every space replaced by -, / dropped, everything else kept verbatim (&, ., _, : survive) — the slug rule used by skills.sh. The slug is the last segment of an install id (owner/repo/slug); matching compares slugs, never raw names.