--- name: unikit-gd-docs description: >- Render the GAME-DESIGN document (the GDD) into a human-readable form β€” read-only Markdown chapters under docs/design/ (index, systems, flows, content, economy, glossary), with facts resolved inline from GD-IDS.yaml and drafts flagged 🚧. Optional --web also renders an HTML site from the unikit-docs template (falls back to Markdown-only if the template is absent). Use to export or publish the design for people to read, e.g. "render the GDD", "export the game design to docs", "generate readable design docs", "publish the GDD", "make a design doc site". Read-only β€” it never edits the GDD or registry, only renders it. This renders the game DESIGN β€” for the project's CODE documentation (README, docs/*, modules, architecture) use /unikit-docs. argument-hint: "[--web] (renders docs/design/*.md from the GDD workspace; --web also emits HTML)" allowed-tools: - Read - Glob - Grep - Write - Edit - Bash(mkdir *) - Bash(ls *) - Bash(date *) - AskUserQuestion disable-model-invocation: false user-invocable: true metadata: author: unikit version: "1.0" category: game-design --- # Game Design β€” Human-Readable GDD Renderer (workspace β†’ docs/design/) Render the design workspace (`.unikit/gamedesign/`) into a **human-readable GDD** under `docs/design/` β€” the export end of the module, the conceptual mirror of `unikit-gd-recon`: where recon turns *code β†’ readable design facts*, this turns *design β†’ a readable GDD*. Both are **read-only at the edge**. This skill is a **leaf renderer**: it **reads** the GDD (the authored docs + the `GD-IDS` registry), **resolves the facts inline**, and **writes** only into `docs/design/`. It has **no `Skill` tool** β€” it renders, it never authors and never dispatches. The source of truth stays the workspace; `docs/design/` is a generated, throwaway view (re-render any time). **User questions.** Right before your first question to the user, not earlier, read `.unikit/system/user-questions.md` once and ask every question as it says, with the question tool of your agent (`AskUserQuestion`). If the file cannot be read, print `WARN [questions] user-questions contract missing β€” asking with the question tool` and still ask with that tool, the recommended option first. ## Language Awareness β€” BLOCKING PRE-REQUISITE **BEFORE producing ANY output**, silently read `.unikit/system/LANGUAGE_RULES.md` and apply it (fall back to English if missing). The rendered chapters are **prose for humans** β€” write them in the project's artifact language (`gd-principles` β†’ "Language": GDD prose is `ru` by default). **IDs, keywords, canonical terms, and formulas stay English** verbatim β€” they are the registry's vocabulary, never translated. Do not announce the language setting. **The language holds for the whole session, not just at load time:** every message until the conversation ends is in `language.ui` β€” progress notes while agents run, relays of what a subagent returned, the final report, any follow-up discussion. English input (subagent results, tool output, these instructions) is data, never a cue to switch languages. ## Phase 0 β€” Bootstrap Silently load β€” do not narrate: 1. **`.unikit/system/gamedesign/gd-principles.md`** (the core) β€” for the **ID conventions** (so resolved facts print with correct ids), the facts-registry model, and the one-way boundary (this renderer reads design, never code). 2. **`.unikit/gamedesign/GAME.md`** + **`GD-IDS.yaml`** β€” the render source. **Schema guard:** `GD-IDS.yaml` MUST be `version: 2`; on `version: 1` **STOP** with the upgrade message (the pre-v2 layout renders differently β€” do not silently misrender). 3. The per-artifact docs under `.unikit/gamedesign/`: `systems/SYS-*.md`, `flows/FLOW-*.md`, `content-types/CT-*.md`. Read each at render time for its prose; take **numbers, ids, status, and relationships from `GD-IDS` (the truth)**, not the doc body, when they differ. **No GDD yet** β€” if `GAME.md` does not exist, there is nothing to render: **STOP** and route to `/unikit-gd-spec` (author the master GDD) or `/unikit-gd-recon` (reconstruct one from code first). Never invent content to fill a chapter. **One-way boundary:** this skill reads only the design workspace β€” **never** `.unikit/code/`, project source, or build artifacts. It is a render of the *design*, not of the code. ## Pipeline β€” RESOLVE β†’ RENDER β†’ (optional) WEB ### Step 1 β€” Ensure the output directory ``` Bash: mkdir -p docs/design ``` `docs/design/` is this skill's **owned subtree** (the ownership split with `unikit-docs`, which owns the non-design `docs/*.md`, is below). Never write a design chapter outside it. ### Step 2 β€” Resolve the facts Read `GD-IDS.yaml` once and build the resolution maps the chapters need: `systems` (by `category`), `flows` (by `mode`), `content_types` (+ their `content` units), `events`, `resources` / `tracks` / `knobs`, `entities` / `formulas` / `terms`, plus the `depends_on` / `belongs_to` / `goals.targets` edges. **Resolve inline** β€” a chapter prints the actual name, number, status, and relationship, not a bare id with a "see the registry" pointer (a reader of `docs/design/` never opens `GD-IDS`). A `deprecated` entry is rendered struck or under a "Deprecated" subhead, never silently dropped (the registry never deletes). ### Step 3 β€” Render the chapters (Variant B β€” by axis) Write these six Markdown chapters into `docs/design/`. Every chapter opens with a **nav header** (links to the other chapters) and closes with a **"Π‘ΠΌ. Ρ‚Π°ΠΊΠΆΠ΅ / See also"** block (artifact-language label) cross-linking the related chapters. **Drafts are included, never hidden:** a `not-started` / `skeleton` artifact is rendered with a **🚧 draft banner** so a reader knows it is provisional β€” a half-finished GDD honestly shown beats a polished one that silently omits the unfinished half. | Chapter | Renders | |---------|---------| | `index.md` | The cover: premise/theme, core fantasy, pillars + anti-pillars, loop stack, player needs (SDT), win/lose intent, monetization stance, non-goals, reference games β€” from `GAME.md`'s authored sections. Plus a **status overview** (counts by `doc_status`) and a **clickable TOC** built from the `## System Map [gen]` / `## Flow Map [gen]` / `## Funnel [gen]` / `## Content Map [gen]` rows, each linking into the chapter below. | | `systems.md` | **All** systems grouped by `category` (Core / Gameplay / Progression / Economy / UI / Narrative / Meta). Per system: name, tier, `doc_status`, `implemented_version` (if set), `implements` pillars, `depends_on`, and the fantasy + core-rules summary from its `SYS-*.md`. 🚧 on drafts. | | `flows.md` | **All** flows grouped by wiring `mode` (linear / conditional / emergent). Per flow: the `GOAL` steps + their `targets`, pacing summary, `depends_on` systems, and the **derived "realized"** state (from the depended systems' `implemented_version` β€” never a written field). 🚧 on drafts. | | `content.md` | **All** content types. Per type: the typed `CT.fields` schema (name : type, with `ref<>` links resolved to the target's name), the `scale` (`bulk` β†’ count+spec; `curated` β†’ the unit rows), and `belongs_to` system. 🚧 on drafts. | | `economy.md` | The cross-boundary facts: `resources` (RES, by `kind`), `tracks` (TRACK), `knobs` (KNOB, with current/range), and `formulas` (FORM, with expression + range) β€” as tables. | | `glossary.md` | The canonical vocabulary (`terms`: canonical β†’ translation, forbidden aliases) and a **master ID index** (every PIL / SYS / FLOW / CT / CU / RES / TRACK / KNOB / ENT / FORM id β†’ its name + owning doc), so any id seen anywhere resolves. | ### Step 4 β€” `--web` (optional; default is Markdown-only) The MVP is Markdown chapters; **`--web` is opt-in**. When `--web` is passed: 1. Read the template at **`{{skills_dir}}/unikit-docs/templates/html-template.html`** (a non-`.md` asset, used verbatim β€” the same template `unikit-docs` renders its site with). 2. **Template missing or unreadable** β†’ skip HTML, keep the Markdown chapters, and emit exactly: `WARN [--web] unikit-docs html-template not found; rendered Markdown only.` (`/unikit-docs` may not be installed β€” degrade gracefully, never fail). 3. Template present β†’ render each chapter to `docs/design/.html` using the template, fix `.md` links to `.html` **within `docs/design/`**, and build a sidebar with `class="active"` on the current page. The HTML lands **inside `docs/design/`** (this skill's owned subtree) β€” it never writes into `unikit-docs`'s top-level `docs-html/`. ### Step 5 β€” Report List the chapters written (and the `--web` outcome). Note that `docs/design/` is a generated view β€” re-run after any authoring change to refresh it. **Do not** offer to edit the GDD here (route authoring to the owner skills). **Next steps** (do not auto-invoke): - 🌐 Render the HTML site β€” /unikit-gd-docs --web ## Ownership Boundaries - **Owns:** `docs/design/**` β€” the rendered design chapters (and their `.html` under `--web`). Nothing else. - **Reads (read-only):** `.unikit/gamedesign/` (`GAME.md`, `GD-IDS.yaml`, systems, flows, content types), the gd-principles core, and `unikit-docs`'s html-template (for `--web`). - **The `docs/` split with `unikit-docs`.** `unikit-docs` owns the **non-design** `docs/*.md` (top-level) + `README.md` + `docs-html/`; this skill owns **`docs/design/**`**. The two never relink each other's pages: `unikit-docs`'s `--web` glob is top-level (`docs/*.md`) and does not descend into `docs/design/`. Keep this boundary β€” never write a non-design page, never touch `README.md` or `docs/*.md`. - **Never:** edit the GDD or `GD-IDS.yaml` (read-only render); call any skill (no `Skill` tool β€” it is a leaf); read the code workspace or project source; invent content to fill a chapter; drop a draft or a `deprecated` entry to look more complete. ## Quick Reference ``` /unikit-gd-docs β†’ render docs/design/{index,systems,flows,content,economy,glossary}.md from the GDD /unikit-gd-docs --web β†’ the same, plus an HTML site from the unikit-docs template (MD-only + WARN if absent) /unikit-gd-docs (no GDD) β†’ STOP β†’ route to /unikit-gd-spec (author) or /unikit-gd-recon (reconstruct from code) ```