# Test Cases for x-ipe-tool-kb-manager
# Generated from skill-meta.md acceptance criteria

test_suite:
  skill_name: x-ipe-tool-kb-manager
  skill_path: .github/skills/x-ipe-tool-kb-manager/SKILL.md
  generated: 2026-02-12

  test_cases:
    # ═══ STRUCTURE TESTS (MUST) ═══

    - id: TC-S01
      ac_ref: AC-S01
      priority: must
      name: "SKILL.md exists with valid frontmatter"
      type: structural
      method: file_exists + yaml_parse
      checks:
        - file_exists: ".github/skills/x-ipe-tool-kb-manager/SKILL.md"
        - frontmatter_field: { key: "name", expected: "x-ipe-tool-kb-manager" }
        - frontmatter_field: { key: "description", expected_contains: "knowledge" }

    - id: TC-S02
      ac_ref: AC-S02
      priority: must
      name: "references/examples.md exists with examples"
      type: structural
      method: file_exists + content_check
      checks:
        - file_exists: ".github/skills/x-ipe-tool-kb-manager/references/examples.md"
        - content_contains: "Example"
        - min_examples: 2

    - id: TC-S03
      ac_ref: AC-S03
      priority: must
      name: "SKILL.md body under 500 lines"
      type: structural
      method: line_count
      checks:
        - max_lines: 500

    # ═══ CONTENT TESTS (MUST) ═══

    - id: TC-C01
      ac_ref: AC-C01
      priority: must
      name: "All required sections present in correct order"
      type: content
      method: section_parse
      checks:
        - sections_in_order:
            - "Purpose"
            - "Important Notes"
            - "About"
            - "When to Use"
            - "Input Parameters"
            - "Definition of Ready"
            - "Operations"
            - "Output Result"
            - "Definition of Done"
            - "Error Handling"
            - "Examples"

    - id: TC-C02
      ac_ref: AC-C02
      priority: must
      name: "Operations use XML structure"
      type: content
      method: regex_match
      checks:
        - regex: '<operation name="classify">'
        - regex: '<operation name="search">'
        - regex: '<operation name="reorganize">'
        - regex: '<operation name="cancel">'

    - id: TC-C03
      ac_ref: AC-C03
      priority: must
      name: "Error Handling table with correct columns"
      type: content
      method: table_parse
      checks:
        - table_header_contains: ["Error", "Cause", "Resolution"]

    - id: TC-C04
      ac_ref: AC-C04
      priority: must
      name: "Four operations defined"
      type: content
      method: content_check
      checks:
        - content_contains: "classify"
        - content_contains: "search"
        - content_contains: "reorganize"
        - content_contains: "cancel"

    # ═══ BEHAVIOR TESTS (MUST) ═══

    - id: TC-B01
      ac_ref: AC-B01
      priority: must
      name: "Classify references POST /api/kb/process"
      type: behavior
      method: content_check
      checks:
        - content_contains: "POST /api/kb/process"

    - id: TC-B02
      ac_ref: AC-B02
      priority: must
      name: "Search references GET /api/kb/search"
      type: behavior
      method: content_check
      checks:
        - content_contains: "GET /api/kb/search"

    - id: TC-B03
      ac_ref: AC-B03
      priority: must
      name: "Trigger phrases in description frontmatter"
      type: behavior
      method: yaml_parse
      checks:
        - frontmatter_description_contains: "classify"
        - frontmatter_description_contains: "search"
        - frontmatter_description_contains: "reorganize"

    # ═══ SHOULD TESTS ═══

    - id: TC-C05
      ac_ref: AC-C05
      priority: should
      name: "When to Use includes explicit triggers"
      type: content
      method: content_check
      checks:
        - section_contains: { section: "When to Use", text: "triggers:" }

    - id: TC-C06
      ac_ref: AC-C06
      priority: should
      name: "Key Concepts section in About"
      type: content
      method: content_check
      checks:
        - section_contains: { section: "About", text: "Key Concepts" }

    # ═══ COULD TESTS ═══

    - id: TC-C07
      ac_ref: AC-C07
      priority: could
      name: "Templates directory exists"
      type: structural
      method: file_exists
      checks:
        - dir_exists: ".github/skills/x-ipe-tool-kb-manager/templates/"

  pass_criteria:
    must_pass_rate: 100%
    should_pass_rate: 80%
    could_pass_rate: 0%
