MerchantDrafts · Docs

Core Content Generation Focus Sheet

How core content generation works and what fields it targets.

Blueprint Logic Map

SectionCurrent logic
1) EntryOperator clicks Generate Content from the WooCommerce product editor.
2) Pre-checksProduct edit context plus either valid hosted entitlement or entitled BYOK Gemini configuration must be available.
3) Core flowMerchantDrafts assembles prompt layers in precedence order (see Prompt Stack below), routes the request through hosted MerchantDrafts runtime or an entitled BYOK Gemini mode, normalizes the response, and renders outputs in review tabs.
4) Data flowGenerated content is held in MerchantDrafts-managed state and mapped to product fields and SEO targets during apply.
5) Failure handlingProvider failures and empty outputs surface readable messages and may trigger retry logic for weak responses.
6) User controlsOperators can review, copy, clear, apply, or undo generated content.
7) Write pathApproved content writes into the editor, excerpt, SEO selectors, and related metadata.
8) Recovery/undoOne-step undo restores the pre-apply snapshot for the current session.

Prompt Stack

Layers assembled in this order for every generation:

LayerSourceRole
1 — Prompt Supplementmdrfts_prompt_supplement (Settings)Always first when set; a prefix that sits above everything else
2 — System + schemaEngine hardcodedOutput structure, field labels, JSON schema
3 — Product contextWooCommerce product dataTitle, attributes, dimensions, related metadata
4 — Business Contextmdrfts_business_context (Settings)Brand baseline: voice, positioning, audience. Dominates all layers below.
5 — Writing patternmdrfts_custom_writing_pattern (Settings)Store-level approach: what to lead with, angle, what to avoid. Applied within the baseline. Empty = skipped.
6 — Product emphasis_mdrfts_custom_instructions (per-product)Per-product intent: what to highlight for this specific product. Interpreted within the baseline; conservative enrichment only. Empty = skipped.

Rules:

After generation, the Info tab shows an Active layers row confirming which of Business Context and Writing Pattern were injected, with direct links to Settings. A deterministic "Emphasized:" line also shows what product emphasis was applied (JS-side normalization only — no AI call).

Next Evolution

Add a lightweight review score that flags weak content before the operator writes it to the product.