Current section

Files

Jump to
hologram lib mix tasks holo gen claude_md.ex
Raw

lib/mix/tasks/holo/gen/claude_md.ex

defmodule Mix.Tasks.Holo.Gen.ClaudeMd do
@moduledoc """
Syncs a CLAUDE.md file with Hologram AI rules.
The content is read from the `usage-rules.md` file shipped with the Hologram
package and wrapped in `<!-- hologram-start -->` / `<!-- hologram-end -->` markers.
If the target file already exists:
- If markers are found, the content between them is replaced.
- If no markers are found, the marked section is appended at the end.
If the target file doesn't exist, it is created with the marked section.
$ mix holo.gen.claude_md
"""
use Mix.Task
@doc false
@impl Mix.Task
def run(opts \\ []) do
# credo:disable-for-next-line Credo.Check.Design.AliasUsage
Hologram.Generators.AIRules.sync("CLAUDE.md", opts)
end
end