Files
hermes-agent/tests/skills/test_decision_questionnaire_skill.py
T
Teknium b1ff8722a5 feat(optional-skills): add decision-questionnaire — turn a blocked decision into an async questionnaire
Ports the MIT-licensed 'to-questionnaire' skill from mattpocock/skills as
decision-questionnaire (optional-skills/productivity). Interviews the user
about the send only (recipient + needed outcomes), then drafts a
most-important-first discovery questionnaire with answer stubs to
decision-questionnaire-<slug>.md. Includes staging tests for frontmatter
standards, template sections, and de-upstreaming.
2026-08-29 05:04:13 -07:00

63 lines
1.8 KiB
Python

"""Tests for optional-skills/productivity/decision-questionnaire."""
import re
from pathlib import Path
import pytest
import yaml
SKILL_MD = (
Path(__file__).resolve().parents[2]
/ "optional-skills"
/ "productivity"
/ "decision-questionnaire"
/ "SKILL.md"
)
def _frontmatter():
text = SKILL_MD.read_text(encoding="utf-8")
m = re.match(r"^---\n(.*?)\n---\n", text, re.DOTALL)
assert m, "SKILL.md missing YAML frontmatter"
return yaml.safe_load(m.group(1))
class TestFrontmatter:
def test_name_matches_directory(self):
assert _frontmatter()["name"] == "decision-questionnaire"
def test_description_length_and_period(self):
desc = _frontmatter()["description"]
assert len(desc) <= 60
assert desc.endswith(".")
def test_license_and_platforms(self):
fm = _frontmatter()
assert fm["license"] == "MIT"
assert set(fm["platforms"]) == {"linux", "macos", "windows"}
class TestBody:
def _body(self):
return SKILL_MD.read_text(encoding="utf-8")
def test_template_sections_present(self):
body = self._body()
for section in ("## Context", "## How to answer", "## Anything else?"):
assert section in body, f"template missing {section}"
def test_output_filename_convention(self):
assert "decision-questionnaire-<slug>.md" in self._body()
def test_interview_the_send_principle(self):
assert "Interview the Send" in self._body()
def test_no_upstream_harness_residue(self):
lower = self._body().lower()
for token in ("claude", "slash command", "disable-model-invocation"):
assert token not in lower, f"upstream residue: {token}"
if __name__ == "__main__":
raise SystemExit(pytest.main([__file__, "-q"]))