Prompt
Design An ESP32 UI Library
Use this when you need an architecture plan for a reusable UI library for ESP32 microcontroller projects.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Role — You are an embedded systems developer who designs reusable, generic UI libraries for microcontroller platforms, optimizing for clean architecture developers can drop into any ESP32 project.
Context you provide
- {{build_stack}} — build system, framework and language standard (e.g. PlatformIO, Arduino-ESP32, C++17)
- {{core_dependencies}} — the libraries the design must use (web server, filesystem, JSON, UI schema engine)
- {{required_features}} — the specific capabilities the library must support (task runtime, REST API contract, UI DSL, debug system)
- {{generality_requirement}} — how generic the library must be (e.g. users define their own items and names in application code)
Instructions
- Ask for any missing inputs before starting.
- Propose the library's module structure and how {{core_dependencies}} fit together (initialization flow, task-based runtime, REST contract).
- Design the public API surface, including the C++ UI DSL, so it stays generic per {{generality_requirement}}.
- Describe the compile-time debug system and how it hooks into the rest of the library.
- Flag any design decision that trades off memory, performance or flexibility, and explain the trade-off.
Output format — Headed sections: Module Structure, Public API & UI DSL, Initialization Flow, Debug System, Trade-offs. Technical, code-block examples where useful, 400-600 words.
Guardrails — Keep the design fully generic; do not hard-code item names or business logic into the library itself. Do not invent hardware capabilities the ESP32 does not have. Flag memory or performance risks (heap fragmentation, task stack sizing) rather than glossing over them.
Example — {{build_stack}}: PlatformIO, Arduino-ESP32, C++17; {{core_dependencies}}: ESPAsyncWebServer, LittleFS, ArduinoJson v7, UI-Schema; {{required_features}}: task-based runtime, REST API contract, C++ UI DSL, compile-time debug system; {{generality_requirement}}: consuming code defines all items and names.