# Phel Lang

> 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). Use when this capability is needed.

- Skill: `tomevault-io/phel-lang` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/phel-lang`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/phel-lang/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/phel-lang

---


# Phel

Lisp dialect compiling to PHP. PHP interop via `php/` prefix.

## Load order

1. `.agents/RULES.md` — hard rules, modern features, CLI cheatsheet
2. `.agents/tasks/common-gotchas.md` — read BEFORE writing code
3. `.agents/index.md` — task map
4. `.agents/tasks/<intent>.md` — recipe for current task
5. `.agents/quick-syntax.md` — one-screen syntax cheatsheet
6. `src/phel/` and `docs/` only when a recipe points there

## Hard rules (skim, then load RULES.md)

- Verify fn names with `(doc <fn>)` or grep `src/phel/core/`. Never invent.
- Collections immutable. `(conj v x)` returns new; rebind via `def`/`let`/`atom`.
- CLI args: `*argv*`, not `php/$argv`.
- Side effects: `doseq`; building sequences: `for`.
- String module is `phel.string` (was `phel.str` pre-v0.33).
- Namespace separator: prefer `.` (`app.main`); `\` deprecated.
- Hot or public `defn`: add `:tag` to params + return. See `.agents/tasks/typed-defn.md`.
- Opt-in `defn` metadata: `^: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.

---
> Source: [phel-lang/phel-lang](https://github.com/phel-lang/phel-lang) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-07-04 -->

