Repository navigation
morpho: make, layout in words, kits, motion recipes, check --fix - #22
Merged
Merged
Conversation
A whole design from one spec file in one call: `morpho make spec.json` builds it (canvas, kit, layers, groups, modifiers, motion), resolves its layout against the engine's real build boxes, applies the mechanical fixes, checks it and draws one PNG. - Layout in words (place.ts): fitWidth/fitHeight as % of the canvas, place at top/centre/bottom/thirds/corners with margins, stack and row with a gap and alignment, centre by ink, contain. In specs, as add options and as set assignments (Title.place=top third, --stack A,B). align now uses the same code and moves groups too. - Style kits (kits.ts): 8 kits of background, palette, fonts and a look per role, from bundled fonts and presets; in catalog; --kit on new and make. A layer's color tints its look's main colour (fill, glow, ink). - Motion recipes (moves.ts): cascade, pop, type-on, slide-in, drop, drift, breathe, or enter/stagger/feel/loop by hand over several layers (`morpho motion`); on a looping clock, exits are timed to end before it. - check --fix (fix.ts): cut-off text, near-centring, loop seams and moves the clock cuts off; everything else as ready-to-run commands. set --check prints only the findings that appeared, went or changed. - --style poster|logo|abstract, kept in the project: abstract turns rules of taste into notes. - Every command ends with the likely next command. - check: text contrast is measured on the best-separated quarter of the pixels (outlines and hard shadows count), and a pop needs small steps on both sides (a move from rest isn't one). - Docs rewritten around make → check (--fix) → vary → video; a morpho-design skill; CLAUDE.md points to them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 1 of the next
morphoround: an AI can now make a good design in about 3 calls and 1–2 images, where it used to take about 12 calls and 3–4 images.What's new
morpho make spec.json [-o f.morpho]: a whole design from one JSON spec (canvas, background, kit, style, clock, layers bottom first: text, shapes, lines, paths, groups, modifiers, settings, layout, motion). One call builds it, resolves its layout against the engine's build boxes, applies the mechanical fixes (--no-fixskips them), runscheckand draws one PNG: the design at rest, or rest plus three moments when it moves. Re-running on an edited spec rebuilds everything. No YAML, because there's no parser among the dependencies.Layout in words (
place.ts), measure then place:fitWidth/fitHeightas % of the canvas;placeat top, centre, bottom, top third, bottom third, left, right or a corner, withmarginin px or %;stack/rowwithgap,alignand a spot for the whole block;centreby ink,contain,offset.These work in specs, on
add(--fit-width 80 --place "top third") and onset('Title.place=top third',--stack A,B --gap 12).alignnow runs on the same code and can move groups.8 style kits (
kits.ts): chrome-night, neon-club, riso-zine, brutal-pop, puff-sky, editorial, holo-y2k, arcade. Each has a background, a palette, a font pairing and a look for headline, accent and body. They're listed incatalog(catalog kits,catalog riso-zine) and applied with--kitonnew/makeor in the spec;addpicks up a design's kit. A layer'scolor(hex or a palette name) tints its look's main colour (fill, neon glow or ink) instead of throwing the look away.Motion recipes (
moves.ts): cascade, pop, type-on, slide-in, drop, drift and breathe, or--enter rise --stagger 0.15 --feel Snappy,--loop float --spread 0.25over several layers at once, throughmorpho motionor in the spec. On a looping clock, everything that enters also leaves before the clock ends, so loops join. This stays within today's motion model:state/motion.ts,tracks.tsand the Timeline are only imported, not edited.check --fix(fix.ts) applies the mechanical fixes:The rest comes back as ready-to-run commands (
align … --edge right,set … contain=true, a fill for low contrast,arrange … top). Plaincheckmarks fixable findings[--fix]and lists the same commands.set --checkprints only the findings that appeared (+), went away (−) or changed (~). Each version's findings are kept by file content intest-results/morpho/.checks/, so it only checks the new version (0.6–1.1 s).--style poster|logo|abstract, stored in the project asproject.agent.style. Withabstract, rules of taste (near-misses, centring, clear lead, crowding, hue count) become notes; mistakes stay warnings.Next-step hints: every command ends with
next: ….Two check fixes found while dogfooding:
poprecipe) was flagged before.Docs:
docs/AGENT-TOOLS.mdis rewritten around make → check (--fix) → vary → video, with the spec format, layout words, kits and recipes..claude/skills/morpho-design/SKILL.md. The local.git/info/excludeignores/.claude/, so this one file was force-added.CLAUDE.mdis now a pointer.The spec format suits
exploreand logo rounds: specs are plain data,fromSpecis pure, and kits and recipes are named, so variations can be generated as specs.Dogfood: calls and images
Old "Night Drive" from-scratch flow in the docs: about 12 calls (new, 4× add, modifier, set, check, set, align, check, video) and 3–4 images.
New, with
make(calls aremorphocommands; writing the spec file is one more tool call each time):catalog ringlookupmakehad no problems and no warnings. The picture showed mycolorhad replaced the neon look with a flat disc. I madecolortint the kit's look instead; with that change, the first spec gives a neon ring. The secondmakeonly thinned the ring, a matter of taste.makeleft three near-miss edges and a busy palette, each with a ready command. I edited the spec instead and the secondmakecame back with 0 warnings.With
serverunning,maketakes 0.8–1.2 s (3.6 s when the machine was under heavy load).Tests
npx vitest run: 149 passed. Newui/src/agent/make.test.tscovers layout resolution (spots, fit, place, stack and row, groups, contain, align, layout assignments), kits (everything they name exists, role looks, palette colours, tinting, catalog), spec building and spec errors, motion recipes (stagger, exits inside the clock, letters, loops out of step),--fix(retime, the loop seam after other fixes, the plan and its commands, abstract style, the new pop rule) and the findings diff.npm run typecheck: passes.npm run build && npm run test:e2e:makefrom a spec, the title fitted to 70% on the top-third line, and--fixmending cut-off text and the loop seam.makestep replaced the design beforedescribe()ran at the end. That's fixed (describenow runs first), but not yet confirmed by a full rerun.cargo testcouldn't build: "No space left on device". This PR changes no Rust.🤖 Generated with Claude Code