{"id":6823,"date":"2026-07-22T22:55:26","date_gmt":"2026-07-22T22:55:26","guid":{"rendered":"https:\/\/lockitsoft.com\/?p=6823"},"modified":"2026-07-22T22:55:26","modified_gmt":"2026-07-22T22:55:26","slug":"nb2lite-skill-claude-revolutionizing-ai-image-generation-with-stateful-claude-code-integration","status":"publish","type":"post","link":"https:\/\/lockitsoft.com\/?p=6823","title":{"rendered":"Nb2lite-skill-claude: Revolutionizing AI Image Generation with Stateful Claude Code Integration"},"content":{"rendered":"<p>The landscape of artificial intelligence-powered image generation is undergoing a significant transformation with the introduction of nb2lite-skill-claude, a novel integration that brings stateful image editing capabilities to Claude Code. This groundbreaking project leverages Google&#8217;s <code>gemini-3.1-flash-lite-image<\/code> model, wrapping it in a lightweight FastMCP server and packaging it as a Claude Code skill. The result is a seamless workflow where users can iteratively refine generated images through simple conversational prompts, maintaining visual context across multiple turns. This article delves into the technical underpinnings, practical applications, and broader implications of this innovative tool.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/lockitsoft.com\/?p=6823\/#The_Stateless_Struggle_A_Legacy_of_Image_Generation_Limitations\" >The Stateless Struggle: A Legacy of Image Generation Limitations<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/lockitsoft.com\/?p=6823\/#Gemini_31_Lite_A_Stateful_Leap_Forward\" >Gemini 3.1 Lite: A Stateful Leap Forward<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/lockitsoft.com\/?p=6823\/#nb2lite-skill-claude_Bridging_the_Gap\" >nb2lite-skill-claude: Bridging the Gap<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/lockitsoft.com\/?p=6823\/#The_Interactions_API_Images_That_Remember\" >The Interactions API: Images That Remember<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/lockitsoft.com\/?p=6823\/#Model_Context_Protocol_MCP_Standardizing_AI_Tool_Integration\" >Model Context Protocol (MCP): Standardizing AI Tool Integration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/lockitsoft.com\/?p=6823\/#Claude_Code_Skills_Embedding_Workflow_Intelligence\" >Claude Code Skills: Embedding Workflow Intelligence<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/lockitsoft.com\/?p=6823\/#Installation_Pathways_Getting_Started_with_Stateful_Image_Generation\" >Installation Pathways: Getting Started with Stateful Image Generation<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/lockitsoft.com\/?p=6823\/#Path_A_The_Plugin_Marketplace\" >Path A: The Plugin Marketplace<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/lockitsoft.com\/?p=6823\/#Path_B_Clone_and_Bootstrap\" >Path B: Clone and Bootstrap<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/lockitsoft.com\/?p=6823\/#Path_C_Install_into_Your_Project\" >Path C: Install into Your Project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/lockitsoft.com\/?p=6823\/#Path_D_Docker_Integration\" >Path D: Docker Integration<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/lockitsoft.com\/?p=6823\/#Troubleshooting_and_Support\" >Troubleshooting and Support<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/lockitsoft.com\/?p=6823\/#Practical_Examples_A_Session_in_Action\" >Practical Examples: A Session in Action<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/lockitsoft.com\/?p=6823\/#Dogfooding_Real-World_Application_and_Validation\" >Dogfooding: Real-World Application and Validation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/lockitsoft.com\/?p=6823\/#Broader_Impact_and_Future_Implications\" >Broader Impact and Future Implications<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/lockitsoft.com\/?p=6823\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"The_Stateless_Struggle_A_Legacy_of_Image_Generation_Limitations\"><\/span>The Stateless Struggle: A Legacy of Image Generation Limitations<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Historically, most AI image generation tools have operated under a stateless paradigm. Users submit a text prompt, the model processes it to produce an image, and then immediately discards all contextual information about that generation. This fundamental limitation poses a significant challenge for iterative refinement. If a user wishes to modify a generated image \u2013 for instance, changing a detail in the background or altering a character&#8217;s expression \u2013 they are typically forced to re-describe the entire scene. This often leads to undesirable outcomes, as the model struggles to retain the original composition, lighting, and character integrity, resulting in a &quot;round trip&quot; of modifications that compromises the initial artistic vision. This persistent issue has been a major bottleneck for creative professionals and hobbyists alike, demanding more intuitive and persistent methods for image manipulation.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Gemini_31_Lite_A_Stateful_Leap_Forward\"><\/span>Gemini 3.1 Lite: A Stateful Leap Forward<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Google&#8217;s <code>gemini-3.1-flash-lite-image<\/code> model, affectionately nicknamed &quot;Nano Banana 2 Lite,&quot; represents a departure from this conventional approach. This high-efficiency image model is engineered for rapid generation, capable of producing images in under two seconds. A key feature of this model is its robust text rendering capabilities, supporting over 25 languages. Crucially, however, it incorporates support for the <strong>Stateful Interactions API<\/strong>. This API allows for multi-turn image refinement, where the model actively preserves the visual context server-side. This stateful memory enables users to issue subsequent prompts that build upon previous generations, rather than starting from scratch. This marks a significant advancement, moving image generation from a discrete, one-off event to a dynamic, conversational process.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"nb2lite-skill-claude_Bridging_the_Gap\"><\/span>nb2lite-skill-claude: Bridging the Gap<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The nb2lite-skill-claude project effectively bridges the gap between Google&#8217;s advanced stateful image generation model and the interactive environment of Claude Code. This integration allows Claude Code, a powerful coding agent, to harness the Gemini model&#8217;s capabilities directly within its conversational interface. Users can interact with Claude Code by typing natural language commands, such as &quot;generate an image of a cyberpunk kitchen.&quot; The agent then translates these commands into requests for the Gemini model, returning the generated image. The true power of this integration lies in its iterative nature: a subsequent command like &quot;add a neon RAMEN sign&quot; directly modifies the <em>same image<\/em>, without requiring the user to re-describe the entire scene. This stateful editing capability drastically simplifies and enhances the creative workflow, making complex image adjustments as easy as a follow-up instruction.<\/p>\n<p>The project is delivered as a cohesive package, combining the technical infrastructure for stateful image generation with the user-friendly interface of a Claude Code skill. This dual nature ensures that both the underlying technology and the user experience are carefully considered.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"The_Interactions_API_Images_That_Remember\"><\/span>The Interactions API: Images That Remember<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>At the heart of this innovation lies Gemini&#8217;s Interactions API, which facilitates stateful image generation. The core operational loop of this API involves a series of interactions where the model maintains a persistent state.<\/p>\n<p><strong>The Stateful Generation Loop:<\/strong><\/p>\n<ol>\n<li><strong>Initial Prompt:<\/strong> The user provides a prompt to generate an image.<\/li>\n<li><strong>Model Processing:<\/strong> The Gemini model processes the prompt, creating an image and storing its context server-side.<\/li>\n<li><strong>Output and Interaction ID:<\/strong> The model returns the generated image along with a unique interaction ID. This ID acts as a key to recall the specific image&#8217;s state for future modifications.<\/li>\n<li><strong>Iterative Refinement:<\/strong> For subsequent edits, the user provides a new prompt that describes only the desired <em>change<\/em>. This prompt is sent along with the previous interaction ID.<\/li>\n<li><strong>Contextual Editing:<\/strong> The Gemini model uses the stored context associated with the interaction ID to apply the requested edit, ensuring continuity and coherence.<\/li>\n<li><strong>Updated Output:<\/strong> The model returns the newly edited image, along with a new interaction ID for further refinements.<\/li>\n<\/ol>\n<p>This mechanism starkly contrasts with the &quot;stateless suffering&quot; of traditional models. Instead of convoluted prompts like:<\/p>\n<blockquote>\n<p>&quot;A watercolor fox in a forest at dawn, mist, soft light, wearing a red scarf, three birch trees on the left, and now also holding a lantern.&quot;<\/p>\n<\/blockquote>\n<p>Users can simply articulate their desired change:<\/p>\n<blockquote>\n<p>&quot;Add a lantern in its paw.&quot;<\/p>\n<\/blockquote>\n<p>The underlying state maintained by the Interactions API ensures that the fox, forest, and other elements remain consistent. The server component of nb2lite-skill-claude transparently handles several practical aspects of this process:<\/p>\n<ul>\n<li><strong>API Key Management:<\/strong> Securely manages the Gemini API key.<\/li>\n<li><strong>Model Configuration:<\/strong> Configures the Gemini model for optimal image generation and editing.<\/li>\n<li><strong>Output Management:<\/strong> Directs generated images to a specified local directory.<\/li>\n<li><strong>Error Handling:<\/strong> Catches and translates API errors into human-readable messages for the Claude Code agent.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Model_Context_Protocol_MCP_Standardizing_AI_Tool_Integration\"><\/span>Model Context Protocol (MCP): Standardizing AI Tool Integration<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The integration of such advanced AI models into conversational agents is made possible by the <strong>Model Context Protocol (MCP)<\/strong>. MCP is an open standard designed to streamline the connection between AI assistants and various tools and data sources. Before MCP, integrating a new service with an AI assistant required bespoke code for each assistant-service pairing, leading to duplicated effort and complex plumbing. MCP simplifies this by establishing a universal interface: tool developers create a single <strong>MCP server<\/strong> that exposes typed tools, and any MCP-compliant client, such as Claude Code or Claude Desktop, can discover and utilize these tools without additional integration code.<\/p>\n<p>An MCP server typically runs as a small, local process that communicates using JSON-RPC over standard input\/output (stdio). The client launches the server, queries it for available tools, and then allows the AI model to invoke these tools as if they were native functions.<\/p>\n<p>The <code>nb2lite-agent<\/code> server, which is part of this project, exposes four distinct tools:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left\">Tool<\/th>\n<th style=\"text-align: left\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left\"><code>generate_image<\/code><\/td>\n<td style=\"text-align: left\">Generates a text-to-image output, up to 1k resolution. It saves the image locally and returns its path along with an interaction ID.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\"><code>edit_image<\/code><\/td>\n<td style=\"text-align: left\">Enables stateful image editing by taking a previous interaction ID and a prompt describing only the desired change.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\"><code>edit_local_image<\/code><\/td>\n<td style=\"text-align: left\">Allows for editing of existing local image files by uploading them inline (base64 encoded) and applying edits. This serves as an entry point for modifying pre-existing visuals.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\"><code>get_help<\/code><\/td>\n<td style=\"text-align: left\">Provides live configuration details, including API key status, the active model, output directory, and a full reference of available tools.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Generated images are saved to disk with filenames prefixed by <code>gen_<\/code>, <code>edit_<\/code>, or <code>edit_local_<\/code>, followed by a timestamp and a unique UUID suffix (e.g., <code>gen_1784759001_a1b2c3d4.jpg<\/code>). This naming convention helps prevent overwrites during concurrent generations and ensures clear identification of edited files. Error messages are communicated as text strings, allowing the agent to interpret and react to them appropriately.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Claude_Code_Skills_Embedding_Workflow_Intelligence\"><\/span>Claude Code Skills: Embedding Workflow Intelligence<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>While MCP provides the &quot;hands&quot; for Claude to interact with tools, a <strong>Claude Code skill<\/strong> provides the &quot;muscle memory.&quot; A skill is essentially a markdown file (<code>SKILL.md<\/code>) bundled with necessary resources. When loaded into Claude&#8217;s context, it educates the AI on specific workflows, dictating which tools to use, in what sequence, and under what constraints.<\/p>\n<p>For the <code>nb2lite-image<\/code> skill, this includes defining:<\/p>\n<ul>\n<li><strong>Tool Mapping:<\/strong> How natural language requests are translated into specific MCP tool calls.<\/li>\n<li><strong>Parameter Inference:<\/strong> Automatically extracting parameters like <code>aspect_ratio<\/code> from user prompts.<\/li>\n<li><strong>State Management:<\/strong> Tracking the latest interaction ID for seamless sequential editing.<\/li>\n<li><strong>Output Interpretation:<\/strong> Understanding the responses from the MCP server, including image paths and interaction IDs.<\/li>\n<\/ul>\n<p>Crucially, the skill package is self-contained. It bundles the MCP server itself (<code>mcp\/server.py<\/span><\/code>), its dependencies, an installation script, and even a copy of the Interactions API developer guide. This means that installing the skill provides users with everything they need to set up the MCP server and begin generating images.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Installation_Pathways_Getting_Started_with_Stateful_Image_Generation\"><\/span>Installation Pathways: Getting Started with Stateful Image Generation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Users can integrate nb2lite-skill-claude with minimal friction, requiring only Python 3.10+, Claude Code, and a Google Gemini API key obtained from Google AI Studio. Several installation paths are provided to cater to different user preferences:<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Path_A_The_Plugin_Marketplace\"><\/span>Path A: The Plugin Marketplace<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>For the quickest setup, users can install the skill directly from the Claude Code plugin marketplace:<\/p>\n<pre><code class=\"language-bash\">\/plugin marketplace add xbill9\/nb2lite-skill-claude\n\/plugin install nb2lite-image@nb2lite-skill-claude<\/code><\/pre>\n<p>This method installs the skill and automatically registers the MCP server. The plugin manifest itself does not store API keys, adhering to best security practices. The MCP server reads the <code>GEMINI_API_KEY<\/code> from the environment, so it must be exported before launching Claude Code.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Path_B_Clone_and_Bootstrap\"><\/span>Path B: Clone and Bootstrap<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Alternatively, users can clone the repository and use a provided bootstrap script:<\/p>\n<pre><code class=\"language-bash\"># 1. Get the code\ngit clone https:\/\/github.com\/xbill9\/nb2lite-skill-claude.git\ncd nb2lite-skill-claude\n\n# 2. One-command setup: installs dependencies, registers the MCP server in .mcp.json, and prompts for API key (stored in ~\/gemini.key)\n.\/init.sh\n\n# 3. Restart Claude Code in this directory and approve the server when prompted. Verify with:\n\/mcp # Should list nb2lite-agent<\/code><\/pre>\n<p>The <code>init.sh<\/code> script automates dependency installation, MCP server registration, and prompts for the API key, storing it securely. Rerunning <code>init.sh<\/code> is safe if any issues arise.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Path_C_Install_into_Your_Project\"><\/span>Path C: Install into Your Project<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>For users who prefer to integrate the skill into an existing project:<\/p>\n<pre><code class=\"language-bash\">make init TARGET=\/path\/to\/your\/project ARGS='--output-dir .\/images'<\/code><\/pre>\n<p>This command copies the skill into the specified project directory and updates the project&#8217;s <code>.mcp.json<\/code> file with the <code>nb2lite-agent<\/code> entry. It can leverage an existing <code>~\/gemini.key<\/code> file. After restarting Claude Code within that project and approving the server, the skill will be active.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Path_D_Docker_Integration\"><\/span>Path D: Docker Integration<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>A Docker image, <code>xbill9\/nb2lite-agent<\/code>, is available for users who prefer containerized environments:<\/p>\n<pre><code class=\"language-bash\">claude mcp add nb2lite-agent --env GEMINI_API_KEY=\"$(cat ~\/gemini.key)\" -- \n  docker run --rm -i -e GEMINI_API_KEY -v \"$PWD:$PWD\" -w \"$PWD\" xbill9\/nb2lite-agent<\/code><\/pre>\n<p>The volume mounts (<code>-v \"$PWD:$PWD\" -w \"$PWD\"<\/code>) are crucial. They ensure the container can access the host&#8217;s filesystem for saving images and reading local files, maintaining consistency between the host and the container.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Troubleshooting_and_Support\"><\/span>Troubleshooting and Support<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>A comprehensive troubleshooting guide is available within the project&#8217;s documentation, addressing common issues related to API key configuration, environment variables, and server registration. Community support channels are also provided for users seeking assistance.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Practical_Examples_A_Session_in_Action\"><\/span>Practical Examples: A Session in Action<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The real power of nb2lite-skill-claude is evident in its practical application. A typical user session demonstrates the seamless iterative refinement:<\/p>\n<p><strong>User:<\/strong> &quot;Generate a cozy cabin in a snowy forest at dusk, 16:9.&quot;<\/p>\n<p>Claude Code translates this into an MCP call:<\/p>\n<pre><code class=\"language-python\">generate_image(\n    prompt=\"A cozy log cabin in a snowy forest at dusk, warm light in the windows\",\n    aspect_ratio=\"16:9\",\n    thinking_level=\"low\",\n)\n# \ud83d\uddbc\ufe0f Saved to: .\/gen_1784759001_a1b2c3d4.jpg\n# Interaction ID: v1_ChdpRU5...<\/code><\/pre>\n<p>The output includes the generated image path and a crucial interaction ID.<\/p>\n<p><strong>User:<\/strong> &quot;Nice. Add smoke curling from the chimney.&quot;<\/p>\n<p>Claude Code then uses the <code>edit_image<\/code> tool with the previous interaction ID:<\/p>\n<pre><code class=\"language-python\">edit_image(\n    previous_interaction_id=\"v1_ChdpRU5...\",\n    edit_prompt=\"add gentle smoke curling from the chimney\",\n)\n# \ud83d\uddbc\ufe0f Saved to: .\/edit_1784759050_e5f6a7b8.jpg\n# Interaction ID: v1_Xk9mPq2... (a NEW ID for the next edit)<\/code><\/pre>\n<p>The cabin, trees, and existing smoke remain, while new smoke is added. A new interaction ID is generated for subsequent modifications.<\/p>\n<p><strong>User:<\/strong> &quot;Now make it night, with aurora in the sky.&quot;<\/p>\n<p>This prompt would again use the <code>edit_image<\/code> tool, building upon the last state. The cabin, trees, and chimney smoke would remain, with only the sky transitioning to night and featuring an aurora. This illustrates the persistent context that eliminates the need for redundant descriptions.<\/p>\n<p>Furthermore, the <code>edit_local_image<\/code> tool allows for the integration of pre-existing visuals:<\/p>\n<p><strong>User:<\/strong> &quot;Take .\/whiteboard-sketch.png and render it as a clean 3D product mockup.&quot;<\/p>\n<p>This translates to:<\/p>\n<pre><code class=\"language-python\">edit_local_image(\n    image_path=\".\/whiteboard-sketch.png\",\n    edit_prompt=\"render this hand-drawn sketch as a high-fidelity 3D product mockup\",\n    aspect_ratio=\"4:3\",\n)<\/code><\/pre>\n<p>The tool uploads the local file and applies the requested transformation, returning an interaction ID for potential follow-up edits, thereby enabling stateful refinement of non-AI-generated images.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Dogfooding_Real-World_Application_and_Validation\"><\/span>Dogfooding: Real-World Application and Validation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The principle of &quot;dogfooding&quot;\u2014using one&#8217;s own product for real work\u2014is central to the development and validation of nb2lite-skill-claude. The project rigorously applies this philosophy across its entire stack, most notably demonstrated by the cover image of this article. This image was generated using the very tool being described, serving as an immediate and tangible proof of its capabilities.<\/p>\n<p>The prompt used for the cover image exemplifies the sophisticated control offered:<\/p>\n<pre><code class=\"language-python\">generate_image(\n    prompt=\"A wide tech blog cover illustration: a friendly robot artist \"\n           \"painting a glowing galaxy on an easel, while a chain of connected \"\n           \"frames behind it shows the same picture evolving step by step \"\n           \"(day sky, then sunset, then storm with lightning). Flat vector \"\n           \"style, deep indigo background, neon cyan and orange accents. \"\n           \"Title text 'NB2Lite + MCP', subtitle 'Stateful image editing \"\n           \"as a Claude Code skill'. Crisp, accurate lettering.\",\n    aspect_ratio=\"16:9\",\n    thinking_level=\"high\",\n)\n# \ud83d\uddbc\ufe0f Image successfully saved!\n# \u2705 Saved to: gen_1784759177_cbab8b65.jpg\n# \u2705 Interaction ID: v1_ChdpRU5hb2o3SWMzV2pNY1AtUFgy...<\/code><\/pre>\n<p>This exact output is committed to the repository as <code>devto-cover.jpg<\/code>, providing transparent evidence of the generation process.<\/p>\n<p>Key aspects highlighted by this dogfooding approach include:<\/p>\n<ul>\n<li><strong>Accurate Text Rendering:<\/strong> The model successfully rendered specific text elements (&quot;NB2Lite + MCP,&quot; &quot;Stateful image editing as a Claude Code skill&quot;) with precision, a common challenge for image generation models.<\/li>\n<li><strong>Consistent Style:<\/strong> The requested &quot;flat vector style&quot; with specific color accents was consistently applied.<\/li>\n<li><strong>Complex Composition:<\/strong> The intricate composition involving a robot, an easel, a galaxy, and a sequence of evolving frames was realized as intended.<\/li>\n<li><strong>Iterative Refinement Simulation:<\/strong> The prompt itself describes an image that visualizes the iterative process, demonstrating the model&#8217;s understanding of abstract concepts related to its own functionality.<\/li>\n<\/ul>\n<p>This commitment to dogfooding provides the cheapest form of credibility: the tool&#8217;s actual output is the first thing users see. If the lettering had been garbled or the layout flawed, the article itself would serve as evidence of those shortcomings. Instead, it acts as a direct, unedited demonstration of the skill&#8217;s efficacy.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Broader_Impact_and_Future_Implications\"><\/span>Broader Impact and Future Implications<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The nb2lite-skill-claude project signifies a pivotal shift in how AI can be integrated into creative workflows. By enabling stateful, conversational image generation and editing within a coding agent, it lowers the barrier to entry for complex visual tasks. This could have profound implications for various fields:<\/p>\n<ul>\n<li><strong>Software Development:<\/strong> Developers can now generate and refine UI mockups, game assets, or visualizations directly within their coding environment, accelerating the design iteration process.<\/li>\n<li><strong>Content Creation:<\/strong> Bloggers, marketers, and designers can create and modify visual content more efficiently, without extensive knowledge of specialized image editing software.<\/li>\n<li><strong>Education:<\/strong> The intuitive, conversational interface can serve as a powerful educational tool for learning about AI image generation and prompt engineering.<\/li>\n<li><strong>Accessibility:<\/strong> By simplifying complex tasks into natural language commands, the technology enhances accessibility for individuals who may not have traditional design skills.<\/li>\n<\/ul>\n<p>The project&#8217;s reliance on open standards like MCP suggests a future where AI agents can seamlessly interact with a vast ecosystem of tools and services, fostering a more interconnected and powerful AI landscape. As models like Gemini continue to evolve, and as tools like Claude Code gain wider adoption, stateful AI interactions are poised to become the norm rather than the exception.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>nb2lite-skill-claude represents a significant advancement in the field of AI-powered image generation. By effectively integrating Google&#8217;s stateful Gemini model with Claude Code via the MCP framework, it offers a powerful, intuitive, and efficient way to create and refine visual content. The project&#8217;s commitment to open standards, ease of installation, and rigorous dogfooding practices underscore its potential to transform creative workflows across numerous industries. As AI continues to permeate our digital lives, innovations like this pave the way for more seamless, intelligent, and accessible human-AI collaboration.<\/p>\n<p><strong>Links:<\/strong><\/p>\n<ul>\n<li>nb2lite-skill-claude GitHub Repository: <a href=\"https:\/\/github.com\/xbill9\/nb2lite-skill-claude\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/xbill9\/nb2lite-skill-claude<\/a><\/li>\n<li>Google AI Studio: <a href=\"https:\/\/aistudio.google.com\/\" target=\"_blank\" rel=\"noopener\">https:\/\/aistudio.google.com\/<\/a><\/li>\n<li>Model Context Protocol (MCP) Documentation: (Link to be provided if available)<\/li>\n<li>Claude Code: (Link to be provided if available)<\/li>\n<\/ul>\n<p><em>Disclaimer: This is a third-party community project, not affiliated with or endorsed by Anthropic or Google. Users are responsible for obtaining and managing their own Gemini API keys. Image generation incurs costs, and users are advised to use <code>thinking_level=\"low\"<\/code> for drafting and <code>thinking_level=\"high\"<\/code> for final outputs.<\/em><\/p>\n<!-- RatingBintangAjaib -->","protected":false},"excerpt":{"rendered":"<p>The landscape of artificial intelligence-powered image generation is undergoing a significant transformation with the introduction of nb2lite-skill-claude, a novel integration that brings stateful image editing capabilities to Claude Code. This groundbreaking project leverages Google&#8217;s gemini-3.1-flash-lite-image model, wrapping it in a lightweight FastMCP server and packaging it as a Claude Code skill. The result is a &hellip;<\/p>\n","protected":false},"author":28,"featured_media":6822,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[136],"tags":[88,669,138,831,374,79,3310,139,530,2025,137,534],"class_list":["post-6823","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development","tag-claude","tag-code","tag-coding","tag-generation","tag-image","tag-integration","tag-lite","tag-programming","tag-revolutionizing","tag-skill","tag-software","tag-stateful"],"_links":{"self":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/posts\/6823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6823"}],"version-history":[{"count":0,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/posts\/6823\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/media\/6822"}],"wp:attachment":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6823"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}