Логотип Dg Generate

Dg Generate

Сообщество
FReptar0
dg-generate

Создайте экран с помощью Google Stitch или Claude Code по текстовому описанию. Используйте этот навык, когда пользователь хочет создать веб-страницу, лендинг, панель управления, страницу с тарифами, страницу «О нас» или любой другой дизайн интерфейса. Навык также подходит, если пользователь просит «спроектировать страницу», «создать экран» или «сделать веб-страницу». Для единообразия оформления необходим DESIGN.md — без него генерация не запускается.

Add to TypingMind

Обзор

ИздательFReptar0
Репозиторийdesign-guard
Название навыкаdg-generate
Звёзды
12
Форки
4
Файлы в комплекте
Только инструкции
ЛицензияMIT
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Всё необходимое — в инструкциях

    Всё необходимое для модели содержится в инструкциях — никаких дополнительных файлов для синхронизации.

  • Открытый исходный код

    Издатель навыка на GitHub — FReptar0. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Dg Generate в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/FReptar0/design-guard/tree/main/.claude/skills/dg-generate
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

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
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Dg Generate в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Dg Generate, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Dg Generate не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

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.

Часто задаваемые вопросы

Что делает навык ИИ Dg Generate?

Создайте экран с помощью Google Stitch или Claude Code по текстовому описанию. Используйте этот навык, когда пользователь хочет создать веб-страницу, лендинг, панель управления, страницу с тарифами, страницу «О нас» или любой другой дизайн интерфейса. Навык также подходит, если пользователь просит «спроектировать страницу», «создать экран» или «сделать веб-страницу». Для единообразия оформления необходим DESIGN.md — без него генерация не запускается.

Зачем использовать Dg Generate в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Dg Generate — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Dg Generate в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/FReptar0/design-guard/tree/main/.claude/skills/dg-generate. TypingMind прочитает файл SKILL.md и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Dg Generate?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Dg Generate?

С любым количеством. В TypingMind вы можете использовать Dg Generate с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Dg Generate?

Да. Навык опубликован на GitHub по лицензии MIT. Издатель — FReptar0. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇