import json
from pathlib import Path


REPO_ROOT = Path(__file__).resolve().parents[1]


def test_root_and_packaged_armorer_skill_match():
    root_skill = (REPO_ROOT / "SKILL.md").read_text(encoding="utf-8")
    packaged_skill = (REPO_ROOT / "skills" / "armorer" / "SKILL.md").read_text(encoding="utf-8")
    assert root_skill == packaged_skill


def test_claude_plugin_manifest_is_valid_json():
    payload = json.loads((REPO_ROOT / ".claude-plugin" / "plugin.json").read_text(encoding="utf-8"))
    assert payload["name"] == "armorer"
    assert isinstance(payload["description"], str) and payload["description"]


def test_project_local_skill_wrappers_exist():
    assert (REPO_ROOT / ".claude" / "skills" / "armorer" / "SKILL.md").exists()
    assert (REPO_ROOT / ".codex" / "skills" / "armorer" / "SKILL.md").exists()
