psychology

chevp-ai-framework

Lifecycle Gates Guidelines Commands Agents Templates
devicesGuideline

Cross-Platform

If a project targets multiple platforms — parity is enforced from commit #1.

Rule
If a project declares more than one platform target (e.g. desktop + Android), every commit must build and pass on all declared targets. Platform parity is enforced from the first commit, not retrofitted later.
Why
Retrofitting mobile support onto a desktop-first codebase is exponentially more expensive than building for both from the start. Desktop-only assumptions (filesystem paths, unlimited RAM, persistent GL context, mouse input, synchronous I/O on main thread) silently embed themselves throughout the codebase. By the time someone says "now let's port", the cost is no longer a port — it's a rewrite.
How
When a project's platform-targets.md declares multiple platforms, the AI enforces platform parity at every lifecycle step. The AI blocks any change that introduces a platform-specific dependency without a PAL (Platform Abstraction Layer) boundary.

Platform-Specific Assumptions to Catch

CategoryExamples
Filesystem / StorageDirect paths, hardcoded separators — Android uses Scoped Storage and AAssetManager
Memory / ResourcesAssuming >4 GB RAM (mobile gets 512 MB–1 GB), no LOD/streaming
Graphics / RenderingWide subgroup ops, persistent GL context, BC7 without ASTC fallback
InputMouse coords without touch abstraction, no rotation/soft-keyboard handling
Threading / LifecycleSync I/O on main thread (ANR on Android), no onPause/onResume
Build / DistributionNo size budget, x86_64 only (missing arm64-v8a), no Gradle/NDK alongside CMake

Platform Abstraction Layer (PAL)

core/ ← platform-agnostic, references only PAL interfaces pal/ ← interface definitions pal/desktop/ ← desktop implementations pal/android/ ← Android implementations

Asset Dual-Target Rule

Asset TypeDesktopAndroid
TexturesBC7 / DXTASTC / ETC2
ShadersSPIR-V (desktop Vulkan)SPIR-V (mobile) or GLSL ES
ModelsFull LOD chainReduced LOD + streaming
BundlesNo size limitBudget per asset pack

An asset pipeline that only outputs one format is a gate violation.

menu_book guidelines/cross-platform.mdopen_in_new