$npx -y skills add Xuxchloris/export_skills --skill quotation-generatorUse when a trade agent needs quotation drafts, price table, SKU quote, proforma offer, MOQ, payment terms, incoterm, packing information, validity, or buyer inquiry response pricing
| 1 | # Quotation Generator |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Generate quotation drafts from approved product and pricing data. The core rule is that missing commercial data blocks a formal quote and creates a review note. |
| 6 | |
| 7 | ## When to Use |
| 8 | |
| 9 | Use this skill when the user asks for a quotation, price offer, PI draft, inquiry reply with pricing, SKU comparison table, quote-ready product summary, HTML quotation, PDF quotation, or Excel quotation sheet. |
| 10 | |
| 11 | Do not use it to invent freight, insurance, certifications, unit price, or delivery terms. |
| 12 | |
| 13 | ## Inputs |
| 14 | |
| 15 | - Product context from `product-loader` |
| 16 | - Pricing rules from `PRICING.yaml` |
| 17 | - Buyer name and country |
| 18 | - Requested SKU and quantity |
| 19 | - Requested incoterm and destination, if provided |
| 20 | - `tools/render_quotation.py` when file exports are requested |
| 21 | |
| 22 | ## Outputs |
| 23 | |
| 24 | ```json |
| 25 | { |
| 26 | "quotation_status": "draft|blocked", |
| 27 | "quotation_number": "", |
| 28 | "buyer": "", |
| 29 | "items": [], |
| 30 | "terms": {}, |
| 31 | "total_amount": 0, |
| 32 | "export_outputs": { |
| 33 | "html": { |
| 34 | "enabled": false, |
| 35 | "filename": "", |
| 36 | "template": "skills/quotation-generator/templates/quotation.html" |
| 37 | }, |
| 38 | "pdf": { |
| 39 | "enabled": false, |
| 40 | "filename": "", |
| 41 | "source": "html" |
| 42 | }, |
| 43 | "excel": { |
| 44 | "enabled": false, |
| 45 | "filename": "", |
| 46 | "sheets": [] |
| 47 | } |
| 48 | }, |
| 49 | "human_review_required": true, |
| 50 | "missing_fields": [], |
| 51 | "review_notes": [] |
| 52 | } |
| 53 | ``` |
| 54 | |
| 55 | ## Procedure |
| 56 | |
| 57 | 1. Match each requested item by exact SKU. |
| 58 | 2. Select the correct tier price based on requested quantity. |
| 59 | 3. Verify product size, packing size, MOQ, unit price, currency, incoterm, payment terms, lead time, and validity. |
| 60 | 4. If the requested quantity is below MOQ, mark the quote as `blocked` unless the user approves sample pricing. |
| 61 | 5. If CIF, DDP, or freight-included terms are requested without confirmed freight and insurance, mark freight fields as missing. |
| 62 | 6. Calculate line totals only from approved unit prices. |
| 63 | 7. Produce a draft quotation table and a buyer reply email draft. |
| 64 | 8. Save the approved draft data as JSON before file export. |
| 65 | 9. Run `python tools/render_quotation.py <quotation.json> --output-dir <folder> --formats html excel` for HTML and Excel output. |
| 66 | 10. Add `pdf` to `--formats` when PDF output is requested. Generate PDF from the reviewed HTML layout so the printable file matches the HTML source. |
| 67 | 11. For Excel output, create workbook sheets for `Quotation`, `Items`, `Terms`, and `Review Notes`. |
| 68 | 12. Use export filenames in the pattern `quotation-<quotation_number>-<buyer>-draft.<ext>`. |
| 69 | 13. Set `human_review_required` to `true` for every HTML, PDF, and Excel export until the user explicitly approves sending. |
| 70 | 14. Add a clear human-review note before any commercial document is sent. |
| 71 | |
| 72 | ## Verification |
| 73 | |
| 74 | - Every quoted SKU exists in product data. |
| 75 | - Unit prices come from pricing rules or explicit user approval. |
| 76 | - Quantity below MOQ is flagged. |
| 77 | - CIF/DDP terms are blocked without freight data. |
| 78 | - Draft status is used until a human approves the offer. |
| 79 | - `export_outputs` lists HTML, PDF, and Excel status when any export is requested. |
| 80 | - HTML, PDF, and Excel exports keep the draft status and human review requirement. |
| 81 | - PDF exports are generated from the HTML layout, not from a separate unverified structure. |
| 82 | - Excel exports include item rows, terms, totals, missing fields, and review notes. |
| 83 | |
| 84 | ## Common Mistakes |
| 85 | |
| 86 | | Mistake | Fix | |
| 87 | | --- | --- | |
| 88 | | Estimating freight to complete CIF | Block or ask for freight confirmation | |
| 89 | | Quoting a similar SKU | Require exact SKU match | |
| 90 | | Ignoring MOQ | Flag quantity and request approval | |
| 91 | | Treating draft as official PI | Label it as draft until reviewed | |