|
| 1 | +# /vibe-sing |
| 2 | + |
| 3 | +A Claude Code skill that ends your session with a song. |
| 4 | + |
| 5 | +Pipeline: **Claude Code session transcript → Gemini (mood translation) → Google Lyria 3 (music) → auto-play.** |
| 6 | + |
| 7 | +- `/vibe-sing` — 30-second clip (default) |
| 8 | +- `/vibe-sing pro` — ~2-minute full song |
| 9 | + |
| 10 | +## Why it isn't corny |
| 11 | + |
| 12 | +Both the transcript filter and the Gemini system prompt explicitly forbid references to programming, files, libraries, bugs, or anything technical. The output is a *cinematic mood prompt* — genre, instrumentation, tempo, feel — not a song about your session. A listener should never guess what you were working on. |
| 13 | + |
| 14 | +## Install |
| 15 | + |
| 16 | +Clone directly into Claude Code's skills directory: |
| 17 | + |
| 18 | +```bash |
| 19 | +git clone https://github.com/harajlim/vibe-sing.git ~/.claude/skills/vibe-sing |
| 20 | +cd ~/.claude/skills/vibe-sing |
| 21 | + |
| 22 | +# Python deps |
| 23 | +python3 -m venv .venv |
| 24 | +.venv/bin/pip install -r requirements.txt |
| 25 | + |
| 26 | +# API key — get one at https://aistudio.google.com/apikey |
| 27 | +cp .env.example .env |
| 28 | +$EDITOR .env # paste your GOOGLE_API_KEY |
| 29 | +``` |
| 30 | + |
| 31 | +Then in any Claude Code session, type `/vibe-sing`. |
| 32 | + |
| 33 | +> **Hacking on the source?** Clone anywhere and symlink instead: |
| 34 | +> `ln -s "$(pwd)" ~/.claude/skills/vibe-sing` — edits go live immediately. |
| 35 | +
|
| 36 | +## Configuration |
| 37 | + |
| 38 | +Env vars (set in `.env` or shell): |
| 39 | + |
| 40 | +- `GOOGLE_API_KEY` — required. |
| 41 | +- `VIBE_SING_GEMINI_MODEL` — defaults to `gemini-flash-latest` (auto-tracks newest Flash). Pin a version like `gemini-2.5-flash` if you want. |
| 42 | + |
| 43 | +Output mp3s land in `./generations/` (gitignored). |
| 44 | + |
| 45 | +## How it works |
| 46 | + |
| 47 | +1. Finds the JSONL transcript of the current session at `~/.claude/projects/<encoded-cwd>/<session>.jsonl` (picks the most recently modified — i.e. the live session). |
| 48 | +2. Extracts user prompts and assistant prose. Skips tool calls, tool results, thinking blocks, and system reminders. Up to ~100k tokens, tail-biased. |
| 49 | +3. Sends to Gemini with strict instructions: cinematic mood prompt only, no technical references, no specifics, no corniness. |
| 50 | +4. Sends Gemini's prompt to Lyria 3 (clip or pro). |
| 51 | +5. Saves the mp3 and `open`s it (macOS default audio player). |
| 52 | + |
| 53 | +## Files |
| 54 | + |
| 55 | +``` |
| 56 | +vibe-sing/ |
| 57 | +├── SKILL.md # instructions Claude follows when /vibe-sing fires |
| 58 | +├── run.sh # launcher (picks .venv/bin/python or system python3) |
| 59 | +├── vibe_sing.py # pipeline |
| 60 | +├── requirements.txt # google-genai, python-dotenv |
| 61 | +├── .env.example # template for your GOOGLE_API_KEY |
| 62 | +└── generations/ # output mp3s (gitignored) |
| 63 | +``` |
| 64 | + |
| 65 | +## Platform |
| 66 | + |
| 67 | +macOS (uses `open` to auto-play). Linux users: swap `open` for `xdg-open` in `vibe_sing.py`. |
0 commit comments