Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Run Clif?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/cfmleditor-run-clif)
---
name: run-clif
description: build, run, smoke-test, and drive clif — the CFML LSP server and CLI tool
---
`clif` is a Go binary with two surfaces: a set of CLI subcommands (`parse`, `scan`, `format`, `unresolved`, `refs`, `deps`, `explain`, `version`, `help`) and an LSP server that communicates over stdio via JSON-RPC 2.0 with Content-Length framing. The driver is `smoke.sh`, a shell script that builds the binary and exercises both surfaces.
## Prerequisites
Go 1.26.8 (pinned in `go.mod`) with CGO enabled — the tree-sitter-cfml grammar is a cgo package. No other runtime deps; the binary is self-contained.
```bash
go version # verify
```
## Build
```bash
make build
# → target/release/clif (the only artifact)
```
`make build` compiles the committed docs (`internal/docs/generated_docs.go`) and fetches no docs; it does try to fetch CFLint to embed, and builds without it when it can't. To skip that too, build directly:
```bash
go build -o target/release/clif ./cmd/clif
```
The parse-timing debug tool is a separate binary and a separate target:
```bash
make cfparse-build # → target/release/cfparse
make cfparse <args> # build + run in one step
```
## Run (agent path) — smoke driver
```bash
bash .claude/skills/run-clif/smoke.sh
```
Exits 0 if all 7 checks pass, 1 on any failure. Covers:
- `version` — binary responds with version string
- `parse` — reports correct function count for a sample `.cfc`
- `scan` — passes clean file, detects parse errors in broken file
- `format` — produces formatted output
- LSP `initialize` — server returns capabilities JSON over stdio
- LSP `shutdown` — server responds with `{"result":null}` and exits 0
The script starts with `make build`, which needs no network for the docs (above); a CFLint download it cannot make is a warning, not a smoke-test failure.
**A smoke run leaves the generated docs alone.** `make build` no longer regenerates them; only `make generate` does, and it refuses (writing nothing) when a source could not be fetched or an entry would be lost. If you did run `make generate` and want the committed docs back, restore both generated files together: `git checkout -- internal/docs/generated_docs.go internal/docs/generated_sources.txt`.
## Run (human path)
```bash
./target/release/clif # blocks — waits for LSP client on stdio
./target/release/clif parse internal/parser/ # parse timing for a dir
./target/release/clif scan internal/parser/ # report parse errors
./target/release/clif format path/to/file.cfc # print formatted output
./target/release/clif format -w path/to/file.cfc # format in-place
# Resolution-debugging subcommands (need a .clif.json to be useful)
./target/release/clif unresolved [--json] [--verbose] [--global-defs] <dir>
./target/release/clif refs [--mermaid] <component-or-function> <dir>
./target/release/clif deps [--mermaid] <dir-or-file>
./target/release/clif explain [--root <dir>] <file> <line> [call-substring]
```
## Driving the LSP server manually
Send Content-Length–framed JSON-RPC over stdin; read the same format back on stdout:
```bash
send_msg() { local m="$1"; printf "Content-Length: %d\r\n\r\n%s" "${#m}" "$m"; }
{ send_msg '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"processId":null,"rootUri":null,"capabilities":{}}}'; \
sleep 0.4; \
send_msg '{"jsonrpc":"2.0","id":2,"method":"shutdown","params":null}'; \
sleep 0.2; \
send_msg '{"jsonrpc":"2.0","method":"exit","params":null}'; } \
| ./target/release/clif 2>/dev/null
```
## Gotchas
- **`timeout` is not available on macOS** — `coreutils` `gtimeout` isn't either by default. Use a background process + `sleep` + `kill` pattern instead (as `smoke.sh` does with `sleep` inside the pipe).
- **`((PASS++))` under `set -e`** — pre-increment `((var++))` returns the old value; when it's 0 that's falsy and kills the script. Use `VAR=$((VAR+1))` instead.
- **LSP stdin must stay open** — the server exits immediately if stdin closes before `exit` is sent. Always send the full `initialize` → `shutdown` → `exit` sequence, or hold stdin open with `sleep`.
- **Daemon mode** activates only when a `.clif.json` config file exists in the current directory or any ancestor directory up to the filesystem root. Without it the server runs standalone (no socket).
- **Running from this repo's root means you are testing daemon mode, not standalone.** The repo has its own `.clif.json` (`workspaceName: testdata`), so `smoke.sh` and any bare `./target/release/clif` invocation from the root become the daemon: they listen on a socket *and* serve the stdio client. To exercise the standalone path, run from a directory with no config above it (e.g. `cd /tmp && /path/to/clif`).
- **The socket file outlives the daemon process.** The path is `<socketDir>/cfmleditor-<sha256(workspaceName)[:8]>.sock` — `$XDG_RUNTIME_DIR/clif/` on Linux when set, otherwise `$TMPDIR/clif-<uid>/` (a directory only that user may reach; a socket elsewhere is not dialled) (`internal/daemon/socket.go`). After a smoke run the daemon exits but the file remains; a stale socket is harmless (the next start fails to `Proxy()` into it and re-listens), but don't read its presence as "a daemon is running" — check for the process instead.