Subwave Worktree Dev logo

Subwave Worktree Dev

CommunityPopular
perminder-klair
subwave-worktree-dev

Stage a SUB/WAVE git worktree so the dev stack can run from it, then start it. A git worktree only checks out tracked files — the dev stack also needs gitignored files (controller/.env, web/.env.local, docker/.env, web/node_modules, and a state/ directory) that this skill copies or scaffolds from the main working tree. Use this skill whenever the user wants to test branch changes in a worktree, run subwave from a worktree, "prep"/"set up" a worktree for dev mode, or asks to copy env files / node_modules / state into a worktree — phrases like "test this worktree in dev mode", "start subwave from the worktree", "prep the worktree", "run my branch locally", "copy the required files into the worktree". Do NOT use it for the main checkout (that's subwave-control) or for production.

Overview

Publisherperminder-klair
Repositorysubwave
Skill namesubwave-worktree-dev
Stars
1.4K
Forks
122
Bundled files
3
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by perminder-klair on GitHub. Read the source before you install it.

Installation

Install the Subwave Worktree Dev AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/perminder-klair/subwave/tree/develop/.claude/skills/subwave-worktree-dev
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/perminder-klair/subwave.git /tmp/subwave
mkdir -p .claude/skills
cp -r /tmp/subwave/.claude/skills/subwave-worktree-dev .claude/skills/subwave-worktree-dev
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Subwave Worktree Dev in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Subwave Worktree Dev on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Subwave Worktree Dev is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

SUB/WAVE worktree dev setup

Get the SUB/WAVE dev stack running from inside a git worktree so branch changes can be tested without touching the main checkout.

Why a worktree needs prep

A worktree checks out every tracked file, so all source is already there. But the dev stack also depends on gitignored files that do not travel with a worktree checkout:

FileWhy the stack needs it
.envRoot .env — the controller's only env_file in dev compose (./.env), and compose's substitution source. ADMIN_USER / ADMIN_PASS / SITE_URL, plus NAVIDROME_* and LLM/TTS keys. Compose refuses to start without it.
controller/.envLegacy — nothing reads it. Older checkouts still keep NAVIDROME_* and API keys here; the script folds any key it has into the worktree's root .env (root wins, ICECAST_* skipped). Without that, the station boots with needsSetup: true and "could not reach http://navidrome:4533".
web/.env.localDev API/stream URL overrides (NEXT_PUBLIC_API_URL etc.). Without it the web UI defaults to same-origin /api and cannot reach the controller. Copied from main if present, otherwise written against $SUBWAVE_DEV_HOST (default localhost).
docker/.envCompose variable substitution (legacy — harmless to copy).
state/setup-config.jsonNavidrome creds the wizard saved on main. Without this the controller reports needsSetup: true and the player redirects to /onboarding on every load.
state/secrets.envCloud LLM / TTS API keys (if main has any). Sourced into the controller's process.env on boot.
state/settings.jsonOperator's full config — LLM provider/model, personas, shows, TTS. Without it the controller boots with default settings (llm.model = ''), every LLM call returns "fetch failed", and the new skills cannot run.
state/moods.jsonLibrary mood tagging produced by npm run tag (LLM walk over the whole library — expensive to redo per branch).
state/sfx.json + sfx/Sound-effects catalogue metadata + rendered WAVs the admin UI lists and liquidsoap mixes in.
state/jingles.json + jingles.m3u + jingles/Pre-rendered station idents. Liquidsoap reads the M3U with reload_mode="watch".
state/recent-plays.json24h play log — the picker and the library-deep-cut skill key off it for dedup.
state/sessions/Archived DJ sessions (the live one is regenerated on boot).
state/voice/Persona TTS reference voices (Chatterbox cloning refs, if any).
web/node_modulesNeeded by npm run dev.
state/Bind-mounted into the containers. A worktree's state/ is empty.

state/ is mirrored from main so the worktree boots into the same configured station — same LLM provider, same personas, same library moods, same jingles — ready to test branch changes against real data. Runtime state (queue.json, session.json, archive/, logs/, listeners.jsonl, now-playing.json) is not copied, since those would clash with what the worktree's own containers produce fresh on first boot. The broadcast container generates its own state/icecast-secrets.env on first boot, so worktrees never need to copy icecast config either.

Two load-bearing facts

  1. One stack at a time. Both compose files use fixed container names (sub-wave-broadcast, …) and host ports (Web 7700, Controller 7701, Icecast 7702). A worktree stack and the main-checkout stack collide — stop whatever is running before starting another.
  2. Controller changes need --build, web changes do not. The controller image COPYs its source at build time, so testing worktree controller code requires docker compose up -d --build. The web dev server (npm run dev) hot-reloads from the worktree filesystem, so UI changes appear with no build.

Workflow

Step 0 — Identify the worktree

The target worktree is usually the session's current directory. Confirm it is a linked worktree and not the main checkout:

bash
git rev-parse --absolute-git-dir          # a worktree's is <main>/.git/worktrees/<name>
git worktree list                         # shows the main tree + every linked worktree

If the user named a specific worktree path, use that.

Step 1 — Stop any running stack

Only one stack can run. Stop whatever is up (it may be the main checkout's):

bash
# Kill the web dev server if it holds :7700 — but only if it is `node`,
# never macOS ControlCenter/AirPlay.
WEB_PID=$(lsof -nP -iTCP:7700 -sTCP:LISTEN -t 2>/dev/null | head -1)
[ -n "$WEB_PID" ] && ps -p "$WEB_PID" -o comm= | grep -qi node && kill "$WEB_PID"

# Bring down whichever dev stack is up. The compose file lives at the
# checkout root (not under docker/); container names are global, so any
# checkout's docker-compose.dev.yml targets the running containers.
docker compose -f <some-checkout>/docker-compose.dev.yml down

Step 2 — Prep the worktree

Run the bundled script. It copies the env files, mirrors the operator's declarative state/ from main (settings, moods, sfx, jingles, sessions, voice), and runs npm install for the web app. <skill base directory> is the absolute path shown as "Base directory for this skill" when the skill loads.

bash
bash "<skill base directory>/scripts/prep-worktree.sh" <worktree-path>

Flags: --reset-state wipes and re-scaffolds state/ (use when the user wants a clean slate); --skip-npm skips the dependency install (use when node_modules is already good). The script is idempotent — re-running it only fills in what is missing, never overwrites a file the worktree already has.

If the user opens the player from another device (e.g. over Tailscale), pass that host as SUBWAVE_DEV_HOST=<ip> so a scaffolded web/.env.local points there, and start the web server with SUBWAVE_DEV_ORIGINS=<ip> npm run dev — Next dev blocks /_next/* for non-localhost origins otherwise.

If /state still reports needsSetup: true after boot, the root .env has no NAVIDROME_* and main had no state/setup-config.json — that is a fresh station headed for /onboarding, not a fault. Add the creds to the worktree's root .env and docker compose -f docker-compose.dev.yml up -d controller (env_file changes need a recreate, not a restart).

Step 3 — Start the stack from the worktree

Compose files now live at the worktree root (not under docker/):

bash
cd <worktree-path> && docker compose -f docker-compose.dev.yml up -d --build

--build is required so the worktree's controller source is baked into the image. The first build is slow (all services); later builds only rebuild changed layers. Then start the web dev server in the background (it is a long-running foreground process):

bash
cd <worktree-path>/web && npm run dev

Step 4 — Verify on-air

Give Liquidsoap ~5s to connect to Icecast, then probe the controller:

bash
sleep 5
curl -sf http://localhost:7701/health                               # expect {"status":"on-air"}
curl -sf -o /dev/null -w '%{http_code}\n' http://localhost:7700      # expect 200

If /health fails, peek at docker compose logs --tail=30 controller broadcast and surface the error. A fresh state/ is normal — an empty queue and default settings on first boot are expected, not faults.

Iterating

  • Web/UI change — nothing to do; npm run dev hot-reloads it.
  • Controller source change — rebuild just that service: cd <worktree-path> && docker compose -f docker-compose.dev.yml up -d --build controller.
  • liquidsoap/radio.liq change — it is bind-mounted in dev; just docker compose restart broadcast.

Allowed without confirmation

  • Running scripts/prep-worktree.sh (copies env files, scaffolds state/, npm install)
  • docker compose up -d --build / down against a worktree's dev compose file
  • npm run dev / killing a node process on :7700
  • Reading logs, curl health probes

Confirm before running

  • --reset-state when state/ already has real data the user may want
  • docker compose down -v (wipes volumes)
  • Killing a non-node process on :7700
  • Touching the main checkout's controller/.env, state/, or config

When NOT to use this skill / hand off

  • Main checkout, not a worktree → use subwave-control to start/stop.
  • Production (docker-compose.yml or docker-compose.byo.yml) → use subwave-control.
  • First-time repo setup, git pull + rebuild, jingle generation, config changes → use subwave-deploy.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Subwave Worktree Dev AI skill do?

Stage a SUB/WAVE git worktree so the dev stack can run from it, then start it. A git worktree only checks out tracked files — the dev stack also needs gitignored files (controller/.env, web/.env.local, docker/.env, web/node_modules, and a state/ directory) that this skill copies or scaffolds from the main working tree. Use this skill whenever the user wants to test branch changes in a worktree, run subwave from a worktree, "prep"/"set up" a worktree for dev mode, or asks to copy env files / node_modules / state into a worktree — phrases like "test this worktree in dev mode", "start subwave...

Why use Subwave Worktree Dev on TypingMind?

Because you install it once and use it with any model. Subwave Worktree Dev is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Subwave Worktree Dev in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/perminder-klair/subwave/tree/develop/.claude/skills/subwave-worktree-dev. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Subwave Worktree Dev?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Subwave Worktree Dev?

As many as you like. As long as a model supports skills, you can use Subwave Worktree Dev with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Subwave Worktree Dev AI skill free?

Yes. It is published on GitHub by perminder-klair under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇