What Is Mode C in the gpt-image-2 Skill? The Complete Guide to Prompt-Advisor Fallback
Mode C is the "Advisor" fallback mode in the gpt-image-2 skill that acts as a pure prompt-consultant, generating high-quality image prompts without attempting any API calls when the host environment lacks image generation capabilities.
The gpt-image-2 skill in the ConardLi/garden-skills repository operates in three distinct runtime modes, with Mode C serving as a critical fallback that ensures users retain access to professional prompt engineering even when image generation tools are unavailable. This mode transforms the skill into a structured prompt-writing assistant that prepares ready-to-use prompts for external tools like ChatGPT, Midjourney, or DALL·E 3.
How Mode C Detection Works
The skill determines its runtime mode by executing skills/gpt-image-2/scripts/check-mode.js immediately upon task initiation. This script evaluates the host environment to determine whether full image generation is possible.
Mode C activates when two specific conditions are met:
- The environment variable
ENABLE_GARDEN_IMAGEGENis not set - The host agent provides no built-in image-generation tool
When both conditions evaluate to true, the skill automatically falls back to Mode C, bypassing all API-dependent functionality. According to the skill documentation in skills/gpt-image-2/SKILL.md, this detection occurs before any template processing begins, ensuring the skill never attempts unsupported API calls.
The Mode C Workflow: Prompt Generation Without APIs
Unlike Mode A (which calls scripts/generate.js) or Mode B (which uses host-native tools), Mode C completes the full prompt preparation workflow but stops before image generation. The skill follows the standard template selection and field-filling process, then renders the final prompt for manual use.
Prompt Preparation and Rendering
When operating in Mode C, the skill executes the following sequence:
- Template Selection: Loads the specified template from the
references/directory - Field Population: Injects user-provided values into template variables
- Prompt Rendering: Generates the complete, formatted prompt text
- File Persistence: Saves the rendered prompt to disk
- User Display: Outputs the prompt with usage instructions
Output Location and File Structure
Mode C saves all generated prompts to a dedicated directory using a timestamped naming convention:
garden-gpt-image-2/prompt/<task-slug>-<timestamp>.md
For example, a brand poster task started on April 24, 2026 at 15:30:45 would save to garden-gpt-image-2/prompt/brand-poster-20260424-153045.md. Each file contains the complete, formatted prompt ready for copy-paste into external image generation platforms.
User Interaction Model
After saving the file, Mode C explicitly informs the user that "it has not generated an image" and provides a recommendation to paste the rendered prompt into compatible tools such as ChatGPT, Midjourney, or DALL·E 3. This transparent communication ensures users understand they are receiving a prompt advisory service rather than image files.
Mode C vs. Mode A: Key Differences
Understanding the boundaries between operational modes prevents workflow errors:
Mode A (Full Generation)
- Calls
skills/gpt-image-2/scripts/generate.jsfor image creation - Calls
skills/gpt-image-2/scripts/edit.jsfor image modification - Requires
ENABLE_GARDEN_IMAGEGENenvironment variable or native host tools - Produces actual image files
Mode C (Prompt Advisor)
- Never invokes
generate.jsoredit.js - Requires only Node.js runtime and template access
- Produces markdown prompt files only
- Explicitly notifies users of the non-generation status
As implemented in the ConardLi/garden-skills repository, Mode C ensures the skill remains functional in restricted environments while maintaining the structured approach to prompt engineering defined in skills/gpt-image-2/references/prompt-writing.md.
Practical Example: Running Mode C Locally
To verify you are operating in Mode C or to intentionally use the prompt-advisor functionality, execute the mode detection script:
# Detect current runtime mode
node skills/gpt-image-2/scripts/check-mode.js
# Expected output: mode = C
To run a complete task in Mode C without image generation:
node skills/gpt-image-2/scripts/run-task.js \
--template references/poster-and-campaigns/brand-poster.md \
--field title="Eco-Friendly Water Bottle" \
--field style="minimalist, pastel"
Expected Output:
✅ Mode C selected – acting as a prompt advisor
📄 Prompt saved to garden-gpt-image-2/prompt/brand-poster-20260424-153045.md
🗒️ Prompt:
"Create a minimalist pastel poster for an eco-friendly water bottle..."
💡 You can now paste the above prompt into any image tool (ChatGPT, Midjourney, DALL·E 3, etc.).
Note that in Mode C, the --template and --field arguments function identically to other modes, but the execution stops after the prompt rendering phase.
Summary
- Mode C is the prompt-advisor fallback in gpt-image-2 that activates when
ENABLE_GARDEN_IMAGEGENis unset and no host image tools are available. - The mode is detected by
scripts/check-mode.jsbefore any task processing begins. - Mode C executes the full template workflow but saves output to
garden-gpt-image-2/prompt/<task-slug>-<timestamp>.mdrather than generating images. - The skill explicitly excludes
scripts/generate.jsandscripts/edit.jsfrom Mode C execution, reserving these for Mode A only. - Users receive ready-to-use prompts formatted for direct input into external generation platforms like ChatGPT, Midjourney, or DALL·E 3.
Frequently Asked Questions
What triggers Mode C in the gpt-image-2 skill?
Mode C triggers automatically when the scripts/check-mode.js script detects that the ENABLE_GARDEN_IMAGEGEN environment variable is not defined and the host agent provides no built-in image-generation capability. This dual-condition check ensures the skill only attempts API calls in supported environments.
How is Mode C different from Mode A?
Mode A executes scripts/generate.js and scripts/edit.js to produce actual image files, requiring either the ENABLE_GARDEN_IMAGEGEN environment variable or native host tools. Mode C skips these scripts entirely, acting solely as a prompt-consultant that prepares text files for manual use in external image generators.
Where does Mode C save the generated prompts?
Mode C persists rendered prompts to garden-gpt-image-2/prompt/<task-slug>-<timestamp>.md using the task identifier and current timestamp to ensure unique filenames. This directory structure keeps prompt assets organized and easily accessible for copy-paste workflows.
Can I manually force the skill to use Mode C?
While Mode C typically activates automatically based on environment detection, you can ensure it runs by unsetting ENABLE_GARDEN_IMAGEGEN and removing access to host image tools before executing scripts/run-task.js. The check-mode.js script will then confirm Mode C selection before proceeding with the prompt-only workflow.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →