economy

economy is a skill for Claude Code from plausibleventures/lattice. It costs 80 tokens per session (3,751 once invoked), scanned A, original, MIT.

A simulation system for game economies, where production, resources, prices, upgrades, capacity, and progress change over time. It also models progress earned while a player is away from the game.

In plain words
What is it for?
Use it for idle, incremental, and tycoon games with resources, currencies, shops, rising prices, upgrades, capacity limits, buy-max actions, or offline earnings.
Why use it?
It keeps live play and offline progress on the same rules, so long periods can be calculated in one step without relying on constant timer updates. It also marks purchases, milestones, and limits as clear state changes.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the lattice plugin — 12 skills, 1 command, 6 agents shipped together

Good fit Use it for idle, incremental, and tycoon games with resources, currencies, shops, rising prices, upgrades, capacity limits, buy-max actions, or offline earnings.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/plausibleventures/lattice/economy
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 plausibleventures/lattice --skill economy
Clone the repo
git clone --depth 1 https://github.com/plausibleventures/lattice

Made for: Claude Code.

Or install lattice, the plugin that ships this one along with the rest of its 12 skills, 1 command, 6 agents.

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 economy

README.md
[![agentmods](https://agentmods.dev/badge/skills/plausibleventures/lattice/economy/github.svg)](https://agentmods.dev/skills/plausibleventures/lattice/economy)
Your own site
<a href="https://agentmods.dev/skills/plausibleventures/lattice/economy"><img src="https://agentmods.dev/badge/skills/plausibleventures/lattice/economy/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 economy

Your own site · 80×15
<a href="https://agentmods.dev/skills/plausibleventures/lattice/economy"><img src="https://agentmods.dev/badge/skills/plausibleventures/lattice/economy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,751 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.00080 $0.03751
Opus 5 $0.00040 $0.01876
Sonnet 5 $0.00016 $0.00750
Haiku 4.5 $0.00008 $0.00375

Measured 9d ago against content hash eb9c3d5cf934, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

economy 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 9d 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.

skills/economy/SKILL.md · 308 lines

How it starts

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

Economy

The whole package is one idea: everything is linear between commits. Gates, milestones, purchases, nightfall and a stock hitting zero are the discontinuities, and every one of them is a boundary — an instant at which the caller re-enters. That is what makes one integration of fourteen hours equal to fifty thousand integrations of one second, and it is why offline progress and live play are the same code path rather than two that drift.

There is no tick, no clock and no state of its own. Every call that moves the anchor takes a required epoch timestamp, so a frame delta has nowhere to go — and a builder who sees dt in update() and reaches for it will find no signature to put it in. That refusal is the design.


A whole economy

import { asEpochMillis } from '@latticekit/core';
import {
  advance, buildFlow, costOfNext, createFlow, defineEconomy,
  elapsedSeconds, maxBuyable, project, zeroStocks,
} from '@latticekit/sim';
import type { CostCurve, Ledger } from '@latticekit/sim';

type Node = 'lamp' | 'coin';
type Gate = 'night';

let reach = 1;                     // a banked total: it changes only when the player acts

const eco = defineEconomy<Node, Gate>({
  // `nodes` is the SAVE'S FIELD ORDER and it never changes. Append in v4 and every v1 save
  // still deserializes with its fields where they were.
  nodes: ['lamp', 'coin'],
  gates: ['night'],
  edges: [
    // A SOURCE — no `from`. This is what an idle game's headline rate usually is: the thing
    // that pays while the player owns zero of everything.
    { to: 'coin', per: 2, gate: 'night' },
    // A plain producer, with a rate that is any expression you like as long as it is
    // piecewise constant in time. `scale` is evaluated ONCE PER buildFlow and frozen.
    { from: 'lamp', to: 'coin', per: 0.5, scale: () => Math.sqrt(reach) },
  ],
});

const flow = createFlow(eco);
const view = zeroStocks(eco);

let ledger: Ledger<Node> = {
  stocks: { lamp: 3, coin: 0 },
  atMs: asEpochMillis(1_700_000_000_000),
};
let dark = false;

/** The game owns the calendar. ONE call site, greppable, and never reaching a tile or a hash. */
const epochNow = (): ReturnType<typeof asEpochMillis> => asEpochMillis(Date.now());

/** In `render` (or in `update` for a HUD): read the economy at an instant. Moves nothing. */
export function read(): number {
  project(eco, ledger, flow, epochNow(), view);
  return view.coin;
}

/** In an action handler: commit what is owed, THEN change the rate. */
function commit(atMs: ReturnType<typeof asEpochMillis>): void {
  ledger = advance(eco, ledger, flow, elapsedSeconds(ledger, atMs), atMs);
}

export function nightfall(nowDark: boolean): void {
  const atMs = epochNow();
  commit(atMs);                                          // a gate is a BOUNDARY, not a curve
  dark = nowDark;
  buildFlow(eco, ledger.stocks, { night: dark ? 1.7 : 1 }, flow);
}

const LAMP: CostCurve = { base: 12, growth: 1.3 };

export function buyLamp(): boolean {
  const atMs = epochNow();
  commit(atMs);
  const price = costOfNext(LAMP, ledger.stocks.lamp);
  if (ledger.stocks.coin < price) return false;          // compare EXACTLY. No epsilon
  ledger = {
    stocks: { lamp: ledger.stocks.lamp + 1, coin: ledger.stocks.coin - price },
    atMs: ledger.atMs,
  };
  reach += 1;
  // `reach` moved and `scale` is sampled once per buildFlow — so this rebuild is not
  // bookkeeping, it is the only thing that makes the new lamp pay.
  buildFlow(eco, ledger.stocks, { night: dark ? 1.7 : 1 }, flow);
  return true;
}

/** The shop's "buy max". Closed form: 4,000 owned costs what 4 owned costs. */
export function affordable(): number {
  return maxBuyable(LAMP, ledger.stocks.lamp, view.coin, 1_000_000);
}

Read the full file on GitHub · 308 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. 9d ago First seen · 308 lines · 80 tokens per session scan A eb9c3d5cf934

Subscribe to this mod's changes

economy is a skill published in the GitHub repository plausibleventures/lattice (37 stars, last pushed 17d ago), licensed MIT. It adds 80 tokens to every session and 3,751 once invoked, about $0.0004 per session on Opus 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

phaser3-engineer

!cat skills/shared/game-visual-foundations.md 2>/dev/null || echo "=== Visual Foundations not loaded ===" !cat skills/shared/protocols/ux-protocol.md 2>/dev/null || true !cat skills/shared/protocols/input-validation.md 2>/dev/null || true !cat skills/shared/protocols/tool-efficiency.md 2>/dev/null || true !cat…

buiphucminhtam/forgewright · 71 tokens

asset-audit

Audits game assets for compliance with naming conventions, file size budgets, format standards, and pipeline requirements. Identifies orphaned assets, missing references, and standard violations.

TraftG/opencode-game-studio · 38 tokens

defi-protocol-templates

Implement DeFi protocols with production-ready templates for staking, AMMs, governance, and lending systems. Use when building decentralized finance applications or smart contract protocols.

HermeticOrmus/claude-code-game-development · 38 tokens

assets-get-data

Get asset data from the asset file in the Unity project — every serializable field and property. Supports token-saving path-scoped reads via paths or viewQuery. Use 'assets-find' to find the asset first.

IvanMurzak/Unity-MCP · 50 tokens

gameobject-set-parent

Reparent a batch of GameObjects under a new parent in the currently opened Prefab or active Scene. Per-item failures are reported in the returned status string instead of aborting the batch. Use 'gameobject-find' to locate the GameObjects first.

IvanMurzak/Unity-MCP · 56 tokens

unity-version-split

Split a C# file into Unity 6.5+ and pre-Unity 6.5 variants. Use when a file needs different implementations for different Unity versions due to API changes (e.g., EntityId vs int, GetEntityId vs GetInstanceID).

IvanMurzak/Unity-MCP · 59 tokens