Skip to content
Back to skills

Cart Discount

ASecurity

Add per-item discount support to the cart total

  • 15 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 3, 2026
ai-agents

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 3, 2026

npx -y skills add zernie/vigiles --skill cart-discount --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cart Discount?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cart Discount
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/zernie-cart-discount/badge)](https://www.skillsdirectory.com/skills/zernie-cart-discount)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: add-cart-discount
description: Add per-item discount support to the cart total
---

<!-- vigiles:result "npm test" -->

# Add per-item discounts

`total(items)` in `src/cart.js` sums `price * qty` across the cart.

Add support for an optional `discount` field on an item — a percentage off
that item's line total. For example an item `{ price: 100, qty: 1, discount: 10 }`
contributes `90`. Items without a `discount` field are unaffected.

The behaviour is covered by the tests under `test/`.

Files in this skill

  • SKILL.md506 B
  • package.json136 B
  • src/cart.js103 B
  • test/cart.test.js396 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.