feat: add submitted skills review desk

This commit is contained in:
Marcos Silva
2026-09-04 00:34:53 -03:00
parent a7034db94b
commit 82fff29571
57 changed files with 3380 additions and 1 deletions
@@ -0,0 +1,36 @@
---
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.
@@ -0,0 +1,123 @@
# Reference: Copy quote info to payload
This file holds the detailed mapping rules and a worked example. The main procedure is in `SKILL.md`.
## Source structure (quote data)
```
{
"quote": {
"id": "...", // the quote id
"customerId": "...",
"customerCategoryId": "...",
"distributionChannelId": "...",
"attributes": { ... },
"orderItemIds": [ ... ], // root product-item ids
"opportunityId": "...",
...
},
"items": [
{ "id": "...", "type": "productItem", ... },
{ "id": "...", "type": "locationItem", ... },
{ "id": "...", "type": "alertItem", ... },
...
]
}
```
## Target structure (quote command skeleton)
The command shape **varies greatly**. Adapt to whatever keys exist. A common example:
```
{
"businessCommand": "quote_init",
"businessCommandAttributes": { ... },
"id": "{{quoteId}}",
"items": [],
"batchCommands": [
{
"businessCommand": "product_items_modify",
"businessCommandAttributes": { "date": "..." },
"id": "{{quoteId}}",
"items": [ { "id": "...", "type": "productItem" }, ... ]
}
],
"quoteCmd": {
"attributes": {},
"customerId": "...",
"customerCategoryId": "...",
"distributionChannelId": "..."
}
}
```
## Field mapping (source → target)
Apply a mapping only when the target has a slot for it. Match by key name and meaning.
| Target field (wherever it appears) | Source value |
| ------------------------------------------------- | ----------------------------------------- |
| `{{quoteId}}` placeholder, top-level `id`, batch `id` | `quote.id` |
| `quoteCmd.customerId` / any `customerId` | `quote.customerId` |
| `quoteCmd.customerCategoryId` / `customerCategoryId` | `quote.customerCategoryId` |
| `quoteCmd.distributionChannelId` / `distributionChannelId` | `quote.distributionChannelId` |
| `quoteCmd.attributes` (when empty and desired) | `quote.attributes` (only if user wants it)|
| `opportunityId` | `quote.opportunityId` |
| `marketId` on items | item's `marketId` from source |
Notes:
- If the skeleton already has a hardcoded value (e.g. a sample `customerId`) and it differs from the source, replace it with the source value — the point is to reflect the source quote. Mention the replacement in the summary.
- If the skeleton has a `date`/timestamp the source doesn't provide (e.g. `businessCommandAttributes.date`), leave the skeleton's value as-is unless the user gives one.
- `quoteCmd.attributes` is often intentionally `{}`. Do **not** dump `quote.attributes` into it unless the user asks — attribute keys in the command context may differ.
## Item-selection rules
- **Product items:** items in the source with `"type": "productItem"`. These are the ones that typically go into a `product_items_modify` (or similar) block's `items` array as `{ "id": <sourceId>, "type": "productItem" }`.
- **Location items** (`"type": "locationItem"`) and **alert items** (`"type": "alertItem"`) are usually *not* copied into a product-items block. Copy them only where the skeleton has a matching slot for that type.
- **Copy all matching items** from the source into the target's item slot, preserving order and ids, using the field shape the skeleton's item entries use (often just `id` + `type`).
- Copy everything **unchanged** unless the user specifies a change (e.g. "set quantity to 2 on the Fibre item", "drop the DISCONNECT item", "change action to ADD"). Apply only what they name.
- Root vs. child products: `quote.orderItemIds` lists the root product ids. If the skeleton only wants roots, use those; if it wants all product items, use every `productItem`. When unclear, default to all `productItem`s and note it.
## Worked example
**Source (quote data):** `quote.id = d968445a-f813-4be1-899d-e06accb6473b`, `customerId = slotest`, `customerCategoryId = 0ded2167-c41b-4f58-9941-dbd247b1985d`, `distributionChannelId = CPMS`. Product items in `items`:
`9b4be199-4b65-4ec0-b54b-d2f61366c9ed`, `81a3fb42-31a5-4ea8-a668-8973e57aa2f9`, `c6a7aacd-8d3b-4c44-8680-829b15be5c06`, `fcd59bff-4339-4fea-8168-bb8598e98085` (plus location and alert items, which are not product items).
**Skeleton:** the `quote_init` + `product_items_modify` command shown above.
**Filled result:**
```json
{
"businessCommand": "quote_init",
"businessCommandAttributes": {
"itemTypesScope": []
},
"id": "d968445a-f813-4be1-899d-e06accb6473b",
"items": [],
"batchCommands": [
{
"businessCommand": "product_items_modify",
"businessCommandAttributes": {
"date": "2026-08-28T10:00:00.000-03:00"
},
"id": "d968445a-f813-4be1-899d-e06accb6473b",
"items": [
{ "id": "9b4be199-4b65-4ec0-b54b-d2f61366c9ed", "type": "productItem" },
{ "id": "81a3fb42-31a5-4ea8-a668-8973e57aa2f9", "type": "productItem" },
{ "id": "c6a7aacd-8d3b-4c44-8680-829b15be5c06", "type": "productItem" },
{ "id": "fcd59bff-4339-4fea-8168-bb8598e98085", "type": "productItem" }
]
}
],
"quoteCmd": {
"attributes": {},
"customerId": "slotest",
"customerCategoryId": "0ded2167-c41b-4f58-9941-dbd247b1985d",
"distributionChannelId": "CPMS"
}
}
```
Summary in this example: filled `{{quoteId}}` (both occurrences) from `quote.id`; set `customerId`, `customerCategoryId`, `distributionChannelId` from the source (replacing the skeleton's sample values); copied all 4 `productItem`s into the `product_items_modify` block unchanged; left `businessCommandAttributes.date` as-is (not present in source); kept `quoteCmd.attributes` empty (not requested).