gestalt-resonator Base Design

gestalt-resonator Base Design

This system is a cross-platform interface design synthesis and transpilation system built upon Gestalt psychology, design composition theory, and software engineering models. Its core responsibility is to act as a “Design Middleware” for Agent collaboration, assisting development Agents in seamlessly transpiling from “Requirement Definition” to “High-Fidelity, High-Experience Code”.

1. Theoretical Synesthesia

The design philosophy is deeply rooted in the research project System Resonance of Pixel and Architecture . We mapped aesthetics, Gestalt principles, and computational thinking at the system level:

  1. “The whole is greater than the sum of its parts” Synesthesia:
    • Interfaces should not be filled with rigid, broken physical borders and fragmented components. We generate logical groupings in DDSL by defining “Proximity Groups” and “Grid Skeletons”.
    • Ensure that when the Client Agent writes code, it relies on grid spacing and soft whitespace rather than explicit physical borders, thereby evoking the user’s perception of “Closure” and “Proximity”.
  2. “Form follows function, technology blends with art” Information Control:
    • Use Design Tokens based on the HSL color space to control the distribution of visual gravity, ensuring that the interface has extremely high maintainability and global design consistency.
    • Define “Common Fate” physical motion effects to translate the control states of the system backend (such as timeout, exception, entering edit mode) into collaborative jitter or overflow effects of interface elements.

2. Interface Contract: Design Contract Package

To ensure that the Client Agent invoking this system can perform lossless transpilation, the system interface design does not output a single code snippet, but rather delivers a “Development Contract Package”:

  • DDSL Semantic JSON (layout.ddsl.json): Based on ddsl.schema.json . Built-in development constraints and design rationale annotations for Agents (_agent_guidelines).
  • Color and Layout Tokens (design_tokens.css): Decoupled CSS variables providing global aesthetic qualities.
  • Agent Transpilation Guidelines (TRANSPILER_RULES.md): Dynamically generated by gestalt-resonator get-context. The Client Agent can inject this file into its System Prompt to obtain the optimal parsing mindset and coding constraints for the layout tree.
  • QA Test Checklist (design_qa_checklist.json): Defines End-to-End (E2E) assertion test cases for the interactive state machine for the Client Agent to perform automated regression validation, preventing the phenomenon of “superficially green UI” (code runs but layout collapses).

3. Driver & Communication Mode

The system supports dual-channel driving methods to adapt to different invocation scenarios:

  • Headless CLI Mode:
    • Command: gestalt-resonator generate --input <ddsl_path> --output-dir <output_dir> --target <target_framework>
    • Suitable for build integration, allowing Agents to batch-generate corresponding framework components with a single command.
  • JSON-RPC Over Stdio (DSP Server):
    • Once started, the Agent can write JSON-RPC requests via stdin to perform stream-based requirement input and interface skeleton generation, achieving lightweight real-time interaction.