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★ 42 звезды на GitHub
Установить ramp-spend-analysis в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Non-Negotiables
- Pass
--rationaleon 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 returnsHTTP 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
amountas 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
--agentfor 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_cursoris 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
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
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), без исполняемых скриптов.
Похожие скиллы
docx
AnthropicUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
xlsx
AnthropicUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
pptx
AnthropicUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…