Hard spending policy for agent-driven DoorDash ordering through the DoorDash CLI (dd-cli). Per-order ceiling, daily/weekly/monthly caps, cooldown between orders
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-doordash-spend-guard-5e8ddb0b9d31 ,按照其中的说明把「doordash-spend-guard」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
A budget stated in a prompt is advisory — the model can forget it mid-session
and prompt injection can override it. This skill makes the budget
deterministic: every checkout and cart mutation goes through one audited
wrapper (dd-guard.sh) that prices the cart, checks the policy, and refuses
out-of-policy actions with a machine exit code. The companion PreToolUse hook
(doordash-spend-guard hook component) denies raw dd-cli order checkout-url /
dd-cli cart add-items calls that try to bypass the wrapper.
Unofficial community skill built on DoorDash's
doordash-oss/doordash-cli. Requiresdd-cliinstalled and logged in. Wrapper needspython3.
cart show exposes; fees, tip
and tax land on the DoorDash payment page. Documented headroom, not
loopholes./doordash-budget reconciles intents against
dd-cli order history, marking entries paid or abandoned.| Piece | Role |
|---|---|
| this skill | protocol: always route through dd-guard, report headroom |
scripts/dd-guard.sh → installs to .claude/skills/doordash-spend-guard/scripts/dd-guard.sh | the deterministic gate |
hook doordash/doordash-spend-guard | denies bypasses of the wrapper |
command /doordash-budget | view/edit policy, reconcile ledger |
~/.claude/dd-guard/limits.json — policy. Human-edited only. Never
edit this file yourself; when the user asks for a change, direct them to
/doordash-budget which confirms interactively.{
"per_order_max": 40,
"daily_max": 60,
"weekly_max": 150,
"monthly_max": 400,
"cooldown_minutes": 45,
"allowed_hours": { "start": 7, "end": 23 }
}
~/.claude/dd-guard/ledger.jsonl — one line per priced action:
{"ts": "...", "cart_uuid": "...", "subtotal": 24.5, "status": "intent"}
(status becomes paid / abandoned after reconciliation).bash .claude/skills/doordash-spend-guard/scripts/dd-guard.sh status prints spend-to-date vs each
cap. Tell the user their remaining budget before adding items.bash .claude/skills/doordash-spend-guard/scripts/dd-guard.sh add-items <the exact dd-cli cart add-items args>
The wrapper execs the real dd-cli cart add-items ... and re-prices the
cart afterwards.dd-cli order checkout-url directly. Use
bash .claude/skills/doordash-spend-guard/scripts/dd-guard.sh checkout <cart-uuid>
dd-cli order history or trimming the cart with
dd-cli cart remove-item./doordash-budget.cart show output
and ask them to confirm the total explicitly before any manual override.Answer "how much have I spent this week?" from the ledger, not memory:
bash .claude/skills/doordash-spend-guard/scripts/dd-guard.sh status
# or raw:
cat ~/.claude/dd-guard/ledger.jsonl | jq -s '[.[] | select(.status != "abandoned")] | map(.subtotal) | add'
Remind the user that subtotals exclude fees/tips and intents may not have
been paid — /doordash-budget reconciles.