Skip to content

Commit b677684

Browse files
committed
docs(agents): add pi-elixir refactoring principle
Item 11 in Development Principles: always prefer elixir_eval, elixir_ast_search, and elixir_ast_replace for Elixir code introspection and structural edits. Fall back to targeted 'edit' only when AST tools cannot match.
1 parent 1859c24 commit b677684

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ For a quick test on a Linux server without a desktop:
163163

164164
If you only edited one file or area, you can scope the formatter:
165165
`mix format path/to/file.ex path/to/other.ex`. Never commit unformatted code — item 2 (the CI check) will block the merge anyway, so it's strictly faster to format locally first.
166+
11. **Use pi-elixir for Elixir refactoring**: Always use `elixir_eval`, `elixir_ast_search`, and `elixir_ast_replace` (part of the pi-bridge ecosystem) for Elixir code introspection and structural refactoring. Avoid raw Python/Perl/shell scripts for source migrations, API renames, or protocol changes. Fall back to targeted `edit` calls only when the AST tools cannot match a pattern (e.g., for newly-inserted code that hasn't been compiled yet). Never use blind global string replacement for protocol/API field renames.
166167

167168
## Dialyzer & Finch
168169

0 commit comments

Comments
 (0)