Skip to content

matt-bat/got-skills / skills/skill-governance

skill-governance

Verified

Govern release-affecting, policy-changing, externally mutating, destructive, or otherwise high-risk work through typed effects, mandatory evidence, independent safety gates, and an explicit go/no-go decision. Do not use for ordinary answers, read-only inspection, tiny reversible edits, or a task made "multi-skill" only by optional process helpers.

FileKindSize
SKILL.mdskill md9.7 KB
fixtures/passed-artifact-evidence.jsonconfig104 B
fixtures/routing-scenarios.jsonconfig44.2 KB
references/governance-artifacts.mdmarkdown5.1 KB
references/risk-and-gates.mdmarkdown4.6 KB
requirements.txtmanifest89 B
schemas/governance-artifact.schema.jsonconfig13.6 KB
schemas/remote-configuration-policy.schema.jsonconfig4.3 KB
schemas/routing-result.schema.jsonconfig7.7 KB
schemas/task-descriptor.schema.jsonconfig13.3 KB
scripts/enforce_governance_ci.pyscript24.4 KB
scripts/generate_governance_artifact.pyscript43.4 KB
scripts/generate_routing_views.pyscript27.6 KB
scripts/governance_common.pyscript14.5 KB
scripts/record_routing_observation.pyscript9.3 KB
scripts/resolve_task_route.pyscript69.4 KB
scripts/validate_governance_artifact.pyscript39.9 KB
scripts/validate_skill_order_sync.pyscript4.0 KB
scripts/validate_skill_policy.pyscript32.3 KB
scripts/verify_remote_configuration.pyscript12.3 KB
tests/test_advanced_svg_render.pyscript5.1 KB
tests/test_conflict_matrix_integrity.pyscript2.1 KB
tests/test_default_skill_quality_gates.pyscript2.9 KB
tests/test_docs_website_navigation.pyscript2.7 KB
tests/test_enforce_governance_scope.pyscript1.7 KB
tests/test_generate_governance_startup.pyscript9.0 KB
tests/test_generate_routing_views.pyscript12.8 KB
tests/test_governance_history_and_pair_integrity.pyscript10.6 KB
tests/test_governance_integrity.pyscript55.7 KB
tests/test_new_skill_integration.pyscript8.3 KB
tests/test_project_index_integrity.pyscript6.4 KB
tests/test_remote_configuration.pyscript5.6 KB
tests/test_routing_observation.pyscript4.3 KB
tests/test_runtime_adapter.pyscript9.2 KB
tests/test_task_routing.pyscript47.5 KB
tests/test_validate_skill_order_sync.pyscript2.4 KB
tests/test_validate_skill_policy_smoke.pyscript869 B

tests/test_new_skill_integration.py

View on GitHub
import copy
import importlib.util
import json
from pathlib import Path
import re
import sys
import tempfile
import unittest


SKILLS_ROOT = Path(__file__).resolve().parents[2]
GOVERNANCE_ROOT = SKILLS_ROOT / "skill-governance"
FIXTURE = json.loads((GOVERNANCE_ROOT / "fixtures/routing-scenarios.json").read_text(encoding="utf-8"))

sys.path.insert(0, str(GOVERNANCE_ROOT / "scripts"))
import resolve_task_route as router  # noqa: E402

SVG_SPEC = importlib.util.spec_from_file_location(
    "advanced_svg_validator",
    SKILLS_ROOT / "advanced-svg/scripts/validate_svg.py",
)
assert SVG_SPEC and SVG_SPEC.loader
svg_validator = importlib.util.module_from_spec(SVG_SPEC)
SVG_SPEC.loader.exec_module(svg_validator)


class TestNewSkillRouting(unittest.TestCase):
    def descriptor(self, **action_overrides):
        descriptor = copy.deepcopy(FIXTURE["descriptor_defaults"])
        descriptor["task_id"] = "new-skill-test"
        descriptor["action"].update(action_overrides)
        return descriptor

    def test_advanced_research_routes_from_typed_intensity(self) -> None:
        result = router.resolve_task_route(self.descriptor(research_intensity="advanced"))
        self.assertEqual(result["selected_skills"], ["advanced-r-and-d"])

    def test_help_routes_only_from_typed_exact_command_signal(self) -> None:
        result = router.resolve_task_route(self.descriptor(help_requested=True))
        self.assertEqual(result["selected_skills"], ["help"])
        ordinary = router.resolve_task_route(self.descriptor())
        self.assertNotIn("help", ordinary["selected_skills"])

    def test_vector_graphics_routes_to_advanced_svg(self) -> None:
        descriptor = self.descriptor()
        descriptor["domains"] = ["vector_graphics"]
        result = router.resolve_task_route(descriptor)
        self.assertEqual(result["selected_skills"], ["advanced-svg"])

    def test_agent_humility_routes_only_for_evidence_challenged_approaches(self) -> None:
        challenged = router.resolve_task_route(self.descriptor(approach_state="challenged"))
        self.assertEqual(challenged["selected_skills"], ["agent-humility"])
        self.assertEqual(
            challenged["decision_domain_owners"]["approach_reassessment"],
            "agent-humility",
        )

        for state in ("not_applicable", "viable"):
            with self.subTest(state=state):
                result = router.resolve_task_route(self.descriptor(approach_state=state))
                self.assertNotIn("agent-humility", result["selected_skills"])

    def test_noncritical_uncertainty_still_blocks_for_user_choice(self) -> None:
        descriptor = self.descriptor()
        descriptor["material_uncertainties"] = [{
            "id": "format-choice",
            "description": "The requested output format is not specified.",
            "severity": "noncritical",
            "status": "unresolved",
        }]
        result = router.resolve_task_route(descriptor)
        self.assertEqual(
            result["selected_skills"],
            ["requirement-clarifier", "eliminate-assumptions"],
        )
        self.assertEqual(result["decision"], "needs_clarification")
        self.assertEqual(result["vetoes"][0]["code"], "assumption_unresolved")


class TestNewSkillPackages(unittest.TestCase):
    def test_user_facing_activation_commands_use_double_dash(self) -> None:
        slash_commands = []
        for path in SKILLS_ROOT.glob("*/SKILL.md"):
            for command in re.findall(r"`(/[a-z][^`]*)`", path.read_text(encoding="utf-8")):
                slash_commands.append(f"{path.parent.name}: {command}")
        self.assertEqual(slash_commands, [])

        help_text = (SKILLS_ROOT / "help/SKILL.md").read_text(encoding="utf-8")
        command_section = help_text.split("## Supported Commands", 1)[1].split("## Output Contract", 1)[0]
        commands = re.findall(r"^- `([^`]+)`:", command_section, flags=re.MULTILINE)
        self.assertTrue(commands)
        self.assertTrue(all(command.startswith("--") for command in commands), commands)

    def test_help_marker_contract_is_catalog_derived(self) -> None:
        content = (SKILLS_ROOT / "help/SKILL.md").read_text(encoding="utf-8")
        self.assertIn("routing_mode` is `explicit_only`", content)
        self.assertIn("send --help to learn more about available tools in agent-command-center", content)

    def test_clean_slate_preserves_active_controls(self) -> None:
        content = (SKILLS_ROOT / "clean-slate/SKILL.md").read_text(encoding="utf-8")
        for invariant in (
            "cannot erase already loaded model context",
            "safety, legal, security, privacy, and authority constraints",
            "not data erasure",
            "Do not delete, rewrite, or hide history",
        ):
            self.assertIn(invariant, content)

    def test_agent_humility_has_evidence_pivot_and_authority_boundaries(self) -> None:
        content = (SKILLS_ROOT / "agent-humility/SKILL.md").read_text(encoding="utf-8")
        for invariant in (
            "Do not repeat an unchanged attempt",
            "Goal",
            "Observed",
            "Invalidated",
            "Next discriminator",
            "External evidence outranks self-generated confidence",
            "Authority And Safety",
        ):
            self.assertIn(invariant, content)

    def test_svg_validator_accepts_safe_file_and_rejects_unsafe_features(self) -> None:
        with tempfile.TemporaryDirectory() as temp_dir:
            root = Path(temp_dir)
            safe = root / "safe.svg"
            safe.write_text(
                '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10" aria-hidden="true">'
                '<defs><linearGradient id="g"><stop offset="0"/></linearGradient></defs>'
                '<rect width="10" height="10" fill="url(#g)" stroke="red"/></svg>',
                encoding="utf-8",
            )
            self.assertEqual(svg_validator.validate(safe, False), [])

            unsafe = root / "unsafe.svg"
            unsafe.write_text(
                '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">'
                '<script>bad()</script><use href="#missing" onclick="bad()"/></svg>',
                encoding="utf-8",
            )
            findings = "\n".join(svg_validator.validate(unsafe, False))
            self.assertIn("unsafe-element", findings)
            self.assertIn("event-handler", findings)
            self.assertIn("unresolved-reference", findings)

    def test_svg_validator_requires_an_explicit_accessibility_strategy(self) -> None:
        with tempfile.TemporaryDirectory() as temp_dir:
            missing = Path(temp_dir) / "missing-a11y.svg"
            missing.write_text(
                '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">'
                '<rect width="10" height="10"/></svg>',
                encoding="utf-8",
            )
            findings = "\n".join(svg_validator.validate(missing, False))
            self.assertIn("ERROR accessibility", findings)

            informative = Path(temp_dir) / "informative.svg"
            informative.write_text(
                '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10" '
                'role="img" aria-labelledby="title desc">'
                '<title id="title">Status</title><desc id="desc">Ready</desc>'
                '<circle cx="5" cy="5" r="4"/></svg>',
                encoding="utf-8",
            )
            self.assertEqual(svg_validator.validate(informative, False), [])

    def test_svg_validator_blocks_external_css_and_active_document_directives(self) -> None:
        with tempfile.TemporaryDirectory() as temp_dir:
            unsafe = Path(temp_dir) / "css-unsafe.svg"
            unsafe.write_text(
                '<!DOCTYPE svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10" '
                'aria-hidden="true"><style>@import "https://example.invalid/x.css"; '
                'rect { fill: url(https://example.invalid/x.png); }</style>'
                '<rect width="10" height="10"/></svg>',
                encoding="utf-8",
            )
            findings = "\n".join(svg_validator.validate(unsafe, False))
            self.assertIn("active-document-directive", findings)
            self.assertIn("css-import", findings)
            self.assertIn("external-css-reference", findings)


if __name__ == "__main__":
    unittest.main()
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall