Files
image-studio/commands/AGENTS.md
2026-07-03 09:34:21 +02:00

11 lines
588 B
Markdown

# Commands Rules
- `commands/` is the only place state changes are implemented.
- Commands may change persistent `ImageDocument` state and transient `EditorState`.
- Commands must be deterministic, testable, and side-effect free.
- Do not import React, DOM UI, renderer/WebGL internals, storage, network, timers, or filesystem APIs.
- Validate payloads before applying changes.
- Preserve all `core/` and `editor/` invariants.
- Return the next `AppState`; do not mutate existing state objects in place.
- Every command needs a stable id, clear payload type, and focused responsibility.