mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
claude-code: added 'agentsDir' option to specify agents from filesystem
This commit is contained in:
parent
343e555657
commit
a641bbbb9b
6 changed files with 55 additions and 0 deletions
14
tests/modules/programs/claude-code/agents-dir.nix
Normal file
14
tests/modules/programs/claude-code/agents-dir.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
programs.claude-code = {
|
||||
enable = true;
|
||||
agentsDir = ./agents;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.claude/agents/test-agent.md
|
||||
assertLinkExists home-files/.claude/agents/test-agent.md
|
||||
assertFileContent \
|
||||
home-files/.claude/agents/test-agent.md \
|
||||
${./agents/test-agent.md}
|
||||
'';
|
||||
}
|
||||
6
tests/modules/programs/claude-code/agents/test-agent.md
Normal file
6
tests/modules/programs/claude-code/agents/test-agent.md
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
name: test-agent
|
||||
description: Test agent for agentsDir functionality
|
||||
---
|
||||
|
||||
This is a test agent to verify that agentsDir works correctly.
|
||||
|
|
@ -20,10 +20,17 @@
|
|||
text = "Some text content";
|
||||
source = ./expected-memory.md;
|
||||
};
|
||||
|
||||
# assert fail: cannot set agents and agentsDir at the same time.
|
||||
agents = {
|
||||
test-agent = "test content";
|
||||
};
|
||||
agentsDir = ./agents;
|
||||
};
|
||||
|
||||
test.asserts.assertions.expected = [
|
||||
"`programs.claude-code.package` cannot be null when `mcpServers` is configured"
|
||||
"Cannot specify both `programs.claude-code.memory.text` and `programs.claude-code.memory.source`"
|
||||
"Cannot specify both `programs.claude-code.agents` and `programs.claude-code.agentsDir`"
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@
|
|||
claude-code-assertion = ./assertion.nix;
|
||||
claude-code-memory-management = ./memory-management.nix;
|
||||
claude-code-memory-from-source = ./memory-from-source.nix;
|
||||
claude-code-agents-dir = ./agents-dir.nix;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
# Claude Code Agents
|
||||
|
||||
## Current Configuration
|
||||
Test implementation of agents directory management.
|
||||
|
||||
## Available Agents
|
||||
- This is a test configuration
|
||||
- AgentsDir should be created at ~/.claude/agents/README.md
|
||||
Loading…
Add table
Add a link
Reference in a new issue