Skip to content

Commit 4d781f5

Browse files
rameerezclaude
andauthored
Add TTM revenue and tighten metric semantics (#9)
* Add TTM revenue and tighten metric semantics * Harden Pay lifecycle compatibility * Document metric semantics inline * Clarify TTM alias and share metric logic * Fix Claude Code Review workflow to use plain prompt instead of plugins The plugin-based approach was failing because the Claude CLI installation returns 403 and can't add marketplaces. Switch to the simpler prompt-based approach used in organizations gem which doesn't require CLI installation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update README.md --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8ccda42 commit 4d781f5

15 files changed

Lines changed: 1750 additions & 1070 deletions

.github/workflows/claude-code-review.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,22 @@ jobs:
3636
uses: anthropics/claude-code-action@v1
3737
with:
3838
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39-
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
40-
plugins: 'code-review@claude-code-plugins'
41-
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
39+
prompt: |
40+
REPO: ${{ github.repository }}
41+
PR NUMBER: ${{ github.event.pull_request.number }}
42+
43+
Please review this pull request and provide feedback on:
44+
- Code quality and best practices
45+
- Potential bugs or issues
46+
- Performance considerations
47+
- Security concerns
48+
- Test coverage
49+
50+
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
51+
52+
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
53+
4254
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
4355
# or https://code.claude.com/docs/en/cli-reference for available options
56+
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
4457

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# `profitable`
22

3+
## [Unreleased]
4+
- Add `Profitable.ttm_revenue` for trailing twelve-month revenue
5+
- Add `Profitable.ttm` as a founder-friendly alias for `ttm_revenue`
6+
- Add `Profitable.revenue_run_rate`, `estimated_arr_valuation`, `estimated_ttm_revenue_valuation`, and `estimated_revenue_run_rate_valuation`
7+
- Make revenue metrics net of refunds when `amount_refunded` is present
8+
- Make subscriber and MRR metrics distinguish between current billable subscriptions and historical period events
9+
- Count `new_customers` from first monetization date rather than signup date
10+
- Count `new_subscribers` / `new_mrr` from when a subscription becomes billable, not when a free trial starts
11+
- Handle additional Pay status variants like `on_trial`, `cancelled`, and `deleted`
12+
- Keep grace-period subscriptions billable until `ends_at`
13+
- Exclude metered Stripe items from fixed run-rate MRR calculations
14+
- Surface TTM revenue in the built-in dashboard
15+
316
## [0.4.0] - 2026-02-10
417
- Add monthly summary (12mo) and daily summary (30d) tables to dashboard
518
- Add `period_data` method for efficient batch computation of period metrics
@@ -32,4 +45,4 @@
3245

3346
## [0.1.0] - 2024-08-29
3447

35-
- Initial test release (not production ready)
48+
- Initial test release (not production ready)

README.md

Lines changed: 244 additions & 13 deletions
Large diffs are not rendered by default.

app/controllers/profitable/dashboard_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ def index
44
@mrr = Profitable.mrr
55
@mrr_growth_rate = Profitable.mrr_growth_rate
66
@total_customers = Profitable.total_customers
7+
@ttm_revenue = Profitable.ttm_revenue
78
@all_time_revenue = Profitable.all_time_revenue
89
@estimated_valuation = Profitable.estimated_valuation
910
@average_revenue_per_customer = Profitable.average_revenue_per_customer

app/views/profitable/dashboard/index.html.erb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@
5353
<h2><%= @mrr.to_readable %></h2>
5454
<p>MRR</p>
5555
</div>
56+
<div class="card">
57+
<h2><%= @ttm_revenue.to_readable %></h2>
58+
<p>TTM revenue</p>
59+
</div>
5660
<div class="card">
5761
<h2><%= @estimated_valuation.to_readable %></h2>
5862
<p>Valuation at 3x ARR</p>

0 commit comments

Comments
 (0)