mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
opencode: add agent skills support
Adds support for OpenCode Agent Skills by managing skill definitions under "/opencode/skill/<name>/SKILL.md" via `programs.opencode.skills`. Documentation: https://opencode.ai/docs/skills/
This commit is contained in:
committed by
Robert Helgesson
parent
3e87b442b5
commit
1cfa305fba
@@ -9,6 +9,10 @@
|
||||
opencode-agents-path = ./agents-path.nix;
|
||||
opencode-commands-path = ./commands-path.nix;
|
||||
opencode-mixed-content = ./mixed-content.nix;
|
||||
opencode-skills-inline = ./skills-inline.nix;
|
||||
opencode-skills-path = ./skills-path.nix;
|
||||
opencode-skills-directory = ./skills-directory.nix;
|
||||
opencode-skills-bulk-directory = ./skills-bulk-directory.nix;
|
||||
opencode-themes-inline = ./themes-inline.nix;
|
||||
opencode-themes-path = ./themes-path.nix;
|
||||
opencode-mcp-integration = ./mcp-integration.nix;
|
||||
|
||||
10
tests/modules/programs/opencode/git-release-SKILL.md
Normal file
10
tests/modules/programs/opencode/git-release-SKILL.md
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: git-release
|
||||
description: Create consistent releases and changelogs
|
||||
---
|
||||
|
||||
## What I do
|
||||
|
||||
- Draft release notes from merged PRs
|
||||
- Propose a version bump
|
||||
- Provide a copy-pasteable `gh release create` command
|
||||
9
tests/modules/programs/opencode/pdf-processing-SKILL.md
Normal file
9
tests/modules/programs/opencode/pdf-processing-SKILL.md
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
name: pdf-processing
|
||||
description: Extract text and tables from PDF files
|
||||
---
|
||||
|
||||
## What I do
|
||||
|
||||
- Extract text from PDFs
|
||||
- Identify tables and structured data
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
name: data-analysis
|
||||
description: Help analyze datasets and results
|
||||
---
|
||||
|
||||
## What I do
|
||||
|
||||
- Summarize datasets
|
||||
- Suggest charts and metrics
|
||||
@@ -0,0 +1 @@
|
||||
extra fixture file
|
||||
15
tests/modules/programs/opencode/skills-bulk-directory.nix
Normal file
15
tests/modules/programs/opencode/skills-bulk-directory.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
programs.opencode = {
|
||||
enable = true;
|
||||
skills = ./skills-bulk;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/opencode/skill/git-release/SKILL.md
|
||||
assertFileExists home-files/.config/opencode/skill/pdf-processing/SKILL.md
|
||||
assertFileContent home-files/.config/opencode/skill/git-release/SKILL.md \
|
||||
${./skills-bulk/git-release/SKILL.md}
|
||||
assertFileContent home-files/.config/opencode/skill/pdf-processing/SKILL.md \
|
||||
${./skills-bulk/pdf-processing/SKILL.md}
|
||||
'';
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
name: git-release
|
||||
description: Create consistent releases and changelogs
|
||||
---
|
||||
|
||||
This is the bulk skillsDir fixture for git-release.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
name: pdf-processing
|
||||
description: Extract text and tables from PDF files
|
||||
---
|
||||
|
||||
This is the bulk skillsDir fixture for pdf-processing.
|
||||
15
tests/modules/programs/opencode/skills-directory.nix
Normal file
15
tests/modules/programs/opencode/skills-directory.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
programs.opencode = {
|
||||
enable = true;
|
||||
skills = {
|
||||
data-analysis = ./skill-dir/data-analysis;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/opencode/skill/data-analysis/SKILL.md
|
||||
assertFileExists home-files/.config/opencode/skill/data-analysis/notes.txt
|
||||
assertFileContent home-files/.config/opencode/skill/data-analysis/SKILL.md \
|
||||
${./skill-dir/data-analysis/SKILL.md}
|
||||
'';
|
||||
}
|
||||
25
tests/modules/programs/opencode/skills-inline.nix
Normal file
25
tests/modules/programs/opencode/skills-inline.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
programs.opencode = {
|
||||
enable = true;
|
||||
skills = {
|
||||
git-release = ''
|
||||
---
|
||||
name: git-release
|
||||
description: Create consistent releases and changelogs
|
||||
---
|
||||
|
||||
## What I do
|
||||
|
||||
- Draft release notes from merged PRs
|
||||
- Propose a version bump
|
||||
- Provide a copy-pasteable `gh release create` command
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/opencode/skill/git-release/SKILL.md
|
||||
assertFileContent home-files/.config/opencode/skill/git-release/SKILL.md \
|
||||
${./git-release-SKILL.md}
|
||||
'';
|
||||
}
|
||||
14
tests/modules/programs/opencode/skills-path.nix
Normal file
14
tests/modules/programs/opencode/skills-path.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
programs.opencode = {
|
||||
enable = true;
|
||||
skills = {
|
||||
pdf-processing = ./pdf-processing-SKILL.md;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/opencode/skill/pdf-processing/SKILL.md
|
||||
assertFileContent home-files/.config/opencode/skill/pdf-processing/SKILL.md \
|
||||
${./pdf-processing-SKILL.md}
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user