Curated methodology catalog for reusable prompt packs.
Loads YAML definitions from config/comm_bus/methodologies by default, validates schema,
and exposes helpers to retrieve methodology metadata or resolve entries for injection.
Summary
Functions
Erases the methodology cache from :persistent_term, forcing a reload on
the next access.
Returns the configured methodology root directory, falling back to
config/comm_bus/methodologies relative to the project root.
Resolves methodology references into a flat list of entries.
Fetches a cached methodology by slug, raising if not found.
Returns all cached methodologies as a list sorted by slug, loading from disk if not yet cached.
Loads all methodology YAML files from the configured root directory, validates
their schema, builds entry structs, and caches the catalog in :persistent_term.
Reloads all methodologies from disk, refreshing the :persistent_term cache.
Functions
@spec clear_cache!() :: :ok
Erases the methodology cache from :persistent_term, forcing a reload on
the next access.
Returns
:ok
@spec default_root() :: String.t()
Returns the configured methodology root directory, falling back to
config/comm_bus/methodologies relative to the project root.
Returns
A string path to the methodology directory.
@spec entries_for(String.t() | [String.t()]) :: [CommBus.Entry.t()]
Resolves methodology references into a flat list of entries.
Accepts a single reference string or a list of references. Each reference
is either a bare slug (returns all entries) or a "slug#entry_id" fragment
(returns only the matching entry).
Parameters
refs— A string like"bug_triage"or"bug_triage#severity-check", or a list of such strings.
Returns
A list of %CommBus.Entry{} structs from the referenced methodologies.
@spec get!(String.t()) :: CommBus.Methodology.t()
Fetches a cached methodology by slug, raising if not found.
Parameters
slug— The methodology slug string.
Returns
A %CommBus.Methodology{} struct.
Raises
Raises ArgumentError if no methodology matches the given slug.
@spec list() :: [CommBus.Methodology.t()]
Returns all cached methodologies as a list sorted by slug, loading from disk if not yet cached.
Returns
A list of %CommBus.Methodology{} structs.
@spec load_from_disk!(keyword()) :: %{required(String.t()) => CommBus.Methodology.t()}
Loads all methodology YAML files from the configured root directory, validates
their schema, builds entry structs, and caches the catalog in :persistent_term.
Parameters
opts— Keyword options::root(directory path override).
Returns
A map of methodology slugs to %CommBus.Methodology{} structs.
Raises
Raises on invalid YAML or missing required fields.
@spec reload!() :: %{required(String.t()) => CommBus.Methodology.t()}
Reloads all methodologies from disk, refreshing the :persistent_term cache.
Returns
A map of methodology slugs to %CommBus.Methodology{} structs.