markdown-optimizer
Recommend a discount percentage and new price for each slow-moving product by running the bundled markdown_optimizer.py script, respecting pricing guardrails that come from the Store Policy Agent (never hardcode them). Use after sales-analysis-chart has identified the slow movers and after fetching the markdown guardrails via the Store Policy Agent's get_markdown_policy. The script applies the max-discount cap and margin floor, computes each new price and margin, flags items that cannot be meaningfully promoted within the floor for clearance instead, and renders a recommended-discount chart.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- markdown-optimizer
- description
- Recommend a discount percentage and new price for each slow-moving product by running the bundled markdown_optimizer.py script, respecting pricing guardrails that come from the Store Policy Agent (never hardcode them). Use after sales-analysis-chart has identified the slow movers and after fetching the markdown guardrails via the Store Policy Agent's get_markdown_policy. The script applies the max-discount cap and margin floor, computes each new price and margin, flags items that cannot be meaningfully promoted within the floor for clearance instead, and renders a recommended-discount chart.
02 资源文件 5
- 参考文档clickable-references.md2.1 KB
- 参考文档draft-pr-procedure.md1.2 KB
- 参考文档golden-rule-details.md3.0 KB
- 脚本markdown_optimizer.py6.1 KB
- 参考文档pre-pr-adversarial-review.md5.0 KB
03 SKILL.md 正文
Markdown Optimizer (BlastBox Omega)
This skill decides how much to mark down each slow-moving product by running the
bundled markdown_optimizer.py script. You do not write any Python and you do
not hardcode the pricing rules: the guardrails come from the Store Policy Agent
via get_markdown_policy(markdown_type) and are passed to the script as CLI flags. This
keeps all policy in one place (the Policy Agent owns it).
When to use
After sales-analysis-chart has produced the structured slow_movers list, and after
you have fetched the guardrails from the Store Policy Agent. Use it whenever a
manager asks what to mark down and by how much within policy.
Inputs (gather these first, then pass them as flags)
- Slow movers - the
slow_moversJSON fromsales-analysis-chart: a list of{sku, name, price, cost}(extra keys are ignored). - Guardrails - call the Store Policy Agent -
get_markdown_policy("promo"). It returnsmax_discount_pct,margin_floor_pct, andmin_useful_promo_discount_pct(e.g.30,15,10). Pass all three. Do not invent or hardcode them. For a clearance pass, callget_markdown_policy("clearance")and use--markdown-type clearance.
Run the bundled script
For a promo markdown, pass the slow movers and the three guardrails:
python3 markdown_optimizer.py \
--markdown-type promo \
--max-discount 30 --margin-floor 15 --min-useful 10 \
--slow-movers '[{"sku":"SKU-VR-NEBULA","name":"Nebula VR Headset","price":199.99,"cost":70.00},
{"sku":"SKU-GALAXY-PAD","name":"Galaxy Pad Controller","price":49.99,"cost":18.00}]'
For a clearance pass (no promo math, every item flagged for a manager decision):
python3 markdown_optimizer.py --markdown-type clearance \
--slow-movers '[{"sku":"SKU-OMEGA-CORE","name":"Omega Core Console","price":399.99,"cost":320.00}]'
The script prints one line per item, then RECOMMENDATIONS_JSON=<json>, and writes
markdowns.png (a bar chart of the recommended promo discounts).
What the script does (for your report, not for you to reimplement)
- floor price =
cost / (1 - margin_floor_pct/100)- the lowest price that still keeps the required gross margin. - recommended discount % =
min(max_discount_pct, floor-allowed %). When the cap binds you get the headline discount; when the floor binds the new margin equals the floor (bindingsays which). - Items whose floor-allowed discount is below
min_useful_promo_discount_pctcome back withflag_clearance: true- they can't be meaningfully promoted, so they should be cleared out via a clearance pass (a separate decision requiring a manager flag).
Report
- Present a table: product, current price, recommended discount %, new price, new margin, and whether the margin floor or max-discount cap was binding.
- Call out any item flagged for clearance, noting clearance is a separate manager
decision (
get_markdown_policy("clearance")). - Hand the finalized promo set (
RECOMMENDATIONS_JSON) to merch-report-pdf for the shareable report.
Notes
- The bundled script is
markdown_optimizer.py; it depends only onmatplotlib(available in the runtime) and prints recommendations even if the chart is skipped. - The guardrail numbers MUST come from the Store Policy Agent. If they are missing, fetch them before running - do not guess.
- All data is mock; recommendations are for demo purposes only.
04 同仓库更多 Skills
slip-pdf-generator
Generate a printable BlastBox return / RMA / exchange slip as a PDF for the associate to hand to the customer. Use at the end of a return, warranty swap, membership cancellation, or upgrade once all amounts are final. The skill runs a bundled Python script that renders the confirmed slip values into a real PDF file.
points-reconciliation
Reconcile a customer's BlastPoints loyalty balance after a complex visit (purchases, returns, promo multipliers, expiry) and convert the net balance to store credit. Use when an associate asks about a member's points, or after a return that should claw back previously earned points. The skill runs a bundled Python script that applies the base earn rate, promo multipliers, tier bonus, clawbacks, and expiry, then prints a points ledger and the redeemable store-credit value.
prorated-refund-calculator
Calculate the exact prorated refund when a customer cancels a BlastPass membership, and the net settlement when a defective unit is traded up to a pricier model. Use after the Store Policy Agent confirms the refund rule and the Membership MCP has returned the membership details. The skill runs a bundled Python script so the arithmetic is exact.
membership-card-png
Generate a digital BlastPass membership card as a PNG image by running the bundled card_png.py script. Use when a member self-serves a lost/stolen/damaged card replacement, or any time a card needs to be shown on screen (vs. printed). The skill takes the member details returned by the Membership MCP (get_membership) plus the new_card_serial returned by reissue_card and passes them as command-line flags to a bundled Python (matplotlib) script that renders a CR80-sized membership card to a real PNG. It only renders the card from already-retrieved values — it never looks anything up or invents data.
membership-card-png
Generate a digital BlastPass membership card as a PNG image by running the bundled card_png.py script. Use when a member self-serves a lost/stolen/damaged card replacement, or any time a card needs to be shown on screen (vs. printed). The skill takes the member details returned by the Membership MCP (get_membership) plus the new_card_serial returned by reissue_card and passes them as command-line flags to a bundled Python (matplotlib) script that renders a CR80-sized membership card to a real PNG. It only renders the card from already-retrieved values — it never looks anything up or invents data.
slip-pdf-generator
Generate a printable BlastBox return / RMA / exchange slip as a PDF for the associate to hand to the customer. Use at the end of a return, warranty swap, membership cancellation, or upgrade once all amounts are final. The skill runs a bundled Python script that renders the confirmed slip values into a real PDF file.