name: phel-lang description: Building applications WITH Phel (Lisp that compiles to PHP). Triggers on .phel files, phel-config.php, phel CLI commands (init, run, repl, test, build), or requests to build a Phel app. Skip when working on the Phel compiler internals (use compiler-guide or phel-patterns instead).
Phel
Lisp dialect compiling to PHP. PHP interop via php/ prefix.
Load order
.agents/RULES.md— hard rules, modern features, CLI cheatsheet.agents/tasks/common-gotchas.md— read BEFORE writing code.agents/index.md— task map.agents/tasks/<intent>.md— recipe for current task.agents/quick-syntax.md— one-screen syntax cheatsheetsrc/phel/anddocs/only when a recipe points there
Hard rules (skim, then load RULES.md)
- Verify fn names with
(doc <fn>)or grepsrc/phel/core/. Never invent. - Collections immutable.
(conj v x)returns new; rebind viadef/let/atom. - CLI args:
*argv*, notphp/$argv. - Side effects:
doseq; building sequences:for. - String module is
phel.string(wasphel.strpre-v0.33). - Namespace separator: prefer
.(app.main);\deprecated. - Hot or public
defn: add:tagto params + return. See.agents/tasks/typed-defn.md. - Opt-in
defnmetadata:^:async,^:memoize,^{:memoize-lru N}. - Top-level side effects break
phel build; guard with(when-not *build-mode* ...).
Working examples
.agents/examples/{todo-app, http-json-api, cli-wordcount}/ — copy, adapt, run.