Skip to content

Domain Cost Attribution

Understanding where engineering effort goes is as important as understanding how much it costs. Domain cost attribution maps every commit to a business domain, then aggregates cost and impact to show where your team is spending its time — and whether that investment is paying off.

Purpose

Most CTOs can tell you their total engineering headcount. Few can tell you what percentage of engineering effort goes to payments vs onboarding vs internal tooling. Domain cost attribution makes this visible.

How Domains Are Mapped

Domains in ShipLens are determined through a two-layer system:

1. Auto-Detection

The LLM commit analysis identifies which business domains a commit affects based on:

  • File paths and directory structure
  • Module and namespace conventions
  • Commit message context
  • Code content and purpose

For example, a commit touching lib/my_app/payments/gateway.ex is automatically attributed to the payments domain.

2. CTO Override

Auto-detected domains can be overridden or refined by the CTO through domain configuration:

ConfigurationPurpose
Domain renamingMap auto-detected names to your preferred terminology
Path patternsExplicitly assign file path patterns to domains
Domain mergingCombine granular auto-detected domains into broader categories
Criticality assignmentSet domain criticality (low / medium / high / critical)

TIP

The best results come from letting auto-detection run first, then refining with overrides. Most projects need only 3-5 manual overrides to get clean domain attribution.

Cost Allocation

A commit's cost is attributed to domains based on the files it touches:

commit_domain_cost=contributor_daily_cost×files in domaintotal files in commit

Where:

contributor_daily_cost=monthly_salary22

If a commit touches 4 files — 3 in payments and 1 in shared — then 75% of that commit's cost is attributed to payments and 25% to shared.

Multi-domain commits (commits spanning multiple domains) are common. Rather than forcing each commit into a single domain, ShipLens splits attribution proportionally. This gives a more accurate picture of where effort actually goes.

ROI per Domain

Each domain has an ROI metric comparing effort invested to impact produced:

domain_ROI=total impact points in domaintotal cost attributed to domain×1,000

This produces an "impact per R$1,000" figure per domain, making cross-domain comparisons straightforward:

DomainCost (R$)Impact PointsROI (impact/R$1k)
Payments35,0002206.29
Onboarding18,0001458.06
Admin Panel12,000423.50
Shared/Infra22,000853.86

A domain with high cost and low ROI isn't necessarily a problem — infrastructure and platform domains often show lower impact scores because their value is indirect. But it's a starting point for conversation.

Low-Activity Domain Toggling

Domains with very few commits can clutter the view. ShipLens allows toggling low-activity domains:

SettingBehavior
Show allEvery domain with at least 1 commit is displayed
Hide low-activity (default)Domains with fewer than 5 commits in the selected period are collapsed into an "Other" category
Custom thresholdSet your own minimum commit count

This keeps the domain cost view focused on the domains that matter, while still accounting for all commits in the totals.

Drill-Down

From the domain cost view, you can drill down through three levels:

Domain (e.g., Payments)
  -> Contributors (who worked in this domain)
    -> Individual commits (what they did)

Each level shows:

  • Domain level: Total cost, impact, ROI, contributor count, top files
  • Contributor level: Their cost allocation to this domain, commit count, average score
  • Commit level: Full commit report with score breakdown

Route

/c/:slug/domain-costs

The domain costs page shows:

  • Treemap visualization of cost distribution across domains
  • ROI table with sorting and filtering
  • Low-activity domain toggle
  • Period selector for sprint-level analysis
  • Click-through to contributor and commit drill-downs

Built with intelligence, not surveillance.