doordash-spend-guard

Enforces deterministic spending caps on DoorDash CLI orders via a wrapper script and ledger.

30.5k|3.5k|Updated Jul 4, 2025
One-click install
npx skills add https://github.com/davila7/claude-code-templates --skill doordash-spend-guard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: doordash-spend-guard
Source: https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/doordash/doordash-spend-guard
Command: npx skills add https://github.com/davila7/claude-code-templates --skill doordash-spend-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires dd-cli, python3, and includes scripts (resource) components.

What problem does it solve?

Budget limits stated in a prompt are advisory and can be forgotten or overridden mid-session. This Skill makes DoorDash spending limits deterministic by routing every cart mutation and checkout through an audited wrapper script that prices the cart, checks a persistent policy, and refuses out-of-policy orders with a machine exit code.

Core Features & Use Cases

  • Deterministic Policy Enforcement: Per-order, daily, weekly, and monthly caps plus cooldown periods and allowed ordering hours, all checked against a persistent JSONL spend ledger before any checkout URL is issued.
  • Bypass Protection: Pairs with a PreToolUse hook that denies raw dd-cli checkout and cart-add calls that try to skip the wrapper, and blocks by default when the cart subtotal cannot be parsed.
  • Spend Reporting and Reconciliation: The status subcommand reports spend-to-date versus each cap, and the companion /doordash-budget command reconciles ledger intents against dd-cli order history as paid or abandoned.
  • Use Case: An agent building a DoorDash cart with dd-cli calls dd-guard checkout, which prices the cart, finds the 24-hour total would exceed the daily cap, exits with code 2, and the agent relays the exact reason instead of completing the purchase.

Quick Start

Ask the agent to check your remaining DoorDash budget and then build a cart, and it will route all cart changes and checkout through the dd-guard wrapper automatically.

Frequently Asked Questions about doordash-spend-guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set spending limits on DoorDash orders placed by an AI agent?

Install this skill and its companion PreToolUse hook, then every cart mutation and checkout routes through the dd-guard.sh wrapper. The wrapper checks per-order, daily, weekly, and monthly caps from limits.json and refuses out-of-policy checkouts with exit code 2.

How do I check how much I have spent on DoorDash this week?

Run dd-guard.sh status to print spend-to-date against each cap, including remaining headroom. The totals come from the persistent ledger at ~/.claude/dd-guard/ledger.jsonl rather than from the model's memory.

Does the spending cap include DoorDash fees, tips, and taxes?

No. Caps apply only to the pre-fee subtotal reported by dd-cli cart show. Fees, tips, and taxes are added later on the DoorDash payment page, so the documented headroom does not cover them.

What happens if the agent tries to bypass the wrapper and call dd-cli checkout directly?

The companion PreToolUse hook denies raw dd-cli order checkout-url and cart add-items calls that skip the wrapper. The skill alone is only guidance, so both the hook and wrapper must be installed for enforcement.

Why was my checkout blocked even though I was under the budget cap?

The wrapper also blocks on cooldown periods, ordering outside allowed hours, or when it cannot parse a unique subtotal from cart show output. The block reason printed on stderr states exactly which policy rule triggered.

What are the requirements for using dd-guard with dd-cli?

You need dd-cli installed and logged in, plus python3 for the JSON and date math in the policy checks. The wrapper creates its policy and ledger files under ~/.claude/dd-guard on first run.