diff --git a/tests/modules/programs/opencode/agents-inline.nix b/tests/modules/programs/opencode/agents-inline.nix new file mode 100644 index 00000000..e077f20f --- /dev/null +++ b/tests/modules/programs/opencode/agents-inline.nix @@ -0,0 +1,37 @@ +{ + programs.opencode = { + enable = true; + agents = { + code-reviewer = '' + # Code Reviewer Agent + + You are a senior software engineer specializing in code reviews. + Focus on code quality, security, and maintainability. + + ## Guidelines + - Review for potential bugs and edge cases + - Check for security vulnerabilities + - Ensure code follows best practices + - Suggest improvements for readability and performance''; + documentation = '' + # Documentation Agent + + You are a technical writer who creates clear, comprehensive documentation. + Focus on user-friendly explanations and examples. + + ## Guidelines + - Write clear, concise documentation + - Include practical examples + - Use proper formatting and structure + - Consider the target audience''; + }; + }; + nmt.script = '' + assertFileExists home-files/.config/opencode/agent/code-reviewer.md + assertFileExists home-files/.config/opencode/agent/documentation.md + assertFileContent home-files/.config/opencode/agent/code-reviewer.md \ + ${./code-reviewer-agent.md} + assertFileContent home-files/.config/opencode/agent/documentation.md \ + ${./documentation-agent.md} + ''; +} diff --git a/tests/modules/programs/opencode/agents-path.nix b/tests/modules/programs/opencode/agents-path.nix new file mode 100644 index 00000000..a8317228 --- /dev/null +++ b/tests/modules/programs/opencode/agents-path.nix @@ -0,0 +1,13 @@ +{ + programs.opencode = { + enable = true; + agents = { + test-agent = ./test-agent.md; + }; + }; + nmt.script = '' + assertFileExists home-files/.config/opencode/agent/test-agent.md + assertFileContent home-files/.config/opencode/agent/test-agent.md \ + ${./test-agent.md} + ''; +} diff --git a/tests/modules/programs/opencode/changelog-command.md b/tests/modules/programs/opencode/changelog-command.md new file mode 100644 index 00000000..e7565670 --- /dev/null +++ b/tests/modules/programs/opencode/changelog-command.md @@ -0,0 +1,4 @@ +# Update Changelog Command + +Update CHANGELOG.md with a new entry for the specified version. +Usage: /changelog [version] [change-type] [message] \ No newline at end of file diff --git a/tests/modules/programs/opencode/code-reviewer-agent.md b/tests/modules/programs/opencode/code-reviewer-agent.md new file mode 100644 index 00000000..f9534035 --- /dev/null +++ b/tests/modules/programs/opencode/code-reviewer-agent.md @@ -0,0 +1,10 @@ +# Code Reviewer Agent + +You are a senior software engineer specializing in code reviews. +Focus on code quality, security, and maintainability. + +## Guidelines +- Review for potential bugs and edge cases +- Check for security vulnerabilities +- Ensure code follows best practices +- Suggest improvements for readability and performance \ No newline at end of file diff --git a/tests/modules/programs/opencode/commands-inline.nix b/tests/modules/programs/opencode/commands-inline.nix new file mode 100644 index 00000000..294f92bc --- /dev/null +++ b/tests/modules/programs/opencode/commands-inline.nix @@ -0,0 +1,25 @@ +{ + programs.opencode = { + enable = true; + commands = { + changelog = '' + # Update Changelog Command + + Update CHANGELOG.md with a new entry for the specified version. + Usage: /changelog [version] [change-type] [message]''; + commit = '' + # Commit Command + + Create a git commit with proper message formatting. + Usage: /commit [message]''; + }; + }; + nmt.script = '' + assertFileExists home-files/.config/opencode/command/changelog.md + assertFileExists home-files/.config/opencode/command/commit.md + assertFileContent home-files/.config/opencode/command/changelog.md \ + ${./changelog-command.md} + assertFileContent home-files/.config/opencode/command/commit.md \ + ${./commit-command.md} + ''; +} diff --git a/tests/modules/programs/opencode/commands-path.nix b/tests/modules/programs/opencode/commands-path.nix new file mode 100644 index 00000000..7b28a894 --- /dev/null +++ b/tests/modules/programs/opencode/commands-path.nix @@ -0,0 +1,13 @@ +{ + programs.opencode = { + enable = true; + commands = { + test-command = ./test-command.md; + }; + }; + nmt.script = '' + assertFileExists home-files/.config/opencode/command/test-command.md + assertFileContent home-files/.config/opencode/command/test-command.md \ + ${./test-command.md} + ''; +} diff --git a/tests/modules/programs/opencode/commit-command.md b/tests/modules/programs/opencode/commit-command.md new file mode 100644 index 00000000..04c7f13b --- /dev/null +++ b/tests/modules/programs/opencode/commit-command.md @@ -0,0 +1,4 @@ +# Commit Command + +Create a git commit with proper message formatting. +Usage: /commit [message] \ No newline at end of file diff --git a/tests/modules/programs/opencode/default.nix b/tests/modules/programs/opencode/default.nix index 5c608485..7fa1eaad 100644 --- a/tests/modules/programs/opencode/default.nix +++ b/tests/modules/programs/opencode/default.nix @@ -3,4 +3,9 @@ opencode-empty-settings = ./empty-settings.nix; opencode-rules = ./rules.nix; opencode-empty-rules = ./empty-rules.nix; + opencode-agents-inline = ./agents-inline.nix; + opencode-commands-inline = ./commands-inline.nix; + opencode-agents-path = ./agents-path.nix; + opencode-commands-path = ./commands-path.nix; + opencode-mixed-content = ./mixed-content.nix; } diff --git a/tests/modules/programs/opencode/documentation-agent.md b/tests/modules/programs/opencode/documentation-agent.md new file mode 100644 index 00000000..f76305eb --- /dev/null +++ b/tests/modules/programs/opencode/documentation-agent.md @@ -0,0 +1,10 @@ +# Documentation Agent + +You are a technical writer who creates clear, comprehensive documentation. +Focus on user-friendly explanations and examples. + +## Guidelines +- Write clear, concise documentation +- Include practical examples +- Use proper formatting and structure +- Consider the target audience \ No newline at end of file diff --git a/tests/modules/programs/opencode/mixed-content.nix b/tests/modules/programs/opencode/mixed-content.nix new file mode 100644 index 00000000..ea7fecd9 --- /dev/null +++ b/tests/modules/programs/opencode/mixed-content.nix @@ -0,0 +1,30 @@ +{ + programs.opencode = { + enable = true; + commands = { + inline-command = '' + # Inline Command + This command is defined inline. + ''; + path-command = ./test-command.md; + }; + agents = { + inline-agent = '' + # Inline Agent + This agent is defined inline. + ''; + path-agent = ./test-agent.md; + }; + }; + nmt.script = '' + assertFileExists home-files/.config/opencode/command/inline-command.md + assertFileExists home-files/.config/opencode/command/path-command.md + assertFileExists home-files/.config/opencode/agent/inline-agent.md + assertFileExists home-files/.config/opencode/agent/path-agent.md + + assertFileContent home-files/.config/opencode/command/path-command.md \ + ${./test-command.md} + assertFileContent home-files/.config/opencode/agent/path-agent.md \ + ${./test-agent.md} + ''; +} diff --git a/tests/modules/programs/opencode/test-agent.md b/tests/modules/programs/opencode/test-agent.md new file mode 100644 index 00000000..387a3ded --- /dev/null +++ b/tests/modules/programs/opencode/test-agent.md @@ -0,0 +1,4 @@ +# Test Agent + +This is a test agent loaded from a file path. +Used to verify path support functionality. \ No newline at end of file diff --git a/tests/modules/programs/opencode/test-command.md b/tests/modules/programs/opencode/test-command.md new file mode 100644 index 00000000..ba203070 --- /dev/null +++ b/tests/modules/programs/opencode/test-command.md @@ -0,0 +1,5 @@ +# Test Command + +This is a test command loaded from a file path. +Used to verify path support functionality. +Usage: /test-command \ No newline at end of file