1
0
Fork 0
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:
Sewer56 2025-08-22 21:35:25 +01:00 committed by Austin Horstman
parent 343e555657
commit a641bbbb9b
6 changed files with 55 additions and 0 deletions

View 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}
'';
}

View 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.

View file

@ -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`"
];
}

View file

@ -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;
}

View file

@ -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