TMT Game GeneratorTMT 游戏生成器 tmt-game-generator v1.1.3

An agent skill for The Modding Tree v2.7, MIT-licensed. Runs in ZCode, Claude Code, Codex, Cursor — any tool that reads SKILL.md.

一个 Agent Skill,跑在 The Modding Tree v2.7 上,MIT 协议。支持 ZCode、Claude Code、Codex、Cursor 等一切读取 SKILL.md 的工具。

One sentence in,
a mod tree out.

一句话进来,
一棵模组树出去。

tmt-game-generator is an agent skill. Say “make me an incremental game about X” and your agent runs the full measured pipeline — interview, data-driven design, scaffold, layer-by-layer generation (each layer browser-gated as it is written), 89 static rules, a load-time smoke test, a pacing simulation, browser verification — and hands you a game that opens and plays, balanced, with a clean console.

tmt-game-generator 是一个 Agent Skill:对它说一句「给我做一个关于 X 的增量游戏」,你的 agent 就走完一条带实测的流水线——采访、数据设计、脚手架、逐层生成(层层浏览器即测)、89 条静态规则、载入冒烟、平衡实测、浏览器实测——交付一个打开即玩、曲线平衡、控制台零报错的游戏。

It doesn't guess numbers. It counts them.它不猜数字。它数数字。

Balance parameters are not folklore. They are per-component statistics across public TMT games — every figure traceable to a file and a line.

平衡参数不是经验,是对公开 TMT 游戏逐组件统计的结果——每一条都能溯源到文件与行。

329
real game files from 132 public games, counted component by component个真实游戏文件(来自 132 局公开游戏),逐组件统计
1,156
layers — the evidence behind requires ladders and cost curves层,构成要求阶梯与成本曲线的证据
29,141
upgrades, milestones, challenges and buyables个升级、里程碑、挑战与可购买项
54.4%
of real upgrades ship no effect() — where the wiring rule comes from的真实升级没有 effect()——接线规则的出处

The wiring rule: most real upgrades carry their power not in effect() but in a branch of their layer's gainMult(). So the brief must name a consumer for every upgrade — an effect nobody consumes gets caught by the checker.

接线规则:一多半真实升级的威力不写在 effect() 里,而写在所在层 gainMult() 的分支里。所以设计书必须给每个升级指名消费者——没有消费者的效果,会被静态检查揪出来。

The simulation is a floor, not a forecast: on one build a human ran 2.5 hours while the sim ran 0.62 (×4); on another, 99.8 hours matched the target. If the floor already misses the target, the target is missed — read the early timeline first, calibrate the total second.

模拟是下界,不是预测:某局人类实玩 2.5 小时、模拟 0.62 小时(×4);另一局 99.8 小时与目标吻合。下界已经错过目标,目标就是错的——所以先读时间线,再校准总数。

The pipeline: any stage can send the brief back流水线:每一道都可能把设计书打回去

When a check fails, fix the table, not the code — the brief is the contract, the code is its execution.

检查不过关时,修的是表格,不是代码——设计书是契约,代码是它的执行。

1

Interview采访

At most 8 structured questions: how the theme decides the structure, the scale blueprint, natural ceilings, pacing and interactivity, side content, automation tolerance, language, endgame flavor. A final question locks the game type and an optional-modifier multi-select — classify.js proposes, you confirm — and every answer lands in the brief's question ledger.最多 8 个结构化问题:主题如何决定结构、规模蓝图、自然上限、节奏与互动、支线内容、自动化容忍、语言、终局风味。最后一步锁定游戏类型并勾选可选修饰符——classify.js 提议,由你确认——每个答案都记入设计书的问题台账。

scripts/classify.js
2

Design brief设计书

A layer-chain table, one row per layer — the code-generation contract. Every number comes from the four data assets. All 23 self-checks must pass — including the question ledger and the buyable-wiring plan — and you confirm the brief before any code exists.层链表一行一层,就是代码生成契约;数字全部来自四份数据资产。23 项自检全部通过——含问题台账与可购买项接线计划——且你确认设计书之后,才允许写代码。

assets/*.json
3

Scaffold脚手架

Copy the bundled TMT v2.7 template, patch mod.js with a permanent unique modInfo.id, write .tmt-profile.json, and self-verify the result.复制内置的 TMT v2.7 模板,给 mod.js 打上永久唯一的 modInfo.id,写 .tmt-profile.json,并自我验证语法。

scripts/scaffold.js
4

Generate生成

Layer files written bottom-row-first: Decimal discipline, every upgrade classified token-vs-value and wired to a consumer, microtabs organization, M1–M21 mechanics, the automation ladder through buyable autobuyers, softcaps. Each layer is gated before the next is written — static re-run, boot, one prestige, clean console.自底向上逐层写:Decimal 纪律、每个升级分类 token/value 并接上消费者、microtabs 组织、M1–M21 机制、直到可购买项自动购买的自动化阶梯、软上限。每层写完即门禁——重跑静态、启动、声望一次、控制台干净。

per the brief按层链表
5

Static checks静态检查

89 rules read the code. FAIL blocks testing; every WARN needs a written acceptance in the brief — an unexplained WARN counts as a failure.89 条规则读代码。FAIL 阻塞测试;WARN 必须在设计书里书面豁免——无解释的 WARN 算失败。

scripts/static_checks.js
5.5

Load-time smoke载入冒烟

The real mod files load in Node: boot-time throws, duplicate layer ids, the startData contract, NaN hooks — all before the full browser pass.真实的 mod 文件在 Node 里加载:启动抛错、重复层 id、startData 契约、NaN 钩子,全部在整局浏览器实测之前。

assets/harness/smoke.js
6

Pacing measurement平衡实测

Drives the real economy and reports the first purchase, each layer's first prestige, and the total time to isEndgame(). Achievements are earned, so the floor sits close to real play; --challenges adds the upper bound and flags every challenge already completable the moment it unlocks. Measured, not estimated.驱动真实经济,报出首次购买、每层首次声望、到 endgame 的总时长。成就会真的被拿到,下界因此贴近真实;--challenges 再给上界,并标出一解锁就能完成的挑战。测量,不是估计。

assets/harness/simulate.js
6.5

Browser verification浏览器实测

The generator opens the served game itself: boot errors empty, every tab and microtab opens, one real prestige per layer kind, save/reload intact, console clean. Late layers open in seconds — the simulator exports a save at that layer's unlock moment.生成器自己打开这个游戏:启动零报错、每个标签页能开、每层真实声望一次、存档往返完好、控制台干净。后期层秒开——模拟器导出该层解锁时刻的存档。

Stage 6.5
7

Test handoff测试交接

Serve, play, and work the checklist: clean console, first prestige within minutes, save and offline cap, a reachable endgame.起服务器,对照清单玩一遍:控制台干净、首次声望在几分钟内、存档与离线上限、endgame 可达。

handoff checklist交接清单

Three ways in三种入口

All three run the same pipeline. What differs is who makes the design decisions — you, the agent, or a prompt you write once and reuse.

三种入口走同一条流水线,区别只在设计由谁决定——你、agent,还是你写一次就能复用的提示词。

Entry入口 Use it when什么时候用 What changes会改变什么
One sentence一句话 You want to start now and let the interview pull the design out of you.想立刻开始,让采访把设计问出来。 Nine questions, one confirmation, then this project's default look and balance defaults.九个问题、一次确认,之后是本项目的默认外观与默认数值。
Full prompt完整提示词 You already know the game and would rather write the spec than answer questions.你已经想清楚要做什么,宁愿写规格也不想答题。 The interview becomes a confirmation pass. Every gate unchanged.采访变成一次确认。所有门禁不变。
Large-game prompt大型游戏提示词 You want 25+ layers and a game that does not look like a default mod tree.你要 25 层以上,且一眼看不出是默认模组树。 Rebuilt background, CSS-drawn icons, redesigned controls and navigation, engine edits allowed, chapter-by-chapter delivery. Every gate still runs.重建背景、CSS 绘制图标、重做控件与导航,允许改引擎,按章交付。所有门禁照走。
Large-game prompt: assets/large-game-prompt.md · Full prompt: assets/full-prompt-template.md大型游戏提示词:assets/large-game-prompt.md · 完整提示词:assets/full-prompt-template.md

Recommended for large builds. Paste assets/large-game-prompt.md into the agent and fill its §11. It is opt-in: if you open with one sentence, the skill never applies it, never suggests it, and never detours through it.

做大型游戏建议用它。把 assets/large-game-prompt.md 贴给 agent,填好 §11 即可。它是自愿启用的:如果你用一句话开场,技能不会应用它、不会推荐它,也不会绕道去问。

Type first, then code先定类型,再写代码

The interview's final step locks the game type — orthogonal to the scale blueprint. The type decides which components are mandatory, which are exempt, and which acceptance rules apply.

采访的最后一步锁定游戏类型。类型与规模蓝图正交:它决定哪些组件强制、哪些被豁免、哪些验收规则生效。

Type类型 Interaction model交互模型 Mandatory contract强制契约 Explicit exemption明确豁免
passive-prestige idle, hands-off挂机放置 passiveGeneration / autoPrestige ladderpassiveGeneration / autoPrestige 阶梯 the “you need tick logic” rule「必须有 tick 逻辑」这条规则
active-click active clicking主动点击 the clickable contract (T-CLICKABLE)clickable 契约(T-CLICKABLE) —
active-tick a tick loop节拍循环 an update() heartbeat with an unlocked guardupdate() 心跳,且带解锁守卫 —
board-minigame a board minigame棋盘小游戏 the grid contract (T-GRID)grid 契约(T-GRID) —
Type gates load from .tmt-profile.json; a game with no declared type produces a byte-identical report.类型守卫按 .tmt-profile.json 生效;没有声明类型的游戏,检查报告与从前逐字节一致。

On top of the type, 10 modifiers can stack (themable challenges, story chapters, boss-rush, gacha, casino and friends). A modifier whose hard dependency is unmet is downgraded with a written reason, never silently dropped.

在类型之上还可以叠加 10 个修饰符(主题化挑战、剧情章节、boss-rush、扭蛋、赌场等)。硬依赖不满足时,修饰符会被降级并写明理由,绝不静默丢弃。

Install安装

The build output is the skill itself: copy it into your tool's skills directory and start a new session.

构建产物就是 skill 本体:拷进你的工具的 skills 目录,新开会话即可触发。

node scripts/pack.js # → dist/tmt-game-generator/ # 产出 dist/tmt-game-generator/
ZCode~/.zcode/skills/tmt-game-generator/
Claude Code~/.claude/skills/tmt-game-generator/
Other tools其他工具the tool's user- or project-level skills directory该工具的用户级或项目级 skills 目录

Requires Node.js ≥ 18; the five scripts have zero npm dependencies. To play the result, any static file server (npx http-server <folder>).

要求 Node.js ≥ 18;五个脚本零 npm 依赖。玩生成结果需要一个静态文件服务器(npx http-server <目录>)。

Once installed, start a new session and say:装好后,新开会话说一句:

  • “Make me an incremental game about bees”「给我做一个关于蜜蜂的增量游戏」
  • “Build a prestige tree game where you breed dragons”
  • or, where the tool supports it: 或在支持斜杠命令的工具里:/tmt-game-generator

For 25+ layers and a look of its own, paste assets/large-game-prompt.md instead. A one-sentence request stays the default path and never pulls that prompt in.要做 25 层以上、且外观自成一套,改为粘贴 assets/large-game-prompt.md。一句话仍是默认路径,不会自动引入那份提示词。

Full docs and source: 仓库与完整文档见 GitHub.。