CommunityCoding & Developmentgithub.com

1203124102-oss/codex-pronunciation-strip

Add a compact, click-to-play pronunciation strip for 2-4 English words in a chat reply and annotate those words inline. Use when the user asks for word pronunciation, audio buttons, or vocabulary notes in conversation; not for producing standalone audio files or web pages.

What is codex-pronunciation-strip?

codex-pronunciation-strip is a Codex agent skill that add a compact, click-to-play pronunciation strip for 2-4 English words in a chat reply and annotate those words inline. Use when the user asks for word pronunciation, audio buttons, or vocabulary notes in conversation; not for producing standalone audio files or web pages.

Works with~Claude Code✓Codex CLI~Cursor
npx skills add 1203124102-oss/codex-pronunciation-strip

Installed? Explore more Coding & Development skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Pronunciation Strip

Add a small, one-row strip of word buttons to a chat reply. Each click speaks the word with the browser's speech synthesis, so nothing opens, downloads, or leaves the conversation. Pair the strip with inline vocabulary annotations.

Workflow

  1. Choose 2-4 words worth teaching: above the learner's level, easily confused, or central to the reply. Avoid re-annotating words already explained.

  2. Annotate each word inside a normal sentence, never as a separate list. Use KaTeX with colored bold text, US IPA, part of speech, and a short gloss in the user's language. Pick a random color per word from a small accessible palette (#2563eb, #7c3aed, #059669, #b45309, #db2777, #0e7490); keep each word one solid color and avoid repeating colors within one reply. This client only renders $$...$$, so write:

    保持紧凑($$\textcolor{#7c3aed}{\textbf{compact}}$$ /kəmˈpækt/,adj. 紧凑的)

  3. Generate the strip:

    python scripts/make_compact_strip.py --out <absolute-path>.html word1 word2 ...
    

    Keep the file durable and easy for the client to read. Prefer the thread's visualization directory with an ASCII filename, for example ~/.codex/visualizations/<date>/<thread-id>/pron-<slug>.html.

  4. The script prints the path and a visualization reference. Put that reference verbatim on its own line in the final reply, at the end.

Rendering rule

The reference is wrapped in private-use characters: open U+E200, separator U+E202, close U+E201. Copy it from the script output. If you retype it, use exactly those code points. A wrong closing character such as U+E041 silently turns the whole reference into plain text, so no strip appears.

Constraints

  • Emit only the HTML fragment. Do not add <!doctype>, <html>, <head>, or <body>; keep CSS and JavaScript scoped to the generated root ID.
  • Keep the strip to 2-4 buttons and one row that wraps only when space is tight.
  • Do not link to external dictionary or TTS pages and do not embed large audio players. The buttons must play in place.
  • Use the host theme variables (--foreground, --border, --primary, --accent, --ring, --primary-foreground) instead of hardcoded palettes.
  • If the client cannot render inline visualizations at all, fall back to compact speaker links inside the sentence: [🔊](https://dict.youdao.com/dictvoice?audio=<word>&type=2).

Files

  • scripts/make_compact_strip.py — validates 2-4 words, writes the fragment, and prints the visualization reference.
  • assets/strip-template.html — the fragment template with __ROOT_ID__ and __WORDS_JSON__ placeholders.

Requires Python 3.8 or newer; no third-party packages.

Related Skills