Forks
A fork is a prompt template that overrides the default for a subset of products. When the plugin needs to run a job for a given product, it looks at every fork of the matching type, finds the one whose rule the product satisfies, and uses it. If no fork matches, the default kicks in.
Forks let you have one tone of voice for kitchenware and another for tools, or strict SEO rules for one sales channel and looser ones for another, without juggling separate templates by hand.
Launching the wizard
Section titled “Launching the wizard”From any prompt template detail page, use the Fork from this action (or Create fork on the list page). The Create prompt fork wizard opens.
The 4-step wizard
Section titled “The 4-step wizard”Step 1 — Describe
Section titled “Step 1 — Describe”- What should change — plain text, e.g. “More technical tone for power tools” or “Always mention the brand in the first sentence”. Required.
- Quick preset buttons — Shorter, Longer, Formal, Marketing, Less Technical, More SEO, No Emoji, Varied — click to drop pre-written instructions into the field.
- Preservation rules (must NOT be relaxed) — pre-populated with “Never invent facts; preserve product specs”; edit as needed. Optional.
Step 2 — Scope
Section titled “Step 2 — Scope”Pick which products this fork should apply to via the Scope mode radio:
- Apply to similar products (auto-detected) — pick a real product; the wizard auto-detects its manufacturer and categories as the scope.
- Define scope manually (filters) — multi-select categories, manufacturers, sales channels, active / inactive state.
- Use an existing Shopware rule — pick an existing rule via the rule picker (no new rule is built).
- No restriction (global) — fork applies to every product of this type (use with caution).
On the same step you also pick the AI connection (used to generate the proposed prompts) and, in a collapsible Hard constraints (advanced) panel, you can set max / min length, output language, forbidden words and required keywords.
The wizard checks for conflicts in real time — if your scope overlaps an existing fork of the same type, a warning lets you edit the existing fork instead of creating a duplicate.
Step 3 — Review
Section titled “Step 3 — Review”The model takes your description, the parent prompt and the constraints and proposes a new system prompt and user prompt. Both proposals appear in editable textareas — you can tweak them directly. This one-shot generation is driven by the meta.fork_wizard template.
Click Refine — say what’s still missing to open an iterative chat (same engine as the AI assistant chat) and iterate without leaving the wizard.
Discuss with AI (brainstorm)
Section titled “Discuss with AI (brainstorm)”If you’re not sure exactly what to change yet, switch the Describe step to Discuss with AI instead of writing a fixed description. This opens a multi-turn brainstorm chat driven by the meta.fork_brainstorm template:
- The AI asks focused follow-up questions about your goals.
- After every turn it publishes a running draft of the description, fork name, and the proposed system prompt + user prompt, so you watch the proposal evolve in real time.
- Brainstorm sessions are saved and listed alongside the other AI assistant chats — see Saved chat sessions.
- When the AI signals it’s done (or you decide it’s good enough), the draft is carried into the rest of the wizard exactly as if you had written it manually.
Both meta-flows share the same connection — pick it once on Step 2.
Step 4 — Test & save
Section titled “Step 4 — Test & save”- Optionally run Test against current product to see the output the proposed fork would generate.
- Fill Fork name (required) and Priority (optional, default 10).
- Click Save fork to persist.
Priority
Section titled “Priority”If multiple forks match the same product, the one with the lowest priority number wins. Use this when you have nested scopes — e.g. a fork for “all tools” with priority 50 and a more specific fork for “drills” with priority 10.
How scope rules are evaluated
Section titled “How scope rules are evaluated”The wizard’s filter / from-product / selected modes all produce a regular Shopware Rule entity, so you can also inspect or edit them under Settings → Shop → Rule builder. To match products without a full sales-channel context, the plugin ships its own product-scoped rule conditions:
p2labAiProductActive— matches whenproduct.activeequals the expected value.p2labAiProductCategoryStrict— matches when the product is directly assigned to one of the picked categories (no inheritance).p2labAiProductCategoryWithChildren— matches when the product is assigned to a picked category or any of its descendants (used by the from-product mode).p2labAiProductManufacturer— matches one of the picked manufacturers.p2labAiProductSalesChannel— matches when the product is visible in one of the picked sales channels.
When you pick Use an existing Shopware rule, any standard rule conditions work — the plugin evaluates them through the same engine.
Rules created by the wizard are named [P2LabAi] <fork label> with a stable fingerprint in the description, so re-running the wizard with the same scope reuses the existing rule instead of producing a duplicate.