Command Palette

Search for a command to run...

Назад к скиллам
скилл № 46365

ramp-spend-analysis

Analyze spend by vendor, category, or team over a date range. Broad AI-spend questions include both financial spend and estimated token cost. Use when: 'how…

БесплатноБез исполняемых скриптов
CognitionAIот CognitionAI★ 42 звезды на GitHub

Установить ramp-spend-analysis в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Non-Negotiables

  • Pass --rationale on every command — it is a required field on these agent-tools (a non-empty string, max 1024 chars). With --json, supply it as a "rationale" key in the body. Omitting it returns HTTP 422 (DEVELOPER_INVALID_SCHEMA), in both agent and human modes.
  • Always query both transactions and bills when investigating complete vendor spend. Card charges and bill payments are separate resources — there is no unified spend endpoint.
  • For a broad AI, LLM, or inference spend question, query token cost in addition to transactions and bills. Report these measures separately and never add them because they can overlap. If the user explicitly asks for card/Bill Pay or token data, query only that data source.
  • Never treat a search result's bill amount as paid-in-period spend. It is the full invoice amount, and a payment-date match may represent only one partial payment. A complete paid total requires payment-allocation amounts and dates from another source.
  • Pass --agent for machine-readable JSON output on all commands.
  • Handle amount format differences: transactions use strings ("$1,048.25", "-$259.49"), bills use numbers (15000), PO amounts use numbers. Reimbursement amounts are in dollars.
  • Paginate until next_page_cursor is null — a single page may not return everything.
  • Flag vendor name variants explicitly (e.g., "Delta Air Lines" vs "Delta Airlines") — the API does not normalize.
  • Negative transaction amounts are refunds. Include them in totals but call them out.

AI Token Cost

Run ramp ai-spend to see the available token-spend commands, then use the command that matches the requested scope.

Workflow

Step 1: Pull card transactions

For each vendor (or all vendors if doing a broad analysis):

ramp transactions list \
  --transactions_to_retrieve all_transactions_across_entire_business \
  --reason_memo_merchant_or_user_name_text_search "<vendor>" \
  --from_date <YYYY-MM-DD> \
  --to_date <YYYY-MM-DD> \
  --include_count \
  --page_size 200 \
  --agent --rationale "List the user's transactions"

If next_page_cursor is not null, paginate:

ramp transactions list \
  --transactions_to_retrieve all_transactions_across_entire_business \
  --reason_memo_merchant_or_user_name_text_search "<vendor>" \
  --from_date <YYYY-MM-DD> \
  --to_date <YYYY-MM-DD> \
  --page_size 200 \
  --next_page_cursor "<cursor>" \
  --agent --rationale "List the user's transactions"

For broad analysis (all vendors): Omit --reason_memo_merchant_or_user_name_text_search to pull all transactions, then group client-side.

Step 2: Pull bill payments

For a specific vendor:

ramp bills search --query "<vendor>" --include_paid \
  --from_payment_date <YYYY-MM-DD> --to_payment_date <YYYY-MM-DD> \
  --limit 50 --agent --rationale "Search bills paid during the user's requested period"

For broad analysis (all vendors):

ramp bills search --include_paid \
  --from_payment_date <YYYY-MM-DD> --to_payment_date <YYYY-MM-DD> \
  --limit 50 --agent --rationale "Search all bills paid during the user's requested period"

Repeat either with --page_cursor if next_page_cursor is not null, preserving the same query and date bounds on every page.

Note: Use from_payment_date and to_payment_date to find bills with payment activity in the period, then use each result's payment_date when presenting or validating the period. Do not substitute due_date: it describes when payment was due, not when spend was paid. A matched bill may be partially paid, while its amount is the full invoice amount. Do not add that amount to actual spend without payment-allocation data. Bills with payment_status: "OPEN" are unpaid — report them separately as commitments.

Step 3: Parse and aggregate

Transaction amounts (strings → numbers)

# Sum a single vendor's transactions
... | jq '[.data[0].transactions[].amount | gsub(","; "") | if startswith("-$") then ltrimstr("-$") | tonumber | (. * -1) elif startswith("$") then ltrimstr("$") | tonumber else tonumber end] | add'

Bill amounts are invoice amounts, not paid amounts

Use bill search to identify payment activity and relevant bill IDs. Do not sum BillInfo.amount as paid-in-period spend: payment-date filtering can match one installment of a partially paid bill while amount remains the full invoice amount. Only combine bills into an actual-spend total when payment-allocation amounts and dates are available; otherwise present the card subtotal and matched bills separately, and label the complete paid total unavailable.

Multi-vendor table with pagination

Fetch all pages first, then aggregate. Write only the minimum fields needed into a fresh per-run directory (mktemp -d) — never a fixed path or glob shared across runs, or stale pages from a previous or concurrent analysis get silently included in the totals. These files can contain s

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл ramp-spend-analysis?

Analyze spend by vendor, category, or team over a date range. Broad AI-spend questions include both financial spend and estimated token cost. Use when: 'how much did we spend on', 'vendor spend', 'SaaS review', 'spend report', 'AI spend', 'token spend', 'token usage', 'inference costs', 'total spend', 'spend by vendor', 'spend analysis', 'pull transactions for', 'cost breakdown'. Do NOT use for: approving transactions (use ramp-approval-dashboard), uploading receipts (use ramp-complete-expenses), or verifying a single bill payment (use ramp-payment-lookup).

Как установить скилл ramp-spend-analysis?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ramp-spend-analysis запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить ramp-spend-analysis с