#!/usr/bin/env python3
from pathlib import Path

ROOT = Path(__file__).resolve().parents[1]
SKILL = ROOT / "skills/gpt-factory/SKILL.md"


def main() -> None:
    text = SKILL.read_text()
    required = [
        "name: gpt-factory",
        "Audience: AI coding agents first.",
        "First line of request file MUST be one plain-text, one-line job description.",
        "factory-gpt adw_plan_build_test_quality",
        "factory-gpt --effort high adw_plan_build_test_quality",
        "factory watch <adw_id> --since-start --follow",
        "factory decisions --adw <adw_id> --json",
        "factory answer <decision_id>",
        "factory stop <adw_id>",
        "git rev-parse HEAD",
        "git rev-parse origin/main",
        "git merge-base HEAD origin/main",
        "git diff --binary origin/main...HEAD",
        "git diff --binary --cached",
        "git ls-files --others --exclude-standard",
        "CLAUDE.md",
        "authoritative plan/spec",
        "Pi may execute mediated host tools",
        "NEVER send secrets",
        "DO NOT package whole repository.",
        "Default effort is `pro`.",
        "A new launch always creates a new run.",
        "Overdeck `/factory`",
    ]
    missing = [item for item in required if item not in text]
    assert not missing, f"missing contracts: {missing}"
    assert "ask-gpt --help" not in text
    assert "factory-gpt --help" not in text
    assert "--visible" not in text
    assert "--mode" not in text
    assert "TODO" not in text and "TBD" not in text
    print("gpt-factory skill contract: PASS")


if __name__ == "__main__":
    main()
