Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
One-time bootstrap of the entire TTS + Telegram bot stack: Kokoro TTS engine (MLX-Audio on Apple Silicon), Telegram bot via BotFather, secrets management, environment configuration, and shell symlinks.
Platform: macOS (Apple Silicon)
Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
When to Use This Skill
First-time setup of the tts-tg-sync plugin
Reinstalling after a clean OS install or hardware migration
Setting up a new machine with the full TTS + Telegram stack
Recovering from a broken installation (run kokoro-install.sh --uninstall first)
Requirements
Component
Required
Installation
Bun
Yes
brew install oven-sh/bun/bun
mise
Yes
brew install mise
uv
Yes
brew install uv
Python 3.14
Yes
uv python install 3.14
Homebrew
Yes
Already installed on macOS dev machines
Apple Silicon (M1+)
Yes
Required for MLX Metal acceleration
Workflow Phases
Phase 0: Preflight Check
Verify all prerequisites are installed and accessible:
command -v bun # Bun runtime for TypeScript botcommand -v mise # Environment managercommand -v uv # Python package manager
uv python list | grep 3.14 # Python 3.14 available
If any tool is missing, install via Homebrew (brew install <tool>). Python 3.14 is installed via uv python install 3.14.
Phase 1: Kokoro TTS Engine Install
Run the bundled installer script:
bash scripts/kokoro-install.sh --install
This performs:
Requires Apple Silicon (fails fast on Intel/Linux)
Creates venv at ~/.local/share/kokoro/.venv with Python 3.14 via uv
Installs PyPI deps (mlx-audio, soundfile, numpy)
Copies kokoro_common.py and tts_generate.py from plugin bundle to ~/.local/share/kokoro/
Downloads Kokoro-82M-bf16 MLX model from HuggingFace (mlx-community/Kokoro-82M-bf16)
Writes version.json with mlx_audio version, backend, and model ID
Phase 2: BotFather Token Setup
Guide the user through Telegram BotFather to create a bot token:
1. [Preflight] Verify Bun installed
2. [Preflight] Verify mise installed
3. [Preflight] Verify uv installed
4. [Preflight] Verify Python 3.14 available via uv
5. [Kokoro] Run kokoro-install.sh --install
6. [Kokoro] Verify MLX-Audio acceleration
7. [BotFather] Guide BotFather token creation (or verify existing)
8. [Secrets] Store token in ~/.claude/.secrets/ccterrybot-telegram
9. [Secrets] Create .mise.local.toml with _.file reference to secrets
10. [Environment] Add KOKORO_VENV and KOKORO_SCRIPT to mise.toml
11. [Symlinks] Create ~/.local/bin/ symlinks for all TTS shell scripts
12. [Verify] Generate test WAV with Kokoro and play with afplay
13. [Verify] Check bot responds to /status via Telegram API
Post-Change Checklist
After modifying this skill:
Verify kokoro-install.sh --health passes all 6 checks
Confirm .mise.local.toml is gitignored
Test symlinks resolve correctly (ls -la ~/.local/bin/tts_*.sh)
Verify bot token works via getMe API call
Run a full TTS round-trip: clipboard text to audio playback
Update references/evolution-log.md with change description
Troubleshooting
Issue
Cause
Solution
uv not found
Not installed
brew install uv
Python 3.14 not available
Not installed via uv
uv python install 3.14
Not Apple Silicon
Intel Mac or Linux
Requires M1 or newer Mac (MLX Metal)
Model download fails
Network issue or HuggingFace outage
Check internet connectivity, retry
BotFather token invalid
Typo or revoked token
Verify via curl https://api.telegram.org/bot<TOKEN>/getMe
kokoro-install.sh permission denied
Script not executable
chmod +x scripts/kokoro-install.sh
Venv already exists
Previous partial install
Run kokoro-install.sh --uninstall then --install
tts_generate.py not found
Bundle copy failed
Check scripts/tts_generate.py exists in plugin
Reference Documentation
Kokoro Bootstrap - Detailed venv setup, Python 3.14 via uv, MLX-Audio, model download
BotFather Guide - Step-by-step Telegram bot creation and token management
Upstream Fork - MLX-Audio Kokoro upstream and bundled script rationale
After this skill completes, reflect before closing the task:
Locate yourself. — Find this SKILL.md's canonical path (Glob for this skill's name) before editing. All corrections target THIS file and its sibling references/ — never other documentation.
What failed? — Fix the instruction that caused it. If it could recur, add it as an anti-pattern.
What worked better than expected? — Promote it to recommended practice. Document why.
What drifted? — Any script, reference, or external dependency that no longer matches reality gets fixed now.
Log it. — Every change gets an evolution-log entry with trigger, fix, and evidence.
Do NOT defer. The next invocation inherits whatever you leave behind.