agentleFS
SkillMedevSkillMedev/live-data/skills/fun-content/SKILL.md

fun-content

Skill0 starsChanged 38 days agoMITView on GitHub

Use when a task needs light entertainment content from a live API - "build a quiz/trivia game", "random dog picture", "cat fact", "advice of the day", "random fun fact" - for a demo, bot, party feature, or filler content slot. Open Trivia DB is the quiz default (its session-token mechanics are documented here); catfact.ninja, random.dog, Advice Slip, and Useless Facts cover the rest, all keyless. Do NOT use for placeholder users/products/images in a prototype - use test-placeholder-data instead; do NOT use for dictionary or encyclopedia lookups - use language-reference instead; if the request is a vague "I need live data", route through public-data-api-picker.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Decode the questions: Default responses are HTML-encoded (", ').

    line 21
  2. Distinctive:

    Ask the user only if missing - trivia: question count (default: 10), category (default: any), difficulty (default: any).

    line 26
  3. Very specific:

    Placeholder people/products/images for a prototype: - test-placeholder-data (Picsum for generic images.

    line 70
  4. Very specific:

    No raw " or ' ever reaches the user.

    line 77

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Fun Content APIs

Pull trivia, animal images, and one-liner facts from verified keyless endpoints. The mistakes this prevents: shipping a quiz that repeats questions because Open Trivia DB's token mechanics were skipped, printing raw HTML entities in questions, and citing one of this category's chronically-dead quote APIs from training memory.

Ranked APIs

  1. Open Trivia DB (opentdb.com) - DEFAULT for quiz/trivia: 4,000+ questions, categories, difficulties. No key, but has session-token and encoding mechanics (below) that naive integrations get wrong.
  2. catfact.ninja - random cat facts. random.dog - random dog images (the better-known Dog CEO API at dog.ceo is returning HTTP 520s, verified - see Do NOT).
  3. Advice Slip (api.adviceslip.com) and Useless Facts (uselessfacts.jsph.pl) - one-liner advice and fun facts.

Procedure

  1. Trivia beyond one throwaway call → get a session token first. The token makes the API track served questions so users never see repeats. Rate limit: 1 request per IP per 5 seconds - batch up to 50 questions per call instead of calling per-question.
  2. Decode the questions. Default responses are HTML-encoded (", '). Either decode entities client-side or request &encode=url3986 and URL-decode - do one of them, or apostrophes render as garbage.
  3. Check response_code on every trivia call. 0 ok; 1 not enough questions for the filters (loosen category/difficulty); 3/4 token missing or exhausted (request/reset token); 5 rate-limited (wait 5s).
  4. Shuffle answers. correct_answer and incorrect_answers arrive separated - merge and shuffle before display or the correct answer's position leaks.
  5. Animal images: fetch the JSON, then use the URL inside it. For random.dog, filter for image extensions - it also serves .mp4/.webm.

Ask the user only if missing - trivia: question count (default: 10), category (default: any), difficulty (default: any).

URL templates + real response shapes

Trivia session + questions:

https://opentdb.com/api_token.php?command=request              ← once per user session
https://opentdb.com/api.php?amount=10&type=multiple&token={token}
https://opentdb.com/api.php?amount=10&category=9&difficulty=easy&token={token}   ← 9 = General Knowledge
https://opentdb.com/api_category.php                           ← id → name list
https://opentdb.com/api_token.php?command=reset&token={token}  ← on response_code 4
{"response_code":0,"results":[{"type":"multiple","difficulty":"easy",
  "category":"Entertainment: Musicals & Theatres",
  "question":"In Shakespeare's play Julius Caesar, Caesar's last words were...",
  "correct_answer":"Et tu, Brute? ",
  "incorrect_answers":["Iacta alea est!","Vidi, vini, vici.","Aegri somnia vana."]}]}

Tokens expire after 6 hours of inactivity. Max amount=50 per call.

One-liners and animals:

https://catfact.ninja/fact                     → {"fact":"...","length":94}
https://random.dog/woof.json                   → {"url":"https://random.dog/….jpg","fileSizeBytes":170059}
https://api.adviceslip.com/advice              → {"slip":{"id":89,"advice":"Don't be afraid to ask questions."}}
https://api.adviceslip.com/advice/search/{q}   → {"slips":[...]} - 404s (JSON body) on no match
https://uselessfacts.jsph.pl/api/v2/facts/random → {"text":"...","source":"...","permalink":"..."}

Advice Slip caches responses for ~2 seconds - identical repeat calls return the same slip; don't build "another one!" loops tighter than that.

Deliverable

For a quiz: working token lifecycle (request → use → reset on code 4), entity-decoded questions, shuffled answers, response_code handled. For content slots: the fetched item plus the URL used, with image extensions filtered where the API mixes media types.

Do NOT use - reach for X instead

  • Dog CEO (dog.ceo) - returning HTTP 520 on all endpoints, verified; random.dog replaces it.
  • quotes.rest, favqs unauthenticated, zenquotes at volume, kanye.rest and friends - this category's quote APIs are chronically down or throttled to uselessness; Advice Slip and Useless Facts are the verified survivors. Probe before adding any other.
  • Placeholder people/products/images for a prototype - test-placeholder-data (Picsum for generic images; this skill's animals are content, not layout filler).
  • Word definitions, encyclopedia facts - language-reference.
  • Anything load-bearing. These are volunteer-run free services - fine for demos and bots, wrong as a paid product's sole content source.

Quality bar

  • Multi-question trivia sessions use a token; zero repeated questions.
  • No raw " or ' ever reaches the user.
  • Answer order is shuffled; response_code paths are handled, not assumed zero.

Sourced and liveness-verified from the public-apis project (MIT).

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.