RuitianXu

movie-receipt

Use when the user wants to end a Claude Code session, view historical usage statistics, or generate a session summary. Trigger phrases: "结束对话", "出票", "生成票根", "收工", "观影报告", "使用统计", "wrap up", "end session", "movie ticket", "viewing report".

RuitianXu 0 Updated 5d ago

Resources

4
GitHub

Install

npx skillscat add ruitianxu/movie-receipt-skill

Install via the SkillsCat registry.

SKILL.md

Movie Receipt

Overview

Generate a thermal-paper-style dual-stub movie ticket (ASCII + SVG, optional PDF) from a Claude Code session transcript. The project topic becomes the film title, the model becomes the seat, and token consumption becomes the ticket price. Historical tickets can be aggregated into a "viewing report."

Scenarios

Ticket (end of session)

Summarize three things yourself — do NOT call another model:

  • Title (片名): A cinematic Chinese short name capturing the session's theme, e.g.《最后的回滚》《零点部署》
  • Genre (类型): 调试 / 开发 / 重构 / 探索 / 文档 etc.
  • Plot summary (剧情总结): ≤100 Chinese characters describing what the session accomplished — problem solved, key changes, results. This gets encoded into the ticket's QR code so the user can scan to recall the session.

Then run:

python ~/.claude/skills/movie-receipt/scripts/receipt.py ticket \
  --title "你总结的片名" --genre "类型" \
  --summary "本场剧情中文总结" --cwd "$(pwd)"

Add --no-pdf to skip PDF generation. Display the ASCII output as-is and tell the user the SVG path.

QR Code

The script auto-installs qrcode (pure Python, no PIL needed) on first run when --summary is provided. Without it, the ticket falls back to a decorative barcode.

Report (usage statistics)

python ~/.claude/skills/movie-receipt/scripts/receipt.py report --period month

--period: week | month | year | all (default). Display output as-is.

Pricing

Four-tier pricing: input miss / cache write / cache read / output. Local prices.json takes priority; falls back to LiteLLM online table (24h cache). Missing models show a warning with $0.0000 cost — add them to prices.json to fix.

PDF Generation

The script auto-installs cairosvg (preferred, handles pattern fills) or svglib as fallback on first run. Conversion chain: cairosvg → svglib+reportlab → rsvg-convert → inkscape. If none available, SVG is still saved.

Common Mistakes

  • Using python3 on Windows — the command is python
  • Editing prices.example.json but not copying it to prices.json
  • Forgetting --cwd "$(pwd)" so the script can't find the session transcript
  • Letting Windows GBK encoding crash emoji output — the script handles this via sys.stdout.reconfigure(encoding="utf-8")