garrytan / garrytan/gstack

Support non-OpenAI image providers in `design` skill (Gemini as first alt)

Open
#990 5 comments 12 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
133k
Forks
19.9k
Avg merge
18h 46m
Merged PRs (30d)
26

Description

## Problem

The `design` binary (`design/src/{generate,iterate,evolve,check}.ts`) is hardcoded to OpenAI's Responses API with the `image_generation` tool + `gpt-4o` vision. Users without OpenAI billing hit a hard wall — `/design-shotgun`, `/design-review`, and `/design-html` all fall back to HTML wireframes instead of real mockups.

## Use case

I'd like to use `/design-review` and `/design-shotgun` on personal projects without paying OpenAI per mockup. Gemini 2.5 Flash Image ("nano-banana") has a usable free tier and produces quality close enough to gpt-image-1 for UI mockups.

## Proposal

Opt-in provider selection, **OpenAI stays default** — no quality regression for existing users:

- New env var: `GSTACK_DESIGN_PROVIDER=openai|gemini` (default `openai`)
- `auth.ts` extended to resolve `~/.gstack/gemini.json` or `GEMINI_API_KEY`
- Thin provider interface abstracted over:
- `generate.ts` → image generation
- `iterate.ts` → iterate on prior mockup
- `evolve.ts` → evolve from screenshot
- `check.ts` → vision quality gate
- `$D setup` extended to guide Gemini key setup
- Docs note: Gemini path is "fallback for users without OpenAI billing; gpt-image-1 remains recommended for best quality"

Architecture stays small — one `Provider` interface with four methods (`generateImage`, `iterateImage`, `evolveImage`, `checkImage`), two implementations.

## Scope

~600 lines touched across 5 files + tests. I'm happy to open the PR if you're open to merging it. Wanted to check direction first before investing the work.

## Questions

1. Are you open to this in principle, or do you want `design` to stay OpenAI-only?
2. Preference between (a) runtime env var vs (b) compile-time flag vs (c) auto-fallback when no OpenAI key present?
3. Any providers you'd **reject** upfront (e.g. "no Pollinations, quality too low")?

Contributor guide

Open the contributing guide

Research direction

Start by reading design/src/generate.ts, iterate.ts, evolve.ts, check.ts and auth.ts to trace the current OpenAI Responses API and key resolution. Review the existing design setup and documentation paths before deciding how provider selection should be exposed. Done means the agreed provider interface, Gemini path, setup guidance, documentation, and tests cover both the default OpenAI path and the opt-in alternative.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.