feat: flow stats — local usage & ROI analytics#80
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…; add windowed tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…sumption; punchier card subtitle Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…cross-task comment Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… compact number format Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…in automation block Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ency) Adds flow stats --png — renders the share card to a self-contained PNG with no runtime dependency (pure-Go drawing via fogleman/gg + embedded Go fonts; CGO stays off). Cost: +1.27MB binary (+7%), no build-time impact. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nvas Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… hero, dark palette Re-skins the PNG card to flow's brand: GitHub-dark palette (#0B0D10/#161B22), 1px bordered surface, the embedded flow wordmark (light flo + gradient wave-w, 30K transparent PNG), and the hero number filled with the brand wave gradient (#0AEAA8 to #198FFF). Content-driven height; automation band only when used. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
flow stats(+flow stats --card) — local, user-facing usage & ROI analytics derived entirely from data flow already keeps (flow.db + Claude session transcripts + on-disk auto-runs/owner/kb dirs). No schema change, no new instrumentation. A derived per-file cache makes repeat runs incremental — only changed transcripts are re-scanned.Highlights
$figure appear only when you actually use it — a manual-only user sees no automation block and no dollar number.est.; assumptions live in user-editable~/.flow/stats.json.--card [--out <path>].How it works
internal/stats/(pure logic):scan(jsonl → lookups + token usage) →cache(per-file, keyed by mtime+size) →report(BuildStatsover db + transcripts + dirs) →model(counterfactual savings). Thin renderers ininternal/app/{stats,card}.go. Reusesclaude.EncodeCwdto locate transcripts; reads flow.db viaflowdb.ListTasks. Config/cache are JSON (no TOML dependency — keeps the binary CGO-free and dependency-light).Testing
go test ./...green.Design spec + implementation plan under
docs/superpowers/.Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
🤖 Generated with Claude Code
Update — shareable PNG
Also adds
flow stats --png: renders the card to a self-contained PNG with no browser/runtime dependency (pure-Go drawing viafogleman/gg+ embedded Go fonts; CGO stays off). Cost: +1.27 MB binary (+7%), zero build-time impact, no new runtime deps.--cardstill emits HTML for those who prefer it.