Skip to main content

dev-loop

Use after changing parser, web, or CLI code to see the change actually running, and before claiming any change works — covers the standalone rebuild flow, smoke verification, and the port/cache/worktree traps that repeatedly bite agents in this repo.

跳到安装

来源信息

仓库
cowcow02/fleetlens
最近来源活动
2026年7月15日 04:51
检测到的 SKILL.md 语言
英语
星标
4
分支
1

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
dev-loop
description
Use after changing parser, web, or CLI code to see the change actually running, and before claiming any change works — covers the standalone rebuild flow, smoke verification, and the port/cache/worktree traps that repeatedly bite agents in this repo.
# Fleetlens dev loop — build, run, verify ## When to use Any change to `packages/parser`, `packages/entries`, `apps/web`, or `packages/cli` that you intend to call done. A green typecheck is not a working feature: **exercise the real artifact and show the observed output.** For team-server changes use the `team-server-dev` skill instead. ## The loop ```bash cd <repo-root> # ALWAYS explicit — see "Worktree cwd drift" below # 1. Build the web standalone into the CLI's app dir rm -rf apps/web/.next packages/cli/app NEXT_OUTPUT=standalone pnpm build node scripts/prepare-cli.mjs # 2. Boot the bundled CLI (kill leftovers first; the port lingers) node packages/cli/dist/index.js stop lsof -ti:3321 | xargs kill -9 2>/dev/null node packages/cli/dist/index.js web usage # → http://localhost:3321/usage ``` Without `prepare-cli.mjs` the CLI silently serves the **old** bundle — if your change "isn't showing up", this is the first thing to check. ## Verifying - `pnpm verify` = typecheck + smoke tests against the **already-running** dev server (every route must return 200). Never rebuild just to validate — if smoke fails, the running server's logs tell you what broke; a rebuild only hides the evidence. - For UI changes, load the affected page and describe what you actually saw. For CLI changes, run the actual command and paste the real output. - `pnpm test` runs vitest across all packages. Team-server's suite needs a local Postgres with a `fleetlens_test` database (`createdb fleetlens_test` once); every other package passes without it. ## Traps (each of these has burned a session) - **Worktree cwd drift.** In a worktree, the shell's cwd can silently reset to the primary checkout after any `cd` away. Greps, seds, `git status`, and builds then run against the WRONG TREE and lie convincingly. Prefix every build/test/grep command with an explicit `cd <abs-worktree-path> &&`, and if a result is surprising, run `pwd` before believing it. - **Standalone cache.** The turbo `build` task keys its cache on `NEXT_OUTPUT`. If `apps/web/.next/standalone` is missing after a build, the env var wasn't set; `pnpm build --force` is the escape hatch if the cache ever misbehaves. - **Zombie server.** `fleetlens stop` + the `lsof` kill above before every boot. A stale server on old code is indistinguishable from "my fix didn't work". - **Root `pnpm dev` includes team-server**, which crashes the whole turbo run at boot without `DATABASE_URL`. Export the env (see `packages/team-server/README.md` → Local development) or run per-package dev commands.
在 GitHub 查看