1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-24 18:00:58 +01:00

tests/claude-code: add path tests for agents/commands

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman 2025-09-16 21:43:58 -05:00
parent 846f27fba8
commit fb928abb67
6 changed files with 86 additions and 0 deletions

View file

@ -0,0 +1,14 @@
{
programs.claude-code = {
enable = true;
agents = {
test-agent = ./test-agent.md;
};
};
nmt.script = ''
assertFileExists home-files/.claude/agents/test-agent.md
assertFileContent home-files/.claude/agents/test-agent.md \
${./test-agent.md}
'';
}

View file

@ -0,0 +1,14 @@
{
programs.claude-code = {
enable = true;
commands = {
test-command = ./test-command.md;
};
};
nmt.script = ''
assertFileExists home-files/.claude/commands/test-command.md
assertFileContent home-files/.claude/commands/test-command.md \
${./test-command.md}
'';
}

View file

@ -8,4 +8,7 @@
claude-code-agents-dir = ./agents-dir.nix;
claude-code-commands-dir = ./commands-dir.nix;
claude-code-hooks-dir = ./hooks-dir.nix;
claude-code-agents-path = ./agents-path.nix;
claude-code-commands-path = ./commands-path.nix;
claude-code-mixed-content = ./mixed-content.nix;
}

View file

@ -0,0 +1,38 @@
{
programs.claude-code = {
enable = true;
commands = {
inline-command = ''
---
allowed-tools: Read
description: Inline command
---
This command is defined inline.
'';
path-command = ./test-command.md;
};
agents = {
inline-agent = ''
---
name: inline-agent
description: Inline agent
tools: Read
---
This agent is defined inline.
'';
path-agent = ./test-agent.md;
};
};
nmt.script = ''
assertFileExists home-files/.claude/commands/inline-command.md
assertFileExists home-files/.claude/commands/path-command.md
assertFileExists home-files/.claude/agents/inline-agent.md
assertFileExists home-files/.claude/agents/path-agent.md
assertFileContent home-files/.claude/commands/path-command.md \
${./test-command.md}
assertFileContent home-files/.claude/agents/path-agent.md \
${./test-agent.md}
'';
}

View file

@ -0,0 +1,8 @@
---
name: test-agent
description: Test agent loaded from file path
tools: Read, Write
---
This is a test agent loaded from a file path.
Used to verify path support functionality.

View file

@ -0,0 +1,9 @@
---
allowed-tools: Bash, Read
argument-hint: [test-arg]
description: Test command loaded from file path
---
This is a test command loaded from a file path.
Used to verify path support functionality.
Usage: /test-command [test-arg]