pub trait PlatformAdapter:
Send
+ Sync
+ Debug {
// Required methods
fn name(&self) -> &str;
fn supports(&self, entity_type: EntityType) -> bool;
fn target_dir(
&self,
entity_type: EntityType,
ctx: &AdapterScope<'_>,
) -> PathBuf;
fn dir_mode(&self, entity_type: EntityType) -> Option<DirInstallMode>;
fn deploy_entry(&self, req: &DeployRequest<'_>) -> DeployResult;
fn installed_path(&self, entry: &Entry, ctx: &AdapterScope<'_>) -> PathBuf;
fn installed_dir_files(
&self,
entry: &Entry,
ctx: &AdapterScope<'_>,
) -> HashMap<String, PathBuf>;
}Expand description
Contract for deploying skill/agent files to a specific AI tool’s directory.
Each AI tool (Claude Code, Gemini CLI, Codex, etc.) has its own convention
for where skills and agents live on disk. A PlatformAdapter encapsulates
that knowledge.
The trait is object-safe so adapters can be stored in a heterogeneous registry.
Required Methods§
fn name(&self) -> &str
fn supports(&self, entity_type: EntityType) -> bool
fn target_dir(&self, entity_type: EntityType, ctx: &AdapterScope<'_>) -> PathBuf
fn dir_mode(&self, entity_type: EntityType) -> Option<DirInstallMode>
Sourcefn deploy_entry(&self, req: &DeployRequest<'_>) -> DeployResult
fn deploy_entry(&self, req: &DeployRequest<'_>) -> DeployResult
Returns {patch_key: installed_path} for every file that was placed.
Returns an empty map for dry-run or when deployment is skipped.