lerd-preflight
Run the full local verification gate for lerd before committing — build, test, vet, gofmt, UI tests, installer tests, then install the local build and smoke-test. Use before every commit or PR, and whenever asked to "verify", "check CI locally", or "make sure it's green".
- License 许可
- MIT
- 所属仓库
- lerd-env/lerd
- 最近更新
- 2026-11-11
- Stars
- ★ 1.5k
- Forks
- 97
01 前言 Front Matter
- name
- lerd-preflight
- description
- Run the full local verification gate for lerd before committing — build, test, vet, gofmt, UI tests, installer tests, then install the local build and smoke-test. Use before every commit or PR, and whenever asked to "verify", "check CI locally", or "make sure it's green".
02 资源文件 5
- 资产文件assets/module-help.csv112 B
- 资产文件assets/module.yaml96 B
- 脚本scripts/cleanup-legacy.py7.6 KB
- 脚本scripts/merge-config.py13.8 KB
- 脚本scripts/merge-help-csv.py6.5 KB
03 SKILL.md 正文
lerd preflight
Run the exact checks CI runs, locally, plus install + smoke. Stop at the first failure, report it plainly with the output, and fix before proceeding. Do not report "green" unless every step below actually passed.
1. Format (fastest signal)
gofmt -l . # must print nothing
If it lists files, run gofmt -w ., then re-check.
2. Build the UI only if it changed
If anything under internal/ui/web/ changed:
make build-ui
make test-ui # Vitest
Skip both if you only touched Go — the embedded dist/ is reused.
3. Go build, test, vet
CGO_ENABLED=1 go build ./cmd/lerd
CGO_ENABLED=1 go test ./...
CGO_ENABLED=1 go vet ./...
On macOS or a host without libayatana-appindicator, use the nogui path instead:
CGO_ENABLED=0 go build -tags nogui ./cmd/lerd (and go test -tags nogui ./...).
4. Installer tests, if install.sh changed
bats tests/installer/installer.bats
5. Install and smoke-test
make install # → ~/.local/bin/lerd, restarts lerd-ui/watcher
Then actually drive the affected surface — a CLI command, a UI page, an MCP call —
and observe the behaviour. A change with a runtime surface is not verified by
tests alone. For UI-only work, make install restarts lerd-ui; reload the
dashboard and exercise the changed view.
Rules
- Never
sudo. If a step needs privilege, ask the human to run it. - Never install anywhere but
~/.local/bin/lerd. - If a step is skipped (e.g. UI tests because the UI was untouched), say so explicitly rather than implying full coverage.
04 同仓库更多 Skills
lerd-hello
Greets lerd sites. Use when the user asks to greet a site.
lerd-open-pr
Draft and open a pull request the lerd way — issue-first, correct issue linking, human prose, none of the banned sections. Use when asked to open, prepare, or draft a PR for lerd. Never creates anything on GitHub without explicit per-action approval.
lerd-add-service
Add or edit a lerd service preset (database, cache, search engine, admin dashboard) as YAML in the lerd-services store. Use whenever the task is to add a new service, a new version of a service, or wire a service into projects — never add services in Go.
lerd-add-framework
Add or extend a lerd framework definition (a new PHP framework or a new major version) as versioned YAML in the lerd-frameworks store. Use whenever the task involves framework detection, per-framework workers, env wiring, doctor checks, custom commands, or scaffolding — never branch on a framework name in Go.