Added a new usage-rules.md markdown document containing general rules…
Purpose: Help coding agents understand the Ecto library and generate more accurate code following the established patterns and anti-patterns.
UsageRules is a development tool for Elixir projects that:
- helps gather and consolidate usage rules from dependencies to provide to LLM agents via mix usage_rules.sync
- provides pre-built usage rules for Elixir
- provides a powerful documentation search task for hexdocs with mix usage_rules.search_docs
Thank you! This is a good beginning but I think it is too extensive. The models already know Ecto quite a bit, so I don't think our usage rules should go over API usage like upserts and similar. We should mostly focus on: security, new APIs (such as Repo.transact), and fixing bad practices/common mistakes LLMs may commit.
I'd also suggest removing the "LLM" verbiage. I've seen no evidence that writing these docs as if you're writing it to or about an LLM has any positive impact. It's just "the usage rules" which are a condensed documentation with a target audience of an LLM.
I have slimmed down the usage_rules.md and tried to keep only the essential. I have not used the Transact API extensively so I suggest reviewing that part. I added some of the suggested DO NOT rules where I could express them.