Usage Rules: Leveling the Playing Field for AI-Assisted Development

11 Replies
Gonzalo Muñoz
Gonzalo Muñoz•3mo ago
mix usage_rules.sync ASH_USAGE_RULES.md $(mix deps | grep -E '^\* ash' | awk '{print $2}') for when you only need ash and don't want to pollute your context window with everything else 👀
$ mix deps | grep -E '^\* ash' | awk '{print $2}'
ash
ash_ai
ash_json_api
ash_phoenix
ash_postgres
ash_sql
$ mix deps | grep -E '^\* ash' | awk '{print $2}'
ash
ash_ai
ash_json_api
ash_phoenix
ash_postgres
ash_sql
ZachDaniel
ZachDanielOP•3mo ago
We could potentially support patterns in mix usage_rules.sync? mix usage_rules.sync AGENTS.md "ash*" or something another thing you can do is add an alias
defp aliases do
[
"usage_rules.sync": [
"usage_rules.sync AGENTS.md ash ash_ai ash_json_api ash_phoenix ash_postgres ash_sql"
]
]
end
defp aliases do
[
"usage_rules.sync": [
"usage_rules.sync AGENTS.md ash ash_ai ash_json_api ash_phoenix ash_postgres ash_sql"
]
]
end
Gonzalo Muñoz
Gonzalo Muñoz•3mo ago
yeah but that one has to change every time I add a new package the grep thingy is dirty but adaptable
ZachDaniel
ZachDanielOP•3mo ago
makes sense
Gonzalo Muñoz
Gonzalo Muñoz•3mo ago
Question: what is the criteria for what information is included in the usage_rules of a package? Is it a human-curated list of "most important" stuff? I ask because in Ash there is nothing about polymorphic relationships for example. But I know that is a topic in the online docs
ZachDaniel
ZachDanielOP•3mo ago
yeah its just human curated/our intuition. I'd suggest adding one line about using polymorphic relationships and listing the guide name that it can find it in might be good now that it has usage_rules.docs_search tasks 😄 I'd accept that PR
Gonzalo Muñoz
Gonzalo Muñoz•3mo ago
Something like this? Sorry for the basic q, this is my first time contributing to Ash
No description
ZachDaniel
ZachDanielOP•3mo ago
No problem, and TBH its not a basic question I'm actually not sure 😆 Hmm....I actually have to think about if we want to link to hexdocs or not 🤔 make that PR and I'll consider it more and let you know
Gonzalo Muñoz
Gonzalo Muñoz•3mo ago
ok perfect, thanks! yeah, I would prefer to have the explanation right there in the offline docs, but I'm sure there is too much already to pack. LLMs are not there yet with their context windows
Gonzalo Muñoz
Gonzalo Muñoz•3mo ago
GitHub
Update usage-rules.md to include Polymorphic Relationships by M-Gon...
Oneliner with a link to hexdocs Contributor checklist Leave anything that you believe does not apply unchecked. I accept the AI Policy, or AI was not used in the creation of this PR. Bug fixes i...
ZachDaniel
ZachDanielOP•3mo ago
Yeah I think the usage rules are a bit bloated already but I'm not sure

Did you find this page helpful?