Skip to main content

AI Agents

2 min read Last updated
On this page

After this page your AI coding agent writes correct Phel. One command installs a skill file for each agent and a shared docs tree into your project, so the agent knows Phel's syntax, idioms, and common mistakes.

To build AI features in Phel instead (LLM chat, embeddings, tool use), see the AI Module.

One-command setup

composer require phel-lang/phel-lang
vendor/bin/phel agent-install --auto

--auto looks for .claude/, .cursor/, AGENTS.md, .github/copilot-instructions.md, and similar files, and installs only for the agents you use. To choose yourself, name a platform or install all of them:

vendor/bin/phel agent-install claude   # Claude Code only
vendor/bin/phel agent-install --all    # every platform

An existing file is backed up to *.pre-phel.bak before it is replaced. Run the command again after you update Phel: it writes only new or changed docs and keeps files you edited.

Per platform

PlatformArgumentFile installed
Claude Codeclaude.claude/skills/phel-lang/SKILL.md
Cursorcursor.cursor/rules/phel.mdc
CodexcodexAGENTS.md
GitHub Copilotcopilot.github/copilot-instructions.md
GeminigeminiGEMINI.md
AideraiderCONVENTIONS.md

Every platform also gets the .agents/ docs tree in the project root. The skill file tells the agent to read it in this order:

  • .agents/RULES.md: the hard rules, modern features, and a CLI cheat sheet
  • .agents/quick-syntax.md: a one-screen syntax reference
  • .agents/index.md: a map from task to recipe
  • .agents/tasks/: recipes for HTTP apps, CLI tools, tests, macros, errors, pattern matching, schema validation, and more
  • .agents/examples/: small runnable projects, only with --with-examples

Flags

FlagEffect
--autoinstall only for agents found in the project
--allinstall for every platform
--with-examplesalso copy .agents/examples/
--no-docsinstall only the skill file, not .agents/
--dry-runprint what would be written, change nothing
--forcereplace the skill file without a backup, and replace docs you edited (after backing them up)
--uninstallremove the skill file and restore its backup
--checkcompare the installed docs version with the bundled one; exit 1 when they differ

Without the CLI

Agents that cannot run phel can read the same knowledge as plain text:

  • https://phel-lang.org/agentic-coding.md: the Agentic Coding reference as one page
  • https://phel-lang.org/llms.txt: a link index of all documentation for LLMs