<?php

namespace MintyPHP\Tests\Architecture;

use PHPUnit\Framework\TestCase;

class CodexSkillReferenceContractTest extends TestCase
{
    use ProjectFileAssertionSupport;

    public function testCoreGuardrailsSkillAndReferencesExist(): void
    {
        $skill = $this->readProjectFile('.agents/skills/core-guardrails/SKILL.md');
        $this->assertStringContainsString('name: core-guardrails', $skill);

        $this->readProjectFile('.agents/skills/core-guardrails/references/boundaries-core.md');
        $this->readProjectFile('.agents/skills/core-guardrails/references/boundaries-ui.md');
        $this->readProjectFile('.agents/skills/core-guardrails/references/quality-gates.md');
        $this->readProjectFile('.agents/skills/core-guardrails/references/source-map.md');
    }

    public function testStarterkitPlannerSkillAndReferencesExist(): void
    {
        $skill = $this->readProjectFile('.agents/skills/starterkit-planner/SKILL.md');
        $this->assertStringContainsString('name: starterkit-planner', $skill);

        $this->readProjectFile('.agents/skills/starterkit-planner/references/plan-template.md');
        $this->readProjectFile('.agents/skills/starterkit-planner/references/tradeoff-matrix.md');
    }

    public function testStarterkitGridStandardsSkillAndReferencesExist(): void
    {
        $skill = $this->readProjectFile('.agents/skills/starterkit-grid-standards/SKILL.md');
        $this->assertStringContainsString('name: starterkit-grid-standards', $skill);

        $this->readProjectFile('.agents/skills/starterkit-grid-standards/references/list-checklist.md');
        $this->readProjectFile('.agents/skills/starterkit-grid-standards/references/row-interaction-standard.md');
        $this->readProjectFile('.agents/skills/starterkit-grid-standards/references/page-size-standard.md');
    }

    public function testStarterkitPhpStyleCiSkillExists(): void
    {
        $skill = $this->readProjectFile('.agents/skills/starterkit-php-style-ci/SKILL.md');
        $this->assertStringContainsString('name: starterkit-php-style-ci', $skill);
    }
}
