local-stack
БесплатноБез исполняемых скриптовНе проверенRun a regelrecht branch locally end-to-end (worktree + Docker stack + DB), with the workarounds needed when developing inside the dev container against Docker…
от NederlandseDigitaleDienst★ 30 звёзд на GitHubОб этом скилле
Local Stack
Spin up a regelrecht branch in a self-contained Docker stack so the user can test it from their browser. Works on any branch — a PR number is just a convenient way to look one up. Handles the quirks that show up when Claude Code is running inside the dev container against Docker Desktop on Windows.
Context: why this skill exists
just local (introduced in PR #274) assumes you run it on a host Docker daemon — when you run it from the dev container against Docker Desktop, three things bite:
- Bind mounts break for
prometheus+grafana. Docker Desktop's daemon doesn't see paths under/workspace/...(the dev container's filesystem); it silently creates empty directories at the mount source. The two services that bind-mount config files (./dev/prometheus.yml,./dev/grafana-datasource-local.yaml, the dashboards/alerting dirs) crash on start. The other services have no bind mounts. - Ports 7100-7300, 3000-3001, 8000 are already claimed by the dev container on the Windows host, so any
docker-composeports:mapping in those ranges fails with "port is already allocated". We use 18000+ instead (free on the Windows host, reachable from Windows). ~/.docker/config.jsonmay reference acredsStorehelper that doesn't exist inside this container (e.g.dev-containers-...). Even pulling a public image then fails witherror getting credentials - err: exit status 255.
Instructions
1. Parse argument
The argument is either:
- A branch name (anything containing
/or matching a local/remote ref) → use directly. - An integer → look up the corresponding PR's branch.
Action depends on the leading verb:
<arg>(no verb) → start the stack for that branch.stop <arg>→ shut down the stack (worktree kept).clean <arg>→ shut down and remove the worktree.
If the user invoked the skill without an argument, ask which branch or PR.
2. Resolve to a branch name
If the argument is a pure integer, treat as a PR:
gh pr view <N> --json number,title,headRefName,state,author
Confirm state == "OPEN" (warn but proceed otherwise). Use headRefName as the branch.
If the argument is a branch name, use it as-is. Verify it exists on origin:
git -C /workspace/regelrecht ls-remote --exit-code --heads origin <branch>
For stop/clean: if the worktree already exists at the predictable path, skip resolution and reuse the existing path; otherwise still resolve to derive the worktree directory.
3. (start only) Pre-flight: Docker credential helper
Read ~/.docker/config.json. If it has a credsStore field, run a quick public-image pull to test:
docker pull alpine:3 >/dev/null 2>&1
If that fails with error getting credentials, back up the file and reset:
cp ~/.docker/config.json ~/.docker/config.json.bak
echo '{}' > ~/.docker/config.json
Tell the user: "Reset broken Docker credsStore (backup at config.json.bak)."
4. (start only) Fetch + worktree
Per project AGENTS.md, always fetch before working with any branch:
git -C /workspace/regelrecht fetch origin <branch>
Derive a worktree slug from the branch: replace / with -, cap at ~40 chars. The worktree path is .worktrees/<slug>. Create it on the branch (not detached):
git -C /workspace/regelrecht worktree add .worktrees/<slug> -B <branch> origin/<branch>
cp -r /workspace/regelrecht/.claude /workspace/regelrecht/.worktrees/<slug>/
If the worktree already exists, reuse it but git -C <worktree> pull --ff-only origin <branch> to bring it up to date — abort if there are local uncommitted changes (the user may be mid-fix).
5. (start only) Pick free ports
Default ports: FRONTEND_PORT=18130, ADMIN_PORT=18180. Before using them, check they aren't held:
docker ps --format '{{.Ports}}' | grep -E ':(18130|18180)->'
If either is taken (e.g. another PR is already running), increment by 100 (18230, 18280, …) until a free pair is found. Record the chosen pair for the final URL output.
6. (start only) Bring up the stack
Skip prometheus and grafana (bind-mount issue — see Context). Start exactly the runtime services:
FRONTEND_PORT=<frontend> ADMIN_PORT=<admin> \
docker compose \
-f /workspace/regelrecht/.worktrees/<wt>/docker-compose.dev.yml \
-f /workspace/regelrecht/.worktrees/<wt>/dev/compose.local.yaml \
--project-directory /workspace/regelrecht/.worktrees/<wt> \
up -d --build postgres admin harvester-worker enrich-worker pipelineapi frontend
--project-directory is required when invoking compose from outside the worktree — without it, the compose project name collides with other PR worktrees.
The first build is slow (Rust release build for 5+ services, ~5-10 min on a clean cache). Run in the background and stream key events: Building, Built, Started, Healthy, Error, error:, failed, panic, unhealthy. If a build fails, surfac
Установить local-stack в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл local-stack?
Run a regelrecht branch locally end-to-end (worktree + Docker stack + DB), with the workarounds needed when developing inside the dev container against Docker Desktop. Accepts a branch name or a PR number. Subcommands: bare arg = start, `stop <arg>` = shut down, `clean <arg>` = shut down and remove worktree.
Как установить скилл local-stack?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл local-stack запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub