Skip to content

amadad/forma-tools

Repository files navigation

forma-tools

Design compiler: natural language → AST → deterministic SVG

Prompt → Gemini → AST → Compiler → SVG

Structure

packages/
  types/   # AST definitions (9 node types)
  core/    # Validation, normalization, compiler
  ai/      # Preference learning (planned)
apps/
  cli/     # CLI
  viewer/  # Canvas editor + AI generation

Usage

pnpm install && pnpm build
cd apps/viewer && pnpm dev  # localhost:3000
  1. Set Gemini API key
  2. Enter prompt → generates AST → renders SVG
  3. Edit AST directly if needed

AST Nodes

root frame group shape stroke mark text paint ref

Pipeline

validate → normalize → solveConstraints → layout → emitSvg

Determinism: fixed-point quantization, seeded RNG, stable stringify

Roadmap

  • Phase 0: Foundation
  • Phase 1: Minimal AST
  • Phase 2: Compiler
  • Phase 3: Doctrine (constraints)
  • Phase 4: Variation Engine
  • Phase 5: Preference Learning
  • Phase 6: Guided Search

Stack

TypeScript 5.x · pnpm · Node 20 · Gemini 2.0 Flash

MIT

About

Co-creative visual generator: meaning → structure → form

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors