Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

usage-patterns-dashboard

БесплатноЗапускает вложенные скриптыНе проверен

Classify a deployment's most expensive conversations by usage pattern (what the user was doing: iterative drafting, browser crawl, batch items, pasted…

Boise-State-Developmentот Boise-State-Development★ 22 звезды на GitHub

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

Conversation Cost Patterns dashboard

Each run pulls the window's per-call cost rows and upload records from the deployment's DynamoDB (read-only, content-free), builds ten datasets locally, and refreshes one Dashboard artifact so its link and run history persist.

  • scripts/build_datasets.py: taxonomy rules + every dataset. Stdlib only, run with python3 -I.
  • assets/index.html: the dashboard page. Reads datasets only; data-independent.
  • references/taxonomy.md: what each pattern means, its lever, and how to add one.

Baseline numbers, findings, parked levers and the data still to collect are in docs/one-pagers/conversation-usage-patterns.md. When a run changes the picture, update it.

It complements the per-conversation diagnoses in backend/src/apis/app_api/admin/costs/diagnoses.py: those say why one conversation cost money; this says what kind of usage carries the spend.

0. Settle the inputs

Input Default Where it comes from
AWS profile ask The deployment's read-only CLI profile (memory may name it)
Table prefix ask e.g. boisestateai-v2 → <prefix>-sessions-metadata, <prefix>-user-file-uploads
Console base URL ask The SPA origin; rows link to <base>/admin/costs/sessions/<id>
Window last 30 days, ending today (UTC) The user may name another

Work in a fresh scratchpad directory: RAW=<scratch>/cpd/raw, OUT=<scratch>/cpd/out. Raw scans stay there. Never copy them, or any id from them, into the repo.

1. Find or create the dashboard

Artifact action: "list", type: "Dashboard", and look for the title Conversation Cost Patterns. If it exists, keep its url for every write below. If not, run Artifact action: "quickstart" (intent: "other"), publish with the Dashboard type_url it names, title: "Conversation Cost Patterns", auto_open: "after_first_write", and read the type's instructions it returns. They are the contract for steps 5 and 6.

2. Pull the data (read-only)

Run each command on one line. A prod read-only guard may refuse multi-line commands and any scripting runtime on a line that names the prod profile. Only scan/query are used. The projections are the privacy boundary: never add title, displayText, citations, fileName or any message field.

aws dynamodb scan --profile <PROFILE> --table-name <PREFIX>-sessions-metadata --filter-expression "begins_with(SK, :c) AND #t >= :d" --projection-expression "sessionId,userId,#t,messageId,#c,tokenUsage,modelInfo.modelId,cacheStatus,cacheGapSeconds,wastedUsd,prefixFingerprints,toolCalls,documentsAttached,documentTokens,hasDocuments,turnDurationMs,windowRemovedMessages,compactionEvents,turnAgentId,agentSwitched" --expression-attribute-names '{"#t":"timestamp","#c":"cost"}' --expression-attribute-values '{":c":{"S":"C#"},":d":{"S":"<START>"}}' --output json > $RAW/cost_rows.json
aws dynamodb scan --profile <PROFILE> --table-name <PREFIX>-user-file-uploads --filter-expression "begins_with(GSI1PK, :c) AND createdAt >= :d" --projection-expression "GSI1PK,sizeBytes,mimeType,createdAt" --expression-attribute-values '{":c":{"S":"CONV#"},":d":{"S":"<START>"}}' --output json > $RAW/uploads.json

userId is read only to count distinct users. No dataset carries it. The cost-row scan grows with traffic (about 200 MB for 64K calls); give it a 10-minute timeout.

3. Carry the run history forward

The dashboard's datasets/runs document holds the history file. ArtifactData get collection datasets, doc runs. If it exists, its source.url is /_blob/<asset id>: Artifact action: "read", url, path: "<asset id>", and copy the saved file to $RAW/runs_previous.json. No document means this is the first run. Skip --history.

4. Build

python3 -I scripts/build_datasets.py --cost-rows $RAW/cost_rows.json --uploads $RAW/uploads.json --history $RAW/runs_previous.json --window-start <START> --window-end <END> --console-base <BASE> --out $OUT

Then add lifetime cost and message counts for the listed conversations (session rows, no title). List the ids in a command that does not name the profile:

python3 -I -c "import json,sys;print('\n'.join(r['session'] for r in json.load(open(sys.argv[1])) if not r['session'].startswith('api-converse')))" $OUT/conversations.json > $RAW/meta_ids.txt
mkdir -p $RAW/meta; while read sid; do aws dynamodb query --profile <PROFILE> --table-name <PREFIX>-sessions-metadata --index-name SessionLookupIndex --key-condition-expression "GSI_PK = :p AND GSI_SK = :m" --projection-expression "sessionId,totalCost,messageCount,deleted,createdAt" --expression-attribute-values "{\":p\":{\"S\":\"SESSION#$sid\"},\":m\":{\"S\":\"META\"}}" --output json > "$RAW/meta/$sid.json"; done < $RAW/meta_ids.txt

Re-run the build with --meta-dir $RAW/meta added. It prints the run summary and the pattern table. Read them before publishing: a fleet total far from the ad

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

Установить usage-patterns-dashboard в Claude Code и Claude Desktop

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

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

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

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

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

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

Вложенные файлы

assets/index.htmlreferences/taxonomy.mdscripts/build_datasets.pyscripts/store_docs.py

FAQ

Что делает скилл usage-patterns-dashboard?

Classify a deployment's most expensive conversations by usage pattern (what the user was doing: iterative drafting, browser crawl, batch items, pasted corpus…) and publish or refresh the "Conversation Cost Patterns" dashboard artifact: pattern spend split by cost mechanism, top conversations with console links, a discovery queue for new patterns, the 5-minute cache cliff, tool reliability, models, attachments, compaction health and run-over-run history. Content-free (no message text, titles or user ids). Use when the user asks "what are our most expensive conversations doing", "refresh the cost patterns dashboard", "classify expensive conversations", "usage patterns", "any new usage patterns", or wants to repeat the cost-pattern analysis.

Как установить скилл usage-patterns-dashboard?

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

Скилл usage-patterns-dashboard запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

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

Сравнить usage-patterns-dashboard с