r/coolgithubprojects • u/rafifmsn • 19m ago
Giving coding agents a JSON DSL instead of raw SVG paths
I needed clean, minimalist logos for a bunch of side projects and wanted an agent to help generate them in bulk. Doing them manually takes too long, and asking an LLM to write raw SVG path coordinates usually ends up with uneven gaps, messy overlaps, and shapes that fall apart at 24px.
I also looked at native SVG generation models. Commercial ones like Recraft (V4.1 Vector) and QuiverAI Arrow 2 are great for illustrative or freeform vectors, but they are still probabilistic, hard to lock to exact grid spacing, and their free plans restrict commercial use and privacy. Open-weights models like StarVector, OmniSVG, and InternSVG are Apache 2.0, though you still have to host 1B-8B weights on a GPU and you still get raw, unverified SVG paths out the other end.
Instead of paying for a vector API or hosting another model, I built a small local CLI called brandspec (GPLv3) that works with whatever coding agent you already use. It is inspired by the geometric construction style in Jens Muller's Logo Modernism (all original grid math, nothing taken from the book).
Rather than guessing SVG coordinates, the agent reads a short SKILL.md and writes a declarative spec.json on a centered grid. The local Python compiler handles the Boolean operations, interlocking clearances, outlined wordmarks, and optical lockups on CPU, then writes out metrics.json and a 4-panel sheet.png (grid overlay, positive, inverted, and 24px scale strip) so the agent can inspect its own output before handing it back. I also added a localhost review UI and perspective mockups (image on github) for quick sanity checks.
If you run into the same issue trying to get reliable, commercial-safe vector marks out of coding agents, the repo has uvx brandspec and npx skills add rafifmsn/brandspec ready to use.