Skip to content

moonlight-lupin/agent-skills / creative/pexels-stock-photos

pexels-stock-photos

Verified

Use when the user wants a REAL photo — 'find a photo of X', 'search for pictures of Y', 'stock image of Z', 'I need a photo for this slide/article'. Searches Pexels free stock library and downloads images. DO NOT use for AI-generated art ('generate an image of', 'create a picture of', 'make me an illustration') — those go to the image_generate tool or fal-enhanced skill. Key distinction: 'photo' = real stock photography = Pexels; 'generate/create/make an image' = AI art = image_generate/fal-enhanced.

FileKindSize
README.mdmarkdown1020 B
SKILL.mdskill md6.3 KB
tests/test_skill.pyscript5.1 KB

tests/test_skill.py

View on GitHub
#!/usr/bin/env python3
"""Unit tests for pexels-stock-photos SKILL.md structure and routing contract.

Run:  python -m pytest creative/pexels-stock-photos/tests/test_skill.py -v
  or:  python creative/pexels-stock-photos/tests/test_skill.py
"""

import re
import unittest
from pathlib import Path

SKILL_MD = Path(__file__).resolve().parent.parent / "SKILL.md"


class TestFrontmatter(unittest.TestCase):
    """Validate SKILL.md frontmatter matches repo conventions."""

    @classmethod
    def setUpClass(cls):
        cls.content = SKILL_MD.read_text()
        # Extract frontmatter between --- markers
        match = re.match(r"^---\n(.*?)\n---\n", cls.content, re.DOTALL)
        cls.fm_text = match.group(1) if match else ""

    def test_file_starts_with_frontmatter(self):
        self.assertTrue(
            self.content.startswith("---\n"),
            "SKILL.md must start with --- frontmatter delimiter",
        )

    def test_name_field(self):
        self.assertIn("name: pexels-stock-photos", self.fm_text)

    def test_description_field(self):
        self.assertIn("description:", self.fm_text)

    def test_version_field(self):
        self.assertIn("version:", self.fm_text)

    def test_author_field(self):
        self.assertIn("author: moonlight-lupin", self.fm_text)

    def test_license_field(self):
        self.assertIn("license: MIT", self.fm_text)

    def test_platforms_field(self):
        self.assertIn("platforms:", self.fm_text)

    def test_description_mentions_real_photo(self):
        """Description must signal 'real photo' to distinguish from AI generation."""
        self.assertIn("REAL photo", self.content)

    def test_description_mentions_pexels(self):
        self.assertIn("Pexels", self.content)

    def test_description_discourages_ai_art(self):
        """Description must redirect AI art requests away from this skill."""
        # Check the description or body mentions not using for AI generation
        self.assertTrue(
            "generate" in self.content.lower() and "do not" in self.content.lower(),
            "SKILL.md should mention it's not for AI-generated art",
        )


class TestRoutingContract(unittest.TestCase):
    """Validate the routing table distinguishes Pexels from AI generation."""

    @classmethod
    def setUpClass(cls):
        cls.content = SKILL_MD.read_text()

    def test_has_routing_table(self):
        self.assertIn("Routing:", self.content)

    def test_routing_mentions_photo_keyword(self):
        """Routing must route 'photo' requests to Pexels."""
        self.assertIn("photo", self.content.lower())

    def test_routing_mentions_generate_keyword(self):
        """Routing must route 'generate' requests to AI generation, not Pexels."""
        self.assertIn("generate", self.content.lower())

    def test_has_key_word_test(self):
        """The keyword test helps the agent distinguish photo vs generate."""
        self.assertIn("key word test", self.content.lower())

    def test_has_attribution_section(self):
        """Attribution is required by Pexels guidelines."""
        self.assertIn("Attribution", self.content)

    def test_has_api_reference(self):
        """API reference section must exist for agent to construct calls."""
        self.assertIn("API Reference", self.content)

    def test_has_search_endpoint(self):
        self.assertIn("/search", self.content)

    def test_has_download_workflow(self):
        """Workflow must include a download step."""
        self.assertIn("Download", self.content)

    def test_has_pitfalls_section(self):
        self.assertIn("Pitfalls", self.content)

    def test_has_verification_checklist(self):
        self.assertIn("Verification Checklist", self.content)

    def test_mentions_rate_limit(self):
        """Rate limit info must be present so the agent can manage quotas."""
        self.assertIn("200", self.content)

    def test_mentions_env_var(self):
        """PEXELS_API_KEY env var must be documented."""
        self.assertIn("PEXELS_API_KEY", self.content)


class TestNoHardcodedPaths(unittest.TestCase):
    """Ensure the skill is portable — no absolute paths to specific machines."""

    @classmethod
    def setUpClass(cls):
        cls.content = SKILL_MD.read_text()

    def test_no_machine_specific_paths(self):
        """No absolute paths into a specific user's home directory (e.g. /root/... or /home/<user>/...)."""
        hits = re.findall(r"(?:/root|/home/\w+)/\S*", self.content)
        self.assertEqual(hits, [], f"SKILL.md contains machine-specific paths: {hits}")

    def test_no_secrets(self):
        """No actual API keys in the skill file."""
        # Check there's no string that looks like a Pexels API key (56-char alphanumeric)
        suspicious = re.findall(r"[A-Za-z0-9]{50,}", self.content)
        # Filter out things that are clearly not keys (like long descriptions)
        for match in suspicious:
            # Pexels keys are 56 chars of alphanumeric
            if len(match) >= 50 and re.match(r"^[A-Za-z0-9]+$", match):
                self.fail(f"Possible API key found in SKILL.md: {match[:10]}...")


if __name__ == "__main__":
    unittest.main()
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall