byu

byu

Phoenix `phx.new` generator and AGENTS.md

@chrismccord : I just saw the Extract AGENTS.md from Phoenix.new into phx.new generator commit to the phoenix project.

My initial shotgun all-over the place unorganized reactions:

  1. I like the idea of the community having a set of AI instructions that works well for elixir projects, which brings together experimentation from all parts of the community… As someone that just wants to “be productive” and doesn’t want to waste time “prompt engineering” an AGENTS.md file from my own frustrations… seeing what others have done/shared is nice.
  2. The merged AGENTS.md reads like an “Elixir + Phoenix + Ecto” best practices or a conventions document… Phoenix has great guides, Credo is like a best practice enforcer.
  3. Is the generator a place for this? Or would a separate community contributed “Phoenix AI Suggestions Package” (maybe credo?) that usage_rules uses to add to AGENTS.md be a better place?
  4. Is there a Phoenix project’s AI Policy, like Ash Framework: AI Policy - #6 by zachdaniel ?

I’m just curious about what the community thinks about elixir plus AI agents instructions in general.

Most Liked

chrismccord

chrismccord

Creator of Phoenix

AGENTS.md is for LLMs so I wouldn’t necessarily call it a best practice or convention doc, but there will of course be overlap. The goals with this are gap-filling for SOTA LLMs to supplement their “world knowledge” only, rather than an exhaustive set of guidelines (which exist as phoenix guides). Less capable models will need more gap filling, but also being less capable they will have less world knowledge and I haven’t yet seen lower tier/local models cross be able to really cross the gap regardless of context stuffing. On the other hand, most state of the art models are closely on par with one another gap wise. Surprisingly so even. You can shop the AGENTS.md around to gpt-4.1/claude/gemini 2.5 pro/grok4 and get more or less similar results.

The generator is indeed the place for this :slight_smile:

usage_rules is great, and zach is doing some great work there! It’s hard to beat a dependency free static file value wise at this point. As folks want to customize and extend their own rules they can bring in usage_rules to manage that process and aggregate their other deps that also provide rules. I don’t think credo makes sense at all in this flow. I do think that a mix task that aggregates AGENTS.md across your deps makes total sense, and it’s one thing that fell out of the Elixir contributors summit that Zach kindly took on the burden of running with. As the community standardizes on this stuff and libraries adopt AGENTS.md I could absolutely see deep integration with a mix task/lib out of the box, but in any case, the file must be there when you run phx.new, so even if we made it library generated, it would to be programmatically run inside phx.new to ensure it’s there out of the box.

Not at this time

zachdaniel

zachdaniel

Creator of Ash

It already exists, and the Phoenix AGENTS.md will be compatible with the format. usage_rules v1.2.6 — Documentation

rocket4ce

rocket4ce

https://github.com/just-another-rule-craft/download-phoenix-guides
I think you were referring to something like this? Or was it something else?

I made a small Bash script that downloads all the guides into your project—you just need to be in your project directory and run the script.

Where Next?

Popular in Discussions Top

laiboonh
Hi all, I am trying to convince my team to use liveview over the current react. What are some of the points where one should consider us...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New
AstonJ
If a newbie asked you about Phoenix Contexts, how would you explain the basics to them? Feel free to be as concise or in-depth as you li...
New
crabonature
I’m still quite new to Elixir. As I understand we got in Elixir “multi guards” as convention to simplify one large guard with or’s?: de...
New
AlexMcConnell
The reason that Rails is as popular as it is is because it’s very easy for relatively inexperienced developers to get a lot of work done....
588 19675 166
New
Crowdhailer
I’ve been hearing much about the new formatter and it’s something I have been keen to try. I find examples buy far the most illuminating...
248 19365 150
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
kostonstyle
Hi all How can I compare haskell with elixir, included tools, webservices, ect. Thanks
New
paulanthonywilson
I like Umbrella projects and pretty much always use them for personal Elixir stuff, especially Nerves things. But I don’t think this is ...
New
AstonJ
It’s been a while since we’ve had a thread like this, so what better way to kick off the year with :003: What does being an Elixir user ...
New

Other popular topics Top

danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29703 241
New
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36432 110
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement