Replace CONSTRAINTS.md with frontend-specific constraints - Next.js, SSR boundaries, UI philosophy, forbidden patterns

This commit is contained in:
jester 2025-12-27 23:33:19 +00:00
parent a2fc3fc78a
commit 5ba386b1c8

View File

@ -1,43 +1,43 @@
# Constraints zlh-grind
# ZeroLagHub Frontend Constraints (ZLH Grind)
This repository is strictly for *decision tracking*, *constraints*, and *ground rules*.
It is not an implementation repo.
These constraints are **non-negotiable**.
They exist to prevent architectural drift, instability, and "demo-ware" UI patterns.
---
## Runtime & Framework
- Node.js **22 LTS**
- Next.js **App Router**
- React 18
- TypeScript
- Build once → run many
- No runtime builds
- No PM2 during active development
## Execution model constraints
- zlh-agent executes installer logic as **embedded scripts**.
- Embedded scripts must not rely on filesystem-relative paths (`$0`, `dirname`, etc.).
- Any shared logic must be executed in the **same shell session** as its callers.
## SSR & Client Boundaries
- Any file that touches:
- `window`
- `document`
- `location`
- WebSockets
- xterm / DOM refs
**MUST** be a client component with `"use client"` as the first line.
- No browser globals at module scope in server components.
- Prefer `useEffect` for browser-only logic.
---
## UI Philosophy
- Control-plane first, not marketing gimmicks.
- Flat UI by default.
- Subtlety beats spectacle.
- Readability > novelty.
## Installer contract constraints
- Installers must be:
- deterministic
- artifact-driven
- idempotent
- strict (`set -euo pipefail`)
- All runtime installers require explicit environment projection:
- `RUNTIME_VERSION` is mandatory
- artifact naming may be customized via `ARCHIVE_PREFIX`
- Installers must not parse JSON or agent state files.
## Explicitly Forbidden
- Neon / RGB accent colors outside error states
- Scanline / CRT / HUD overlays
- Persistent 3D transforms or perspective UI
- Excessive glow stacking
- Clip-path bevel frames
- Continuous decorative animations
---
## Responsibility boundaries
- API declares *intent* (runtime, version, container type).
- Agent translates intent into:
- environment variables
- filesystem operations
- installer execution order
- Installers perform no orchestration or decision-making.
---
## Anti-patterns (explicitly forbidden)
- Mega-installers that handle multiple runtimes via branching logic
- Package-managerbased installs (apt, nvm, pyenv, sdkman)
- Weakening installer strictness to accommodate agent bugs
---
## Branding
- Brand: **ZeroLagHub**
- Shorthand: **ZLH**
- Gaming heritage is acceptable, esports aesthetic is not.