agentleFS
THEROCKSSSTHEROCKSSS/hermes-skills-portfolio/skills/gif-search/SKILL.md

gif-search

Skill1 starsChanged 4 months agoMITView on GitHub

Use when the user wants a GIF for a message or reaction — including a specific reaction GIF (facepalm, thumbs up, celebration) — found and downloaded via the Tenor API.

  • Reads credentials

17 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 17 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Search and download animated GIFs from Tenor's API.

    line 17
  2. Distinctive:

    Search Tenor with the query

    line 133

“Common” is measured: kept by at least 6 in 10 of the 17 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

gif-search

Overview

Search and download animated GIFs from Tenor's API. The agent finds GIFs by keyword, previews results, and downloads the selected GIF to a local file.

When to Use

  • The user wants a GIF for a message or reaction.
  • The user wants to find a specific reaction GIF (facepalm, thumbs up, celebration).
  • The user says "find me a GIF", "search for a GIF", or "I need a reaction GIF".

Prerequisites

A Tenor API key. Get one free at https://developers.google.com/tenor/guides/quickstart

# Store the key as an environment variable
export TENOR_API_KEY="your_key_here"

Search for GIFs

import requests
import os

def search_gifs(query: str, limit: int = 10, pos: str = "") -> list:
    """Search Tenor for GIFs matching the query."""
    api_key = os.environ.get("TENOR_API_KEY", "")
    params = {
        "q": query,
        "key": api_key,
        "limit": limit,
        "media_filter": "gif",
        "contentfilter": "medium",
    }
    if pos:
        params["pos"] = pos

    resp = requests.get("https://tenor.googleapis.com/v2/search", params=params)
    resp.raise_for_status()
    data = resp.json()

    results = []
    for item in data.get("results", []):
        gif_url = None
        for media in item.get("media_formats", []):
            if media.get("gif"):
                gif_url = media["gif"]["url"]
                break
        if gif_url:
            results.append({
                "id": item.get("id"),
                "title": item.get("title", ""),
                "url": gif_url,
                "preview": item.get("media_formats", [{}])[0].get("tinygif", {}).get("url", ""),
            })
    return results

Download a GIF

def download_gif(url: str, output_path: str) -> str:
    """Download a GIF to a local file."""
    resp = requests.get(url, stream=True)
    resp.raise_for_status()
    with open(output_path, "wb") as f:
        for chunk in resp.iter_content(chunk_size=8192):
            f.write(chunk)
    return output_path

Full Workflow

# 1. Search for GIFs
results = search_gifs("facepalm", limit=5)

# 2. Show options to the user
for i, r in enumerate(results):
    print(f"{i}: {r['title']} — {r['url']}")

# 3. User picks one
choice = 2
selected = results[choice]

# 4. Download
path = download_gif(selected["url"], "facepalm.gif")
print(f"Downloaded to {path}")

Trending GIFs

def trending_gifs(limit: int = 10) -> list:
    """Get currently trending GIFs."""
    api_key = os.environ.get("TENOR_API_KEY", "")
    params = {"key": api_key, "limit": limit, "media_filter": "gif"}
    resp = requests.get("https://tenor.googleapis.com/v2/featured", params=params)
    resp.raise_for_status()
    # Same parsing as search_gifs
    ...

Categories

def categories() -> list:
    """Get available GIF categories."""
    api_key = os.environ.get("TENOR_API_KEY", "")
    params = {"key": api_key, "type": "featured"}
    resp = requests.get("https://tenor.googleapis.com/v2/categories", params=params)
    return resp.json().get("tags", [])

Workflow

  1. Get the search query from the user
  2. Search Tenor with the query
  3. Present top 5-10 results (title + URL) to the user
  4. User picks one
  5. Download the selected GIF to a local file
  6. Return the file path

Common Pitfalls

  1. No API key — Without a Tenor API key, all requests fail. Get one at https://developers.google.com/tenor/guides/quickstart (free).
  2. Content filter — Tenor returns NSFW content by default if no filter is set. Use contentfilter=medium or contentfilter=high to keep results safe.
  3. Rate limits — Tenor's free tier allows ~100 requests per minute. For normal use this is plenty.
  4. GIF size — Full GIFs can be 5-20 MB. If you need smaller files, use the tinygif or nanogif media format instead of gif.
  5. API version — Tenor has v1 and v2 APIs. v2 is current. v1 is deprecated but still works. Always use tenor.googleapis.com/v2/.
  6. Attribution — Tenor doesn't require attribution, but linking back to the Tenor page is good practice.

Verification Checklist

  • TENOR_API_KEY is set and a test search returns results, not an auth error
  • contentfilter set to medium or high before showing results to the user
  • Downloaded file is a valid, non-zero-size GIF at the expected path
  • Media format chosen (gif vs tinygif/nanogif) matches the size constraint the use case needs

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.