2026-06-17 21:16:20 +02:00
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_project_opencode_skills_have_required_frontmatter() -> None:
|
|
|
|
|
skills_root = Path(".opencode/skills")
|
2026-06-21 14:28:19 +02:00
|
|
|
# Scope to the project's own skills; third-party tooling (e.g. kiro-*) lives
|
|
|
|
|
# alongside them and uses a different frontmatter convention.
|
|
|
|
|
skill_files = sorted(skills_root.glob("openultrasast-*/SKILL.md"))
|
2026-06-17 21:16:20 +02:00
|
|
|
|
|
|
|
|
assert {path.parent.name for path in skill_files} == {
|
|
|
|
|
"openultrasast-fix-audit",
|
|
|
|
|
"openultrasast-scan",
|
|
|
|
|
"openultrasast-triage",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for skill_file in skill_files:
|
|
|
|
|
text = skill_file.read_text()
|
|
|
|
|
header = text.split("---", 2)[1]
|
|
|
|
|
assert f"name: {skill_file.parent.name}" in header
|
|
|
|
|
assert "description: " in header
|
|
|
|
|
assert "Use when" in header
|