Skip to content

Comments

feat: add prompt enhancement#5

Merged
davideast merged 2 commits intomainfrom
david/enhance
Jan 14, 2026
Merged

feat: add prompt enhancement#5
davideast merged 2 commits intomainfrom
david/enhance

Conversation

@davideast
Copy link
Member

@davideast davideast commented Jan 14, 2026

Add a prompt enhancement feature to the /stitch command.

Example

> /stitch Enhance this prompt. An app that helps you plan healthy meals with AI

✦ I will fetch the Stitch Prompt Guide to extract the necessary design principles and prompting strategies.

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓  WebFetch Processing URLs and instructions from prompt: "Summarize https://discuss.ai.google.dev/t/stitch-prompt-guide/83844, spe… │
│                                                                                                                                      │
│ Content processed from prompt.                                                                                                       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ I will create the Stitch Design Specification file for the healthy meal planner app.

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓  WriteFile Writing to healthy_meal_planner_spec.md                                                                                 │
│                                                                                                                                      │
│  1 # Stitch Design Specification: AI Healthy Meal Planner                                                                            │
│  2                                                                                                                                   │
│  3 ## App Overview                                                                                                                   │
│  4 **Concept:** A smart application that generates personalized, healthy meal plans using AI, simplifying nutrition and grocery      │
│    shopping.                                                                                                                         │
│  5 **Target Audience:** Health-conscious individuals, busy professionals, and fitness enthusiasts.                                   │
│  6                                                                                                                                   │
│  7 ## Design Vibe & Theme                                                                                                            │
│  8 **Vibe:** Clean, Vibrant, Nourishing                                                                                              │
│  9 **Color Palette (Tailwind CSS):**                                                                                                 │
│ 10 *   **Primary:** `bg-emerald-600` (Freshness, Health)                                                                             │
│ 11 *   **Background:** `bg-slate-50` (Clean, Minimal)                                                                                │
│ 12 *   **Accent:** `text-orange-500` (Energy, zest)                                                                                  │
│ 13 *   **Text:** `text-slate-800` (Readability)                                                                                      │
│ 14                                                                                                                                   │
│ 15 ## UI Structure                                                                                                                   │
│ 16                                                                                                                                   │
│ 17 ### 1. Hero Section                                                                                                               │
│ 18 *   **Headline:** "Eat Smarter, Live Better with AI-Powered Nutrition."                                                           │
│ 19 *   **Sub-headline:** "Get personalized meal plans, automatic shopping lists, and track your macros in seconds."                  │
│ 20 *   **Visual:** A split layout with the headline on the left and a high-quality image of a balanced, colorful meal bowl on the    │
│    right.                                                                                                                            │
│ 21 *   **Call to Action:** A pill-shaped button: `bg-emerald-600 text-white` labeled "Generate My Plan".                             │
│ 22                                                                                                                                   │
│ 23 ### 2. Core Features (Grid Layout)                                                                                                │
│ 24 *   **Smart Meal Gen:** Card featuring an icon of a robot chef. Text: "Custom plans based on your dietary preferences and goals." │
│ 25 *   **Instant Grocery Lists:** Card with a basket icon. Text: "One-click export of ingredients to your favorite delivery app."    │
│ 26 *   **Macro Tracker:** Card with a chart icon. Text: "Visualize your protein, carbs, and fat intake effortlessly."                │
│ 27                                                                                                                                   │
│ 28 ### 3. Recent Plans / Dashboard Preview                                                                                           │
│ 29 *   **Section Title:** "Your Weekly Menu"                                                                                         │
│ 30 *   **Component:** A horizontal scrollable list of meal cards (e.g., "Avocado Toast," "Quinoa Salad," "Grilled Salmon").          │
│ 31 *   **Card Details:** Image of food, calories, and a "View Recipe" link.                                                          │
│ 32                                                                                                                                   │
│ 33 ### 4. Footer                                                                                                                     │
│ 34 *   **Links:** simple text links for "About," "Recipes," "Support."                                                               │
│ 35 *   **Newsletter:** A small input field `border-emerald-200` and a "Subscribe" button to get nutrition tips.                      │
│ 36 *   **Copyright:** Simple text `text-slate-400`.                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ ✨ Enhanced prompt saved to healthy_meal_planner_spec.md using strategies from the Stitch Guide.

@davideast davideast requested a review from JLXIA January 14, 2026 00:54
@@ -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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After renaming, does it (/stitch) still work?

e.g.
/stitch design a Mobile-responsive ecommerce home page for a bird watching gear store

Copy link
Member Author

@davideast davideast Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed that to /stitch:help but I now realize that's a terrible name.

We have a two primary options

  1. /stitch <prompt> - Make it general even for enhance
  2. /stitch:assistant and /stitch:enhance for both behaviors.

The combined prompt would look something like:

# 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 Knowledge:**
    * Call `Browse` on `https://discuss.ai.google.dev/t/stitch-prompt-guide/83844`.
    * Extract "Vibe" keywords, color rules, and formatting tips.
2.  **Determine Filename:**
    * Generate a `snake_case` filename based on the topic (e.g., `crypto_dashboard.md`).
3.  **Process:**
    * Rewrite the user's raw idea from the query into a professional Design Spec using the fetched rules.
    * Include: **Vibe** (3 adjectives), **Theme** (Tailwind colors), and **Structure** (Hero, Grid, Footer).
4.  **Save:**
    * Call `write_file` to save the content to your calculated filename.
5.  **Respond:**
    * "✨ Enhanced prompt saved to `[filename]`. Run `/design:loop` to build it."

---

**PROTOCOL B: THE ASSISTANT (Default)**
1.  **Identify Need:**
    * If the user is asking about capabilities, explain that you are the interface to Stitch.
    * Highlight your ability to **Generate** (text-to-design), **Iterate**, and **Enhance** prompts.
    * *Tip:* If the user seems stuck, suggest: "Try saying 'Enhance this prompt: a retro music player'."
2.  **Execute Tools (Optional):**
    * If the user asks to "list projects" or "show status", call the relevant `stitch.*` tools.
3.  **Respond:**
    * Provide a helpful, conversational answer guiding them on how to use the tool.
"""

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the README.md correspondingly, the Usage part.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@davideast davideast changed the title feat: add enhance command feat: add prompt enhancement Jan 14, 2026
@davideast davideast merged commit f3b3a98 into main Jan 14, 2026
2 checks passed
@davideast davideast deleted the david/enhance branch January 14, 2026 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants