feat: global agent definitions at ~/.multiclaude/agents/#374
Open
kiambogo wants to merge 1 commit into
Open
Conversation
…#373) Add a global base layer to agent resolution order: ~/.multiclaude/agents/ → ~/.multiclaude/repos/<repo>/agents/ → <repo>/.multiclaude/agents/ - Add GlobalAgentsDir field to config.Paths (DefaultPaths, NewTestPaths, EnsureDirectories) - Add SourceGlobal constant and globalAgentsDir field to agents.Reader - Change NewReader signature: NewReader(globalAgentsDir, localAgentsDir, repoPath) - Add ReadGlobalDefinitions method; ReadAllDefinitions now layers global→local→repo - EnsureDirectories skips empty paths for backwards compat with hand-constructed Paths - Update all NewReader call sites (cli.go, daemon.go, test/agents_test.go) - Add TestReadGlobalDefinitions, TestReadAllDefinitionsThreeLayers, TestEmptyGlobalDir tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements issue #373 — adds
~/.multiclaude/agents/as a global base layer for agent definitions.~/.multiclaude/agents/→~/.multiclaude/repos/<repo>/agents/→<repo>/.multiclaude/agents/~/.multiclaude/agents/is created byEnsureDirectoriesso it exists out of the boxChanges
pkg/config: AddedGlobalAgentsDir stringtoPaths(~/.multiclaude/agents/); updatedDefaultPaths,NewTestPaths,EnsureDirectories(skips empty paths for compat with hand-constructedPathsin tests)internal/agents: AddedSourceGlobalconstant,globalAgentsDirfield,ReadGlobalDefinitions()method;NewReadersignature extended toNewReader(globalAgentsDir, localAgentsDir, repoPath);ReadAllDefinitionsnow callsMergeDefinitionstwice: global+local first, then repo on topinternal/cli/cli.go(2 sites),internal/daemon/daemon.go(1 site),test/agents_test.go(2 sites)TestReadGlobalDefinitions,TestReadAllDefinitionsThreeLayers,TestEmptyGlobalDirTest plan
go build ./...— cleango test ./internal/agents/... ./pkg/config/...— all passgo test ./test/...— all passinternal/cliandinternal/forkverified to exist on main before this changeNotes for continuation
The
EnsureDirectoriesempty-path guard is a minimal backward-compat shim for tests that constructPathsmanually without all fields. It could be removed if all test construction switches toNewTestPaths.🤖 Generated with Claude Code