Logo di Dg Generate

Dg Generate

Community
FReptar0
dg-generate

Genera una schermata con Google Stitch o Claude Code a partire da una descrizione testuale. Usalo quando l’utente vuole creare una nuova pagina web, landing page, dashboard, pagina dei prezzi, pagina «Chi siamo» o qualsiasi interfaccia. Usalo anche quando dice «progetta una pagina», «crea una schermata» o «realizza una pagina web». Richiede DESIGN.md per garantire coerenza visiva e blocca la generazione se il file manca.

Add to TypingMind

Panoramica

Pubblicato daFReptar0
Repositorydesign-guard
Nome della skilldg-generate
Stelle
12
Fork
4
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da FReptar0 su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Dg Generate in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/FReptar0/design-guard/tree/main/.claude/skills/dg-generate
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/FReptar0/design-guard.git /tmp/design-guard
mkdir -p .claude/skills
cp -r /tmp/design-guard/.claude/skills/dg-generate .claude/skills/dg-generate
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Dg Generate in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Dg Generate non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Dg Generate non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Generate a screen from a description using the configured generator (Stitch or Claude Code).

Guardrails (MUST follow)

Before sending any prompt to Stitch:

  1. Verify prompt is under 5000 characters
  2. Verify prompt targets ONE screen only (not multiple pages)
  3. For refinements: verify ONE change only (not compound changes)
  4. Reject vague requests ("make it better", "improve it") — ask for specifics
  5. Check quota before generating: read .guardrc.json to see current usage
  6. DESIGN.md is required — step 1 blocks generation if missing
  7. Flag generic terms ("modern", "clean", "professional") and suggest specific UI/UX vocabulary replacements (e.g., "asymmetric hero layout", "bento grid", "sticky nav with CTA")

Instructions

  1. Generator selection (MUST run before generating):

    • Read .guardrc.json and check the generator field.
    • IF generator is already set (value is "stitch" or "claude"):
      • Use it. Tell the user: "Using [Stitch MCP / Claude Code] as your configured generator."
      • Do NOT ask again.
    • IF generator is NOT set (field missing or .guardrc.json does not exist):
      • Present the options to the user:

        "Which generator would you like to use for this project?

        1. Claude Code (recommended) -- Generates HTML locally. Anti-slop rules from .claude/rules/ are enforced during generation. Best for design-system compliance.
        2. Google Stitch -- Generates via Stitch MCP. More creative/varied layouts, but anti-slop rules do NOT apply during generation (the critic catches issues after).

        Which do you prefer? (Default: Claude Code)"

      • If the user picks Claude Code (or does not express a preference): set generator to "claude".

      • If the user picks Stitch: set generator to "stitch".

      • Save the choice to .guardrc.json by updating the generator field (create file with defaults if it does not exist).

      • Tell the user: "Saved generator preference to .guardrc.json. You can change it anytime by editing the file or telling me to switch."

  2. Read DESIGN.md (REQUIRED):

    • Read DESIGN.md from the project root.
    • IF DESIGN.md does NOT exist: STOP. Do NOT create one inline. Do NOT proceed with generation.
      • Tell the user: "No DESIGN.md found. A design system is required before generating screens. Run /dg-design to create one (or /dg-discover first if this is for a real business)."
      • Do NOT offer to create DESIGN.md within this skill. The user MUST use /dg-design which has context isolation and discover checks.
    • IF DESIGN.md exists: use it as context for visual consistency. Extract colors, fonts, spacing, and component patterns.
  3. Guide the user through building a good prompt using the zoom-out-zoom-in framework:

    Zoom out (context ~30%):

    • Product name and what it does
    • Target user/audience
    • Overall aesthetic direction

    Zoom in (specifics ~70%):

    • Page type (landing page, dashboard, pricing, about, contact, etc.)
    • Goal of this screen
    • Each section with specific descriptions
    • UI patterns: "bento grid", "sticky header", "card layout"
    • Specific numbers: "3 pricing tiers", "4 testimonials"
  4. Build the prompt following this structure:

    A [adjective] [page type] for "[Product Name]," a [product description].
    Designed for [target user]. [Visual tone].
    
    Include these sections:
    1. [Section with brief description]
    2. [Section with brief description]
    ...
  5. Generate the screen:

    • IF generator is stitch:
      • Model selection: Before generating, read packages/cli/src/research/known-state.json to check available models. Use ONLY non-deprecated models:
        • GEMINI_3_FLASH (350/month quota) — default for fast iteration and standard screens
        • GEMINI_3_1_PRO (200/month quota) — use for high-quality hero pages or when the user explicitly requests best quality
        • Do NOT use GEMINI_3_PRO or GEMINI_2_5_FLASH — these are deprecated and may produce inferior results or fail
      • Call mcp__stitch__generate_screen_from_text with the prompt, the selected model, and the Stitch project ID from .guardrc.json.
    • IF generator is claude: Generate a complete, single-file HTML page directly. Follow these constraints:
      • Apply ALL rules from .claude/rules/anti-slop-design.md
      • Apply ALL rules from .claude/rules/design-system-adherence.md
      • Apply ALL rules from .claude/rules/content-authenticity.md
      • Follow DESIGN.md for all color, typography, spacing, and component decisions
      • Use the zoom-out-zoom-in prompt structure from step 3 as the page specification
      • Output a complete HTML file with embedded CSS (no external dependencies except Google Fonts)
      • Run the self-check from .claude/rules/post-generation-evaluation.md before presenting
  6. After generation, retrieve the screen code and save the HTML to screens/[screen-name].html.

  7. Post-generation quality gate: After saving the HTML, run the dg-critic agent to check quality:

    • The critic runs static lint + 5 quick pattern checks (identical cards, gradient text, button hierarchy, palette compliance, content truth).
    • If the critic returns FAIL: show the issues, attempt one automatic fix pass using the critic's suggestions as a refinement prompt, then re-lint. If still failing, present both versions to the user with the issues noted.
    • If the critic returns WARN: show the warnings but proceed to preview.
    • If the critic returns PASS: proceed to preview.
    • The anti-slop rules in .claude/rules/ prevent issues in Claude-generated HTML, but Stitch output is NOT influenced by rules — the critic catches what rules cannot.
  8. Preview the screen after saving:

    • Call mcp__stitch__get_screen_image with the project ID and screen ID to get a base64 PNG.
    • Display the image inline so the user can see the result immediately.
  9. For refinements, use this structure (one change at a time):

    On the [specific section] of [screen name], [specific change]:
    - [Detail 1]
    - [Detail 2]
  10. Multi-screen requests — SEQUENTIAL ONLY: When the user asks to generate multiple screens (e.g., "create a landing page, about page, and pricing page"), generate them ONE AT A TIME. Follow this sequence for each screen:

    1. Build the prompt for screen N
    2. Generate screen N (Stitch or Claude)
    3. Save to screens/
    4. Run the critic on screen N
    5. Fix any issues the critic flags
    6. Wait for the full cycle to complete before starting screen N+1

    NEVER send multiple generation requests in parallel — this causes cascading timeouts on Stitch and wastes quota when screens fail. If Stitch is already timing out on one request, sending more will make it worse.

    For subsequent screens, prefix prompts with: "Following the same design language as the homepage..."

  11. For variants, offer to call mcp__stitch__generate_variants to produce 2-3 alternative designs the user can compare before committing to one direction.

  12. For inline edits to an existing screen, use mcp__stitch__edit_screens instead of regenerating from scratch.

  13. Next step: Based on the critic verdict, provide context-aware guidance:

    • If PASS: "Screen passes quality gate. Preview with /dg-preview, deep-evaluate with /dg-evaluate, or generate another screen."
    • If WARN: "Screen has minor issues. Run /dg-evaluate for detailed analysis, or refine with /dg-generate targeting the flagged issues."
    • If FAIL: "Screen needs work. Use the suggested refinement prompt above, or run /dg-evaluate for a full breakdown."
    • Always show quota status: "Quota: Flash {used}/{limit}, Pro {used}/{limit}"

Error Handling

Stitch Timeout Recovery

IF a Stitch MCP call (mcp__stitch__generate_screen_from_text) times out, hangs, or returns an error:

  1. Do NOT silently switch to Claude Code generation. The user chose Stitch and must be informed.
  2. Auto-check if the screen completed server-side: Stitch often completes generation even when the MCP response times out. Immediately call mcp__stitch__list_screens to check if the screen was created despite the timeout.
    • IF the screen IS found: download it via mcp__stitch__get_screen and get_screen_code, save to screens/, and tell the user: "Stitch timed out but the screen completed server-side. Downloaded to screens/[name].html." Proceed to the critic step as normal.
    • IF the screen is NOT found: continue to step 3.
  3. Tell the user exactly what happened: "Stitch MCP timed out while generating [screen name] and the screen was not completed server-side."
  4. Offer options (do NOT pick one silently):
    • "Would you like me to generate this screen locally with Claude Code instead? (Anti-slop rules will be enforced during generation.)"
    • "Or run /dg-sync later to check again if it appears."
  5. Generate locally with Claude Code ONLY if the user explicitly agrees.
  6. NEVER:
    • Retry the Stitch call (the timeout suggests a server-side issue)
    • Send parallel requests to Stitch
    • Generate locally without asking
    • Pretend the timeout didn't happen

Claude Code Generation Errors

IF generating locally with Claude Code and the output is incomplete or malformed:

  1. Tell the user what went wrong.
  2. Offer to retry generation.
  3. Do NOT switch to Stitch as a fallback.

Reference: See docs/prompting-guide.md for examples and strategies.

Domande frequenti

Cosa fa la skill IA Dg Generate?

Genera una schermata con Google Stitch o Claude Code a partire da una descrizione testuale. Usalo quando l’utente vuole creare una nuova pagina web, landing page, dashboard, pagina dei prezzi, pagina «Chi siamo» o qualsiasi interfaccia. Usalo anche quando dice «progetta una pagina», «crea una schermata» o «realizza una pagina web». Richiede DESIGN.md per garantire coerenza visiva e blocca la generazione se il file manca.

Perché usare Dg Generate su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Dg Generate è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Dg Generate in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/FReptar0/design-guard/tree/main/.claude/skills/dg-generate. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Dg Generate?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Dg Generate?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Dg Generate: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Dg Generate è gratuita?

Sì. È pubblicata su GitHub da FReptar0 con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇