Agent Skills › fmaclen/canutin › local-servers

local-servers

GitHub

管理本地开发服务器(Vite、PocketBase)的启动、停止及端口配置。定义工作区内的所有权规则,处理端口冲突,并支持通过 dev-link 将本地服务发布到 tailnet 供其他设备访问。

.agents/skills/local-servers/SKILL.md fmaclen/canutin

Trigger Scenarios

需要启动或停止 Vite/PocketBase 等本地服务 需要配置或读取本地开发端口 需要将本地服务发布到远程网络进行调试

Install

npx skills add fmaclen/canutin --skill local-servers -g -y
More Options

Non-standard path

npx skills add https://github.com/fmaclen/canutin/tree/master/.agents/skills/local-servers -g -y

Use without installing

npx skills use fmaclen/canutin@local-servers

指定 Agent (Claude Code)

npx skills add fmaclen/canutin --skill local-servers -a claude-code -g -y

安装 repo 全部 skill

npx skills add fmaclen/canutin --all -g -y

预览 repo 内 skill

npx skills add fmaclen/canutin --list

SKILL.md

Frontmatter
{
    "name": "local-servers",
    "description": "Local server ownership, ports, start\/stop rules, and publishing Vite and PocketBase to the tailnet"
}

Local Servers

Ownership

In a checkout under /.worktrees/ the slot's servers are yours: start, stop, and restart them as the work needs (fleet worktree-dev skill). Everywhere else, and for any listener whose process cwd is another checkout, the listener is the user's: reuse it if healthy, never stop it. bun run test starts and stops its own preview server; one left behind by a test run you started may be killed.

Ports

Read them from the checkout's .env (written by the worktree manager, see setup); without one these defaults apply:

  • Vite dev — :5173, VITE_PORT
  • Playwright's preview server — :42069, VITE_PREVIEW_PORT (falls back to VITE_PORT)
  • PocketBase — :42070, PB_PORT; PUBLIC_PB_URL is the URL the browser reaches it at

Commands

bun run dev       # Vite dev server
bun run pb        # PocketBase (compiles the Go binary on first run)
bun run pb:reset  # Wipe the PocketBase dev database

Publishing for another device

dev-link PORT proxies a loopback port to https://<host>.ts.net:PORT and prints that URL. The phone's browser reads PUBLIC_PB_URL, so publish PocketBase first and start Vite with its published URL:

set -a; source .env; set +a
bun run pb &
PUBLIC_PB_URL=$(dev-link "$PB_PORT") bun run dev &
dev-link "$VITE_PORT"   # the link to hand over

Vite listens on 127.0.0.1 with strict ports and accepts .ts.net hosts. worktree-done unpublishes both ports.

Version History

  • b491bd7 Current 2026-09-28 12:22

    简化了服务器所有权逻辑,明确区分工作区内外的控制权;新增 dev-link 命令说明以支持 Tailnet 发布功能。

  • 28eb754 2026-09-23 01:22

Same Skill Collection

.agents/skills/architecture/SKILL.md
.agents/skills/auth-system/SKILL.md
.agents/skills/code-quality/SKILL.md
.agents/skills/code-review/SKILL.md
.agents/skills/deployment/SKILL.md
.agents/skills/failure-discipline/SKILL.md
.agents/skills/failures-and-logs/SKILL.md
.agents/skills/frontend-design/SKILL.md
.agents/skills/issue-writing/SKILL.md
.agents/skills/pb-import/SKILL.md
.agents/skills/pb-migrate/SKILL.md
.agents/skills/pocketbase/SKILL.md
.agents/skills/realtime/SKILL.md
.agents/skills/setup/SKILL.md
.agents/skills/svelte5/SKILL.md
.agents/skills/testing/SKILL.md
.agents/skills/verify/SKILL.md
.agents/skills/commits-and-prs/SKILL.md

Metadata

Files
0
Version
b491bd7
Hash
3af1533c
Indexed
2026-09-23 01:22

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-28 17:42
浙ICP备14020137号-1