hearth-code

hearth-code is a skill for Claude Code from echoo19/hearth. It costs 88 tokens per session (2,603 once invoked), scanned A, original, MIT.

A guide to writing behavior scripts for Hearth, a game-making environment. It documents Lua and JavaScript scripts, game events, movement, timers, cameras, audio, saving, and related scripting details.

In plain words
What is it for?
Use it when implementing movement, artificial intelligence, pickups, rules, collisions, or other in-game behavior in Hearth.
Why use it?
It gives an agent the information needed to add behavior to a Hearth game without guessing how its scripting interface works.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it when implementing movement, artificial intelligence, pickups, rules, collisions, or other in-game behavior in Hearth.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/echoo19/hearth/hearth-code
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add echoo19/hearth --skill hearth-code
Clone the repo
git clone --depth 1 https://github.com/echoo19/hearth

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for hearth-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/echoo19/hearth/hearth-code/github.svg)](https://agentmods.dev/skills/echoo19/hearth/hearth-code)
Your own site
<a href="https://agentmods.dev/skills/echoo19/hearth/hearth-code"><img src="https://agentmods.dev/badge/skills/echoo19/hearth/hearth-code/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for hearth-code

Your own site · 80×15
<a href="https://agentmods.dev/skills/echoo19/hearth/hearth-code"><img src="https://agentmods.dev/badge/skills/echoo19/hearth/hearth-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,603 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00088 $0.02603
Opus 5.5 $0.00035 $0.01041
Sonnet 5.5 $0.00018 $0.00521
Haiku 4.5 $0.00009 $0.00260

Measured 1mo ago against content hash 9efabc1df21c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

hearth-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/examples/bounce-patrol/.claude/skills/hearth-code/SKILL.md · 249 lines

How it starts

The opening of the file, as written. The whole thing — 249 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Scripting Hearth: the ctx stdlib

This skill covers making things happen — behavior scripts and the ctx API. What entities/components exist in the world is the hearth-build skill; game-feel recipes that use these APIs live in hearth-feel; the operating loop (validate, playtest, screenshot, snapshot) is the core hearth skill.

hearth inspect api --json is the canonical, always-current ctx reference — every member with signature, docs, and a Lua + JS example. Read it when scripting instead of trusting memory.

Scripts and lifecycle hooks

Behavior lives in scripts/. Lua is the default (hearth create script emits .lua); JS is equally supported (--language js). Both get the identical ctx API and run the same in editor preview, headless playtests, and export.

hearth create script coin-spin                 # Lua
hearth create script boss-ai --language js
hearth create script noise --dir lib           # scripts/lib/noise.lua helper
hearth attach script "Level 1" Coin scripts/coin-spin.lua

A Lua script returns a table of lifecycle hooks; JS export defaults an object with the same hooks: onStart(ctx), onUpdate(ctx, dt), onCollision(ctx, other), onUiEvent(ctx, event), onEvent(ctx, name, data).

Script modules

Share helpers with load-time require from the top of the file:

local noise = require("lib/noise") -- scripts/lib/noise.lua
const noise = require('lib/noise'); // scripts/lib/noise.js

A library is just a script that returns a table (Lua) or exports an object (JS), usually with no lifecycle hooks. No new asset type. Rules that matter: same-language only (.lua requires .lua, .js requires .js), resolution cannot escape scripts/, cycles are errors, and require is load-time only. Call it at the top of the file, not inside onUpdate or another hook.

Hot reload recompiles dependents when a library changes. If any compile fails, the old graph keeps running. Module top-level state resets on successful reload, so put state that must survive in ctx.vars.

Read the full file on GitHub · 249 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 249 lines · 88 tokens per session scan A 9efabc1df21c

Subscribe to this mod's changes

hearth-code is a skill published in the GitHub repository echoo19/hearth (49 stars, last pushed 18d ago), licensed MIT. It adds 88 tokens to every session and 2,603 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

script-execute

Compiles and runs C# in the Unity Editor (Roslyn): plain statements with the last expression as the result, or a full class with a static method. See the skill body for the modes, usings/include and Unity object parameters.

IvanMurzak/Unity-MCP · 53 tokens

script-delete

Delete one or more .cs script files from disk, refresh the AssetDatabase, and wait for Unity compilation to settle before delivering the final result via the request's requestId. Pair with 'script-read' to inspect files before deletion.

IvanMurzak/Unity-MCP · 52 tokens

script-read

Read a .cs script file and return its content as a string. Supports a 1-based lineFrom/lineTo slice for partial reads. Pair with 'script-update-or-create' to write back.

IvanMurzak/Unity-MCP · 49 tokens

script-update-or-create

Write a .cs script file (create or overwrite) with the provided C# code. Validates syntax via Roslyn before write — invalid code is rejected with error details and the file is left untouched. Refreshes the AssetDatabase and delivers the final result via requestId after Unity finishes the triggered compilation. Use…

IvanMurzak/Unity-MCP · 80 tokens

ebitengine-game

Create, improve, debug and package playable 2D games in Go with Ebitengine (github.com/hajimehoshi/ebiten/v2). Use for Ebitengine game requests: game design translated into a complete loop, input, rendering, text, audio, scenes, gameplay tests and desktop, browser or mobile builds. Also use when fixing these systems…

gamedev-skills/awesome-gamedev-agent-skills · 108 tokens

bevy-ecs

Structure a Bevy app around its Entity Component System: build the App with plugins, define Component/Resource types, write systems with Query/Res/Commands, filter and order systems, and use the Time resource for frame-rate-independent motion. Use when building or debugging a Bevy game in Rust — when the user mentions…

gamedev-skills/awesome-gamedev-agent-skills · 100 tokens