Packages
A config-driven dev tool for Elixir projects to manage AGENTS.md files and agent skills from dependencies
Current section
42 Versions
Jump to
Current section
42 Versions
Compare versions
5
files changed
+30
additions
-17
deletions
| @@ -5,6 +5,15 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline | |
| 5 5 | |
| 6 6 | <!-- changelog --> |
| 7 7 | |
| 8 | + ## v0.1.2 (2025-05-24) |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + ### Bug Fixes: |
| 14 | + |
| 15 | + * replace package-rules with usage-rules |
| 16 | + |
| 8 17 | ## v0.1.1 (2025-05-24) |
| @@ -4,6 +4,10 @@ | |
| 4 4 | |
| 5 5 | You'll note this package itself doesn't have a usage-rules.md. Its a simple tool that likely would not benefit from having a usage-rules.md file. |
| 6 6 | |
| 7 | + ## For Package Authors |
| 8 | + |
| 9 | + Even if you don't want to use LLMs, its very possible that your users will, and they will often come to you with hallucinations from their LLMs and try to get your help with it. Writing a `usage-rules.md` file is a great way to stop this sort of thing 😁 |
| 10 | + |
| 7 11 | ## Key Features |
| 8 12 | |
| 9 13 | 1. **Dependency Rules Collection**: Automatically discovers and collects usage rules from dependencies that provide `usage-rules.md` files in their package directory |
| @@ -6,7 +6,7 @@ | |
| 6 6 | {<<"GitHub">>,<<"https://github.com/ash-project/ash_graphql">>}, |
| 7 7 | {<<"Website">>,<<"https://ash-hq.org">>}]}. |
| 8 8 | {<<"name">>,<<"usage_rules">>}. |
| 9 | - {<<"version">>,<<"0.1.1">>}. |
| 9 | + {<<"version">>,<<"0.1.2">>}. |
| 10 10 | {<<"description">>, |
| 11 11 | <<"A dev tool for Elixir projects to gather LLM usage rules from dependencies">>}. |
| 12 12 | {<<"elixir">>,<<"~> 1.18">>}. |
| @@ -330,9 +330,9 @@ if Code.ensure_loaded?(Igniter) do | |
| 330 330 | package_rules_content = Enum.map_join(package_contents, "\n", &elem(&1, 1)) |
| 331 331 | |
| 332 332 | full_contents_for_new_file = |
| 333 | - "<-- package-rules-start -->\n" <> |
| 333 | + "<-- usage-rules-start -->\n" <> |
| 334 334 | package_rules_content <> |
| 335 | - "\n<-- package-rules-end -->" |
| 335 | + "\n<-- usage-rules-end -->" |
| 336 336 | |
| 337 337 | Igniter.create_or_update_file( |
| 338 338 | igniter, |
| @@ -343,8 +343,8 @@ if Code.ensure_loaded?(Igniter) do | |
| 343 343 | |
| 344 344 | new_content = |
| 345 345 | case String.split(current_contents, [ |
| 346 | - "<-- package-rules-start -->\n", |
| 347 | - "\n<-- package-rules-end -->" |
| 346 | + "<-- usage-rules-start -->\n", |
| 347 | + "\n<-- usage-rules-end -->" |
| 348 348 | ]) do |
| 349 349 | [prelude, current_packages_contents, postlude] -> |
| 350 350 | Enum.reduce(package_contents, current_packages_contents, fn {name, |
| @@ -363,17 +363,17 @@ if Code.ensure_loaded?(Igniter) do | |
| 363 363 | end) |
| 364 364 | |> then(fn content -> |
| 365 365 | prelude <> |
| 366 | - "<-- package-rules-start -->\n" <> |
| 366 | + "<-- usage-rules-start -->\n" <> |
| 367 367 | content <> |
| 368 | - "\n<-- package-rules-end -->" <> |
| 368 | + "\n<-- usage-rules-end -->" <> |
| 369 369 | postlude |
| 370 370 | end) |
| 371 371 | |
| 372 372 | _ -> |
| 373 373 | current_contents <> |
| 374 | - "\n<-- package-rules-start -->\n" <> |
| 374 | + "\n<-- usage-rules-start -->\n" <> |
| 375 375 | package_rules_content <> |
| 376 | - "\n<-- package-rules-end -->\n" |
| 376 | + "\n<-- usage-rules-end -->\n" |
| 377 377 | end |
| 378 378 | |
| 379 379 | Rewrite.Source.update(source, :content, new_content) |
| @@ -419,13 +419,13 @@ if Code.ensure_loaded?(Igniter) do | |
| 419 419 | |
| 420 420 | defp clean_empty_package_rules_section(content) do |
| 421 421 | # Handle both cases: empty section and section with only whitespace |
| 422 | - case String.split(content, "<-- package-rules-start -->") do |
| 422 | + case String.split(content, "<-- usage-rules-start -->") do |
| 423 423 | [prelude, remainder] -> |
| 424 | - case String.split(remainder, "<-- package-rules-end -->") do |
| 424 | + case String.split(remainder, "<-- usage-rules-end -->") do |
| 425 425 | [package_section, postlude] -> |
| 426 426 | # Check if package section is empty or only contains whitespace |
| 427 427 | if String.trim(package_section) == "" do |
| 428 | - # Remove the entire package-rules section if empty |
| 428 | + # Remove the entire usage-rules section if empty |
| 429 429 | cleaned_prelude = String.trim_trailing(prelude) |
| 430 430 | cleaned_postlude = String.trim_leading(postlude) |
| 431 431 | |
| @@ -435,10 +435,10 @@ if Code.ensure_loaded?(Igniter) do | |
| 435 435 | cleaned_prelude <> "\n\n" <> cleaned_postlude |
| 436 436 | end |
| 437 437 | else |
| 438 | - # Keep the package-rules section |
| 438 | + # Keep the usage-rules section |
| 439 439 | prelude <> |
| 440 | - "<-- package-rules-start -->" <> |
| 441 | - package_section <> "<-- package-rules-end -->" <> postlude |
| 440 | + "<-- usage-rules-start -->" <> |
| 441 | + package_section <> "<-- usage-rules-end -->" <> postlude |
| 442 442 | end |
| 443 443 | |
| 444 444 | _ -> |
| @@ -447,7 +447,7 @@ if Code.ensure_loaded?(Igniter) do | |
| 447 447 | end |
| 448 448 | |
| 449 449 | _ -> |
| 450 | - # No package-rules section found |
| 450 | + # No usage-rules section found |
| 451 451 | content |
| 452 452 | end |
| 453 453 | end |
| @@ -1,7 +1,7 @@ | |
| 1 1 | defmodule UsageRules.MixProject do |
| 2 2 | use Mix.Project |
| 3 3 | |
| 4 | - @version "0.1.1" |
| 4 | + @version "0.1.2" |
| 5 5 | @description """ |
| 6 6 | A dev tool for Elixir projects to gather LLM usage rules from dependencies |
| 7 7 | """ |