Using Hotcode with a coding agent
On this page
Hotcode ships an agent skill in skills/hotcode/: instructions that a coding agent (Claude Code
and similar) loads when you ask it to adopt Hotcode in your project. With it, the agent works
through the same steps a careful person would, in order, and stops where a human has to decide.
What it contains
| file | what it is |
|---|---|
SKILL.md |
the procedure: when not to use Hotcode, the deployment-shape triage, the audit, classification, install and configuration, code conversions, tests, CI, first deploy, rollout, and a final report |
references/hazards.md |
every hot-deploy hazard: how to find it, why it breaks, the fix, whether it stays restart-only |
references/deploy-shapes.md |
systemd, Docker on ECS, Kubernetes, Fly.io, independent nodes, Erlang clusters, desktop and CLI: what works and what is missing |
references/conversion-templates.md |
before and after code: Hotcode.Versioned, Hotcode.Table, Hotcode.Swap, closures, supervisors, hooks |
references/ci-recipes.md |
toolchain pins, exit codes, GitHub Actions, the fleet push for independent nodes, building against a saved manifest, Argo CD |
references/troubleshooting.md |
each refusal and failure, and what the agent does about it |
scripts/audit.exs |
a read-only scan of a project |
The audit script
The script runs with plain elixir (no dependencies, Elixir 1.17 or later) and never writes to
the project:
elixir skills/hotcode/scripts/audit.exs PATH/TO/PROJECT
elixir skills/hotcode/scripts/audit.exs PATH/TO/PROJECT --json
elixir skills/hotcode/scripts/audit.exs PATH/TO/PROJECT --all --exclude some_dir
It prints how the project is deployed (release, toolchain pins and whether they agree, Docker,
Fly, Kubernetes, ECS and systemd hints, distribution, clustering libraries, web server, CI
actions), the module prefixes to put in allowed_prefixes, and findings grouped by hazard with
file:line and a fix. It reads .ex and .exs files under every lib/ directory and skips
deps/, _build/, test/, comments and documentation. It is a text scan: each finding is a lead
to read, not a verdict. It complements mix hotcode.check, whose Credo rules parse the code but
do not see closures built in another module, accept loops, @derive, Application callback modules
or registries built from the .app module list.
Installing it for Claude Code
Claude Code reads skills from .claude/skills/<name>/SKILL.md in a project, or from
~/.claude/skills/<name>/ for every project. Copy or link the directory:
# one project
mkdir -p .claude/skills
cp -R deps/hotcode/skills/hotcode .claude/skills/hotcode
# every project, from a clone of Hotcode
ln -s /path/to/hotcode/skills/hotcode ~/.claude/skills/hotcode
The layout (skills/<name>/SKILL.md in a GitHub repository) is the one the skills command
line tool reads (npx skills add OWNER/REPO@SKILL), so npx skills add filipecabaco/hotcode@hotcode
should install it; that command has not been tried against this repository. Other agents that
read SKILL.md files take the same directory.
Prompting the agent
Name the skill and the goal, and say what the agent may change:
- "Use the hotcode skill to assess whether this project fits Hotcode. Do not change code."
- "Use the hotcode skill to adopt Hotcode here. Stop after the classification table and wait for me."
- "Use the hotcode skill to convert
MyApp.CarttoHotcode.Versionedand write its tests." - "Use the hotcode skill to add a hot-deploy job to our CI. Staging only."
Give it the answers it will ask for, if you know them: how the deploy command reaches a node, who signs and where the keys live, which path survives a restart, and whether the nodes are an Erlang cluster.
What it will and will not do
It will:
- run the audit, fill in the deployment-shape table and print a classification of every stateful module (hot-deployable, needs conversion, restart-only) before changing code;
- add the dependency and
config :hotcode, convert modules with the templates, writeHotcode.Testtests and a CI job, and runmix compile,mix hotcode.check --strictand the tests; - end with a report that lists what it ran, what passed and what it could not verify.
It will not:
- generate, read, move or commit private keys, or put one in config, an image or CI files;
- weaken trust: no
--force,unsafe_allow_unsigned,insecure_http, lowerthresholdor broadallowed_prefixes, and noallow_app_restartor--accept-majordecision on your behalf; - deploy, restart or roll back a node, commit, branch or push, unless you ask for that action;
- claim a hot deploy works without tests and a
--dry-runagainst a real node.
The skill states Hotcode's limits as they are, including where Hotcode has no feature yet (a
client-side pull flow for desktop apps, shipping files in priv/).