ImaGen #4: /imagine skill — single entry point for all mai agents #4
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
Ship the
/imagineskill — the canonical entry point for any mai agent (otto/head, otto-wa, lex-research workers, mai-writer, m's own /imagine on the CLI) to request an image. Wraps the ImaGen CLI + HTTP API with a thin skill body that codifies usage patterns.Prerequisites: ImaGen#1 (framework), and at least one real adapter — #2 (ComfyUI) OR #3 (Replicate) — must be live.
Scope
1. Skill file
Create
~/.dotfiles/claude/.claude/skills/imagine/SKILL.md(top-level skill, nomai-prefix per m's preference 2026-05-08 14:24):When to skip imagine
Not every visual ask needs gen-AI. Skip in favour of:
mexdraw— for technical diagrams with controllable geometry (Excalidraw)See also
m/ImaGen— repo / framework / adaptersmai-mexdraw— programmatic Excalidraw diagrams (different shape, different use case)Shift-1 checkpoint (athena/coder)
Status: drafted + committed; live demo parked on #2.
What landed (commit
301fbf3onmai/athena/issue-4-imagine-skill):mai/.mai/skills/imagine/SKILL.md— top-level skill (nomai-prefix per m's preference 2026-05-08 14:24)Path correction (worth flagging in #4 description): the issue says skills go to
~/.dotfiles/claude/.claude/skills/. That path is gitignored in dotfiles. The tracked location ismai/.mai/skills/<name>/SKILL.md;~/.claude/skillsis a symlink via~/.mai/skills → ~/.dotfiles/mai/.mai/skills/. Verified against existing top-level skills (edit-article,show-md,seo-audit,lex-research— all undermai/.mai/skills/). Skill placed in the correct location; original draft path was a bug.Spec-drift fixed in skill body vs issue draft:
imagine generate— actual CLI isimagen generate. Fixed.imagen config get default_backend— that subcommand does not exist (onlyinit|validate|path). Skill points atimagen config validate(which printsdefault=...) and~/.config/imagen.yaml.imagen usage --since 7d— also does not exist yet. Skill notes it as a planned follow-up; until thenjq -s 'map(.metadata.cost_estimate_usd // 0) | add' ~/Pictures/imagen/*.json.PWA delivery: filed m/mAi#213 for
m pwa reply --attach-image. Confirmed viam pwa reply --helpthat no image-attach flag exists today. Skill body documents the file-link fallback per channel.Lint: no skill-metadata lint script exists in
~/.dotfiles/(grepped). Frontmatter matches existing skills' pattern (name,description,allowed-tools). If stricter validation is wanted, that's a separate task.Blocked on: ImaGen#2 (FLUX install + ComfyUI adapter on mRock — hermes). Once phase-1 image is in, athena runs
/imagine "a fishbowl with a cat" --backend flux-schnell-localend-to-end and confirms acceptance #3.Next steps:
301fbf3and merge intodotfiles/mainonce you're satisfied with the skill bodyPath correction (head note): the skill file lands at
mai/.mai/skills/imagine/SKILL.mdinm/dotfiles, NOTclaude/.claude/skills/imagine/as the issue body says. The latter path is gitignored in dotfiles; the canonical tracked layout usesmai/.mai/skills/and~/.claude/skillssymlinks via~/.mai/skills. Athena verified against existing top-level skills (edit-article, show-md, seo-audit, lex-research) before committing.Draft committed at
301fbf3onmai/athena/issue-4-imagine-skill. Acceptance #1, #2, #4 covered. Acceptance #3 (live demo) parked until ImaGen#2 lands a working FLUX backend on mRock. Filed m/mAi#213 form pwa reply --attach-imagefollow-up; skill body documents file-link fallback in the meantime.Shift-2 checkpoint (athena/coder) — live demo PASSED
All four acceptance criteria met. Image at
/home/m/dev/ImaGen/poc/third-image-via-skill.png(1024x1024 PNG, 1.3 MB).Skill discoverability (#1):
~/.claude/skills/imagineresolves via the symlink chain into the committed file. Claude's skill listing showsimagine: Generate images via the ImaGen framework...alongside the rest of the top-level skills.Skill body (#2): Commit
301fbf3covers backend choice, style presets, FLUX prompt tips, cost awareness, channel-aware delivery, do not list, when-to-skip.Live demo (#3):
flux-schnell-local(comfyui adapter →http://mrock:8188)flux1-schnell.safetensors6585474305228830100/home/m/Pictures/imagen/2026-05-08-a-fishbowl-with-a-cat-staring-out-photo-6585474305228830100.png+.jsonsidecar; copied topoc/third-image-via-skill.pngfor head/mSkill lint (#4): No skill-metadata lint script exists in
~/.dotfiles/. Frontmatter matches existing top-level skills (name + description + allowed-tools).Live-run observation for a future tightening (not blocking): The skill body says cost-estimate is in the sidecar metadata "when the adapter supports it". The ComfyUI adapter does not emit
cost_estimate_usd(no API billing — local). One-line edit: "for hosted backends only; local ones omit the field". Can land with the next imagen-related ticket; not committing to athena's branch since head wants a single clean commit.Cleanup note for the merge: I created a temporary symlink at
/home/m/.dotfiles/mai/.mai/skills/imagine → /home/m/.dotfiles/.worktrees/athena/mai/.mai/skills/imagineso the demo could find the skill. Before merging the worktree branch into dotfiles main,rm /home/m/.dotfiles/mai/.mai/skills/imagineto clear the path; thengit mergeproduces the real directory in its place.Branch:
mai/athena/issue-4-imagine-skillCommit:
301fbf3 feat(skills): add /imagine skill — single entry point for image generationReady for head's merge into dotfiles main and the commit-link stamp on this issue.
Live demo PASSED — all four acceptance criteria green
Run
a fishbowl with a cat staring out, photo, soft lightflux-schnell-local(comfyui adapter, http://mrock:8188)flux1-schnell.safetensors6585474305228830100/home/m/dev/ImaGen/poc/third-image-via-skill.png(1024×1024, 1.3 MB PNG).jsonnext to the image, contains seed + latency + backend + promptAcceptance
/imagineinvokable from any Claude paneimagine: Generate images via the ImaGen framework...301fbf3~/Pictures/imagen/...png, m sees it~/.dotfiles/claude/Skill body observations from the live run (one-line follow-up worth filing)
Athena flagged: the skill body says cost-estimate appears in the sidecar "when the adapter supports it" - that's true for hosted backends (Replicate, OpenAI - landing in #3) but the local ComfyUI adapter doesn't emit
cost_estimate_usd. One-line clarification - will fold into a follow-up commit on the next imagen-side touch.Merge status
Branch
mai/athena/issue-4-imagine-skill(commit301fbf3) is ready to merge into dotfiles main. Held by head pending an unrelated unresolved state on m's local dotfiles working tree (UU onmai/.mai/skills/lex-research/SKILL.mdfrom a prior merge; a few uncommitted modifications). Will merge in one shot once that's clear, then stamp the merge commit hash + applydonelabel here.Merged into dotfiles main
Branch
mai/athena/issue-4-imagine-skillmerged via--no-ffinto m/dotfiles main at7c841fdbe369168a1dc99a5397a6c0dc91598b98. Pushed to origin/main.301fbf3—mai/.mai/skills/imagine/SKILL.md(151 lines)7c841fdbe369168a1dc99a5397a6c0dc91598b98All four acceptance criteria green
/imagineinvokable from any Claude paneimagine: Generate images via the ImaGen framework...~/Pictures/imagen/...png, m sees it/home/m/dev/ImaGen/poc/third-image-via-skill.png, 7.84 s end-to-endFiled during the work
m pwa reply --attach-imagefollow-up (skill body documents file-link fallback)imagen generatetypo, missingimagen config get, missingimagen usage) — all reflected in the skill bodymai/.mai/skills/imagine/, NOTclaude/.claude/skills/imagine/(latter is gitignored in dotfiles); saved to memory underimagengroup so future workers don't repeat the trapOpen follow-ups (not blocking close)
/imagineSKILL.md touch./imagineSKILL.md preview-section update) was deferred during #5 to avoid colliding with this merge — now unblocked. Will pick up next.