Skip to content

Conversation

pcharbon70
Copy link

The Usage-rules tool is a library that help ai coding agents write better Elixir code by synchronizing the coding agent rules file with the different rules for the libraries and frameworks used in a project.

Since the goal of this library is to statiscally analyze the code of a project for some coding-style that has become the de-facto standard for the Elixir community it makes sense to help coding assistant to not make those mistakes in the first place.

The usage-rules.md file contains a condensed version of Credo's rules and will be synced to the coding agent rules of those adopting the usage-rules tool. They will still be able to edit those rules to ignore the ones that they prefer not to include.

For those adopting an Ai work-flow it will hopefully help prevent the tango between the agent code generation and having to fix the code generated after the credo checks fails.

@rrrene
Copy link
Owner

rrrene commented Aug 30, 2025

Thanks for putting this together, quite impressive that we have that many checks in Credo.

I don't think this makes sense in Credo, the package, unfortunately.

Have you considered pushing this as its own project? We could link it in Credo's README 👍

@pcharbon70
Copy link
Author

pcharbon70 commented Aug 31, 2025 via email

@zachdaniel
Copy link
Contributor

zachdaniel commented Sep 2, 2025

I don't think this makes sense in Credo, the package, unfortunately.

I agree and disagree. I think most of this file should be removed, and instead the usage-rules.md file should just explain broadly how to use credo, i.e the mix task and its basic interface, how to skip rules if necessary, basic stuff that an agent should know.

This file isn't a place to actually describe the conventions. That is what credo is for 😆

@zachdaniel
Copy link
Contributor

The idea with the file living in this project is so that it can change as the library changes etc.

@pcharbon70
Copy link
Author

pcharbon70 commented Sep 3, 2025 via email

@zachdaniel
Copy link
Contributor

the idea behind it was to prevent the
coding agent from making the mistakes before Credo needed to fix it.

Two things

  1. context management is key. The benefit of a linter is that the agent doesn't have to have the rules loaded up into their context window.
  2. credo is fully configurable to disable any of these checks.

The only tenable usage-rules.md file would be one that explains how to run credo, configure it, etc. IMO.

@zachdaniel
Copy link
Contributor

Of course it would be worth finding out from @rrrene if a trimmed down doc like the one I'm suggesting would even be welcome, but I do personally think something lightweight would be good 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants