Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/vimalk0703/shipworthy/cart-patternsnpx skills add Vimalk0703/shipworthy --skill cart-patternsgit clone --depth 1 https://github.com/Vimalk0703/shipworthyWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/vimalk0703/shipworthy/cart-patterns)<a href="https://agentmods.dev/skills/vimalk0703/shipworthy/cart-patterns"><img src="https://agentmods.dev/badge/skills/vimalk0703/shipworthy/cart-patterns.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00030 | $0.00838 |
| Opus 5 | $0.00015 | $0.00419 |
| Sonnet 5 | $0.00006 | $0.00168 |
| Haiku 4.5 | $0.00003 | $0.00084 |
Grade A, and why
cart-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Cart Patterns
Cart State Management
Rule: Cart is server-authoritative
Never trust client-side cart state for pricing or inventory. The client holds product IDs and quantities; the server calculates everything else.
Client sends: { items: [{ productId: "abc", quantity: 2 }] }
Server returns: { items: [{ productId: "abc", quantity: 2, unitPrice: 29.99, lineTotal: 59.98, available: true }], subtotal: 59.98, tax: 5.40, total: 65.38 }
Rule: Use integers for money
Never use floating-point for currency. Store prices in the smallest currency unit (cents for USD, pence for GBP).
// WRONG
const price = 29.99;
const total = price * 3; // 89.97000000000001
// RIGHT
const priceInCents = 2999;
const totalInCents = priceInCents * 3; // 8997
const displayPrice = (totalInCents / 100).toFixed(2); // "89.97"
Rule: Validate inventory at checkout, not at cart-add
- Adding to cart: check inventory but don't reserve — show "low stock" warning if < 5 remaining
- Starting checkout: reserve inventory with a TTL (10-15 minutes)
- Completing payment: convert reservation to deduction
- Timeout/abandonment: release reservation
Rule: Idempotent cart operations
Cart mutations (add, remove, update quantity) must be idempotent. If a user clicks "Add to Cart" twice due to a slow network, they should get quantity 1 (or quantity+1 from current), not quantity 2.
Use: PUT /cart/items/{productId} with desired quantity, not POST /cart/items with delta.
Price Calculation
Order of operations (always this order):
- Base price per item
- Apply item-level discounts (sale prices, volume discounts)
- Calculate line totals (price * quantity)
- Calculate subtotal (sum of line totals)
- Apply cart-level discounts (promo codes, loyalty points)
- Calculate tax (on discounted subtotal, jurisdiction-dependent)
- Add shipping
- Calculate total
Discount rules
- Only one promo code at a time (unless explicitly supporting stacking)
- Validate promo code server-side: is it active? Has it expired? Has it hit its usage limit? Is the cart minimum met?
- Never expose discount calculation logic to the client — only the result
- Log every discount application for audit trail
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 83 lines · 30 tokens per session scan A 9f095c972ee3
cart-patterns is a skill published in the GitHub repository Vimalk0703/shipworthy (7 stars, last pushed 4mo ago), licensed MIT. It adds 30 tokens to every session and 838 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
hedgehog-core-design
Use on full-stack-app and landing-page alike only when neither shipped core fits a project that is still building something real — picks the stack and designs the layer sequence for it, and writes .hedgehog/core.yaml. Invoked by the planner agent as Phase 0's third outcome, after the vendored BMAD shelf has run; don't…
hedgehog-planning-intake
Use on any core for first-run planning intake — Phase 0 runs the vendored BMAD-METHOD planning shelf, shared by every core, and Phase 1 (mining 04-prd.md into intent records plus the Add-ons/sync-and-remote-entities decision) is full-stack-app's and pwa-app's shared procedure — identical mechanics, a different…
inbound-triage
Maintainer-only. Use when triaging inbound GitHub issues and pull requests on skyf0xx/hedgehog — "triage the issues", "check the PRs", "review inbound", "what's in the queue". Reads each item read-only, judges it for security and for whether it is real, then fixes and closes or comments and closes. Not part of the…
bmad-product-brief
Create, update, or validate a product brief. Use when the user wants help producing, editing, or validating a brief.
bmad-revendor
Maintainer-only. Use when re-vendoring vendor-skills/BMAD/ against a newer BMAD-METHOD commit — "update BMAD", "re-vendor BMAD", "bump the BMAD pin". Not part of the Hedgehog discipline a consuming project copies; this only applies to the Hedgehog repo itself.
bmad-deep-recon
Decision-grade research, three ways: draft a deep-research prompt for the user to run in their own tool (ChatGPT, Gemini, Grok, Perplexity, …), process a finished research report — file it, distill a succinct cited summary with metadata that downstream skills consume without reprocessing — or run the research here…