Skip to content

Commit 888dce4

Browse files
committed
usage_rules
1 parent 224164f commit 888dce4

4 files changed

Lines changed: 42 additions & 2 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ diffo-*.tar
2727
.DS_Store
2828

2929
# Agent related
30-
.claude/*
30+
.claude/*
31+
CLAUDE*

.igniter.exs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This is a configuration file for igniter.
2+
# For option documentation, see https://hexdocs.pm/igniter/Igniter.Project.IgniterConfig.html
3+
# To keep it up to date, use `mix igniter.setup`
4+
[
5+
module_location: :outside_matching_folder,
6+
extensions: [],
7+
deps_location: :last_list_literal,
8+
source_folders: ["lib", "test/support"],
9+
dont_move_files: [~r"lib/mix"]
10+
]

mix.exs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ defmodule DiffoExample.MixProject do
2525
homepage_url: "http://diffo.dev/diffo_example/",
2626
docs: [main: "readme", extras: ["README.md"]],
2727
elixirc_paths: elixirc_paths(Mix.env()),
28+
# agent stuff
29+
usage_rules: usage_rules(),
2830
# hex.pm stuff
2931
deps: deps(),
3032
docs: &docs/0,
@@ -89,9 +91,10 @@ defmodule DiffoExample.MixProject do
8991
{:diffo, diffo_version("~> 0.2.2")},
9092
{:ash_json_api, "~> 1.6"},
9193
{:plug_cowboy, "~> 2.7"},
92-
{:req, "~> 0.5", only: [:dev, :test]},
9394
{:picosat_elixir, "~> 0.2.0"},
9495
{:simple_sat, ">= 0.0.0"},
96+
{:usage_rules, "~> 1.0", only: [:dev]},
97+
{:req, "~> 0.5", only: [:dev, :test]},
9598
{:igniter, "~> 0.6", only: [:dev, :test]},
9699
{:ex_doc, "~> 0.37", only: [:dev, :test], runtime: false}
97100
]
@@ -113,4 +116,29 @@ defmodule DiffoExample.MixProject do
113116

114117
defp elixirc_paths(:test), do: elixirc_paths(:dev) ++ ["test/support"]
115118
defp elixirc_paths(_), do: ["lib"]
119+
120+
defp usage_rules do
121+
# Example for those using claude.
122+
[
123+
file: "CLAUDE.md",
124+
# rules to include directly in CLAUDE.md
125+
usage_rules: ["usage_rules:all"],
126+
skills: [
127+
location: ".claude/skills",
128+
# build skills that combine multiple usage rules
129+
build: [
130+
"ash-framework": [
131+
description: "Use this skill working with Ash Framework or any of its extensions. Always consult this when making any domain changes, features or fixes.",
132+
# Include all Ash dependencies
133+
usage_rules: [:ash, ~r/^ash_/]
134+
],
135+
"diffo-framework": [
136+
description: "Use this skill working with Diffo or any related non-Ash Diffo components. Understand the provider extension and assigner.",
137+
# Include all Diffo dependencies
138+
usage_rules: [:diffo, ~r/^diffo_/]
139+
]
140+
]
141+
]
142+
]
143+
end
116144
end

mix.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"stream_data": {:hex, :stream_data, "1.3.0", "bde37905530aff386dea1ddd86ecbf00e6642dc074ceffc10b7d4e41dfd6aac9", [:mix], [], "hexpm", "3cc552e286e817dca43c98044c706eec9318083a1480c52ae2688b08e2936e3c"},
5757
"telemetry": {:hex, :telemetry, "1.4.1", "ab6de178e2b29b58e8256b92b382ea3f590a47152ca3651ea857a6cae05ac423", [:rebar3], [], "hexpm", "2172e05a27531d3d31dd9782841065c50dd5c3c7699d95266b2edd54c2dafa1c"},
5858
"text_diff": {:hex, :text_diff, "0.1.0", "1caf3175e11a53a9a139bc9339bd607c47b9e376b073d4571c031913317fecaa", [:mix], [], "hexpm", "d1ffaaecab338e49357b6daa82e435f877e0649041ace7755583a0ea3362dbd7"},
59+
"usage_rules": {:hex, :usage_rules, "1.2.6", "a7b3f8d6e5d265701139d5714749c37c54bb82230a4c51ec54a12a1e4769b9d1", [:mix], [{:igniter, ">= 0.6.6 and < 1.0.0-0", [hex: :igniter, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:req, "~> 0.5", [hex: :req, repo: "hexpm", optional: false]}], "hexpm", "608411b9876a16a9d62a427dbaf42faf458e4cd0a508b3bd7e5ee71502073582"},
5960
"uuid": {:hex, :uuid, "1.1.8", "e22fc04499de0de3ed1116b770c7737779f226ceefa0badb3592e64d5cfb4eb9", [:mix], [], "hexpm", "c790593b4c3b601f5dc2378baae7efaf5b3d73c4c6456ba85759905be792f2ac"},
6061
"websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"},
6162
"websock_adapter": {:hex, :websock_adapter, "0.5.9", "43dc3ba6d89ef5dec5b1d0a39698436a1e856d000d84bf31a3149862b01a287f", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "5534d5c9adad3c18a0f58a9371220d75a803bf0b9a3d87e6fe072faaeed76a08"},

0 commit comments

Comments
 (0)