Cc-skills full-stack-bootstrap
One-time bootstrap for Kokoro TTS engine, Telegram bot, and BotFather setup. TRIGGERS - setup tts, install kokoro, botfather, bootstrap tts-tg-sync, configure telegram bot, full stack setup.
git clone https://github.com/terrylica/cc-skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/terrylica/cc-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/plugins/tts-tg-sync/skills/full-stack-bootstrap" ~/.claude/skills/terrylica-cc-skills-full-stack-bootstrap && rm -rf "$T"
plugins/tts-tg-sync/skills/full-stack-bootstrap/SKILL.mdFull Stack Bootstrap
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
first)kokoro-install.sh --uninstall
Requirements
| Component | Required | Installation |
|---|---|---|
| Bun | Yes | |
| mise | Yes | |
| uv | Yes | |
| Python 3.13 | Yes | |
| 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 bot command -v mise # Environment manager command -v uv # Python package manager uv python list | grep 3.13 # Python 3.13 available
If any tool is missing, install via Homebrew (
brew install <tool>). Python 3.13 is installed via uv python install 3.13.
Phase 1: Kokoro TTS Engine Install
Run the bundled installer script:
<!-- SSoT-OK: kokoro-install.sh is the SSoT for versions and deps -->bash scripts/kokoro-install.sh --install
This performs:
- Requires Apple Silicon (fails fast on Intel/Linux)
- Creates venv at
with Python 3.13 via uv~/.local/share/kokoro/.venv - Installs PyPI deps (mlx-audio, soundfile, numpy)
- Copies
andkokoro_common.py
from plugin bundle totts_generate.py~/.local/share/kokoro/ - Downloads Kokoro-82M-bf16 MLX model from HuggingFace (
)mlx-community/Kokoro-82M-bf16 - Writes
with mlx_audio version, backend, and model IDversion.json
Phase 2: BotFather Token Setup
Guide the user through Telegram BotFather to create a bot token:
- Open Telegram, search for
@BotFather - Send
, follow prompts (name + username)/newbot - Copy the HTTP API token
- Verify token:
curl -s "https://api.telegram.org/bot<TOKEN>/getMe" | jq .ok - Get chat_id by sending a message to the bot, then:
curl -s "https://api.telegram.org/bot<TOKEN>/getUpdates" | jq '.result[0].message.chat.id'
If a token already exists at
~/.claude/.secrets/ccterrybot-telegram, verify it works and skip this phase.
Phase 3: Secrets Storage
Store the bot token securely:
mkdir -p ~/.claude/.secrets chmod 700 ~/.claude/.secrets echo "BOT_TOKEN=<token>" > ~/.claude/.secrets/ccterrybot-telegram echo "CHAT_ID=<chat_id>" >> ~/.claude/.secrets/ccterrybot-telegram chmod 600 ~/.claude/.secrets/ccterrybot-telegram
Create
.mise.local.toml (gitignored) in the bot directory to load secrets:
# ~/.claude/automation/claude-telegram-sync/.mise.local.toml [env] _.file = "{{env.HOME}}/.claude/.secrets/ccterrybot-telegram"
Phase 4: Environment Configuration
Add Kokoro paths to
mise.toml:
# In ~/.claude/automation/claude-telegram-sync/mise.toml [env] section KOKORO_VENV = "{{env.HOME}}/.local/share/kokoro/.venv" KOKORO_SCRIPT = "{{env.HOME}}/.local/share/kokoro/tts_generate.py"
Phase 5: Shell Symlinks
Create symlinks in
~/.local/bin/ pointing to plugin shell scripts:
mkdir -p ~/.local/bin ln -sf <plugin>/scripts/tts_kokoro.sh ~/.local/bin/tts_kokoro.sh ln -sf <plugin>/scripts/tts_read_clipboard.sh ~/.local/bin/tts_read_clipboard.sh ln -sf <plugin>/scripts/tts_read_clipboard_wrapper.sh ~/.local/bin/tts_read_clipboard_wrapper.sh ln -sf <plugin>/scripts/tts_speed_up.sh ~/.local/bin/tts_speed_up.sh ln -sf <plugin>/scripts/tts_speed_down.sh ~/.local/bin/tts_speed_down.sh ln -sf <plugin>/scripts/tts_speed_reset.sh ~/.local/bin/tts_speed_reset.sh
Phase 6: Verification
- Generate a test WAV and play it:
~/.local/share/kokoro/.venv/bin/python ~/.local/share/kokoro/tts_generate.py \ --text "Hello, bootstrap complete." --voice af_heart --lang en-us --speed 1.0 --output /tmp/test-bootstrap.wav afplay /tmp/test-bootstrap.wav rm -f /tmp/test-bootstrap.wav
- Verify bot responds to /status via Telegram API:
curl -s "https://api.telegram.org/bot${BOT_TOKEN}/getMe" | jq .ok
TodoWrite Task Templates
Template: Full Stack Bootstrap
1. [Preflight] Verify Bun installed 2. [Preflight] Verify mise installed 3. [Preflight] Verify uv installed 4. [Preflight] Verify Python 3.13 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
passes all 6 checkskokoro-install.sh --health - Confirm
is gitignored.mise.local.toml - Test symlinks resolve correctly (
)ls -la ~/.local/bin/tts_*.sh - Verify bot token works via
API callgetMe - Run a full TTS round-trip: clipboard text to audio playback
- Update
with change descriptionreferences/evolution-log.md
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| uv not found | Not installed | |
| Python 3.13 not available | Not installed via uv | |
| 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 |
| kokoro-install.sh permission denied | Script not executable | |
| Venv already exists | Previous partial install | Run then |
| tts_generate.py not found | Bundle copy failed | Check exists in plugin |
Reference Documentation
- Kokoro Bootstrap - Detailed venv setup, Python 3.13 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
- Evolution Log - Change history for this skill
Post-Execution Reflection
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.