# `Juggernaut.Install`
[🔗](https://github.com/holsee/juggernaut/blob/v0.4.0/lib/juggernaut/install.ex#L1)

The file edits behind `mix juggernaut.install` (design notes §3), as pure functions of
file contents, so they are tested without Igniter and the installer stays a thin layer
over them. Each edit detects its own earlier application, which keeps the installer
idempotent.

# `agents`

```elixir
@spec agents(String.t() | nil) :: String.t()
```

`AGENTS.md` with the Juggernaut section: replaced in place from its start marker to the
first end marker after it, or to the end of the file when that end marker is missing;
appended when there is no start marker; or the whole file when there is none (`nil`).

# `agents_section`

```elixir
@spec agents_section() :: String.t()
```

The marked `AGENTS.md` section.

# `config_file`

```elixir
@spec config_file(keyword()) :: String.t()
```

The contents of a new `.juggernaut.exs`. Options: `:ecto?` adds the Ecto compile-time
macros to `raw_calls`; `:raw_calls` and `:skip_calls` add converted routes;
`:integration_tags` (found by `integration_tags/1`) join `:integration` as the tags of
the integration test lane (`test_lanes`).

# `ecto_raw_calls`

```elixir
@spec ecto_raw_calls() :: [tuple()]
```

The `raw_calls` written when the project depends on `ecto_sql`.

# `gitignore`

```elixir
@spec gitignore(String.t()) :: {:ok, String.t()} | :unchanged
```

`.gitignore` with `/_build/juggernaut/` appended, or `:unchanged` when `_build` (or
`_build/juggernaut`) is already ignored. The committed triage file is never ignored.

# `igniter_missing_message`

```elixir
@spec igniter_missing_message() :: String.t()
```

What the installer prints when Igniter is not available.

# `integration_tags`

```elixir
@spec integration_tags([String.t()]) :: [atom()]
```

The conventional integration tags (`integration`, `external`, `e2e`, `end_to_end`,
`acceptance`, `feature`, `browser`, `db`, `database`, `network`, `system`) that the test
files `sources` (their contents) set with `@tag`, `@describetag` or `@moduletag`, as
`:name` or `name: true`; sorted. Other tags are left out.

# `skill`

```elixir
@spec skill() :: String.t()
```

The agent skill (`.claude/skills/juggernaut/SKILL.md`): how to use Juggernaut, choose a lane, read the agent
output, and tell when a fresh boot or the integration tests are needed. The file is
Juggernaut's: `mix juggernaut.install --agents` writes it again when it differs.

# `skill_file`

```elixir
@spec skill_file(String.t() | nil) :: {:ok, String.t()} | :unchanged
```

The skill file's new contents given its current ones (`nil` when there is none), or
`:unchanged` when it is current.

# `skill_path`

```elixir
@spec skill_path() :: String.t()
```

Where the agent skill is installed, relative to the project root.

# `write_agents`

```elixir
@spec write_agents(Path.t()) :: [{String.t(), :created | :updated | :unchanged}]
```

Writes the agent guidance under `root` without Igniter: the `AGENTS.md` section
(`agents/1`) and the skill (`skill_file/1`), each only when it differs. Returns each
path with `:created`, `:updated` or `:unchanged`. It is what `mix juggernaut.install
--agents` does, for a project that has no Igniter.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
