---
name: copy-quote-info-to-payload
description: Fill a quote command payload from quote data. Use when the user asks to "copy quote info to payload", "copy quote data into the command", "fill the quote command from the quote", or provides a quote-data JSON plus a quote-command skeleton JSON and wants the command populated. Takes info from the source quote and fills it into the command skeleton, copying all quote items across unless the user asks for changes.
---

# Copy quote info to payload

Populate a **quote command** (target skeleton) with data taken from **quote data** (source), and return the filled command as valid JSON.

## Inputs

The user provides two JSON documents (as files, paths, or pasted text):

1. **Quote data** — the source. Has a top-level `quote` object and an `items` array. Items have a `type` such as `productItem`, `locationItem`, `alertItem`.
2. **Quote command skeleton** — the target to fill. Shape varies widely; it may contain `businessCommand`, `id`, `items`, `batchCommands`, `quoteCmd`, placeholders like `{{quoteId}}`, etc.

If either document is missing or ambiguous (e.g. two files given but it's unclear which is source vs. target), ask which is which before proceeding. The source is the one with the `quote` object + populated `items`; the target is the one with `businessCommand` / placeholders / empty item lists.

## Procedure

1. Parse both JSON documents.
2. Start from the **command skeleton** and preserve its exact structure, key order, and any keys the source has no data for (leave them as-is).
3. Fill fields **only** from the source quote. Do not invent values. See `reference.md` for the field-mapping table.
4. Replace placeholders (e.g. `{{quoteId}}`, wherever they appear including inside `batchCommands`) with the matching source value (`{{quoteId}}` → `quote.id`).
5. **Copy quote items faithfully.** Wherever the skeleton expects items, copy the corresponding items from the source across with **no changes** — same ids, order, and any other fields the skeleton's item shape uses — unless the user explicitly requests a change. Apply only the changes the user names; leave everything else untouched. See `reference.md` for how to pick which items go where (e.g. `productItem`s into a `product_items_modify` block).
6. If a field the skeleton needs isn't present in the source, leave the skeleton's original value/placeholder and note it in your summary rather than guessing.
7. Output the completed command as a single valid JSON document. Then give a short summary of what was mapped, which items were copied, and anything left unfilled.

## Rules

- Never fabricate data. Every filled value must come from the source quote (or from an explicit user instruction).
- Copy items as-is by default; only change what the user specifies.
- Preserve the skeleton's overall shape — the command format can vary greatly, so adapt to whatever keys it has instead of assuming a fixed template.
- Keep JSON valid and, where the skeleton had a style, match its formatting.

See `reference.md` for the detailed field mapping, item-selection rules, and a full worked example.
