/pure-dev:pure-code-stylefrom Pure Dev
Reformats .pure files to a consistent house style: 2-space indentation, tight colons in type annotations, spaced pipes on branches, and no trailing whitespace. Whitespace-only, never changes semantics.
Ships in Pure Dev. 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.
None: SKILL.md is the whole skill.
A whitespace-only formatting pass for .pure source. Every rule below changes layout, never
tokens — the function/class declarations, expressions, and comments must be byte-identical modulo
whitespace before and after. This is not a logic refactor: don't rename, reorder, inline, or alter
any expression while applying it.
No tabs. No column-aligned "hanging indent to match the opening paren" style — that's what makes large Pure files look ragged as expressions get edited over time. Every continuation line is indented exactly 2 spaces from the line that opened its block, not aligned to wherever a paren or earlier token happened to land.
// Before (column-aligned, drifts every time something upstream gets renamed)
let x = someCall(a, b,
c, d);
// After (fixed 2-space continuation)
let x = someCall(a, b,
c, d);
:Function parameters and Class properties: name:Type[mult], never name: Type[mult] or
name :Type[mult]. This is the single most common inconsistency in hand-edited Pure files — the
same function signature often mixes both within one parameter list.
// Before
function f(a:String[1], b: Integer[1], c :Boolean[1]):String[1]
// After
function f(a:String[1], b:Integer[1], c:Boolean[1]):String[1]
|) spacing: space on both sides, with one carve-out| introduces a lambda body in Pure, and it shows up in three shapes. Two of them always get a
space on both sides; the third stays tight by established codebase convention:
if(...)/branch pipes (zero-arg lambda): | thenBranch, not |thenBranch.match() arms (typed single-arg lambda): binding:Type[mult] | body, not
binding:Type[mult]|body.map(x|$x->foo()), not map(x | $x->foo()). This is the one
deliberate exception; it matches how these appear throughout the existing codebase and keeps
short ->map(...)/->filter(...) chains compact.// Before
if($x->isEmpty(),
|$default,
|$x->toOne()
);
$v->match([
s:String[1]|$s->toUpper(),
a:Any[1]|$a->toString()
]);
// After
if($x->isEmpty(),
| $default,
| $x->toOne()
);
$v->match([
s:String[1] | $s->toUpper(),
a:Any[1] | $a->toString()
]);
// Unchanged either way - short inline callback stays tight
$xs->map(x|$x->toOne())
Multi-param lambdas passed to fold/similar ({a, b | ...}) also get spaces around |, same as
match arms — only the single-arg short callback shape stays tight.
A signature that's hard to scan at a glance (rule of thumb: over ~140 characters, or 4+ parameters
with non-trivial types) breaks onto multiple lines — one parameter per line, each indented 2 spaces
under function, with the closing ) and return type on their own line back at the base indent:
// Before
function meta::foo::bar(a:TypeA[1], b:TypeB[1], c:Function<{X[1] -> Y[1]}>[1], d:DebugContext[1]):Result[1]
// After
function meta::foo::bar(
a:TypeA[1],
b:TypeB[1],
c:Function<{X[1] -> Y[1]}>[1],
d:DebugContext[1]
):Result[1]
Short signatures that already read fine on one line stay on one line — don't break a signature just
because a rule says "always break", only because it's genuinely hard to scan. Splitting at the
top-level parameter commas is the hard part here: commas inside a parameter's own generic
(Map<String, AccessorQualifier>) or function type (Function<{A[1], B[1] -> C[1]}>) are not
split points. When in doubt, do this by hand per signature rather than with a blind
comma-splitting regex — a wrong split silently breaks the file.
Exactly one blank line between top-level declarations (functions, classes). Never a blank line
immediately after the opening { or immediately before the closing } of a function body. Never
two consecutive blank lines anywhere, including right after the import block.
Strip trailing spaces/tabs from every line.
grep -c "^function\|^Class " <file>.pure, and ideally a list of the actual
function/Class signatures (name + arity), since a reformat is exactly the kind of change
where a copy/paste slip silently drops or duplicates a block.pure-lsp-check for a fast
single-file check, or the project's own Maven/LSP build), run it. Formatting changes should
never fail a build; if one does, you introduced a real change, not a whitespace one — find and
fix it before calling the pass done.This is a per-file or per-diff pass, not a repo-wide sweep. Apply it to the file(s) the user names,
not every .pure file in the project, unless explicitly asked to do a full-codebase pass.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub finos/legend-engine --plugin pure-dev15 skills in this plugin
/pure-backend-startStarts (or confirms) the standalone legend-engine backend - engine Server + H2 + local metadata server on fixed ports 9095/9092 - so a Pure LSP started with -Dlegend.test.* routes execute()/go() through real plan-generation instead of the interpreted engine. Starts only the backend, not the LSP. Use when the user wants to run Pure queries 'through the real engine', 'through plan-gen' or 'via the backend server', reproduce compiled-mode behaviour the interpreted engine cannot, or mentions legend.test.server, EngineServerForTest or LegendTest./pure-chain-updateProcedure for git-syncing and rebuilding a local legend-pure + legend-engine checkout, in dependency order, with pinned dependency versions resynced. Run by hand, one project at a time, fixing problems as they surface. Use for 'update my project chain', 'pull latest and rebuild <project>', 'sync legend-pure/legend-engine', 'refresh my local checkouts', or 'propagate my engine snapshot downstream'./pure-lsp-checkCompiles/checks a single .pure file against the already-running Legend Pure LSP bridge and reports diagnostics (errors/warnings) in under a second, as a fast alternative to a full `mvn test`/`mvn compile` cycle while iterating on Pure source in legend-pure. Use whenever the user is editing .pure files and wants to know if they compile, asks 'does this Pure file compile', 'check this .pure file', 'validate this Pure code', or wants fast type/syntax feedback without running the full Maven build./pure-lsp-classpathComputes and caches the engine-scale Pure classpath (via Maven dependency:build-classpath) for any pure-bearing project registered in config/projects.json - legend-pure, legend-engine, or a project you've layered on top via PURE_DEV_EXTRA_PROJECTS_JSON - and resolves that project's dependency-ordered --repo-root set. Use before the first engine-scale LSP start in a repo, when the cached classpath is stale after pulling or rebuilding, when engine-scale boot fails on missing classpath entries, or when you need repo-roots for a project with dependencies. Provides pure-lsp-classpath and pure-lsp-roots./pure-lsp-connectAttaches the pure-lsp HTTP bridge to an LSP daemon that is ALREADY running (e.g. started from IntelliJ, or left over from a prior session) - never spawns a new daemon JVM. Defaults to socket port 9100. Use for 'connect to the existing/already-running LSP', 'attach the bridge to the LSP on port X', or 'reconnect to the LSP' - as opposed to pure-lsp-launch-engine, which boots a new session. Also recovers a bridge whose connection has gone stale (health OK, requests fail with a broken pipe)./pure-lsp-executeRuns exactly ONE existing Pure function by path (signature, mangled id or bare path) through the running Legend Pure LSP bridge, without a go() wrapper, and returns its typed value in returnValue. Also runs every test in a package or .pure file serially with --package/--source. For 2 or more functions or tests, use pure-lsp-execute-parallel instead, never a shell loop of this command. Use when the user wants to run a specific function, a single <<test.Test>> or <<PCT.test>>, or the result of a Pure function.Other plugins' skills for the same job