token-report

/token-report - Generate Token Summary Report

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "token-report" with this command: npx skills add michael-menard/monorepo/michael-menard-monorepo-token-report

/token-report - Generate Token Summary Report

Usage

/token-report STORY-XXX

Arguments

  • STORY-XXX — story ID (e.g., STORY-001, WRKF-1021)

Locate Story Directory

The story can be in one of these directories:

  • plans/stories/backlog/STORY-XXX/

  • plans/stories/elaboration/STORY-XXX/

  • plans/stories/ready-to-work/STORY-XXX/

  • plans/stories/in-progress/STORY-XXX/

  • plans/stories/QA/STORY-XXX/

  • plans/stories/UAT/STORY-XXX/

Search these directories in order to find the story.

Preconditions

  • KB must have token entries for the story (logged via /token-log )

  • If no entries found: STOP and report "No token entries found in KB for STORY-XXX — run /token-log phases first"

Task

  • Query KB for token entries: kb_search({ type: "token_usage", story_id: "STORY-XXX" }) // Returns array of { phase, input_tokens, output_tokens, timestamp }

  • Aggregate phase data

  • Generate <story-directory>/_implementation/TOKEN-SUMMARY.md

Token Summary Format

Token Summary - STORY-XXX

Generated: YYYY-MM-DD HH:MM

Phase Breakdown

PhaseInputOutputTotal% of Total
pm-generate15,0005,00020,00012.6%
elaboration20,0002,00022,00013.8%
dev-implementation80,00037,000117,00073.6%
Total115,00044,000159,000100%

Cost Estimate

Using Claude Opus pricing:

  • Input: $0.003 / 1K tokens
  • Output: $0.015 / 1K tokens
CategoryTokensCost
Input115,000$0.35
Output44,000$0.66
Total159,000$1.01

High-Cost Operations

Phases exceeding 30,000 tokens:

PhaseTotal TokensNotes
dev-implementation117,000Primary implementation work

Comparison to Typical Budget

MetricThis StoryTypicalVariance
PM phases42,00050,000-16%
Dev phases117,000100,000+17%
Total159,000200,000-21%

Timeline

First EntryLast EntryDuration
YYYY-MM-DD HH:MMYYYY-MM-DD HH:MMX hours

Raw Log

(From KB storyTokenUsage)

TimestampPhaseInputOutputTotalCumulative
...

Calculations

Percentage of Total:

phase_percent = (phase_total / grand_total) * 100

Cost Estimate:

input_cost = (input_tokens / 1000) * 0.003 output_cost = (output_tokens / 1000) * 0.015 total_cost = input_cost + output_cost

Typical Budget Reference:

Phase Group Typical Total

PM phases (pm-generate, pm-fix, elaboration) 50,000

Dev phases (dev-*, code-review) 100,000

QA phases (qa-verify) 50,000

Full story lifecycle 200,000

Variance:

variance_percent = ((actual - typical) / typical) * 100

High-Cost Threshold

Flag phases exceeding 30,000 tokens as "high-cost operations"

Phase groups for analysis:

  • PM: pm-generate, pm-fix

  • Elaboration: elaboration

  • Dev Setup: dev-setup

  • Dev Planning: dev-planning

  • Dev Implementation: dev-implementation (often highest)

  • Dev Verification: dev-verification

  • Dev Documentation: dev-documentation

  • Review: code-review

  • QA: qa-verify

  • Fix: dev-fix

Output

After generating the summary, report:

Token summary generated for STORY-XXX:

Total: XXX,XXX tokens (~$X.XX) Phases: N phases logged Highest: phase-name (XX,XXX tokens) Status: [Under budget / On budget / Over budget]

File: plans/stories/<status>/STORY-XXX/_implementation/TOKEN-SUMMARY.md

Error Handling

If KB returns no entries for the story:

  • Report: "No token entries found in KB for STORY-XXX"

  • Suggest running /token-log for each phase

If KB query fails:

  • Report the error message

  • Suggest checking that the KB MCP server is running

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

review

No summary provided by upstream source.

Repository SourceNeeds Review
General

review-draft-story

No summary provided by upstream source.

Repository SourceNeeds Review
General

wt-list

No summary provided by upstream source.

Repository SourceNeeds Review