| name | unity-data-struct |
| description | Generate tree-format data structure documentation for Unity JSON schemas (db_*.json tables like db_TTE, db_DBSE). Use when the user pastes/shares a table of fields with short keys (a0, b1, c2...), wants a hierarchical tree diagram of a JSON data structure, asks to "create tree format", "data structure doc", "document db_XXX.json", or "generate data struct markdown". Output is a markdown file with a tree showing parent-child nesting (Object arrays → child objects) plus per-level field reference tables. |
Unity Data Structure Documentation
Generate tree-format markdown documentation for Unity JSON data schemas (the db_*.json tables the tool team maintains for short-key-encoded game data like events, bosses, tiers, scoring rules).
When to use
Trigger on any of:
- Table image or pasted rows with columns:
Name | Short key | Type | Description | Example value | Note
- File named
db_*.json referenced in Docs/Features/<feature>/
- User says: "tree format for this data", "data structure documentation", "doc this schema", "create db_XXX tree"
Input assumptions
The source is usually a table where:
- Short key uses compressed letters+digit (
a0..a10, b0..b6, c0..c6) — group keys by letter prefix to detect nesting depth.
- Type =
string, int, float, TimeStamp, Object array, String array, Localized.
- Object array means the field contains nested child objects — those children appear as a new indented block in the tree.
- The letter prefix usually increases with depth:
a* = root, b* = first nested object, c* = second nested object.
Output Format
Two sections, in this order:
1. Tree diagram (inside a fenced code block)
Use box-drawing characters. Match the simplified style below — do not add closing connector arrows (┐, ─) on the right edge; indent with spaces only.
db_TTE.json (Tactics Tactics Event)
│
├── ID [string] event_tactics_1 (Auto-generated by Brick)
│
├── a0 StartTime [TimeStamp] 1783099545
├── a1 EndTime [TimeStamp] 1791048345
├── a2 GenderDivision [int] 0:Male / 1:Female / 2:Universal
│
├── a3 Tiers [Object array]
│ │
│ └── Tier
│ ├── b0 TierId [string] "Tier1"
│ ├── b1 BossId [string] "boss_id_1"
│ ├── b3 FeatureScoringRule [Object array]
│ │ │
│ │ └── ScoringRule
│ │ ├── c0 RuleName [string] "GemDestroyed"
│ │ ├── c1 Score [int] 700
│ │
│ └── b4 RequiredSuperstarNumber [int] 1
│
└── a10 VFXDefeatedBoss [string] odb/tactics/grayfx
Rules:
- Top-level line: filename + parenthetical human label.
- One blank
│ line as separator between logical groupings (root scalars vs nested object arrays).
- Each field:
<short-key> <Name> [<type>] <example> with │ column rule alignment for readability.
- Trailing notes from the source (
Auto by Brick, Refer from RoadBoss) placed after the example value.
Object array fields introduce a child block at deeper indent; reuse the child name from the description or context (e.g., Tier, ScoringRule).
2. Field Reference Tables
One markdown table per level. Use the exact heading pattern:
## Field Reference
### Root (Event)
| Short Key | Name | Type | Description | Example |
|---|---|---|---|---|
### Tier Object (`a3[ ]`)
| Short Key | Name | Type | Description | Example |
|---|---|---|---|---|
### ScoringRule Object (`b3[ ]`)
| Short Key | Name | Type | Description | Example |
|---|---|---|---|---|
Rules:
- Columns:
Short Key | Name | Type | Description | Example.
- Quote strings in examples (
"Tier1"), keep numbers bare (700, 0.45).
Object array type rows show — in Example column.
- Notes from source table (e.g.
Auto-generated by Brick) go inside Description as parenthetical.
- Convert full type names (
Object array → Object array), no abbreviations.
Workflow
- Identify source: image of a table, pasted rows, or existing JSON.
- Extract fields: name, short key, type, description, example, note per row.
- Group by nesting: short-key letter prefix indicates depth. Object-array rows open a new indented block with child rows.
- Draft the tree in a fenced
``` block (3 backticks, no language tag).
- Draft the reference tables, one per nesting level.
- Save to
<project>/Docs/Features/<feature>/db_<NAME>_TreeStructure.md. If path not given, ask or default to Docs/Features/db_<NAME>_TreeStructure.md.
Style guidance
- Keep
<short-key> <Name> pairs aligned with spaces; let the type column visually start at the same column for every row.
- The root file line should use the JSON filename verbatim (
db_TTE.json).
- Don't decorate with emoji or color.
- Don't fabricate fields — only document what's in the source.
Anti-patterns
- Do NOT add a closing
─┐ arrow at the end of sub-tree introducer lines (user prefers simplified).
- Do NOT output JSON syntax (
{}, []) in the tree — only box-drawing characters.
- Do NOT include source-table markdown that duplicates the reference tables — the tree + reference tables already cover everything once.