aigen-image-generation
Skill263 starsChanged 35 days agoMITView on GitHub
Use the local aigen CLI to generate images through configured providers such as OpenRouter or OpenAI. Use when the user asks to create, generate, or render images and wants files produced locally through an external CLI.
- Reads credentials
- Installs packages
In this repository37 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/code-citation-clickable.mdcCursor rule
- .cursor/rules/commit-message-english.mdcCursor rule
- autonomous-maintainability-campaignSkill
- autonomous-requirement-discoverySkill
- delivering-delegated-linear-issuesSkill
- development-deliverySkill
- development-designSkill
- development-implementationSkill
- development-lifecycleSkill
- development-retrospectiveSkill
- development-reviewSkill
- development-task-understandingSkill
- development-validationSkill
- idea-search-funnelSkill
- nextclaw-agent-instructions-governanceSkill
- nextclaw-product-blog-storytellingSkill
- nextclaw-product-visual-assetsSkill
- x-twitter-birdSkill
- bb-browserSkill
- browser-controlSkill
- claude-code-narp-runtimeSkill
- clawhub-nextclawSkill
- codex-narp-runtimeSkill
- find-skillsSkill
- gemigo-cliSkill
- impeccableSkill
- lark-cliSkill
- linear-cliSkill
- mmx-cliSkill
- nextclaw-skin-studioSkill
- opencliSkill
- proxy-local-ai-subscriptionsSkill
- publish-to-nextclaw-marketplaceSkill
- skillhub-guideSkill
- superpowersSkill
- ui-ux-pro-maxSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. About 0 are common, 9 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill when the user wants AI-generated images and local file output through the aigen CLI.
- Very specific: line 14
Do not present this as a built-in NextClaw image engine.
- Very specific: line 19
Use provider/model routes such as openrouter/x-ai/grok-imagine-image-quality.
- Very specific: line 39
If aigen is not installed, use the published package:
- Very specific: line 45
If global install is not appropriate, use npx for the current task:
- Very specific: line 51
Prefer a stable aigen binary for multi-step workflows because provider and secret commands need consistent local state.
- Distinctive: line 60
Do not edit these files manually unless the user explicitly asks.
- Distinctive: line 76
Add a model under the provider:
- Distinctive: line 82
If the user has not provided an API key and no safe environment variable is available, stop and ask the user for the key or for permission …
- Distinctive: line 86
Create an output directory outside the repo unless the user explicitly asks for a project path:
- Distinctive: line 121
Never print raw API keys.
- Distinctive: line 122
Never write secrets into repo files, shell scripts, screenshots, logs, or markdown output.
- Very specific: line 123
Prefer AIGEN_HOME pointing to a temporary directory for tests and smoke checks.
- Distinctive: line 124
Prefer non-repo output directories for generated images unless the user explicitly wants files in the project.
- Distinctive: line 125
Do not overwrite generated files.
- Very specific: line 126
If provider/model/secret setup fails, report the exact missing piece and stop before generation.
- Distinctive: line 130
Check provider and model setup:
- Very specific: line 153
Run provider/model setup commands first, or set AIGEN_HOME to the expected config directory.
- Very specific: line 157
Use aigen secrets set <provider-id> --stdin --json.
- Very specific: line 169
Use aigen models list --remote --provider <provider-id> --kind image --json when supported.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
aigen Image Generation
Use this skill when the user wants AI-generated images and local file output through the aigen CLI.
This is a wrapped external tool skill:
- The skill owns setup guidance, readiness checks, safe secret handling, and the generation workflow.
aigenowns provider configuration, API calls, response normalization, and writing image files.- Do not present this as a built-in NextClaw image engine.
What This Skill Covers
- Generate images from text prompts.
- Use provider/model routes such as
openrouter/x-ai/grok-imagine-image-quality. - Configure provider records, model records, and provider API keys through
aigen. - Save generated image files to a caller-created output directory.
What This Skill Does Not Cover
- Video, audio, or image editing workflows.
- Long-running daemon management.
- Secret storage outside
aigen secrets. - Provider-specific SDK patching or hidden fallback behavior.
Readiness Check
First check whether aigen is available:
command -v aigen
aigen --versionIf aigen is not installed, use the published package:
npm install -g @nextclaw/aigenIf global install is not appropriate, use npx for the current task:
npx -y @nextclaw/aigen@latest --versionPrefer a stable aigen binary for multi-step workflows because provider and secret commands need consistent local state.
Configuration Model
aigen stores its own config under ${AIGEN_HOME:-~/.aigen}:
config.jsoncontains providers and models.secrets.jsoncontains masked provider API key records.
Do not edit these files manually unless the user explicitly asks. Prefer the dedicated commands.
First-Use Setup
For OpenRouter:
aigen providers add openrouter --api-format openrouter --jsonSet the API key through stdin. Never put the key directly in shell history:
printf '%s' "$OPENROUTER_API_KEY" | aigen secrets set openrouter --stdin --jsonAdd a model under the provider:
aigen models add openrouter/x-ai/grok-imagine-image-quality --kind image --generate --max-count 1 --jsonIf the user has not provided an API key and no safe environment variable is available, stop and ask the user for the key or for permission to use another configured provider. Do not invent, log, or echo API keys.
Generation Workflow
Create an output directory outside the repo unless the user explicitly asks for a project path:
output_dir="$(mktemp -d)"Choose a collision-resistant output name:
output_name="image-$(date +%Y%m%d-%H%M%S)-$(openssl rand -hex 3)"Generate:
aigen image \
--model openrouter/x-ai/grok-imagine-image-quality \
--prompt "<prompt>" \
--output-dir "$output_dir" \
--output-name "$output_name" \
--jsonParse the JSON result. A successful result contains:
ok: trueassets[]assets[].pathassets[].mimeTypeassets[].sizeBytes
Return the generated file path to the user. In environments that can render local images, show the image using its absolute path.
Safety Rules
- Never print raw API keys.
- Never write secrets into repo files, shell scripts, screenshots, logs, or markdown output.
- Prefer
AIGEN_HOMEpointing to a temporary directory for tests and smoke checks. - Prefer non-repo output directories for generated images unless the user explicitly wants files in the project.
- Do not overwrite generated files. Use unique output names.
- If provider/model/secret setup fails, report the exact missing piece and stop before generation.
Diagnostics
Check provider and model setup:
aigen providers list --json
aigen models list --json
aigen secrets list --json
aigen doctor --model openrouter/x-ai/grok-imagine-image-quality --jsonRemote model discovery, when supported by the provider:
aigen models list --remote --provider openrouter --kind image --jsonTroubleshooting
aigen not found
Install @nextclaw/aigen globally or use npx -y @nextclaw/aigen@latest.
Config not found
Run provider/model setup commands first, or set AIGEN_HOME to the expected config directory.
Missing API key
Use aigen secrets set <provider-id> --stdin --json. Do not pass the key as a command-line argument.
Provider request failed
Check:
- provider
apiFormat - provider
apiBase - model route
- API key validity
- whether the model supports image output
Use aigen models list --remote --provider <provider-id> --kind image --json when supported.
Success Criteria
The skill succeeds when:
aigen --versionruns,- provider/model/secret readiness is confirmed,
aigen imagereturnsok: true,- at least one asset exists on disk,
- and the user receives the generated image path or rendered image.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

