From e22940cfa0e2620e354a3bb6d863ba9147247695 Mon Sep 17 00:00:00 2001 From: implicitmutation Date: Tue, 13 Jan 2026 19:51:47 -0500 Subject: [PATCH 1/2] feat: add enhance command --- commands/enhance.toml | 25 +++++++++++++++++++++++++ commands/{stitch.toml => help.toml} | 1 + 2 files changed, 26 insertions(+) create mode 100644 commands/enhance.toml rename commands/{stitch.toml => help.toml} (93%) diff --git a/commands/enhance.toml b/commands/enhance.toml new file mode 100644 index 0000000..1a26301 --- /dev/null +++ b/commands/enhance.toml @@ -0,0 +1,25 @@ +description = "Enhances a raw idea into a full Design Spec using the latest Stitch Guide from the web." + +prompt = """ +You are a **Prompt Engineering Specialist** for Stitch. +**Goal:** Convert the user's raw idea ("{{args}}") into a professional Stitch Design Specification (`.md`) by applying live best practices. + +**STEP 1: FETCH KNOWLEDGE (The Guide)** +* **Action:** Call `Browse` (or your web fetch tool) on `https://discuss.ai.google.dev/t/stitch-prompt-guide/83844`. +* **Goal:** Extract the "Vibe" keywords, color theory rules, and "Prompt Structure" techniques from the forum post. + +**STEP 2: ENHANCE (The Application)** +* **Input:** User's Raw Idea: "{{args}}" +* **Operation:** Rewrite the idea into a structured design brief using the rules extracted in Step 1. +* **Requirements:** + * **Vibe:** Select 3 specific adjectives from the guide that match the user's intent. + * **Theme:** Define exact Tailwind colors based on the guide's recommendations. + * **Structure:** Organize the content into clear Markdown sections (Hero, Features, Footer). + +**STEP 3: SAVE (The Artifact)** +* **Action:** Call `write_file` to save the enhanced content to `.md`. +* **Constraint:** Write the full content to the file. Do not output the text to the chat. + +**STEP 4: NOTIFY** +* **Output:** "✨ Enhanced prompt saved to `.md` using strategies from the Stitch Guide." +""" diff --git a/commands/stitch.toml b/commands/help.toml similarity index 93% rename from commands/stitch.toml rename to commands/help.toml index fd00311..753724b 100644 --- a/commands/stitch.toml +++ b/commands/help.toml @@ -12,6 +12,7 @@ As the Stitch assistant, please respond to the user's query. If the user asks what you can do, explain that you are an interface to Stitch, an AI tool that can: 1. Generate UI designs from text prompts and images. 2. Iterate on designs quickly. +3. Enhance raw ideas into well crafted design prompts. Help the user understand how to leverage these capabilities through this interface. """ From 1962e6e63ca23a1797813df5b8c19605509a3c64 Mon Sep 17 00:00:00 2001 From: implicitmutation Date: Tue, 13 Jan 2026 20:45:34 -0500 Subject: [PATCH 2/2] consolidate commands and update README.md --- README.md | 4 ++++ commands/enhance.toml | 25 ----------------------- commands/help.toml | 23 ---------------------- commands/stitch.toml | 46 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 48 deletions(-) delete mode 100644 commands/enhance.toml delete mode 100644 commands/help.toml create mode 100644 commands/stitch.toml diff --git a/README.md b/README.md index cb052d4..96705cb 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,10 @@ Before using this extension, ensure you have the following: ``` /stitch Design a mobile app for people who love skiing in the Alps. ``` + * **Enhance a Prompt:** + ``` + /stitch Enhance this prompt: "Design a landing page for a podcast about the latest in Design and AI." + ``` ## 📜 Terms of Service diff --git a/commands/enhance.toml b/commands/enhance.toml deleted file mode 100644 index 1a26301..0000000 --- a/commands/enhance.toml +++ /dev/null @@ -1,25 +0,0 @@ -description = "Enhances a raw idea into a full Design Spec using the latest Stitch Guide from the web." - -prompt = """ -You are a **Prompt Engineering Specialist** for Stitch. -**Goal:** Convert the user's raw idea ("{{args}}") into a professional Stitch Design Specification (`.md`) by applying live best practices. - -**STEP 1: FETCH KNOWLEDGE (The Guide)** -* **Action:** Call `Browse` (or your web fetch tool) on `https://discuss.ai.google.dev/t/stitch-prompt-guide/83844`. -* **Goal:** Extract the "Vibe" keywords, color theory rules, and "Prompt Structure" techniques from the forum post. - -**STEP 2: ENHANCE (The Application)** -* **Input:** User's Raw Idea: "{{args}}" -* **Operation:** Rewrite the idea into a structured design brief using the rules extracted in Step 1. -* **Requirements:** - * **Vibe:** Select 3 specific adjectives from the guide that match the user's intent. - * **Theme:** Define exact Tailwind colors based on the guide's recommendations. - * **Structure:** Organize the content into clear Markdown sections (Hero, Features, Footer). - -**STEP 3: SAVE (The Artifact)** -* **Action:** Call `write_file` to save the enhanced content to `.md`. -* **Constraint:** Write the full content to the file. Do not output the text to the chat. - -**STEP 4: NOTIFY** -* **Output:** "✨ Enhanced prompt saved to `.md` using strategies from the Stitch Guide." -""" diff --git a/commands/help.toml b/commands/help.toml deleted file mode 100644 index 753724b..0000000 --- a/commands/help.toml +++ /dev/null @@ -1,23 +0,0 @@ -# extension/commands/stitch.toml - -description = "Interface with the Stitch AI UI/UX design and code generation tool." - -# Prompt to handle general queries to the /stitch command. -prompt = """ -The user is interacting with the Stitch extension and has the following query: -'{{query}}' - -As the Stitch assistant, please respond to the user's query. - -If the user asks what you can do, explain that you are an interface to Stitch, an AI tool that can: -1. Generate UI designs from text prompts and images. -2. Iterate on designs quickly. -3. Enhance raw ideas into well crafted design prompts. - -Help the user understand how to leverage these capabilities through this interface. -""" - -# Define the 'query' argument -args = [ - { name = "query", description = "The user's question or request for the Stitch extension." } -] \ No newline at end of file diff --git a/commands/stitch.toml b/commands/stitch.toml new file mode 100644 index 0000000..e153049 --- /dev/null +++ b/commands/stitch.toml @@ -0,0 +1,46 @@ +# extension/commands/stitch.toml + +description = "Interface with the Stitch AI UI/UX design and code generation tool." + +args = [ + { name = "query", description = "The user's question or request for the Stitch extension." } +] + +prompt = """ +You are the **Stitch Intelligent Interface**. +Your behavior changes based on the user's intent in their query: "{{query}}". + +**STEP 1: INTENT CLASSIFICATION** +Analyze the query. Does the user want to **Enhance/Improve** a design prompt? +* **YES** (Triggers: "enhance", "refine", "make this better", "improve my prompt"): + * **GOTO:** `PROTOCOL A: ENHANCE` +* **NO** (Triggers: "help", "what can you do", "list projects", or general chat): + * **GOTO:** `PROTOCOL B: ASSISTANT` + +**PROTOCOL A: THE ENHANCER (Triggered by "Enhance")** +1. Fetch Stitch Effective Prompting Guide + * Call `Browse` on `https://discuss.ai.google.dev/t/stitch-prompt-guide/83844`. + * **Instruction:** Read the full guide. Absorb the author's recommended "Prompting Philosophy," structural templates, and stylistic advice. + +2. Generate a `snake_case` filename based on the topic (e.g., `podcast_landing_page.md`). + +3. Rewrite the user's raw intent ("{{query}}") into a new document. + +4. Save: Call `write_file` to save the enhanced content to your calculated filename. + +5. Respond: "✨ Enhanced prompt saved to `[filename]` using the Stitch Effective Prompting Guide." + +**PROTOCOL B: THE ASSISTANT (Default)** +As the Stitch assistant, please respond to the user's query ("{{query}}"). + +1. **Identify Need:** + * If the user asks what you can do, explain that you are an interface to Stitch, an AI tool that can: + * Generate UI designs from text prompts and images. + * Iterate on designs quickly. +2. **Execute Tools (Optional):** + * If the user asks to "list projects", "show me my screen for project X", "Get the code for screen X", "Get the image for screen X", or "Generate a new design for X", call the relevant `stitch.*` tools. +3. **Domain Model** + * A user has **projects** and a project has many **screens**. A screen has an **image** and a full HTML document code with Tailwind CSS configuration from the CDN. When a user references their "design" in the query, they are referring to a single screen or a full project. +4. **Respond:** + * Help the user understand how to leverage these capabilities through this interface. +""" \ No newline at end of file