agentleFS
scaliavenscaliaven/menu-translate/SKILL.md

menu-translate

Skill1 starsChanged 4 months agoMITView on GitHub

Use this skill whenever the user wants to read, translate, or decode a restaurant menu — from a photo/image/PDF, or by looking a restaurant up online by name or address. Produces a structured bilingual (English + 中文) menu with dish names, romanization/pinyin, descriptions, prices (original + optional converted), and dietary/spice/allergen tags. Photo-mode triggers — "translate this menu", "what does this menu say", "read this menu photo/PDF", "菜单翻译", "decode this menu", "what's on this menu", "prices on this menu", "is this dish vegetarian/spicy". Discovery-mode triggers — "find the menu for <restaurant>", "look up <restaurant>'s menu", "menu for the place at <address>", "what does <restaurant> serve", "translate <restaurant>'s menu near <place>". Handles source languages in any script (Chinese, Japanese, Korean, Thai, Vietnamese, French, Italian, Spanish, Arabic, etc.) and outputs English + 中文 by default.

  • In this repositoryOne other file it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

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

    Read/translate restaurant menus and emit a structured bilingual (English + 中文) table.

    line 9
  2. Very specific:

    Read references/output-schema.md (the schema you must produce) and references/translation-guide.md (romanization + tagging + currency …

    line 41
  3. Distinctive:

    ALWAYS output English + 中文 (Simplified).

    line 45
  4. Distinctive:

    Keep the original text AND its romanization/pinyin.

    line 46
  5. Distinctive:

    NEVER invent dishes, descriptions, or prices.

    line 47
  6. Very specific:

    Use tags from the controlled vocabulary in references/translation-guide.md only — do not coin new tags.

    line 50
  7. Distinctive:

    Verify it is the right restaurant (name + location match).

    line 71
  8. Distinctive:

    STOP and ask the user when:

    line 78
  9. Very specific:

    No online menu can be found — but first confirm you were actually ABLE to look.

    line 82
  10. Distinctive:

    Always state the detected source language and currency.

    line 90
  11. Distinctive:

    If you could only read part of the menu, say so plainly — which parts are missing and why.

    line 93
  12. Very specific:

    Test the renderer against examples/sample_menu.json.

    line 105
  13. Distinctive:

    If WebFetch is blocked in a sandboxed/cloud session, that is a network-policy denial, NOT "no menu online" — the fix is an environment with …

    line 112

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

menu-translate Skill

Read/translate restaurant menus and emit a structured bilingual (English + 中文) table. KEY PRINCIPLE: Claude reads the image/PDF/web page and does the translation itself; the helper scripts do ONLY deterministic work — validate the structured menu JSON and render it as a bilingual markdown table. Scripts NEVER do OCR or translation.

Two entry points

Input typeWorkflow doc
Photo / image / PDF of a menureferences/photo-workflow.md
Restaurant name or addressreferences/discovery-workflow.md

Photo mode: read the file NATIVELY with the Read tool (no OCR library). Discovery mode: find the menu with built-in WebSearch + WebFetch (NO API key); browser automation is a FALLBACK only — claude-in-chrome locally, headless Chromium/Playwright in a cloud sandbox (where claude-in-chrome is unavailable).

Pipeline (both modes)

  1. Obtain the source — Read tool for images/PDFs; WebFetch for web pages.
  2. Build a structured menu JSON per references/output-schema.md.
  3. Render it:
python3 scripts/render_menu.py menu.json

Output is a chat markdown table only — no HTML, no saved files.

Building the menu JSON

Read references/output-schema.md (the schema you must produce) and references/translation-guide.md (romanization + tagging + currency rules) before building JSON. Hard rules:

  • ALWAYS output English + 中文 (Simplified).
  • Keep the original text AND its romanization/pinyin.
  • NEVER invent dishes, descriptions, or prices. If a field is unreadable, omit it or mark it — do not guess.
  • Lower the confidence value when unsure.
  • Use tags from the controlled vocabulary in references/translation-guide.md only — do not coin new tags.

Rendering output

python3 scripts/render_menu.py <menu.json> [--convert-to USD] [--rate 0.14 | --rates-file rates.json] [--sections-only]

The final answer is a chat markdown table only. Use --convert-to (with --rate or --rates-file) to add an approximate converted-price column. --sections-only renders section headers without rows.

Discovery rules (summary)

  1. Clarify FIRST when ambiguous (chain with many locations, missing city).
  2. WebSearch → official site or a reputable listing (Google Maps / Yelp / delivery apps).
  3. WebFetch the menu page — or download the menu PDF and Read it.
  4. Browser automation only as a fallback when WebFetch cannot retrieve it — claude-in-chrome locally, Playwright/Chromium in a cloud sandbox.
  5. Verify it is the right restaurant (name + location match).
  6. Cite the source URL.

Full steps: references/discovery-workflow.md.

Verification & clarification

STOP and ask the user when:

  • The restaurant is a chain with many locations, or the city/address is missing.
  • A photo is too blurry/cropped to read reliably.
  • No online menu can be found — but first confirm you were actually ABLE to look. If fetches are being refused by the environment rather than by the sites, report that instead; it is not a fact about the restaurant. See references/network-setup.md.
  • The currency is unknown or ambiguous (before doing any conversion).

Reporting

Always state the detected source language and currency. Label allergen/dietary tags as best-effort and converted prices as approximate.

If you could only read part of the menu, say so plainly — which parts are missing and why. Never present a partial or search-snippet-derived menu as if it were the full card.

Scripts

ScriptPurposeUsage
scripts/check_env.pyQuick environment probe (Python version, optional Pillow, poppler/pdftoppm for PDF menus, and whether a network policy proxy may block discovery). Makes no network request. Run first if unsure.python3 scripts/check_env.py
scripts/render_menu.pyMenu JSON → bilingual markdown table.python3 scripts/render_menu.py <menu.json> [--convert-to USD] [--rate 0.14 | --rates-file rates.json] [--sections-only]
scripts/preprocess_image.pyOPTIONAL (needs Pillow): clean up a low-quality photo.python3 scripts/preprocess_image.py --in <img> --out <img> [--grayscale --autocontrast --sharpen --tile --max-dim N]

Test the renderer against examples/sample_menu.json.

Failure modes

Blurry photos, no online menu, unknown currency, and other recovery recipes: references/failure-modes.md. Reference index: references/README.md.

If WebFetch is blocked in a sandboxed/cloud session, that is a network-policy denial, NOT "no menu online" — the fix is an environment with Full network access. See references/network-setup.md for setup and for telling a policy block apart from a site's own anti-bot.

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.