add-report

Adds report cards to ClaudeBar that parse local data files and display metrics with comparison deltas.

1.4k|129|Updated Dec 20, 2025
One-click install
npx skills add https://github.com/tddworks/ClaudeBar --skill add-report
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-report
Source: https://github.com/tddworks/ClaudeBar/tree/main/.claude/skills/add-report
Command: npx skills add https://github.com/tddworks/ClaudeBar --skill add-report

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Adding analytics features to the ClaudeBar macOS app requires coordinating domain models, file parsers, analyzers, and SwiftUI card views across multiple layers, which is error-prone without a consistent pattern. This Skill provides a structured TDD workflow for building report cards that read local data sources, aggregate metrics, and display period-over-period comparisons in the existing glassmorphism UI.

Core Features & Use Cases

  • Phased TDD Workflow: Guides architecture design with user approval, then domain models, infrastructure parsers/analyzers, card views, and integration, each with tests written first.
  • Established Data Flow Pattern: Enforces the Data Source → Parser → Analyzer → Report Model → UsageSnapshot → Card View pipeline used by the existing DailyUsage feature.
  • UI Consistency Rules: Provides a styling checklist for glassmorphism cards (theme gradients, borders, progress bars, hover effects) so new cards match the app.
  • Use Case: Add a weekly cost breakdown card that reads Claude JSONL session files, aggregates per-day costs, compares this week versus last week, and renders the result in the menu bar stats grid.

Quick Start

Use the add-report skill to add a weekly token usage report card to ClaudeBar that compares this week against last week.

Frequently Asked Questions about add-report

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new report card to ClaudeBar?

Follow the four-phase workflow: design the architecture and get approval, create domain Stat and Report models with tests, build the parser and analyzer in Infrastructure, then add the card view and wire it through UsageSnapshot and the provider's refresh method.

How do I parse Claude JSONL session files in Swift?

Create a parser struct in Sources/Infrastructure that reads JSONL files into typed records, then have an analyzer partition records by date and aggregate them. Filter files by modification date first, since scanning thousands of JSONL files is too slow.

Why use Decimal instead of Double for cost metrics in Swift?

Decimal avoids floating-point errors when representing monetary values like API usage costs. The skill requires Decimal for currency, TimeInterval for durations, and the en_US locale for currency formatting without extra spacing.

How does the report card show today versus yesterday comparisons?

The Report model holds current and previous Stat models, computing deltas, percentage changes, and progress ratios. Change percent returns nil when the previous value is zero to avoid division by zero, and formatted deltas always include a sign.

What testing approach does this Swift feature workflow use?

It uses Chicago School TDD with Swift Testing, testing state rather than interactions. Write Stat and Report tests first covering formatting, isEmpty, deltas, and edge cases, then implement the models until tests pass.