dev

GitHub

用于启动本地开发环境,通过 dev-runner 管理 Docker 服务、端口分配及健康检查。解决多 worktree 并发时的端口冲突与基础设施所有权问题,确保开发环境稳定运行。

.agents/skills/dev/SKILL.md stella/stella

触发场景

需要启动本地开发服务器 配置多工作区并行开发环境 排查开发环境端口或容器冲突

安装

npx skills add stella/stella --skill dev -g -y
更多选项

非标准路径

npx skills add https://github.com/stella/stella/tree/main/.agents/skills/dev -g -y

不安装直接使用

npx skills use stella/stella@dev

指定 Agent (Claude Code)

npx skills add stella/stella --skill dev -a claude-code -g -y

安装 repo 全部 skill

npx skills add stella/stella --all -g -y

预览 repo 内 skill

npx skills add stella/stella --list

SKILL.md

Frontmatter
{
    "name": "dev",
    "description": "Launch the local dev environment using the project's dev-runner. The runner handles env symlinks, migrations, port allocation, and readiness checks; worktree infrastructure needs an independently owned offset."
}

Dev Server

Launch the local dev environment using the project's dev-runner (packages/scripts/src/dev-runner.ts). The runner handles env symlinks, Docker services, migrations, port allocation, and health checks.

Instructions

  1. Resolve application ports (dry run):

    Run the dev-runner in dry-run mode to learn which ports it will use. The runner hashes the canonical worktree path into a port offset, so multiple worktrees can run simultaneously and switching branches inside one worktree keeps its ports.

    bun run dev --dry-run --skip-install --no-browser
    

    If this exits before the runner starts with a missing-package or module-resolution error, run bun ci once and retry the exact same dry-run command. Do not treat other failures as bootstrap errors or retry them this way.

    Parse the numeric offset: and the web: and api: URLs. This offset covers application ports only; do not copy it into --infra-offset without the independent ownership check below.

  2. Resolve infrastructure ownership:

    Offset 0 belongs to the root checkout and its shared Docker project. A non-root worktree needs a stable non-zero offset whose Compose project and volumes belong to that worktree.

    Reuse a previously recorded assignment for the same canonical worktree path. For a new assignment, select from the full valid infrastructure range, reserve the candidate with a race-safe lock, and validate all five shifted ports (Postgres, Valkey, RustFS API, RustFS console, and Gotenberg). Reject the candidate if any of those ports intersects the dry-run web or API ports, or if any container or Docker volume already uses the corresponding stella-dev-<offset> project unless its Compose working-directory label matches this worktree. Probe another candidate on any ownership or port collision.

    The runner hashes application offsets into only 400 buckets and checks application ports separately. That hash is not an infrastructure ownership mechanism, and adjacent infrastructure offsets can overlap because RustFS uses consecutive ports.

  3. Start the dev runner:

    Launch the full runner in the background. It manages Docker services, env symlinks, db:push, process lifecycle, and readiness polling internally.

    bun run dev --no-browser --infra-offset <resolved-offset>
    

    Run this in the background. The runner exits if any child process dies, so a single background command covers everything. Keep dependency installation enabled on the first run. Add --skip-install only when this worktree is already bootstrapped and its dependencies have not changed.

  4. Handle cold-start setup safely:

    The first isolated run creates Docker volumes and applies every migration, so it can take longer. Never reset or repair the shared database to resolve migration drift. In a non-root worktree, confirm the command uses its owned non-zero --infra-offset; in the root checkout, keep offset 0.

    If the runner completes infrastructure and migrations but exits only because its application-readiness deadline elapsed, rerun the same command once. The expensive setup is cached. If the second run fails, inspect its logs and report the blocker.

  5. Use the runner's readiness result:

    Capture the live runner output and read the final summary for the exact web and API URLs. Infrastructure startup or another process can make the runner move away from the dry-run application offset, so never poll or report the preliminary URLs from step 1. The runner prints its final summary only after its bounded internal readiness checks pass; do not duplicate those checks or open a browser to verify them again.

  6. Report the resolved URLs and status to the user. Leave the runner active until the user asks to stop it.

版本历史

  • e41bf51 当前 2026-09-22 09:02

    修复端口偏移量绑定逻辑,改为基于工作区路径哈希而非分支名,并优化了健康检查失败时的错误输出信息。

  • dd81665 2026-08-16 07:08

    引入RustFS替代MinIO,增强多worktree基础设施偏移量的冲突检测与所有权验证机制。

  • 85792bd 2026-07-24 16:11

同 Skill 集合

.agents/skills/click-around/SKILL.md
.agents/skills/conventions-ai/SKILL.md
.agents/skills/conventions-db/SKILL.md
.agents/skills/conventions-i18n/SKILL.md
.agents/skills/conventions-ingestion/SKILL.md
.agents/skills/conventions-mcp/SKILL.md
.agents/skills/conventions-perf/SKILL.md
.agents/skills/conventions-scale/SKILL.md
.agents/skills/conventions-security/SKILL.md
.agents/skills/conventions-use-effect/SKILL.md
.agents/skills/conventions-ux/SKILL.md
.agents/skills/finish-pr/SKILL.md
.agents/skills/new-handler/SKILL.md
.agents/skills/open-pr/SKILL.md
.agents/skills/plan/SKILL.md
.agents/skills/product-deep-think/SKILL.md
.agents/skills/product-think/SKILL.md
.agents/skills/rabbit-round/SKILL.md
.agents/skills/regression-hunt/SKILL.md
.agents/skills/security-audit/SKILL.md
.agents/skills/update-deps/SKILL.md
.ai/local-skills/click-around/SKILL.md
.ai/local-skills/conventions-ai/SKILL.md
.ai/local-skills/conventions-db/SKILL.md
.ai/local-skills/conventions-i18n/SKILL.md
.ai/local-skills/conventions-ingestion/SKILL.md
.ai/local-skills/conventions-mcp/SKILL.md
.ai/local-skills/conventions-perf/SKILL.md
.ai/local-skills/conventions-scale/SKILL.md
.ai/local-skills/conventions-security/SKILL.md
.ai/local-skills/conventions-use-effect/SKILL.md
.ai/local-skills/conventions-ux/SKILL.md
.ai/local-skills/dev/SKILL.md
.ai/local-skills/new-handler/SKILL.md
.ai/local-skills/open-pr/SKILL.md
.ai/local-skills/plan/SKILL.md
.ai/local-skills/product-deep-think/SKILL.md
.ai/local-skills/rabbit-round/SKILL.md
.ai/local-skills/security-audit/SKILL.md
.ai/local-skills/update-deps/SKILL.md
.claude/skills/conventions-ai/SKILL.md
.claude/skills/conventions-db/SKILL.md
.claude/skills/conventions-i18n/SKILL.md
.claude/skills/conventions-ingestion/SKILL.md
.claude/skills/conventions-mcp/SKILL.md
.claude/skills/conventions-perf/SKILL.md
.claude/skills/conventions-scale/SKILL.md
.claude/skills/conventions-security/SKILL.md
.claude/skills/conventions-use-effect/SKILL.md

元信息

文件数
0
版本
e41bf51
Hash
9159cf77
收录时间
2026-07-24 16:11

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-22 10:37
浙ICP备14020137号-1