How to create reference documentation for complex coordinate systems and building constraints
domain
documentation
confidence
low
source
earned
Context
When a project involves complex spatial logic (coordinate systems, layout algorithms, size constraints) or technical constraints (rate limits, API boundaries), create two complementary reference documents:
Architecture diagram (educational) — visual explanations that help contributors understand the math and logic
Constraints documentation (prescriptive) — authoritative rules that enforce consistency
This skill applies when:
Code uses non-obvious coordinate calculations or spatial algorithms
There are hard technical limits (API rates, world boundaries, size caps)
Multiple services/features must coordinate on shared conventions (e.g., all features use same Y-level convention)
New contributors need to understand "why these specific numbers"
Source file references at the end — link to authoritative code
Cross-references between docs (architecture → constraints, constraints → architecture)
Version-specific info (e.g., "BaseY=-60 for superflat worlds")
Scaling limits explicitly documented
Content Organization
Architecture diagrams:
Big picture first (full coordinate system)
Zoom into specifics (individual structure footprints)
Worked examples with real numbers
Edge cases and scale limits last
Constraints:
Table of contents (long document, need quick lookup)
Foundational conventions first (coordinate system)
Building blocks next (structures, sizes)
Derived rules after (paths, fences — depend on structures)
System-level limits last (scale, performance)
Examples
ASCII Art for Y-Level Breakdown
Y=-59: Air (player walking level)
↑ Players walk here
│
Y=-60: █████████████████████ ← BaseY (grass block surface)
│ Structures place floors here
Why this works: Visual hierarchy shows relationships. Annotations explain purpose, not just labels.
Coordinate Calculation Example
col = index % 2 // Alternates 0, 1, 0, 1, ...
row = index / 2 // Increments every 2 resources: 0, 0, 1, 1, 2, 2, ...
x = BaseX + (col × 10) // Result: 10, 20, 10, 20, 10, 20, ...
Why this works: Formula + concrete results + inline comments. Reader sees pattern immediately.
Critical Rule Documentation
### ⚠️ Critical Y-Level Rules1.**Never place fences at `BaseY + 1`** — they will float one block above the ground.
2.**Paths must be at `BaseY - 1`** with grass cleared at `BaseY` — this makes them flush with the surrounding terrain.
Why this works: Emoji draws attention. "Never" is unambiguous. Explanation shows consequence of violation.