chore(architecture): enforce layer boundaries
This commit is contained in:
10
commands/AGENTS.md
Normal file
10
commands/AGENTS.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# 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.
|
||||
Reference in New Issue
Block a user