Merge pull request #339 from ggozad/fix/generated-skills-preamble

fix: apply config.prompts.domain_preamble in generated skills
This commit is contained in:
Yiorgis Gozadinos 2026-04-08 14:03:24 +03:00 committed by GitHub
commit f10d6b9960
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 0 deletions

View file

@ -79,6 +79,10 @@ def create_skill(
tools = create_skill_tools(db_path, config, SkillState, _TOOL_NAMES)
extras = create_skill_extras(db_path, config)
if config.prompts.domain_preamble and instructions:
instructions = f"{config.prompts.domain_preamble}\n\n{instructions}"
return Skill(
metadata=metadata,
instructions=instructions,

View file

@ -273,6 +273,21 @@ class TestRenderTemplates:
assert "create_skill_extras" in content
assert "extras=extras" in content
def test_domain_preamble_applied_to_instructions(self, tmp_path):
render_templates(
output_dir=tmp_path,
name="docs",
description="A docs skill.",
tool_names=["search"],
)
init = tmp_path / "docs-skill" / "docs_skill" / "__init__.py"
content = init.read_text()
assert "config.prompts.domain_preamble" in content
assert (
'instructions = f"{config.prompts.domain_preamble}\\n\\n{instructions}"'
in content
)
def test_create_skill_accepts_optional_params(self, tmp_path):
render_templates(
output_dir=tmp_path,