Module: TheLocal

Defined in:
lib/the_local.rb,
lib/the_local/cli.rb,
lib/the_local/sync.rb,
lib/the_local/agent.rb,
lib/the_local/scope.rb,
lib/the_local/builder.rb,
lib/the_local/railtie.rb,
lib/the_local/refresh.rb,
lib/the_local/version.rb,
lib/the_local/registry.rb,
lib/the_local/installer.rb,
lib/the_local/reference.rb,
lib/the_local/the_local.rb,
lib/the_local/disk_providers.rb,
lib/the_local/trigger_writer.rb,
lib/generators/the_local/install_generator.rb,
lib/generators/the_local/provider_generator.rb,
sig/the_local.rbs

Overview

Resident Claude Code expert subagents ("locals"), contributed by the gems and app that register with it and installed into a consuming app's .claude/agents/.

Defined Under Namespace

Modules: Companion, DiskProviders, Generators, Reference, Refresh, Scope Classes: Agent, Builder, CLI, Collector, Error, Installer, Provider, Railtie, Registry, Sync, TriggerWriter

Constant Summary collapse

VERSION =

Returns:

  • (String)
"0.3.0"

Class Method Summary collapse

Class Method Details

.register(gem_name, prefix: gem_name, scope: nil, agents_dir: nil) {|Collector.new(gem_name, prefix, registry, agents_dir: agents_dir)| ... } ⇒ Object

Providers (gems or the app) call this at load time to contribute their agents. The first argument is the providing gem's name (used to filter to a host's direct dependencies); prefix is the agent filename namespace and defaults to the gem name; scope is a one-line phrase describing the provider's domain, used to generate the delegation trigger. agents_dir is the absolute path to the provider's committed, pre-rendered .md files (e.g. File.expand_path("the_local/agents", dir)); when given, each agent records its source_path there for the host installer to copy:

TheLocal.register("keystone_ui", prefix: "keystone", scope: "UI work") do |c|
c.agent "scaffold", description: "", tools: "", body: "", knowledge: ""
end

Yields:



35
36
37
38
# File 'lib/the_local.rb', line 35

def register(gem_name, prefix: gem_name, scope: nil, agents_dir: nil)
  registry.add_provider(Provider.new(gem_name: gem_name, prefix: prefix, scope: scope))
  yield Collector.new(gem_name, prefix, registry, agents_dir: agents_dir)
end

.registryObject



19
20
21
# File 'lib/the_local.rb', line 19

def registry
  @registry ||= Registry.new
end

.reset!Object



40
41
42
# File 'lib/the_local.rb', line 40

def reset!
  registry.clear
end