feat: preload CLI skills on launch (#1359)
* feat: preload CLI skills on launch * test: cover continue with worktree and skills flags * feat: show activated skills before CLI banner
This commit is contained in:
@@ -4,7 +4,11 @@ import os
|
||||
from unittest.mock import patch
|
||||
|
||||
import tools.skills_tool as skills_tool_module
|
||||
from agent.skill_commands import scan_skill_commands, build_skill_invocation_message
|
||||
from agent.skill_commands import (
|
||||
scan_skill_commands,
|
||||
build_skill_invocation_message,
|
||||
build_preloaded_skills_prompt,
|
||||
)
|
||||
|
||||
|
||||
def _make_skill(
|
||||
@@ -79,6 +83,33 @@ class TestScanSkillCommands:
|
||||
assert "/generic-tool" in result
|
||||
|
||||
|
||||
class TestBuildPreloadedSkillsPrompt:
|
||||
def test_builds_prompt_for_multiple_named_skills(self, tmp_path):
|
||||
with patch("tools.skills_tool.SKILLS_DIR", tmp_path):
|
||||
_make_skill(tmp_path, "first-skill")
|
||||
_make_skill(tmp_path, "second-skill")
|
||||
prompt, loaded, missing = build_preloaded_skills_prompt(
|
||||
["first-skill", "second-skill"]
|
||||
)
|
||||
|
||||
assert missing == []
|
||||
assert loaded == ["first-skill", "second-skill"]
|
||||
assert "first-skill" in prompt
|
||||
assert "second-skill" in prompt
|
||||
assert "preloaded" in prompt.lower()
|
||||
|
||||
def test_reports_missing_named_skills(self, tmp_path):
|
||||
with patch("tools.skills_tool.SKILLS_DIR", tmp_path):
|
||||
_make_skill(tmp_path, "present-skill")
|
||||
prompt, loaded, missing = build_preloaded_skills_prompt(
|
||||
["present-skill", "missing-skill"]
|
||||
)
|
||||
|
||||
assert "present-skill" in prompt
|
||||
assert loaded == ["present-skill"]
|
||||
assert missing == ["missing-skill"]
|
||||
|
||||
|
||||
class TestBuildSkillInvocationMessage:
|
||||
def test_loads_skill_by_stored_path_when_frontmatter_name_differs(self, tmp_path):
|
||||
skill_dir = tmp_path / "mlops" / "audiocraft"
|
||||
|
||||
Reference in New Issue
Block a user