AGENT SKILL

voucher-budget

Applies platform or shop voucher arithmetic to a product set.

License 许可
Apache-2.0
最近更新
2026-10-22
Stars
★ 19
Forks
8

01 前言 Front Matter

name
voucher-budget
description
Applies platform or shop voucher arithmetic to a product set.

03 SKILL.md 正文

You are solving a shopping task with voucher-budget constraints.

Goal:

  • Use shopping tools to find products that match every user-requested attribute.
  • Recommend product IDs in the correct order.
  • Crucially, before recommending, explicitly verify voucher feasibility using:
    1. minimum spend threshold,
    2. discount type,
    3. discount cap,
    4. final payable amount versus the user’s budget,
    5. same-shop requirement.

Input format:

  • The user asks for one or more products, each with attribute constraints such as category, color, size, quantity/pack type, service tags (e.g. COD, LazMall, LazFlash, free delivery), capacity, material, etc.
  • The user also gives:
    • a total budget,
    • voucher rules:
      • same-shop only or equivalent wording,
      • minimum subtotal threshold,
      • discount type and value (currently percentage discount in examples),
      • discount cap.

Required workflow:

  1. Parse all requested product slots and all required attributes for each slot.
  2. Search with shopping tools for each slot using targeted queries.
  3. Inspect candidate product details with product-information tools before deciding.
  4. Build a bundle that satisfies the user’s requested attributes.
  5. Check voucher eligibility across the entire bundle:
    • All recommended items must come from the same shop if the voucher says so.
    • Compute subtotal before discount.
    • Confirm subtotal exceeds/meets the voucher threshold exactly as stated.
    • Compute discount according to the voucher type.
      • For percentage discount: discount = percentage × subtotal.
      • Apply the cap: actual discount = min(computed discount, cap).
    • Compute final payable = subtotal - actual discount.
    • Confirm final payable is within the user’s budget.
  6. Only then recommend the ordered product IDs.
  7. Call recommend_product after selecting a valid bundle, then call terminate on the next tool step. Do not emit user-facing prose during the tool phase.

Output requirements:

  • After termination, the runtime requests a separate user-facing answer.
  • Include the final recommended product IDs in exact requested order and do not mention alternative product IDs.
  • In that final answer, provide a concise voucher-check explanation showing:
    • shop consistency,
    • subtotal,
    • threshold check,
    • raw discount,
    • capped discount,
    • final payable,
    • whether it fits the budget.
  • If no valid bundle exists, terminate without inventing a match. Explain the blocking constraint only in the post-termination final answer.

Tool-use expectations:

  • You must use shopping tools (e.g. search + product detail inspection) before recommending.
  • Do not recommend unverified product IDs.
  • Avoid repetitive or aimless searches; refine queries based on missing attributes.
  • Inspect enough product details to confirm requested constraints and shop IDs.

Important task-specific lessons from prior failures:

  • Do not return user-facing text before termination.
  • Do not omit prices, shop matching, or voucher math.
  • Do not recommend items unless you have evidence they satisfy the requested attributes and voucher constraints.
  • Do not recommend or terminate with unsupported product IDs.
  • The main evaluation is sensitive to voucher-budget reasoning, so always show the threshold, discount type, cap, final budget calculation, and same-shop check before recommending.

Post-termination final-answer structure:

  1. Short summary of matched items.
  2. Voucher check:
    • Same shop: yes/no
    • Subtotal: X
    • Threshold needed: Y
    • Discount: Z% of subtotal = A
    • Cap: B
    • Actual discount: min(A, B) = C
    • Final payable: subtotal - C = D
    • Budget: E
    • Result: within budget / not within budget
  3. recommended_product_ids: [ ... ] in exact requested order
  4. Terminate

If no valid bundle:

  1. State no valid recommendation found.
  2. Briefly state the blocking constraint(s).
  3. recommended_product_ids: []
  4. Terminate

04 同仓库更多 Skills