ImaGen #1: bootstrap repo + framework skeleton (Backend interface, CLI shell, config, output writer) #1
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Bootstrap the ImaGen repo with a minimal, model-agnostic framework that other components (skill, adapters, agents) can build on. After this issue lands, the repo has: a CLI shell, a Backend interface, a config loader, an output writer, plus an in-repo CLAUDE.md so future workers have context.
m's framing (PWA 2026-05-08 14:24): "Das Projekt wäre 'mImaGen' und soll für uns möglichst model-agnostisch sein. Also wir machen das Framework und können später leicht tauschen. Aber ich brauche halt ne gute Anlaufstelle für otto oder andere agents, um Bilder zu erstellen."
Skill name:
/imagine(decided). Project ID:imagen. Repo:m/ImaGen. Memory group:imagen.Scope
1. Repo skeleton (Go)
2. Backend interface (the contract every adapter implements)
3. CLI shape
Backends are looked up via the registry (
internal/backend/registry.go). When a backend isn't implemented yet, the CLI returns a clean "backend X not registered, available: …" error.4. Config
~/.config/imagen.yaml:Adapters get only their own sub-block at construction. The framework doesn't know what
comfyuiorreplicateadapters need internally — that's the adapter's contract.5. Output writer
internal/output/:namingtemplate (placeholders:{date},{time},{slug}from prompt,{seed},{backend}).write_metadata_jsonis true, write<filename>.jsonwith the full Request + Result.Metadata + ISO timestamp.6. Style presets (prompt enrichment)
internal/prompt/styles.yaml:When
--style photois passed, the preset string is appended to the prompt before sending to the backend. m can extend this list later.7. CLAUDE.md (in-repo)
Document: project goal, architecture overview, how to add a new backend (one paragraph), how the skill calls it, the config file location, where credentials live (always env vars, never hardcoded). Reference
~/.m/docs/msystem.md.8. Tests
internal/output/unit tests for naming + sidecar writinginternal/backend/mock backend for end-to-end CLI smoke test9. README.md
Short: what it is, why it exists, "see CLAUDE.md for design", install instructions (
go install ...), one-liner example.Acceptance criteria
go build ./...is clean.imagen backendslists registered backends (only the mock+stub at this point), exits 0.imagen generate "test prompt" --backend mock --output /tmp/x.pngwrites a real (mock-generated) PNG and a sidecar JSON.~/.config/imagen.yamlparses cleanly viaimagen config validate.Out of scope (intentional)
/imagineskill — that's #4.Refs
imagen(registered)imagenm/ImaGenWorkflow
Coder role. End shift with
make build+imagen generate "test" --backend mocksmoke test. After this lands and merges, m or otto/head assigns mAi to #2, #3, #4 (which are blocked-on-#1 today).Bootstrap landed on
m/ImaGenmainFramework skeleton merged. The repo now has:
internal/backend/—Backendinterface, thread-safeRegistry,Mockreference adapter (deterministic gradient PNG)internal/config/— YAML loader, validation, sample generator. Adapters get only their own sub-block viaBackendSpec.Rawinternal/output/— filename templating ({date}/{time}/{slug}/{seed}/{backend}/{ext}), JSON sidecarinternal/prompt/— embeddedstyles.yaml, style-preset suffix applicationinternal/server/— 501 stub (HTTP surface lands in a follow-up)cmd/imagen/—generate / backends / config (init|validate|path) / serve / versionCLAUDE.md,README.md,docs/architecture.md,docs/usage.md,MakefileAcceptance criteria
go build ./...cleanimagen backendslists registered + flags non-compiled typesimagen generate "test prompt" --backend mock --output /tmp/x.pngwrites PNG + sidecarimagen config init↔imagen config validateround-tripOK — 4 backend(s) defined, default="mock"CLAUDE.mddocuments how to add an adaptergo test ./...: 4 packages, all green.What's next
Unblocks the three follow-up issues. Each one drops a single file under
internal/backend/plus an anonymous import incmd/imagen/main.go:comfyui.go)replicate.go)/imagineskill — wrapsimagen generateRefs
mai/bohr/issue-211-bootstrap(preserved for history; merged via--no-ff)Mirrored from m/mAi#211 (closed) — the original bootstrap issue moved here; this is the canonical paper trail on the code repo.