Skip to content

armgit / klad

Public Imported from GitHub
0

A drawing app built for agent/human collaboration

Rust

Principle: every feature has a CLI form and an editor form

Indicode BVef2f2b411695
diff --git a/CLAUDE.md b/CLAUDE.md
index 1cbbb23..d0a7a71 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -1,6 +1,6 @@
# klad
-_Last updated: 2026-11-04 15:05_
+_Last updated: 2026-11-04 19:31_
Agent-first 2D art application in Rust: a `klad` CLI for agents and a native editor for people with a pen, sharing one document bundle on disk. What and why: `docs/DESIGN.md`. How to build, test and send a change: `CONTRIBUTING.md`. How an agent draws with it: `docs/skill/SKILL.md`.
@@ -26,6 +26,7 @@ Agent-first 2D art application in Rust: a `klad` CLI for agents and a native edi
## Standing rules
+- Every feature has a CLI form and an editor form (DESIGN principle 7): a change that adds one adds the other, with tests on both sides, unless it only makes sense on one side (the editor's view and settings; the CLI's batch, hash and test tools).
- No comments in code except `// TODO:`.
- Iterator chains over `for` loops where they read better; plain loops in hot pixel paths where they are clearer or faster.
- Determinism in `core`, `brush` and `render`: transcendental math through `libm`, one seeded RNG (`klad_core::rng`), no wall clock, no `HashMap` iteration order in output, parallelism only over independent units (tiles, image rows).
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e775a42..632b8d0 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -25,6 +25,7 @@ These come from `CLAUDE.md`, which is also the guide for coding agents working o
- Determinism: `core`, `brush` and `render` give the same pixels on every machine. Transcendental math goes through `libm`, randomness through the seeded `klad_core::rng`, no clock, no `HashMap` order in output, parallelism only over independent tiles or rows. A change that moves a sample's hash says why.
- Bundles never break: a format change bumps the format version and adds a migration, so older drawings open unchanged.
- Dependencies are permissive only (MIT, Apache-2.0, BSD, ISC, Zlib and the others in `deny.toml`). Adding one means `just audit` passes and `just notices` regenerates `THIRD-PARTY-NOTICES.md` in the same change.
+- Every feature has a CLI form and an editor form: a new command or op also gets its place in the editor, and an editor feature gets its command or op, with tests on both sides.
- New behaviour comes with tests in the crate that owns it. `just lint` and `just test` are clean before a pull request.
- No em-dashes in docs or messages; every doc in `docs/` starts with a `_Last updated:_` line.
diff --git a/docs/DESIGN.md b/docs/DESIGN.md
index 4871f5d..2b19817 100644
--- a/docs/DESIGN.md
+++ b/docs/DESIGN.md
@@ -1,4 +1,4 @@
-_Last updated: 2026-11-04 19:17_
+_Last updated: 2026-11-04 19:31_
# klad: design
@@ -14,6 +14,7 @@ An agent drives it through a CLI and sees results as PNG renders. A person with
4. **Time is in the model from the start.** Every layer's content lives in cels on a timeline. A still image is a one-frame document.
5. **Edit and see in one call.** Every mutating CLI command can render and return the PNG path.
6. **Professional output.** 16-bit float layers, colour management, proper blend modes, exports a game engine can use as they are.
+7. **Both hands can do everything.** Every feature has a CLI form (a command or an `apply` op) and an editor form (a tool, pane, window or command), doing the same thing through the same code. Only what makes sense on one side alone is exempt: the editor's view, pen calibration and keys; the CLI's batch, hash and test tools.
## Architecture