/lsfusion-ai-skills:lsfusion-devfrom lsfusion-ai-skills
Set up, run, and verify lsFusion applications locally on Windows. Use this skill whenever the user works with lsFusion in any way — writing or editing .lsf modules, scaffolding an lsFusion app, downloading the lsFusion server jar or client war, starting the lsFusion application server, diagnosing why the server won't start or a form won't open, or checking an lsFusion result in the browser. Triggers on "lsFusion", ".lsf", "start the lsFusion server", "write lsFusion code", "verify the form", and any request to create, launch, debug, or verify an lsFusion project. Use it even when the user only mentions lsFusion in passing and expects something runnable.
Ships in lsfusion-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Companion MCP server —
lsfusion-ai(ai.lsfusion.org, registered by thelsfusion-ai-skillsplugin). Callmcp__lsfusion-ai__lsfusion_get_guidancefirst in any lsFusion task (if its rules aren't already in context) and follow every rule it returns — the element order, the coding rules, and thelsfusion_report_feedbackconsent policy all live there. Confirm syntax withmcp__lsfusion-ai__lsfusion_retrieve_docsinstead of guessing. If these tools are missing, the server isn't installed — see the ai-skills README to add it.
This skill turns the current folder into a runnable lsFusion project: it checks
the environment, downloads the platform binaries, scaffolds the project,
launches the server, monitors startup, and verifies the result in a headless
browser. The current folder is the project root; .lsf source files live
under src/main/lsfusion/ (the standard Maven layout — see step 3),
and the platform binaries and runtime state live in a hidden .lsfusion-dev/
subfolder of the project root.
lsFusion has two processes, plus a database:
lsfusion-server-<ver>.jar. Runs the business
logic, talks to PostgreSQL, exposes RMI on port 7652, an HTTP Action API
on port 7651, and a WebSocket server on port 8887. Started with
java -cp ".;<jar>" lsfusion.server.logics.BusinessLogicsBootstrap.lsfusion-client-<ver>.war deployed in Apache Tomcat.
Serves the browser UI at the project's app-id context path —
http://localhost:8080/<app id>/ (the root / just redirects there) — and
connects to the application server over RMI (port 7652).A change to any .lsf file requires restarting the application server (the
web server does not need a restart).
.lsf codeDo not invent lsFusion syntax from memory. For any task that reads or
writes lsFusion code, use the MCP server (header note above) — this is
non-negotiable and the MCP itself enforces it: lsfusion_get_guidance first,
then lsfusion_retrieve_docs (query in English for best recall) for the exact
syntax and semantics of every construct, before writing or changing code.
lsfdev.ps1 CLIAll environment and runtime operations go through one PowerShell script.
Call it through its STABLE path — %LOCALAPPDATA%\lsfusion-dev\lsfdev.ps1,
i.e. C:\Users\<user>\AppData\Local\lsfusion-dev\lsfdev.ps1 — and through
no other path, with a bypassed execution policy so it runs regardless of
system settings:
powershell -ExecutionPolicy Bypass -File "C:\Users\<user>\AppData\Local\lsfusion-dev\lsfdev.ps1" <command> [options]
(Spell the path out — check/setup print it. %LOCALAPPDATA% expands
only in cmd; bash passes it literally, so there write the absolute path or
"$LOCALAPPDATA/lsfusion-dev/lsfdev.ps1"; in a PowerShell tool
& "$env:LOCALAPPDATA\lsfusion-dev\lsfdev.ps1" <command>, see below.) That
file is a tiny forwarder: it re-resolves the newest installed skill copy at
call time and forwards all arguments and the exit code. The plugin's
SessionStart hook installs and refreshes it at the start of every session
— so it exists before the first lsfdev call on a fresh install and is
re-pointed right after a plugin update — and every lsfdev.ps1 run
refreshes it too (check/setup print it). Put only that path in session
memories, notes and permission allow rules. The reason: when the skill is
installed as a plugin (the usual case), the real script lives under the
plugin cache at
C:\Users\<user>\.claude\plugins\cache\lsfusion\lsfusion-ai-skills\<ver>\skills\lsfusion-dev\scripts\lsfdev.ps1
— a path that embeds the plugin version and dies on every plugin update:
an allow rule or a remembered command pinned to it silently stops working at
the next update (a rule still pointing at …\0.1.0\… was found this way).
Shim missing? That happens only where the plugin's hooks do not run — a
harness without SessionStart hooks, or a project-local skill copy instead of
the plugin. Then run the real script once: this SKILL.md file's own
directory is the skill root — take the absolute path of the
scripts/lsfdev.ps1 next to it (quoted; the relative
.claude/skills/lsfusion-dev/scripts/lsfdev.ps1 holds only for a
project-local copy, under a plugin install it fails with "The argument …
does not exist", exit 127). That run creates the shim, and every later call
goes through the stable path. The examples below write the short form
lsfdev.ps1 <command> for brevity — it always means the stable path.
-ExecutionPolicy Bypass is required on a default Windows install: without
it PowerShell refuses to load unsigned .ps1 files with
UnauthorizedAccess: running scripts is disabled on this system. The flag
bypasses the policy for this one invocation only — it does not change any
system setting. Do not drop the flag to make permission prompts go away;
that breaks the script for everyone whose execution policy is not
RemoteSigned (the default on personal Windows machines is Restricted).
Got a dedicated PowerShell tool? Call the script in-process — no flag, no
classifier friction. Some harnesses (Claude Code on Windows among them)
expose a PowerShell tool whose host process already runs with the Process
execution-policy scope set to Bypass (check with Get-ExecutionPolicy -List). Inside such a tool, invoke the script directly:
& "$env:LOCALAPPDATA\lsfusion-dev\lsfdev.ps1" setup -DbPassword "<pwd>"
The .ps1 loads under the host's own policy — no powershell.exe child
process, no -ExecutionPolicy Bypass on any command line, so the auto-mode
classifier (below) has nothing to flag. A full session of lsfdev calls runs
this way without a single prompt (verified). Everything below about the
powershell -ExecutionPolicy Bypass -File … form applies when you only have
a generic bash/exec tool to work with.
Heads-up on the auto-mode classifier — prefer accept-edits from the start
(when spawning powershell.exe).
Claude Code's auto-mode classifier frequently refuses these invocations with
"Running PowerShell with -ExecutionPolicy Bypass tunnels around the execution
policy safety control". The verdict is non-deterministic — the same command
can be allowed on one turn and blocked on the next, and the classifier has
been observed citing Bypass even when the flag was absent. Because most
lsFusion sessions need many lsfdev.ps1 calls in a row (check → setup → start →
verify → restart …), getting blocked mid-flow is painful.
Recommend that the user switch to accept-edits mode (Shift+Tab) up front, before you start running lsfdev.ps1 commands. State this in your first reply when the user kicks off an lsFusion task. One-time toggle, no per-call prompts, and every subsequent invocation just works.
If the user prefers a persistent fix, an allow entry such as
Bash(powershell -ExecutionPolicy Bypass -File "C:\Users\<user>\AppData\Local\lsfusion-dev\lsfdev.ps1"*)
— the stable path spelled out exactly as the commands spell it (bash passes
%LOCALAPPDATA% literally, so a rule written with it never matches), never
the versioned plugin-cache path, which stops matching at the next update —
in .claude/settings.local.json also clears the classifier — but you cannot
add it yourself. The classifier blocks Claude from editing its own
permission config (including via the update-config skill) as
"Self-Modification of agent permission config". So if the user goes this
route, hand them the exact line to paste; do not call update-config and hope
it works.
Either way, the underlying PowerShell -ExecutionPolicy Bypass flag still
needs to stay — accept-edits / allow rules clear the classifier, not Windows'
script-execution policy.
Always double-quote Windows paths in lsfdev.ps1 arguments. Bash strips unescaped backslashes when it parses a command line, so
... lsfdev.ps1 setup -ProjectDir C:\Work\proj -DbPassword postgres
is delivered to PowerShell as -ProjectDir C:Workproj, and Resolve-Path
fails with "Cannot find path 'C:<cwd-name>\Workproj'" (PowerShell also
silently prepends the current working directory to the mangled relative
path, which makes the error message look unrelated to escaping). Quote every
path argument:
... lsfdev.ps1 setup -ProjectDir "C:\Work\proj" -DbPassword postgres
This applies to -ProjectDir, -DbServer, -Url, -Script, and any other
option that takes a path. Quoting forward-slash paths ("C:/Work/proj") is
fine too and avoids the issue entirely — pick whichever style you started
with and stay consistent within the project.
PowerShell quoting for -Do / -Click / -Script values: single quotes,
always. When a value carries double quotes, brackets or commas — attribute
selectors ([data-id="add item"]), JS for eval:, action scripts with
string literals — wrap it in single quotes:
... verify -Do 'click:[data-id="add item"]','fill:input[name="qty"]=>5'
Backslash-escaping the inner quotes (-Do "click:[data-id=\"add\"]") is a
bash habit that PowerShell does not share, and it never degrades gracefully
(all measured): the argument splits apart ("A positional parameter cannot
be found that accepts argument 'add]'"), a | in the value becomes a real
pipe ("The term ')' is not recognized"), and a comma in the unquoted
remainder aborts parsing outright ("Missing argument in parameter list").
The backtick form "click:[data-id=`"add`"]" also works; \" never
does. Three more PowerShell-isms: several -Do steps are one array
argument — -Do 'step1','step2' — repeating the flag (-Do a -Do b)
fails with "parameter 'Do' is specified more than once"; array
parameters arrive as a real array only from an in-process call
(& .\lsfdev.ps1 ...) or powershell -Command — powershell -File
passes 'a','b' as one literal string (precheck -Files tolerates
that by splitting on commas; multi-step -Do cannot, since steps
legitimately contain commas — use the in-process/-Command form); and
for api scripts with string literals or non-ASCII text, skip argv
entirely with -ScriptFile (same for -OpenScriptFile).
Pass -ProjectDir on EVERY call — don't rely on the current directory.
Without -ProjectDir the script uses the shell's cwd, and tool shells reset
their cwd between calls, so a bare lsfdev.ps1 verify that worked after a
cd earlier can later look at the wrong directory. The symptom is
"Project is not set up: no .lsfusion-dev\config.json under '<dir>'" on a
project that IS set up (the message names the directory it inspected — check
it first). This is purely path resolution: it is not caused by server state,
a running verify -Session browser, or anything else that happened before.
| Command | What it does |
|---|---|
check | Detect Java, PostgreSQL, Python, git, and Maven; report versions and what is missing. |
versions | List the lsFusion versions on the download server and the alias mappings. |
setup | Fetch the server jar, client war, and Tomcat into .lsfusion-dev/ (only what's missing / version-changed, plus the war on -RefreshWar — see note); write config + settings.properties. Safe to re-run anytime. |
start-server | Start the application server, tail the log, and report a verdict (started / failed / inconclusive). |
start-web | Start Tomcat with the web client; wait until the UI responds. |
start | start-server then start-web. |
restart | Restart the application server only (stop + start-server) and leave a running Tomcat alone — the web client reconnects to the new server by itself (measured: a form opened right after), so an .lsf edit costs one server start, not a Tomcat cycle on top. Tomcat is started only when it is not running. The command after editing .lsf files. -Web restarts Tomcat as well (after setup -RefreshWar or a changed -TomcatOpts/-WebPort — never needed for .lsf edits); -NoWeb neither touches nor starts it. |
stop | Stop the application server and Tomcat — of this project only (its pid files, and its ports only when the process carries the project's -Dlsfdev.project= marker). |
keep-running | Exempt this project from the session-end auto-stop (the plugin's hooks stop the servers a Claude session started ~60 min after that session's process ended without being resumed — see Servers, sessions and other processes on the box). -Off re-enables it. |
status | Show which processes/ports are up, plus Database: <name> (N connections) — the actually-observed DB binding (flags a mismatch for a running server); Auto-stop: OFF when keep-running is set. |
log | Print the tail of the server log and flag errors. |
verify | Playwright (headless Chromium) screenshot + DOM dump of the web UI into .lsfusion-dev/. -OpenScript "SHOW <form> WINDOW;" opens a specific form directly — no navigator clicking, parameterizable down to one object's edit card (→ verify-open.png, assert with -OpenExpect); -Click "<navigator text>" (chain with >) clicks into a form like a user, -DoubleClick "<cell text>" double-clicks that grid cell as a gesture and classifies what the platform did (opened form / in-place editor / no reaction; assert a card with -DoubleClickExpect); -Do "<verb:step>",... runs generic interaction steps by Playwright selector (click/dblclick/rclick/hover/drag/dnd/mouse/fill/type/edit/press/eval/wait/screenshot/assert-count/assert-text) — the way to drive CUSTOM/React components, real drag gestures and HTML5 drag-and-drop included (→ verify-do.png); -OutPrefix <stem> keeps per-form artifacts in a batch loop; -Session keeps a live browser between calls; -Url <base> (with -User/-Password) targets another web client. Strict exit codes (0 = every check passed, 2 = a check failed, 1 = tool error), a whole-run watchdog (default 180 s, -Timeout), classified failure diagnoses, uncaught page exceptions and custom-view failures called out, the web client's error-log delta on load timeouts. Short form in step 5, full contract in references/verify.md. |
open | Open the web UI in the user's default browser. |
api | Call the HTTP Action API via -Script "<code>" or -ScriptFile "<path>" (advanced verification / data seeding). Action code only — its /eval/action endpoint wraps the script in an action body, so declarations produce garbage parse errors; lint declarations with precheck instead. Use -ScriptFile (UTF-8) for any script with non-ASCII text. For a long-running action pass -Timeout <s> — it bounds the HTTP wait (default 30 s; 60 s when a large script is sent as a POST body); a client timeout is not a server verdict — the action keeps running and may still commit: check log / re-read state, never blindly re-run. Exit codes are trustworthy: 0 = HTTP success, 1 = request failed (HTTP error / connection refused), 3 = client timeout (no verdict — deliberately distinct from 1). |
precheck | Sub-second syntax + name lint of .lsf files against the running dev server (~30 ms/file). -Files 'a.lsf','b.lsf' (project-relative or absolute; default: every .lsf under src/main). Strips the MODULE/REQUIRE/NAMESPACE headers (line numbers preserved) and keeps PRIORITY — eval's wrapper supplies its own MODULE/REQUIRE, so the file's priority list applies as in the module, and the module's own namespace is put first in that list when the server has it loaded, so the own-namespace precedence applies too (NAMESPACE itself is stripped) — posts to /eval, and gives each file one of these verdicts: [OK] (eval compiled it — syntax and names proven), [FAIL] (a real error in the code: parse error, unknown name, unclosed META, missing header, a header out of order or duplicated, a PRIORITY listing the module's own namespace), [SKIP] (eval cannot check it — a limitation of the pre-check, never an error: a construct the eval module refuses such as CLASS / WHEN / CONSTRAINT, one that crashes its compiler such as EXTEND FORM, a name declared in another project file the server has not loaded, an all-META/EXTEND FORM file, a file declaring run()), [WARN] (an ambiguous name: eval's throwaway module REQUIREs every loaded module, the real module only its REQUIRE closure, where the name may be unique — never an error here, the full load decides), each [SKIP] / [WARN] followed by [NEEDS DRYRUN] — the full module loader checks it, and the summary prints the exact scoped dryrun -TopModule "…" command. The summary is red and the exit code 1 only for [FAIL]; a run whose only findings are pre-check limitations ends in [NEEDS DRYRUN] with exit 0 (exit 3 = no verdict, the endpoint could not be used). New-module code is mostly refused declarations, so iterate on the scoped dryrun there and keep precheck for files eval can fully check. See the precheck part of step 4. |
dryrun | Full-fidelity validation without starting anything — the inner loop for new code (scoped) and the gate before a restart. Launches the server JVM with -Dsettings.dryRun=true: every module in scope is parsed, metacode-expanded and name-resolved against its real REQUIRE graph — everything a restart checks at load time, EXTEND FORM and restart-only files included — then the JVM exits before the DB sync. Binds no ports (measured: zero listening sockets), opens no DB connection at all — no PostgreSQL needed — and never touches the running server, so it validates safely next to a live instance. -TopModule <M> (comma-separated list allowed — quote it) forces logics.topModule for the run, cutting the scope to the REQUIRE closure (measured: 772 → 11 modules = 9 s → 4 s). Exit 0 = OK, 1 = failed. See the dryrun part of step 4. |
Key options: -AppId (the project's short identifier = its db.name and
its web context path; see step 2), -DbPassword, -DbUser, -DbServer, -DbName, -Version
(7 — default; stable; dev/snapshot; or an exact tag — see below), -TomcatVersion, -TopModule, -RmiPort, -HttpPort,
-WebSocketPort, -WebPort, -ShutdownPort, -JvmArgs / -TomcatOpts
(extra JVM flags for the app server / Tomcat, persisted at setup — e.g.
-JvmArgs "-Duser.language=ru -Xmx4g"; on start/start-server/
restart/dryrun an explicit -JvmArgs is a one-shot for that run, not
persisted),
-NoDevMode (real auth for acceptance tests — see step 4), -Web
(restart: restart Tomcat as well — after setup -RefreshWar or a changed
-TomcatOpts/-WebPort, never for .lsf edits), -User /
-Password (the account verify logs in with and api calls as),
-FullStart, -TakeOverDb (start/restart: start on a database another
project last started — only on the user's say-so, see Database binding),
-RefreshWar (setup:
re-download the client war at the same version — the -SNAPSHOT
war↔server build-drift fix, see below), -Url, -OpenScript /
-OpenScriptFile / -OpenExpect (verify: direct form open), -Click,
-DoubleClick / -DoubleClickExpect, -OutPrefix (verify: per-run artifact filename stem — batch
runs keep per-form screenshots), -ViewportWidth / -ViewportHeight / -Locale (verify), -Script,
-Do (verify: generic click/dblclick/rclick/hover/drag/dnd/mouse/fill/type/edit/press/eval/wait/screenshot/assert-count/assert-text
steps by Playwright selector, first visible match — see
references/verify.md), -DoFile
(verify: -Do steps from a file — JSON array or one per line; survives
nested quoting), -AllowWarnings (verify: report-only exit 0 — by default
any failed check exits 2), -Session / -Reload / -EndSession
(verify: persistent browser between calls; -Reload forces a page reload in
it), -ScriptFile, -Timeout. Run the script with no command to print full
usage.
If port 8080 is taken (e.g. another Tomcat), pass setup -WebPort <free port>
— the skill rewrites Tomcat's server.xml accordingly, and every later command
reads the port from config. Run check/status to see port conflicts.
Every command returns as soon as it prints its verdict, so an oversized timeout costs no wall-clock by itself — but a very long timeout is one of the signals that gets a command reclassified as a background task (see the no-pipe note in step 4), so don't inflate it "just in case":
| Command | Tool-call timeout |
|---|---|
check / status / log / versions / api / open | default (120 s) |
api — long-running action (pass -Timeout <s>, it bounds the HTTP wait) | -Timeout + 60 s |
setup — first run (downloads ~400 MB) | 600 s |
setup — re-run (ports, DB, settings tweaks) | default |
setup -RefreshWar (re-downloads the ~250 MB war) | 600 s |
start / restart — routine edit→restart cycle (lightstart; restart touches the application server only, so it is the shorter of the two) | 300 s |
start-server — first start on this DB, or major-version upgrade (raise the inner -Timeout to 300 as well) | 600 s |
verify — first ever run (installs Playwright + Chromium, ~120 MB) | 300 s |
verify — later runs | 240 s minimum — the outer timeout must EXCEED the 180 s watchdog budget (-Timeout <s> changes it; keep outer ≈ budget + 60 s), or the outer kill fires first and eats the hung-step diagnosis. The command self-terminates on a hang and reports the hung step, so never park it in the background to "wait out" a hang |
dryrun | default (Maven compile / staging + a 4–10 s JVM phase even at 772 modules; the command's own watchdog kills hung runs, so the inner -Timeout rarely matters) |
Rule of thumb: outer timeout ≈ the script's inner -Timeout (default 180 s)
plus ~2 minutes of Maven/Tomcat overhead. Don't copy the 600 s ceiling from a
first-start invocation into routine restarts — recalibrate per call.
setup downloads are version-driven, not -Force-driven. Re-running
setup (with or without -Force) only fetches an artifact that is missing
or whose platform version changed — the single exception being the
explicit -RefreshWar switch (war only, same version; see below):
-Version bump, otherwise kept (the war also on
-RefreshWar)..lsfusion-dev/tomcat and re-run setup.)-Force regenerates config + settings.properties but does not re-download
binaries (delete the file to force a refetch). Before replacing Tomcat or the
war, setup stops a running Tomcat first, so an update can't fail on a
locked bootstrap.jar / exploded ROOT. Net effect: re-running setup to
tweak ports, DB, or settings is cheap and won't touch the ~400 MB of binaries.
The one refetch case that DOES arise on an unchanged version: -SNAPSHOT
build drift in Maven projects. Maven re-resolves the server jar over time
(pom change, mvn -U, snapshot update policy) while the war stays whatever
setup downloaded; war and server from different snapshot builds can break
RMI serialization, and every form open fails with invalid stream header. start-web / status / setup compare the two build dates
(zip entry stamps) and warn, naming the stale side; setup -RefreshWar
re-downloads the war at the same version (current snapshot build). Details:
references/runtime.md.
The application server uses three ports beyond the web port: rmi.port
(default 7652 — the RMI register the web client connects to), http.port
(default 7651 — the embedded HTTP server / Action API used by /eval,
/exec, the lsfusion-eval skill), and webSocket.port (default 8887 — a
WebSocket server the platform binds unconditionally at startup). To run
multiple instances side by side, give each project a disjoint set of all
five ports plus its own database, then setup once with those values and
start:
# instance A — defaults (7652 / 7651 / 8887 / 8080), app id names its DB + context
lsfdev.ps1 setup -ProjectDir "C:/Work/projA" -AppId proja -DbPassword <pwd>
lsfdev.ps1 start -ProjectDir "C:/Work/projA" # UI: http://localhost:8080/proja/
# instance B — shifted ports + its own app id/DB, runs concurrently with A
lsfdev.ps1 setup -ProjectDir "C:/Work/projB" -AppId projb -DbPassword <pwd> `
-RmiPort 7662 -HttpPort 7661 -WebSocketPort 8897 `
-WebPort 8091 -ShutdownPort 8006
lsfdev.ps1 start -ProjectDir "C:/Work/projB" # UI: http://localhost:8091/projb/
webSocket.port is the one everybody forgets, and the failure is silent:
a second instance left on the default still starts fine — but stderr gets a
java.net.BindException: Address already in use stack trace from
WebSocketServer, and that instance's WebSocket features just don't work. If
that trace shows up after bringing up a second server, shift webSocket.port
and restart. (debugger.port, default 1299, also exists but is bound only
when debugging — it doesn't collide in normal runs.)
You usually don't have to pick the numbers yourself: when setup runs with
no port flags and finds a default port already taken by a foreign process,
it derives a deterministic per-project port set from the project-path
hash (the same hash that names the database), probes that the whole set is
free, and persists it. Parallel agent sessions on one box thus land on
disjoint ports instead of all reaching for "default+10" and colliding —
explicit -RmiPort/... flags always override.
-RmiPort / -HttpPort / -WebSocketPort follow the exact same scheme as
the database settings: setup writes rmi.port / http.port /
webSocket.port into the project's settings.properties (right next to
db.*), and the server reads them natively at startup. So the ports live in a durable project file — not just
.lsfusion-dev/config.json — and survive a wiped .lsfusion-dev/, a fresh
clone, or any launch path. You can equally set them by hand-editing
settings.properties instead of passing the flags. start/restart/stop/
api read them back from settings.properties (config.json is only a
cache/fallback). start-web writes conf/Catalina/localhost/<app id>.xml
(the per-context descriptor, named after the deployed <app id>.war) with a
port <Parameter> so that project's Tomcat dials its own server's
rmi.port instead of the built-in default 7652. When hitting the Action API
for a specific instance, use that instance's http.port
(e.g. http://localhost:7661/eval/action).
Default ports (7652 / 7651 / 8887) are left implicit —
settings.propertiesonly carries them when non-default, exactly likedb.user/db.server. An explicitly passed flag (-DbName,-RmiPort, …) is written straight into the authoritativeconf/settings.propertieseven without-Force; a plain re-setupwith no flags preserves whatever the file already holds;-Forceregenerates the whole file. You can also just hand-edit the file.
Changing rmi.port / http.port on a running instance — stop FIRST.
stop (and restart's stop phase) finds the live server by the ports in the
current config. If you change the ports before stopping, stop looks for
the server on the new ports, misses the still-running old instance, and you
end up with a stale server holding the old ports (and the database). Always do:
lsfdev.ps1 stop # kills the server on the OLD ports
lsfdev.ps1 setup -RmiPort <new> -HttpPort <new> # rewrites conf/settings.properties
lsfdev.ps1 start # starts on the NEW ports
Do not use restart to change ports — its stop phase already reads the new
config. After the switch, the Action API moves with http.port (e.g.
http://localhost:<new http.port>/eval/action); the web port is unaffected.
Each instance needs its own app id — the id IS db.name, and two servers
pointed at the same database will fight over the schema. Distinct ids give
distinct databases (and the no--AppId fallback id is derived from the
project path, so distinct project dirs differ too); -DbName sets the name
explicitly when needed.
The file the server actually reads at runtime is conf/settings.properties
(in both Maven and non-Maven projects; in a non-Maven project the project-root
settings.properties is a human-readable mirror that setup and start keep
in sync). It is the source of truth: start / restart / stop / api
read db.name (and the other db.*, and the ports) back from it — exactly like
the port handling above — and config.json is only a cache. So a hand-edit of
db.name in conf/settings.properties is honored on the next start and is
never reverted from config.json by restart/start.
setup always persists db.name and never drops it on a re-run: a later
setup -Force (e.g. just to change a JVM flag) reads the current db.name
straight from settings.properties and writes it back verbatim — it does not
fall back to the per-project auto-name or the shared default DB, even if
.lsfusion-dev/ was wiped. setup -DbName <x> writes the new name into
settings.properties and config.json together (no -Force needed); to
repoint at a different database you must say so explicitly with -DbName.
Watch out for a repo-committed db.name: when a cloned project ships
conf/settings.properties with a db.name line, that committed value wins
over the per-project default — every clone of the repo then points at the
same database. setup warns when it first sees this; pass
setup -DbName <unique> -Force to give the instance its own DB.
Several Claude sessions routinely run sibling lsFusion projects at the same
time on one machine (C:\Test\projA and C:\Test\projB, an IDE-launched
platform server, …). Their JVMs look identical to yours — same jar, same
main class BusinessLogicsBootstrap / Bootstrap — and they die just as
easily. Rules that follow from real incidents:
java / powershell / chrome / python by name or by
command-line pattern — no Get-Process java | Stop-Process, no
taskkill /IM java.exe, no Where-Object CommandLine -match 'BusinessLogicsBootstrap'|'lsfdev'|'ms-playwright'. Every measured "the
server died mid-work" that was not a Windows reboot came down to a
neighbouring session doing exactly this: one session's "stop the BLB"
pattern kill took the app servers of two other projects down four times in
an hour (each time leaving their Tomcats up — the tell-tale signature),
and a "kill stray java" sweep killed a sibling's fresh server + Tomcat.
Stop only your project, only via lsfdev.ps1 stop / restart -ProjectDir <yours>: it kills its own pid-file processes and, on the
project's ports, only a process whose command line carries
-Dlsfdev.project=<that project dir> (every server and Tomcat JVM
lsfdev launches gets that marker; anything else is reported, not
killed). Need to know whose JVM something is? Read that marker from its
command line (Get-CimInstance Win32_Process -Filter "ProcessId=<pid>" | Select CommandLine) — never guess from the port or the age.start/restart launch the JVMs
detached through a short-lived hidden trampoline (their parent exits
at once, so a tree walk from the tool shell no longer reaches them —
measured: taskkill /T /F on the launching shell leaves both JVMs
running). Anything else you spawn from a backgrounded shell still dies
with it; and on plugin builds before 0.1.34, a TaskStop of a backgrounded
restart …; verify … command is exactly what took the server and Tomcat
down (measured 2026-08-17). Either way: keep start/restart in the
foreground (below) instead of parking them in background tasks.%TEMP%\claude-lsfdev-<session id>.txt, written by a PostToolUse
hook that recognizes the canonical lsfdev.ps1 start|restart -ProjectDir "<abs path>" call). When that session's CLI process ends, a SessionEnd
hook does not stop them on the spot: it schedules the stop for 60 min
later (LSFDEV_STOP_GRACE_MIN overrides; 0 = immediate) and cancels
it if the session is resumed — or a new session starts in the same
folder — before then. The desktop app suspends an idle session's process
(~15 min after the last turn, measured) and resumes it when the user comes
back, so "process ended" is a very poor proxy for "the user is done"; the
pre-0.1.34 hook stopped servers right there, which is how a server "died
silently" while its Tomcat lived on. If the stop does fire, the next
session start in that folder gets a one-line note saying so (what was
stopped, when, why, and the start command). Projects owned by another
live session are never touched, and `lsfdev.ps1 keep-running -ProjectDir
` exempts a project completely (`-Off` re-enables; `status` shows
`Auto-stop: OFF`). Servers started **outside** lsfdev (IDE, a hand-typed
java command) are invisible to the hooks. **Every hook decision is logged**
in `%TEMP%\claude-lsfdev-hooks.log` — read it before theorizing.
lsfdev.ps1 status (what is up now);
%TEMP%\claude-lsfdev-hooks.log (did the auto-stop fire?); the tail of
.lsfusion-dev/server.out.log (a JVM that was terminated stops mid-line
with no shutdown message; a graceful shutdown prints Server is stopping… — that is a Windows shutdown/logoff or a Ctrl+C, not a kill);
the last Change current time snapshots line (logged every 30 min — it
brackets the time of death); .lsfusion-dev/tomcat/logs/catalina.*.log
(Stopping ProtocolHandler = graceful stop of Tomcat too = the whole
machine went down — check the System event log for id 1074 / 42);
and, when only the app server died while Tomcat survived, the transcripts
of the other sessions on the box for the pattern kills above. Do not
"fix" it by killing anything, and do not invent WMI/Start-Process
workarounds around lsfdev — the servers are already detached from the
tool tree, and the hooks are the only thing that stops them by design.Work through these steps. Stop and tell the user if a step needs their input (for example a missing program or the PostgreSQL password).
Run check. It reports Java, PostgreSQL, Python, git, and Maven.
verify command — it drives Playwright.
Playwright itself (plus its bundled Chromium, ~120 MB) is auto-installed on
the first verify run. If Python is absent, verify is unavailable but the
rest of the skill still works.clone command — the first step when working with
an existing project hosted in a Git repository (see Working with an existing
project). Not required if you scaffold a
new project or run sources already on disk. If git is missing and the user
wants to clone a repo, ask them to install it.pom.xml at the
project root). When Maven is on PATH the skill builds with it and pulls
lsfusion-server straight from pom.xml (no jar download, exact dependency
graph). Without Maven the skill still runs such projects by staging the build
itself against the downloaded server jar — so Maven is recommended but not
strictly required, even for a pom.xml project. For a non-Maven project it
is not needed at all.Pick a short app id first — always pass -AppId on the first setup of a
project. When creating an application, choose a short identifier for it —
lowercase letter first, then letters/digits/underscores, ≤ 30 chars, e.g.
clinic for a clinic-management app — derived from what the app is (its
domain or project name), not from the folder path. This one identifier is
the project's db.name and covers everything downstream:
-AppId x is in effect a
validated -DbName x (pass one or the other, not both), anddb.name with no extra
key to keep in sync: the client war is deployed as <app id>.war, so the
UI lives at http://localhost:<web port>/<app id>/ (the root / serves a
redirect there).Tell the user which id you picked. If setup runs without -AppId, the skill
derives a fallback id from the folder name plus a 4-hex path hash (e.g.
clinic_3f9a), so two same-named checkouts still get distinct databases — but
a deliberately chosen id is shorter and nicer, so don't rely on the fallback
for a new app. The id is persisted as db.name in settings.properties (the
usual source of truth) and survives re-setups. Changing it later
(setup -AppId <new>) repoints BOTH the database and the web context: the
deployed war is renamed in place, but the data stays in the old database —
setup warns about this; if you only want to move the web context while keeping
the data, don't change the id. A db.name set via -DbName that is not a
valid context name (uppercase, dots, a stock Tomcat webapp name) is accepted
as the database name, and the web client then simply deploys at the context
root / as before.
You also need the PostgreSQL connection details. The defaults are server
localhost and user postgres. The PostgreSQL password is
installation-specific — ask the user for it if check could not connect, then:
powershell -ExecutionPolicy Bypass -File "C:\Users\<user>\AppData\Local\lsfusion-dev\lsfdev.ps1" setup -AppId <short id> -DbPassword "<password>"
setup downloads ~410 MB (server jar 146 MB, client war 251 MB, Tomcat ~12 MB),
so it takes a while — run it with a generous timeout and tell the user it is
downloading. The client war is moved straight into Tomcat as <app id>.war
(that war name is what makes the web context path /<app id>) and the download
is not retained, so only the server jar and Tomcat stay on disk. setup also
writes settings.properties and a starter .gitignore entry. Changing the app
id later renames the deployed war in place (no re-download) — and, since the id
is db.name, repoints the database as well.
Which lsFusion version. This skill targets platform 7 only — every
alias resolves within the 7.x line. Default to -Version 7 — the latest
7.x build on the download server. The 7 alias tracks the highest 7.x
available (currently 7.0-SNAPSHOT) and rolls forward to the 7.0 stable
release once it ships. Pick it when the user gives no version cue: 7.x
carries the newest platform behaviour the skill is tuned for (for instance,
headless verify relies on 7.0's automatic tooltip suppression).
Because the latest 7.x is a SNAPSHOT today, mention once to the user that SNAPSHOT builds can change daily, sometimes break, and may not be available through the apt installer used by deploy workflows. Don't switch tracks on your own.
Switch off the default only when the user clearly asks for it — e.g.
"stable", a specific 7.x tag (like 7.0-SNAPSHOT), or when the project
itself pins a version (its pom.xml parent declares a specific version, or
its README requires it). In that case pass -Version <alias-or-tag>. If the
cue is ambiguous, ask rather than guessing. If the pinned version is
outside the 7.x line, surface that to the user before setup — the skill
targets 7.x.
Which exact version each alias resolves to is not stable — it depends on
what the download server currently publishes. Always run lsfdev.ps1 versions
to see how 7, stable, dev, and concrete tags
resolve right now, before locking in a non-default choice. To switch later,
re-run setup with the new alias and -Force; the skill removes the stale
server jar and clears the init marker so the next start is a full one (fresh
stats and Reflection sync for the new platform's module set).
.lsf codeFollow the MCP rules above (guidance first, then a docs lookup per construct).
Default scaffold for a new from-scratch project. Use the standard
Maven-style directory layout that every existing lsFusion solution
ships with. The skill's runtime auto-detects this layout (with or without
Maven on PATH) and the deploy skill expects it too, so this is the path
of least surprise for everything downstream.
Create the following tree at the project root (where you run lsfdev.ps1):
<project-root>/
├── src/
│ └── main/
│ ├── lsfusion/
│ │ ├── <Project>.lsf # top module — only REQUIRE, no own code
│ │ └── main/
│ │ └── Main.lsf # first feature module — real logic lives here
│ ├── resources/
│ │ └── lsfusion.properties # logics.topModule = <Project>
│ └── java/ # (optional) Java action classes; create
│ # on demand when an .lsf needs INTERNAL
A bigger project just adds more sibling feature dirs under
src/main/lsfusion/ (accounting/, crm/, inventory/, …) and more
resources under src/main/resources/ (<Project>ResourceBundle.properties
for i18n, <Project>Icons.properties, images/, sql/, web/).
Browse any existing lsFusion solution repository to see a fully populated
example.
Why two .lsf files, not one. The top module's only job is to pull
everything else in via REQUIRE. It contains no classes, properties,
actions, or forms of its own. Adding a new feature later is then "create
feature/Feature.lsf → append , Feature to the REQUIRE list in
<Project>.lsf" — logics.topModule never changes, neither does the
deploy jar's lsfusion.properties, no -Force re-setup is needed, and
the user's modules stay organized as siblings instead of piling into one
growing file.
Default REQUIRE list for the top module. Always pull in these platform modules — they're small, broadly useful, and projects almost always need them later anyway:
Icon — icon vocabulary for forms / navigator entriesEval — evaluating lsFusion expressions at runtime (used by the /eval HTTP API, various dev/admin tools)ProcessMonitor — built-in dashboard for running threads/queries; invaluable when debugging stuck operationsBackup — built-in DB backup/restore actionsMinimal contents:
// src/main/lsfusion/<Project>.lsf — the top module. Wiring only.
MODULE Project;
REQUIRE Icon, Eval, ProcessMonitor, Backup,
Main;
// src/main/lsfusion/main/Main.lsf — the first feature module.
MODULE Main;
REQUIRE System;
// classes, properties, forms, navigator entries go here...
# src/main/resources/lsfusion.properties
logics.topModule = Project
After creating the tree, just run setup (or start if setup is already
done). The project's own lsfusion.properties sets the top module; you
don't need to pass -TopModule separately. If Maven is on PATH, the
skill switches to Maven mode automatically once you add a pom.xml; if
not, start-server stages the project itself — it copies
src/main/resources/** and src/main/lsfusion/** into target/classes/
(and javac-compiles src/main/java/** if present), then launches the
JVM with classpath target\classes;<server jar>. Both modes work
without any extra flags. Putting source roots and the project root
on the classpath together is deliberately avoided — lsFusion would
discover the same .lsf file through two paths and fail at startup with
"module 'X' has already been added".
If the user has existing .lsf files in the directory (cloned repo,
copied snippet, hand-written single file), use the project's own
structure as-is — don't restructure on top of an existing layout.
Run start (after later edits: validate first — see "Validate before
you restart" below — then restart). start-server tails the log and
returns one of three verdicts:
Server has successfully started. Good..lsf syntax, Java module access), and
restart.log to see more.
Don't bump the timeout to 10 minutes on principle — poll the log
frequently (every 10–20 s) instead; you'll catch a started/failed signal
earlier and you won't sit around when the startup actually takes 40 s.
Default -Timeout is fine; raise it only if you're explicitly working
around a long first-time schema sync (see the lightstart policy below).Exit codes are strict: only a confirmed healthy start exits 0 —
failed, inconclusive, a DATABASE MISMATCH, and a web client that
never answered HTTP all exit 1 (after printing their diagnostics), and the
combined start stops before Tomcat when the app server did not come up.
restart leaves a running Tomcat as it was either way, and its probe of
that kept web client afterwards is advisory: a [WARN] there does not
change the exit code (the application server did restart) — status
re-checks, restart -Web restarts Tomcat too. Automation can trust $LASTEXITCODE; an unknown command name also
exits 1. One nuance on start-web: exit 1 with the "STILL RUNNING" WARN
means readiness was not confirmed within -Timeout (honored in full,
default 180 s — there is no internal cap), NOT that Tomcat is broken — it is
left running and often finishes moments later; status re-checks cheaply.
The WARN names which of two shapes it is: "TCP connect OK, no HTTP
response" = the app is reachable and alive, just answering slowly — if
data recently grew, refresh PostgreSQL statistics first
(analyzeDBAction(), below) instead of hunting connector problems; "TCP
never connected" = the HTTP connector never bound.
War deploy (~15 s in catalina.log) is not readiness: the app answers its
first 200 tens of seconds after that on a loaded machine.
.lsf syntax errors surface here, in the server log. Read them carefully and
correct the code with help from lsfusion_retrieve_docs.
Dev-mode startup. By default the server starts with
-Dlsfusion.server.devmode=true plus the three drop flags
-Ddb.denyDrop{Modules,Tables,Properties}=false. The drop flags let the
schema sync remove modules/tables/columns that disappear from the
REQUIRE graph (or shrink when a platform upgrade ships a different
module set), instead of aborting startup with "Dropping modules /
tables / properties is restricted by settings"; production deployments
override these in their own settings.properties, and locally they stay
on regardless of the devmode switch below (local schemas legitimately
shift between runs). One side effect worth remembering: in devmode
lsFusion auto-authenticates as admin, so the web client opens directly
on the navigator and the login form never appears — both for the user's
browser tab and for the headless verify run.
That auto-auth means devmode cannot verify auth or roles — switch to
-NoDevMode for that class of checks. "Login/logout works" and "role X
is not offered form Y" are typical acceptance requirements for a business
app, and under devmode everything runs as the full-rights admin. To
exercise them:
restart -NoDevMode — devmode off for this run only (config
untouched); setup -NoDevMode persists the choice
(setup -NoDevMode:$false re-enables). With devmode off the web client
shows the real login form and the Action API requires
credentials.verify logs in through that form automatically; -User <login> -Password <pwd> picks the account (default admin / empty password) —
so "role X sees the right UI" is checked by verifying as that role's
user.api sends Basic credentials automatically when the server runs
devmode-off (same -User/-Password to call as a specific account) —
no 401 to debug.restart -JvmArgs "..."
applies extra flags to that run only; setup -JvmArgs "..." persists
them.Database binding is pinned and then verified — read the verdict. The
launch line also carries -Ddb.name (plus -Ddb.server/-Ddb.user/
-Ddb.password when set), mirroring the values resolved from
settings.properties; -D is the strongest resolution layer, so the server
provably lands on the reported database even if a settings-file layer is
mis-parsed (a BOM-damaged file, a platform regression — a real incident put
a project's data into the shared default DB lsfusion this way, where a
neighbour server's schema sync then wiped it, while ports from the same file
applied fine). After Server has successfully started, start-server checks
the actual connection through pg_stat_activity and prints
Database binding verified: … connected to '<name>' — or a loud
DATABASE MISMATCH. Treat a mismatch as stop-the-line: stop the server and
investigate before writing any data (runtime.md, "silently ignores
db.name"). status shows the same at a glance as Database: <name> (N connections); 0 connections under a running server is the same red flag.
Each start also records this project as the database's owner (a PostgreSQL
comment with the project path), and setup, every start and status check
it before the sync. When the database was last started by another
project (same -AppId, or a copied project folder) or another lsFusion
server on this machine is connected to it right now, start / restart
refuse to run (Not starting: database '<name>' is not this project's alone, exit 1; nothing is stopped, a running server stays up) — two logics
in one database drop each other's tables on every start. Give
this project its own database with setup -AppId <new id>; pass
-TakeOverDb only when the user confirms the other project may lose the
database. A database last started by an earlier setup of this same
folder (a reused folder with a new app inherits the old app's database)
or with tables but no owner record (a restored dump, one made by hand
or by an older skill version) only warns — expected after a restore or a
wiped .lsfusion-dev/, otherwise it explains objects that "came from
nowhere". Details:
runtime.md, "Is the database really this project's own?".
UI language. On a host with a non-English locale the system UI
(navigator, captions, validation messages) comes up in the host
language — the server JVM inherits the OS locale silently (verified
on a pl-PL host: Polish web UI, Polish log dates, Polish system captions;
the script-compiler [error] texts stay English, so errors give no hint).
setup, check and every server start print a warning with the fix
when the host locale is non-English and the JVMs don't pin one. The
resolution chain, strongest first:
setup -JvmArgs "-Duser.language=ru -Duser.country=RU" (then restart).setup -TomcatOpts "..." for
client-side strings (the connect/error pages come from this JVM, so
pin BOTH or the two halves speak different languages).Authentication.language — user-level localization;
setting language(u) <- 'ru' alone does not re-localize the system
captions, so don't stop there.verify -Locale ru-RU for matching screenshots).One thing the flags do not heal after the fact: system captions are
also persisted into the database (Reflection tables) during the
instance's first real use, and they keep that first language — restarts
never rewrite them (measured: a server switched to -Duser.language=en
shows an English navigator while caption(NavigatorElement) still answers
Polish; even a later -FullStart did not rewrite). The live UI is what
mostly matters, but if reflection-driven forms must match too, pin the
locale before the first start of a fresh database.
Lightstart: leave ON. Devmode enables -Dlsfusion.server.lightstart=true;
that's the default for every restart. Same code loads either way — lightstart
skips reloading user-side DB-stored UI prefs (table-view layout, security
policy) and the Reflection metadata sync: Reflection.Action /
Reflection.Property rows are not synchronized under lightstart, so anything
that references logic by canonical name (scheduler tasks — the platform
resolves the picked action via actionCanonicalName() — or reflection-driven
admin forms) silently gets NULL for actions/properties added since the
last full start; a scheduler task then saves with an empty action instead of
erroring. That is the one debugging case where -FullStart IS the fix: after
adding actions referenced by canonical name, run one restart -FullStart,
then return to lightstart. Otherwise don't propose -FullStart as a debugging
step — it's not a fix for "Property not found", schema drift, or compile
errors. Lightstart is forced OFF when the init marker is absent or was
auto-invalidated (first launch, platform version switch, the configured DB
had to be re-created, db.name repointed) and when -FullStart is passed.
Detail and rationale: see
references/runtime.md.
Polling, not waiting. A typical lightstart restart is 30 s – 1 min; a
full first-time start can take a few minutes. Either way, poll the log
every 10–20 s — don't -Timeout 600 and walk away. If a real long sync
is genuinely in progress, the log keeps printing real work and you can
extend the wait deliberately.
Run start/restart in the foreground — never pipe it through a filter.
start-server already polls the log itself and returns the moment it prints a
verdict (started / failed / inconclusive) — usually 10–40 s on a lightstart
restart — so the command's own stdout is your signal; it does not block for
the full -Timeout. Wrapping the invocation in a pipe or attaching a very long
timeout can make the agent's shell tool classify the command as long-running
and run it in the background. You then sit waiting for a task-completion
notification and polling status in a loop — pure dead time the command never
needed. Any pipe counts — | tail, | head, | grep, | Select-String,
| ForEach-Object — the filter you pick doesn't matter, the pipe itself does;
an observed failure mode is exactly restart | Select-String '===' going to
the background on a one-minute lightstart restart. There is nothing to filter
anyway: the output is already a compact verdict (the full java command line is
written to .lsfusion-dev/launch-cmd.txt, not echoed). Let it run in the
foreground and read the verdict it prints. If you really do want to background
a long first-time sync, do it deliberately (the shell tool's
run_in_background), not as an accidental side effect of a pipe.
One more reason to keep it out of background tasks: stopping a background
task kills that shell's whole process tree. The JVMs themselves are safe
since 0.1.34 (start/restart launch them detached — measured to survive a
taskkill /T of the launching shell), but a verify browser, a python
helper or anything else that command spawned is not, and on older plugin
builds a TaskStop of a backgrounded restart …; verify … took the app server
and Tomcat down with it (measured 2026-08-17). If a start did land in the
background, let it finish or read its output file — don't TaskStop it and
then wonder why the server is gone; the how-to-tell-what-killed-it checklist
is in Servers, sessions and other processes on the
box.
Refresh PostgreSQL statistics after a first start, a big schema change, or
mass data growth — call analyzeDBAction(). lsFusion emits large,
join-heavy SQL. Whenever PostgreSQL's planner statistics don't match the
data — a freshly-loaded dev DB, a sync that created/changed many tables, or
a lot of new rows since the last ANALYZE (bulk imports, API loads, or data
created through the app's own UI — no schema change needed) — form opens and
counts can crawl until autovacuum eventually catches up. The stale-data
variant is the treacherous one: the UI that opened instantly yesterday
suddenly takes minutes (measured: landing page 104 s → 0.7 s after ANALYZE),
start-web/status report "TCP OK but no HTTP response", and it is easy to
burn the diagnosis on hung connectors or leaked browsers — run this action
first when a working app suddenly slows down. The
platform ships a built-in maintenance action for exactly this:
analyzeDBAction() (from the system Service module — also callable as
Service.analyzeDBAction()), which runs PostgreSQL ANALYZE on the
server's own connection. This is not the same as lsFusion's
Recalculating stats and materializations at the first start log line —
that fills the platform's internal optimizer stat tables, which is
separate. Once the log shows Server has successfully started, call it once
through the skill's api command (devmode auto-authenticates):
lsfdev.ps1 api -Script "analyzeDBAction();"
Calling the action (rather than raw psql) works uniformly with no psql
client on PATH and no DB credentials to dig out. Skip it for ordinary
edit→restart cycles; it matters after the first full schema load, a sync
that touched many tables, or whenever data volume jumped since the last
run — regardless of whether the schema changed.
UTF-8 / non-ASCII pitfall. Put any non-ASCII script text (Cyrillic names, localized strings) in a UTF-8 file and pass
-ScriptFile— never inline via-Script(the Windows argv boundary mangles it to?before anything is sent) — and judge responses by the bytes of a saved file, not console output (console pipes fabricate mojibake that is not in the data). The transport itself is fine; mechanics and verified details are in the lsfusion-eval skill:lsfdev.ps1 api -ScriptFile "C:/Work/proj/.lsfusion-dev/seed.lsf"
Restart only for schema changes. For runtime data operations, use
lsfusion-eval — do NOT create a module and restart. A restart
exists to reload the schema: new classes, properties, forms,
actions, events, constraints, migration steps. Everything else —
seeding test data, running a one-off fix, ad-hoc count / lookup,
calling an existing action with specific arguments — is data, not
schema, and belongs on the running server.
Validate before you restart — and pick the inner loop by what the edit contains. A restart is the only way to apply new schema, but it's a slow way to discover mistakes: a failed restart costs 26–41 s, takes the app down, and reports one name error per cycle (parse errors do come batched). Two cheaper validators cover the discovery, with different reach:
dryrun. New modules are mostly schema
declarations — CLASS, persistent DATA, WHEN, CONSTRAINT,
EXTEND FORM, META — and those are exactly what /eval refuses to
load, so precheck answers [SKIP] + [NEEDS DRYRUN] there,
proving little (measured session: 15 new files, every one declaring a
CLASS → precheck caught ~nothing, while a scoped dryrun surfaced
the errors at ~4 s per run — parse and semantic errors batched, live
server untouched). For new code
dryrun -TopModule "<EditedModules>" is the inner loop — go
straight there instead of iterating on precheck.precheck. Computed properties,
actions, whole FORM declarations: ~30 ms/file beats seconds, and
names ARE checked — up to the first construct eval refuses: a CLASS
or TABLE anywhere in the file stops eval's first pass (names checked
nowhere), any other refused construct stops the main pass (names
checked only in the statements before it). The [SKIP] verdict says
exactly which line stopped it; the scoped dryrun is the loop then.Both paths converge on the same tail: an unscoped dryrun gate —
it covers what neither loop proved (REQUIRE completeness after a
clean precheck, dependents after a scoped run) — then one restart,
to apply.
precheck — the sub-second linter. It feeds each file to the
running server's /eval endpoint
(MODULE/REQUIRE/NAMESPACE headers stripped, PRIORITY kept, line
numbers preserved), which compiles it in a fixed
order (parse → EVAL-restriction → name resolution) in ~30 ms:
lsfdev.ps1 precheck -ProjectDir "C:/Work/proj" # all .lsf under src/main
lsfdev.ps1 precheck -ProjectDir "C:/Work/proj" -Files 'src\main\lsfusion\Invoice.lsf'
Read the verdict labels literally — they separate errors in the code
from limits of the check. [OK] = eval compiled the file (syntax and
names proven). [FAIL] = a real error: a parse error means bad syntax,
... is not found an element that does not exist (typo, or a REQUIRE
you have not added). [SKIP] = eval cannot check the file, or the
rest of it — a limitation of this pre-check, never a finding about the
code — and every [SKIP] is followed by [NEEDS DRYRUN], the loader
that does check it. [WARN] = an ambiguous name: eval's throwaway
module REQUIREs every loaded module, so a name that is unique inside
your module's REQUIRE closure can be ambiguous server-wide — the file's
PRIORITY and its own namespace's precedence are applied in the check, so
whatever they settle never shows up, and what remains is for the full load
to decide (a real ambiguity fails
there with the same message; fix it with PRIORITY <namespace>; in the
header or by qualifying the name). Never a [FAIL], [NEEDS DRYRUN]
follows, and names after that statement stay unchecked. Only [FAIL]
turns the summary red (exit 1); a run whose only findings are [SKIP]s /
[WARN]s ends in a [NEEDS DRYRUN] summary with exit 0 — do not read it
as broken code, run the printed command. (Exit 3 = no verdict at all: the
endpoint could not be used.)
What produces a [SKIP], and how much was still proven (all measured):
CLASS, TABLE, INDEX,
DATA … NONULL / MATERIALIZED / TABLE, WHEN, ON, CONSTRAINT,
=>, <- … WHEN, AGGR, GROUP … : <parent from another module>,
… IN <group of another module> — answered ... cannot be used in EVAL module / ... is forbidden in EVAL module. The restriction is
thrown, so eval stops right there, and where decides the coverage:
CLASS and TABLE are refused in eval's first pass — syntax is
proven only up to that line, names nowhere (a name error on line 1 goes
unreported with a CLASS on line 2, a parse error on line 2 with a
CLASS on line 1); everything else is refused in the main pass,
which runs only after the whole file parsed clean — syntax proven for
the whole file, names only in the statements before that line. The
verdict names the line and the construct.EXTEND FORM,
EXTEND CLASS, DESIGN / NAVIGATOR edits of existing elements,
+ { } / += implementations of an existing ABSTRACT — an internal
exception with a Java stack instead of the polite error. Not a verdict
on the file (a + { } on a non-abstract target is a genuine
... is not found at a full load too, and stays [FAIL]).is not found is a cross-file reference, not an error — precheck
harvests every top-level declaration under src/main to tell the two
apart.@-instantiations / EXTEND FORM
(see below) and a file declaring run() (eval would execute it).One blind spot the other way: eval's throwaway
module depends on every loaded module, so a name your file uses
without the matching REQUIRE still resolves — an incomplete REQUIRE
list surfaces only at restart or dryrun (which checks the real
REQUIRE graph — see below). Its other structural difference: the file's
own declarations live in a private namespace, so an overload set spanning
several modules of one shared namespace — your file overloading a name
another module of that namespace declares with a different signature — is
not reproduced, and a ... is not found on such a call is one for the
full load to judge. The run summary prints the exact scoped
command — dryrun -TopModule "<the skipped modules>" — covering every
[SKIP] / [WARN] in one go (one exception: a headerless run() eval
probe is not a module, cannot be dry-run, and keeps only its [SKIP]). A
PASS can still carry a narrow caveat worded per file — META bodies nothing
in the file instantiates, or a namespace the server could not confirm (the
module's own namespace outranks its PRIORITY list at load time; precheck
reproduces that by putting the namespace first in the list when the server
has it loaded) — those don't trigger the hint.
Know the restart-only file class — precheck names it upfront. A file
that is entirely META definitions / @-instantiations / EXTEND FORM
(the typical extension/main module) gets zero eval coverage — precheck
answers [SKIP] + [NEEDS DRYRUN] immediately instead of a hollow
PASS, checking just the structure: MODULE header, META/END balance (an
unclosed META is a hard [FAIL]: it swallows the rest of the file at
restart) and bracket balance (a warning). Plan the loop around the truth:
for such a file, only a full load checks it — dryrun (below) does
that in seconds without touching the live server, the restart does it
while applying the schema; don't spend cycles re-running precheck there.
Files that merely declare META next to other code are linted normally,
with the caveat that un-instantiated META bodies stay unchecked until a
full load.
Do not use api for any of this: its /eval/action
endpoint wraps the script as an action body and any declaration dies
with misleading wrapped-brace parse errors. The lsfusion-eval skill's
"Syntax-checking .lsf without a restart" has the phase table and the
raw-curl form for remote servers.
dryrun — the full-fidelity check without starting anything; for new
code, the inner loop itself. It launches the server JVM with
-Dsettings.dryRun=true: the whole logic —
modules, classes, properties, actions, forms — is parsed,
metacode-expanded, name-resolved and finalized exactly as at a restart,
then the JVM exits before the DB sync instead of starting services.
Exit code 0 = the logic loads; 1 = it does not (every error, with
file:line:col, is printed). Every load-time blind spot of precheck is
covered (all measured): names resolve against the file's real
REQUIRE closure, so an incomplete REQUIRE list fails here;
EXTEND FORM, () + { } overrides, META instantiation — the whole
[SKIP] class — get real checking; and, unlike a restart, semantic
errors come batched too (dryRun implies batchScriptErrors: three
planted name errors across two modules all reported in one run), so fix
everything it lists before re-running.
lsfdev.ps1 dryrun -ProjectDir "C:/Work/proj" # whole project
lsfdev.ps1 dryrun -ProjectDir "C:/Work/proj" -TopModule Invoice # one subtree
What makes it different from a restart (all measured):
.lsfusion-dev/dryrun-classes) so
target/classes is never wiped under a live server; in Maven mode the
incremental mvn compile does refresh target/classes — the same
thing an IDE build under a running server does.-TopModule <M> limits the checked scope to M's REQUIRE closure
(plus system modules) by forcing logics.topModule for that run only —
the project's lsfusion.properties is not touched. The value may be a
comma-separated list (-TopModule "Sales,Purchase" — quote it so
PowerShell passes one string); the union of the closures is checked. On
the measured 772-module project the closure of a leaf module was 11
modules and the JVM phase dropped from ~9 s to ~4 s. Two hard caveats,
both measured: modules outside the closure are not checked at all
(not even parsed), and
dependents of the listed modules are not checked either — a
signature change that breaks M's callers only surfaces in a full dryrun
(or the restart). So scope iteration to the module you edit, but keep
the unscoped dryrun as the gate before the restart. The flip side
helps new code: a scoped run checks a brand-new module even before
it is wired into the top module's REQUIRE — under a configured
logics.topModule (the standard layout) the unscoped run, like the
restart, loads only that closure and silently skips such a module,
which is also why precheck's summary always suggests the scoped list
(with no topModule configured, every classpath module loads instead). Never write
settings.dryRun or a forced topModule into settings.properties /
lsfusion.properties — a server started with dryRun just exits, and
a persisted narrow topModule would make a real start drop the
out-of-closure modules' tables at schema sync. lsfdev passes both as
per-run -D flags only.
When to reach for dryrun: as the inner loop for new code (scoped
with -TopModule to the edited modules — a failed scoped run costs
seconds and nothing else); for every [NEEDS DRYRUN] precheck
prints (EXTEND FORM / all-META modules, refused constructs, cross-file
names), where precheck proves little to nothing; to catch a missing
REQUIRE precheck structurally cannot; as the gate right before a
restart (a failed restart costs 26–41 s and downtime; a failed full
dryrun ~10–40 s and nothing else); and for CI-style "does this branch
even load" checks — that box needs no PostgreSQL at all. precheck
keeps its edge where eval genuinely checks names — property/action/FORM
files with no refused construct anywhere in them, ~30 ms
per file — and its structural [FAIL]s (unclosed META) are instant.
Treat it as a fast probe, not a gate: the moment it answers [SKIP] /
[NEEDS DRYRUN], the next step is the dryrun command its summary
prints, not another precheck round — and never read that summary as a
failure of the code.
Web resources (JS / CSS / images) need NO restart — the next page load
picks up a changed file; browser cache is NOT a factor. The server reads
CUSTOM-component .js/.jsx/.css (registered via onWebClientInit,
or auto-loaded from web/init/) and other web assets from its
classpath — the first match in classpath order, normally the staged
copy under target/classes/, not your source file — keeps the bytes in
memory, and a watcher on every classpath directory drops that copy the
moment a file there changes; the next page load then gets the new bytes
under a new content-hash URL (/file/dev/...?version=<hash of the bytes>
in devmode, /file/static/... with devmode off; served
Cache-Control: no-store on top), so the browser cannot hold a stale
copy. Two kinds of asset live elsewhere and change only with a restart:
the IMAGE 'x.png' icons of navigator elements, actions and containers
(read once into the server's image cache, which that watcher does not
touch), and — with devmode off only — the login-page resources of
onLoginInit (the web client caches the server settings that carry them;
restart -Web refreshes them). What carries your edit into
target/classes is a second,
devmode-only watcher that mirrors file changes under
src/main/resources/** and src/main/lsfusion/** into the build directory
— every file with an extension other than .lsf; extension-less names,
~ backups and .tmp.<hex> editor temp files are skipped — active only
while that Maven layout exists, i.e. at least one of those two source roots
next to target/classes, which is exactly the layout start-server
builds target/classes from (measured: a saved .css or .jrxml is in
target/classes within seconds). start-server / restart print which
case you are in (Source mirroring ON / OFF). Four gaps: a flat
project (loose .lsf files in the project root) stages only those
.lsf/.properties — no web resource or .jrxml reaches the classpath at
all — so move the WHOLE project to the Maven layout (.lsf →
src/main/lsfusion/, lsfusion.properties and web assets →
src/main/resources/; creating either source root switches the root-file
fallback off, so a half-moved project loses its modules); with devmode
off (-NoDevMode) nothing is mirrored — edit the staged copy under
target/classes/ (picked up on the next load; a non-Maven restart wipes
and re-stages target/classes from source, while Maven's incremental
mvn compile keeps a staged file that is newer than its source and the
staged copies of sources you deleted or renamed — stop the server, mvn clean, start to reset it) or restart; and a folder
created after the server started is neither mirrored nor watched (a
folder name has no extension) — the first file of a new web/init/ needs
one restart; and compiled web sources (src/main/web/**, bundled by
the platform parent POM's web-compile plugin into web/.compiled/*.js
and .css at build time) are not mirrored at all — in Maven mode a
restart rebuilds them (mvn compile), and the non-Maven staging never
compiles them, so such a project needs Maven on PATH. So after editing
a copied file, do not restart — reload
the page: a default verify starts a fresh browser (always a reload); a
verify -Session deliberately does NOT reload the live page — pass
-Reload, or re-run your -OpenScript (it re-navigates anyway; see
references/verify.md). If an edit "doesn't apply",
check, in this order, and never the browser cache: whether the file is on
the classpath at all and which copy you edited (mirroring OFF: only the
classpath copy counts, normally target/classes); whether the copy in
target/classes already equals your source — the mirror is asynchronous
(seconds), and a copy that failed is logged once in the server log as
FilesChangeWatcher processFile error and not retried, so save the file
again; whether the page was actually reloaded; whether the file sits in a
folder created since the last start. Apart from that new-folder case, a
restart is only needed when you also changed the .lsf side (e.g.
the CUSTOM 'name' declaration, new form properties/actions the JS calls,
the onWebClientInit registration itself) — that's schema. Pure JS/CSS
iteration is a reload loop of seconds, not a 30 s restart loop.
Report templates (.jrxml) follow the same rule — NO restart.
JasperReports templates are read from the classpath at print time (the
bytes are not cached), so the next PRINT — not a page reload — uses the
edited template, via the same mirroring: in devmode with the Maven layout,
editing src/main/resources/<name>.jrxml is enough (give the mirror its
seconds); with devmode off edit the staged target/classes/<name>.jrxml
and re-print, then copy the finished layout back into your source tree
(the staged copy is not the source of truth: a non-Maven restart
overwrites it, Maven's incremental compile keeps whichever file is newer);
a flat project stages no .jrxml at all.
The lsfusion-eval skill talks to the live server's HTTP endpoints
(/exec, /eval, /eval/action) and accepts arbitrary
NEWSESSION { NEW … APPLY; } scripts. The same script that you'd put
inside an action body runs there directly. No .lsf file, no top
REQUIRE entry, no restart cycle — round-trip is sub-second instead of
30+ s.
Signs you are about to make this mistake: a TestData.lsf / SeedData.lsf
/ Migration001.lsf module written to be called once; a top-REQUIRE
entry the production config will never want; work shaped like "create N
rows / set property X", not "introduce a class / property / form". In all
three, stop and switch to lsfusion-eval — one-shot data manipulation
should never leave a trace in the codebase (a permanent module is for
actions the application genuinely needs later: admin tools, importers,
scheduled jobs).
Once status shows both processes up, always verify in this fixed order
— cheapest, most diagnostic check first, expensive end-user check last.
Don't lead with the UI; that's like running an integration test before
checking the unit-test output.
Server log — first, always. lsfdev.ps1 log (or read the tail
already printed by start-server / restart directly). It tells you
whether schema sync ran, whether modules/tables were dropped, which
platform version actually loaded, and surfaces any silent
WARN/ERROR lines. Both API and UI depend on these — if the log
shows a failure, nothing further will work, and you'll waste time
debugging the wrong layer if you start with screenshots.
HTTP Action API. Once the log is clean, run an lsFusion expression
over /eval/action — via lsfdev.ps1 api (or the lsfusion-eval
skill). The server resolves names, types, and security exactly as the
app would, so a clean response proves your new class / property / form
really exists in the running schema. Cheap, scriptable, exact — and
tells you semantic truth without rendering. If the response or the
script carries non-ASCII text, see the UTF-8 / non-ASCII pitfall
note in step 4 (use the api command / -ScriptFile, not a raw curl
POST body).
Reading values back and confirming mutations has sharp edges — the
canonical recipes are in the lsfusion-eval skill ("Getting values
back", "Chaining and verifying"). In short: RETURN <expr>; sends a
scalar back in the response body (for several values give each its
own column of RETURN JSON FROM a = ..., b = ... rather than
concatenating one string — + propagates NULL, so one NULL operand
blanks the whole body, while a NULL column just drops out of the JSON;
don't answer with a bare EXPORT — it reaches the body only when the
action has no RETURN with a value, and is lost in NEWSESSION /
after APPLY), a
plain MESSAGE is visible nowhere over HTTP (not in the response
and not in the server log — only MESSAGE ... NOWAIT leaves a
Server message: log line), and a constraint-canceled APPLY
returns the same empty 200 as success — so end every mutation script
with a self-check, e.g.
APPLY; IF canceled() THEN RETURN 'CANCELED: ' + (OVERRIDE applyMessage(), 'no message'); RETURN 'OK';.
The api command adds two safety nets of its own: it prints a
recipe hint whenever the body comes back empty (the full
explanation once per session, a recipe one-liner on later calls), and it
tails the server log for Server message: lines after every call —
which surfaces MESSAGE ... NOWAIT output and the constraint text a
canceled APPLY logs, but cannot rescue a plain MESSAGE (no
NOWAIT → no log line → nothing to tail; use RETURN for
anything you need to read back).
The Server message: log line is a no-client-context behavior — not a
property of NOWAIT. The platform logs a message only when the action
runs with no interactive client attached (Action API calls, scheduler
tasks). The same action triggered from a live UI — a form button, a
custom-view controller callback — delivers MESSAGE, NOWAIT included,
to that client's browser and writes nothing to the server log:
instrumenting a UI-triggered action with MESSAGE ... NOWAIT and then
tailing the log is a measured dead end (the toast pops in the user's
browser, the log stays silent). To trace an action that runs from the
UI, write into a DATA property and apply it in a separate session —
NEWSESSION, not NESTEDSESSION (a nested session's APPLY copies
changes back into the form's session instead of the database) — so the
trace persists immediately without committing the user's own pending
form changes:
diag = DATA STRING ();
// inside the action under test (OVERRIDE keeps the entry when x is
// NULL: string + propagates NULL, and CONCAT skips a NULL operand -
// the trace would silently record nothing):
NEWSESSION { diag() <- CONCAT ' | ', diag(), 'reached A, x=' + (OVERRIDE STRING(x), 'null'); APPLY; }
then read it back any time with lsfdev.ps1 api -Script "RETURN MyModule.diag();" and reset with NEWSESSION { MyModule.diag() <- NULL; APPLY; } — namespace-qualify the property in API scripts, they resolve
names across every loaded module. Two caveats: (1) inside NEWSESSION
property reads see a fresh session, not the form's uncommitted
changes — parameters (like x above) carry their values in, so pass
whatever you need to log as a parameter or bake it into the string
beforehand; (2) the isolation holds only outside an apply
transaction — when the instrumented code runs inside apply events or
constraints, the platform defers the NEWSESSION body into the outer
APPLY, so the trace shares that apply's fate and vanishes if it is
canceled (readback stays empty even though the code ran).
UI, last. When log + API agree the build is healthy, check the
UI. The workhorse is verify — it runs in every agent harness
(terminal CLI, desktop app, subagents, CI) because it needs no in-app
browser. Its full contract — every option, the -Do step verbs, the
diagnosis lines, the watchdog, -Session, -Url, the in-app browser
rules — is in references/verify.md: read it
before the first run that uses -Do, -DoubleClick, -Session or
-Url, and whenever a run fails. The short form:
verify drives a headless Chromium (via Playwright): it screenshots
the landing page (verify-login.png), logs in when a login form is
present (devmode off; -User/-Password, default admin/empty →
verify-app.png), and dumps the DOM (verify-dom.html) and the
browser console incl. uncaught page exceptions (verify-console.txt)
into .lsfusion-dev/. In devmode there is no login form. The first
run installs Playwright + Chromium (~120 MB, once).
Open the form under test directly with -OpenScript — the
default; don't click through the navigator. The payload is an
ordinary action script, navigated as <web>/eval/action?script=…
(shared mechanism reference:
../lsfusion-eval/references/form-open-url.md):
lsfdev.ps1 verify -OpenScript "SHOW Shop.items WINDOW;" -OpenExpect "Coffee beans"
lsfdev.ps1 verify -OpenScript "FOR Shop.name(Shop.Item i) = 'Coffee beans' DO SHOW EDIT Shop.Item = i WINDOW;" -OpenExpect "Coffee beans"
Three rules: open the form in its production window mode (WINDOW
for navigator forms and edit cards — a bare SHOW opens a small
floating window whose layout is not what the user sees); qualify
every name with its namespace (the script compiles against all
loaded modules); assert with -OpenExpect on something rendered
inside the form (a cell value, a panel caption) — never the
form's own caption, which renders on the docked tab outside the
form and fails the scoped check. The report cross-checks the opened
form against the DOM: [OK] Open check: is the real pass, a [WARN] Open check: means the SHOW did not take effect, and a found expect
under it is demoted to a WARN. Checking several forms in a row: pass
-OutPrefix <stem> per run, or each run overwrites the evidence of
the previous one.
-Click "Tab > Entry" clicks navigator entries like a user;
-DoubleClick "<cell text>" is a gesture whose outcome the
platform decides per cell (editable → in-place editor, read-only →
the object's edit form) — verify classifies and screenshots it,
and -DoubleClickExpect asserts an opened card. -Do "<verb:step>",… runs generic interaction steps by Playwright
selector (click/dblclick/rclick/hover/drag/dnd/mouse/fill/type/edit/
press/eval/wait/screenshot/assert-count/assert-text) — the way to
drive CUSTOM/React components; steps with commas or nested quotes go
through -DoFile. -Session keeps one live browser between calls
(never an implicit reload — -Reload after JS/CSS edits); `-Url
verify is strict: exit 0 means every requested check passed, any
failed check exits 2 (-AllowWarnings for report-only exit 0), tool
errors exit 1, and a watchdog (default 180 s, -Timeout)
tree-kills a wedged page and names the hung step. Browser console
errors, uncaught page exceptions and custom-view failures (a broken
.jsx → an empty custom container) are reported as [WARN] lines but
never flip the exit code — when a custom view must fail the batch,
assert on content it renders (-OpenExpect, -Do "assert-text:…").
Read the classified failure before theorizing: not found (with the
real captions listed), intercepted, disabled, not visible; a
load timeout is followed by what the web client's gwtlog-err.log
received during the run.
If the session exposes an in-app browser (Claude Desktop's
Browser pane — mcp__Claude_Browser__* tools), it may complement
verify for reading an already-rendered page — verify comes
first, and the pane gets one attempt: stop at the first failure
signature (the "tab is already opened" page after a direct open,
screenshots timing out, an entry outside the viewport) and never
retry, resize, reload or type a password through it; layout at
production viewport, real drag gestures and on-disk evidence come from
verify only. The full split with the measured signatures is the
last section of references/verify.md.
Verify print forms headless via PDF — don't assume. There's no browser/IDE preview here, so render server-side and read the result:
lsfdev.ps1 api -Script "LOCAL f = FILE (); PRINT myForm OBJECTS o = <expr> PDF TO f; WRITE f() TO 'C:/proj/.lsfusion-dev/out';"
PRINT … PDF TO <fileProp> renders on the server with no client interaction;
WRITE f() TO '<path>' dumps it to disk (extension auto-appended →
out.pdf). Open the PDF with your file-reading tool and actually eyeball it —
a wrong field name/type or band height only shows in the rendered output.
For template / field-mapping rules, retrieve the Report_design docs — the
guidance's report rules mandate that before touching any .jrxml anyway.
Do not query PostgreSQL directly to inspect data. lsFusion owns the
schema — table names are mangled (<class>_<namespace>, _x_yz columns),
property values live in normalized layouts that don't match the .lsf
declaration shape, and the physical layout can shift between platform
versions or after any restart -FullStart. A SELECT against the lsFusion
DB looks authoritative and is almost always wrong, misleading, or both.
Direct psql is a last resort — DBA-level recovery, debugging schema
corruption, or comparing physical layout between two installs. Before
running any psql / pg_dump / direct-SQL command that reads or changes
the project's data, ask the user first and explain why the three
lsFusion-layer checks above (log → API → UI) aren't enough for the
situation at hand. Do not run such queries silently just because you have
the password — even read-only ones can lead you to false conclusions you
then act on.
Connection and catalog metadata are not data — reading them needs no
permission. Which database the server is actually connected to
(pg_stat_activity), whether a database exists (pg_database), and
whether a table exists or which tables a database holds
(information_schema.tables) say nothing about business data, and they are
the right tool for "is the server on the database I think it is?" and "did
the schema get created there?" — for example after
relation "_auto_<ns>_<class>" does not exist on APPLY, which usually
means the table was never created in the database the server really uses.
The skill already runs these checks itself (the post-start
Database binding verified / DATABASE MISMATCH verdict, the status
Database line, the warnings about a database that already holds tables or
has other connections — runtime.md, How the processes are launched); read those first,
query yourself only for what they don't show. Read-only SELECTs against
these catalogs are fine; anything that writes (CREATE / DROP DATABASE,
DML) is still the user's call.
Every task that started or restarted the server ends here — non-optional.
After start / restart succeeds — whether you scaffolded a new module,
edited existing code, fixed a server failure, or just brought the project up
for inspection — always run open so the user lands in the running
application and can click through it. open already targets the app's
context path (http://localhost:<web port>/<app id>/); quote that full URL,
context path included, whenever you tell the user where the app runs. Do not stop at "the server is up": the
user expects to actually use the UI and try out what you built. This step
applies even when verify already produced a screenshot for your own check —
the screenshot is for you, open is for the user.
In devmode (the skill's default) lsFusion auto-authenticates as admin,
so the browser lands straight on the navigator — no login screen, no
credentials needed. Mention this in your reply when you surface the URL,
especially if the user was expecting a sign-in page. If devmode is off
(-NoDevMode, or the user points the skill at a production server), the
default account is admin with no password (blank password field) —
state this explicitly so the user can sign in. After the first login the user can
change the password and add other users.
The skill also runs lsFusion code that ships in a Git repository — typically a
Maven layout with pom.xml at the root, .lsf modules under
src/main/lsfusion/<namespace>/, and a lsfusion.properties under
src/main/resources/. The flow is the standard workflow with a clone step in
front of step 2:
lsfdev.ps1 clone -GitUrl <repo URL> [-Target <dir>] [-Branch <name>].
Drops the repo into a subfolder named from the URL (or the explicit
-Target) and reports whether the layout looks like an lsFusion project.
Requires git on PATH.cd into the clone, or pass -ProjectDir <path> to every command, then
run setup -AppId <short id> -DbPassword <pwd> exactly as for a new project
(the app id names the database and the web context path). When the skill
detects an existing project (any of pom.xml, src/main/lsfusion/, or a
lsfusion.properties), it writes a minimal settings.properties
containing only install-specific overrides — DB credentials, and other
fields only if you passed them. The project's own lsfusion.properties
keeps control of logics.topModule, namespaces, and the rest, so the skill
does not silently change how the project loads.start, verify, restart all behave the same. When the project has
pom.xml and Maven is on PATH, the skill switches to Maven mode:
setup does not download lsfusion-server-<ver>.jar — Maven will
pull it (and every other dependency) from pom.xml. Saves ~150 MB and
guarantees the exact version the project expects.start-server runs mvn -q -DskipTests compile, then
mvn dependency:build-classpath (cached, refreshed only when pom.xml
changes), and launches Java with the Maven-resolved classpath plus
target/classes and the source roots. So the JVM runs with exactly
the dependency graph the project's pom.xml defines.PATH, the skill still works — it falls back to the
downloaded lsfusion-server-<ver>.jar and stages a Maven-style build
itself: each start-server wipes target/classes/, copies
src/main/resources/** and src/main/lsfusion/** into it, compiles
any src/main/java/** Java sources via javac -d target/classes, and
launches the JVM with classpath target\classes;<server jar>. The
classpath stays exactly two entries — staging dir plus jar — which
avoids the duplicate-module trap.Pass -TopModule <Name> at setup only if the project's own config does
not set one (rare) — that value persists and steers real starts. This does
not apply to dryrun -TopModule, which deliberately overrides the
configured top module for that validation run only and is the normal
way to scope it. For everything else — code edits, dev-mode behaviour,
light start, verification — the workflow is identical to a scaffolded
project.
When extending an existing project, explore before adding: use
lsfusion_retrieve_docs and any project-element search the MCP exposes to
understand the existing modules, namespaces, and conventions, then add new
elements that fit in.
This is the platform-level resolution chain (lowest priority first, each
later layer overrides the previous one). Know it before you set db.name,
db.password, a drop guard, or any other tunable — guessing which file
"wins" is a recurring waste of debugging time.
lsfusion.server.physics.admin.Settings.java).lsfusion.properties — the project's own config, loaded from the
classpath. In a Maven layout this lives at
src/main/resources/lsfusion.properties (gets staged into target/classes/
at build time). Project authors put logics.topModule, namespace
declarations, and other application-wide settings here.conf/settings.properties — install-specific overrides, loaded by
relative path from the JVM's working directory. lsfdev launches the JVM
with cwd = <project-root>, so this resolves to
<project-root>/conf/settings.properties. This is the canonical place
for db.server, db.name, db.user, db.password, rmi.port, and any
override you want to apply at runtime without recompiling the project.-D...=value arguments. lsfdev injects a few unconditionally:
-Dlsfusion.server.devmode=true, -Ddb.denyDrop{Modules,Tables,Properties}=false,
(when light start is on) -Dlsfusion.server.lightstart=true, and the
-Ddb.* mirror of the resolved settings.properties values — a
same-value duplicate that guarantees the database binding even if a file
layer is mis-parsed (the file remains the source of truth between runs;
lsfdev re-reads it and re-asserts db.name into conf/settings.properties
before every launch). Any -D you add by hand wins over the file-based
layers below (and, coming later on the command line, over lsfdev's own
-Ddb.*).Administration → System → Settings → Parameters
in the UI. Useful for tunables that should survive a redeploy and that
admins should be able to edit without filesystem access.Service.pushSetting[STRING, STRING] /
Service.popSetting[STRING] — temporary, scoped to one action / session.Do NOT put runtime overrides in .lsfusion-dev/settings.properties.
That directory is lsfdev's own internal state (cached classpath,
config.json, generated logs, the downloaded server jar). The JVM never
reads anything from there. If you put a db.name = ... line there
expecting it to take effect, it is silently ignored and the server keeps
using whatever the resolution chain above produces.
lsfdev's setup flow:
-DbPassword, -DbUser, -DbServer, -DbName flags passed to
lsfdev.ps1 setup are written into the right files for you — you don't
need to touch conf/settings.properties by hand unless you want to.<project-root>/conf/settings.properties
directly (layer 3 above) or pass -Dkey=value in FUSION_OPTS (layer 4)..lsfusion-dev/. setup adds it to
.gitignore. Generated settings files at the project root and
<project-root>/conf/settings.properties contain the DB password in
plain text (this is how lsFusion works) — mention this to the user if
the repo is shared. The same password also appears on the server's java
command line (-Ddb.password, the binding belt) and thus in
.lsfusion-dev/launch-cmd.txt and the local process list — equivalent
exposure on a single-user dev box, but worth knowing.verify contract — every option, the -Do step verbs, diagnosis
lines, the watchdog, -Session, -Url, the in-app browser split — is in
references/verify.md: read it before the first run
that uses -Do, -DoubleClick, -Session or -Url, and whenever a
verify run fails.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub lsfusion/ai-skills --plugin lsfusion-ai-skills3 skills in this plugin
/lsfusion-deployDeploy an lsFusion application to a remote Linux server (Ubuntu/Debian or RHEL). Covers the official auto-installer, switching the platform between major versions or release channels, packaging the configuration into a jar under /var/lib/lsfusion, the app-server and web-client systemd units, HTTPS via Let's Encrypt/certbot, and pulling the remote PostgreSQL DB into a local lsfusion-dev instance. Use whenever the user wants to install lsFusion on a remote host, push a project (Maven repo or plain .lsf files) over ssh/scp, upgrade or downgrade the platform, set up TLS on the web client, debug the production database locally, or diagnose a stopped lsFusion service, a failed schema migration, "Dropping modules" / "Dropping tables" or a "no viable alternative" parse error. Triggers on ssh + systemctl + lsFusion tasks and on "deploy lsfusion", "install lsfusion on the server", "upgrade the platform", "enable https on lsfusion", "pull the prod DB locally". For LOCAL Windows development use lsfusion-dev instead./lsfusion-evalRun lsFusion code against a running server (local dev or deployed production) and inspect what code is actually loaded there. Use when the user wants to: evaluate an lsFusion expression or run a script via HTTP (/exec, /eval, /eval/action), call a project action by name remotely, check that a class / property / form / module exists in the running config, count or sample data through the lsFusion layer instead of PostgreSQL directly, or read / grep the `.lsf` sources deployed on a remote host (the `/files/*` API on the web port). Use it when the task is "ask the server" rather than "edit code locally": the canonical way to verify server state before changing things, debug what's actually running, and answer "is the schema in sync with my source?". Triggers on "call action via HTTP", "/eval", "eval/action", "run lsfusion script remotely", "check what's on the server", "what logic is running on the server", "look at .lsf on the server", "count via API", "API check", "verify class/property on the server".