Docs

From Kevin-Liu-01/Claude-of-Tanks · View interactive version

Docs is an AI agent skill from the GitHub repository Kevin-Liu-01/Claude-of-Tanks. Maintain the public field manual, indexed topic pages, typed icons, and battle-reel interactions.

How to use this skill

Skill file

claude-of-tanks / src/docs

Purpose

<!-- agent-docs:fill:purpose -->

Explain the shipped game through lightweight public HTML pages and real

game-rendered evidence, without booting the playable world: the Field Manual's

index (/docs) and its fifteen chapters on two shelves (Play, Behind the game),

in English and, under /cn, Chinese.

Mental model & key files

<!-- agent-docs:fill:model -->

shelves, task-first), each chapter's label, title, lede and hero take, the

text chapters' sections and figures, and the chapter page's markup

(topicPageMarkup: shelf rail, search, banner, article, on-this-page, pager).

A chapter with rich: true has no sections of its own: it is data-built.

builder). A builder returns RichSection[] from the game's own tables and

catalogs — the fleet (fleet.ts, rows read tool-side by

tools/docsFleetTable.ts), the sim's constants, the mode rules, the room

protocol, the audio tables, the Studio's lists — and never retypes a number.

charts.ts draws the SVG line charts; chapters.css styles these pages only.

chapter's <main id="topicRoot"> in site/docs-<slug>.html, the Chinese

markup in topicPrerender.zh-CN.json (applied to the /cn pages at build by

src/presentation/localizedHtml.ts), the search indexes

searchIndex.<locale>.json, and the index's chapter map between

<!--docs:map--> markers in site/docs.html.

mediaArchive.ts and its sheet on the click, the battle reels).

docsSearch.ts searches the prebuilt index (Cmd K / Ctrl K); the 404 reuses

its entriesOf() and searchManual(). reference.ts mounts the tanks

chapter's fleet reference from reference.generated.json

(tools/generate-manual-reference.mjs); referenceTakes.ts gives each record

its take. battleReels.ts owns the index's reels (names resolve on read and

follow the catalog when it lands); docsIcons.ts maps concepts to the sprite;

filming.ts fills the Filming chapter's take viewer

(public/media/filming-r1, tools/media-r5/docs-media.mjs).

TOPIC_HERO_RUNGS (960 and phone); figures from public/media/docs-r1

(its manifest.json); a figure that is not 1920x1080 needs a

TOPIC_FIGURE_SIZES row (tools/media-fallback.selftest.mjs reads headers).

Patterns to follow / invariants

<!-- agent-docs:fill:patterns -->

from their owners, pass numbers through catalog templates, and keep both

catalogs in step (no English in the Chinese pages; names, codes and key caps

stay as written).

node tools/docs-prerender.mjs --write and commit what it rewrites

(site/docs-*.html, site/docs.html's map, topicPrerender.zh-CN.json,

searchIndex.*.json); without --write it exits 1 naming stale files.

(eager, fetchpriority=high); everything else waits for its boundary. Size

every figure, and name a loop hero's picture by its take.

shows a 2px accent outline; element colour resets sit in @layer base

(tools/surface-element-resets.selftest.mjs), never in surfaces.

the manual. Share public presentation helpers instead of copying them.

Common tasks → first action

<!-- agent-docs:fill:tasks -->

with a builder in chapters/ registered in chapters/index.ts if it is

data-built), site/docs-<slug>.html from site/docs-topic.html, its Vite

input and optimizeDeps.entries line (vite.config.ts), the vercel.json

rewrite lists and PUBLIC_ROUTE_RECORDS (src/ui/localeRouting.ts), the copy

in both catalogs, then the prerender. Run topics, chapters,

tools/vercel-routes, seoMetadata and tools/i18n-page-catalogs selftests.

node src/docs/chapters/chapters.selftest.mjs and topics.selftest.mjs.

referenceTakes and tools/generate-manual-reference selftests.

tools/media-r5/site-video-budget selftests; the reels' static caption and

the hero takes are wired by tools/media-r5/site-media-wire.mjs.

(node tools/vercel-static-preview.mjs --dist=dist) after the focused tests.

Gotchas

<!-- agent-docs:fill:gotchas -->

This directory is public application code, not the repository's engineering

docs/ directory. chapters/*.ts read files through node:fs: never import

them from a page module. The prerendered blocks are generated — a hand edit is

overwritten, and a stale topicPrerender.zh-CN.json ships stale Chinese.

Retired chapters (vehicles, worlds, interface, performance) answer 308 to their

successors in vercel.json. Do not name the tank asset manifest (public/icons/tank-assets/)

from src/ (tools/tool-only-public-files.selftest.mjs); a catalog change renames

the hashed chunks a page imports, so compressed bundle rows move by a few bytes

with identical raw size.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.