Skip to main content

Module agents

Module agents 

Source
Expand description

Manage agent instructions and skills (CLAUDE.md, AGENTS.md, .claude/skills/, …) sourced from one or more upstream git repos.

Three concerns kept separable:

  • manifest parses the upstream croft-agents.toml that declares which files map to which destinations.
  • merge applies downstream overrides + expands [[dir]] mappings against the cloned worktree.
  • apply orchestrates cache (via croft::cache) → manifest → merge → drift / collision / shadow checks → file writes, maintaining .croft/agents.state.json along the way.

Re-exports§

pub use apply::ApplyOptions;
pub use apply::ApplyReport;
pub use apply::DestCollision;
pub use apply::DriftEntry;
pub use apply::SourceResult;
pub use apply::apply;
pub use apply::detect_drift;
pub use apply::is_floating_rev;
pub use error::AgentsError;
pub use manifest::DirMapping;
pub use manifest::FileMapping;
pub use manifest::FileMode;
pub use manifest::UpstreamManifest;
pub use manifest::parse_manifest;
pub use merge::ResolvedEntry;
pub use merge::expand_source;
pub use state::AgentsState;
pub use state::AppliedFile;
pub use state::SourceRecord;

Modules§

apply
End-to-end apply pipeline.
error
manifest
Upstream croft-agents.toml manifest types.
merge
Merge upstream manifests with downstream overrides + expand [[dir]] mappings against the cloned worktree. Produces a flat list of ResolvedEntry ready for the apply pipeline.
state
.croft/agents.state.json — what croft owns, what it pinned to, what bytes it last wrote. Drives drift detection and orphan removal across agents install / agents update runs.