brainstorming
Structured design dialogue that validates ideas before implementation begins.
forensic-debt-quantification
Use when justifying technical debt to executives, calculating the cost of quality issues, translating tech metrics to business language, or planning quality budgets - uses research-backed formulas (2-3x defects, productivity multipliers) to convert code problems into dollars and ROI
Full skill instructions
State explicitly: "Using forensic-debt-quantification formulas"
Then follow these steps:
Technical debt quantification translates code metrics into business language. Instead of "high cyclomatic complexity," explain "this costs us $120K/year in wasted developer time." This skill provides research-backed formulas for calculating the business impact of technical debt.
Core principle: Technical debt has measurable costs - productivity loss, defect risk, coordination overhead, and opportunity cost. Quantify these to make informed investment decisions.
This is the research-backed approach - always use these specific formulas:
Total Annual Debt Cost =
Productivity Loss Cost +
Defect Risk Cost +
Coordination Overhead Cost +
Opportunity Cost
Where all costs are in business terms: dollars, time, or features not built.
Critical: Use conservative estimates (ranges, not exact numbers). Better to under-promise than lose credibility.
Always reference the research when using these multipliers:
| Debt Type | Multiplier | Source | When to Cite |
|---|---|---|---|
| High complexity file | 2.5x development time | Microsoft Research | "Research shows complex files take 2.5x longer to modify" |
| Critical hotspot | 4x development time | Code forensics studies | "Hotspots require 4x more time per change" |
| >9 contributors | 2-3x defect rate | "Google found >9 contributors = 2-3x more bugs" | |
| High change + complexity | 4-9x defect rate | Microsoft Research | "Microsoft Research: hotspots have 4-9x defect rates" |
| Poor test coverage | 2x defect rate | Industry average | "Industry data shows 2x defects without tests" |
| >40% unplanned work | Morale issues | Research correlation | "Research links >40% interrupt work to low morale" |
Always cite the source when presenting these numbers to stakeholders. This builds credibility.
Productivity Loss = Σ (hotspot_changes × baseline_time × time_tax)
Time tax by complexity:
- Simple code: 1.0x (baseline)
- Moderate complexity: 1.5x
- High complexity: 2.5x
- Critical hotspot: 4.0x
Example:
auth.js: 8 changes/month × 2 hours × (2.5 - 1.0) = 24 hours/month wasted
Defect Risk Cost = hotspot_count × defect_multiplier × avg_defect_cost
Example:
- 10 critical hotspots
- 3x higher defect rate
- $5,000 average defect cost (incident response + customer impact)
- Annual risk: 10 × 3 × $5,000 = $150,000
Coordination Cost = high_coord_files × coordination_hours × hourly_rate
High coordination = >7 active contributors
Example:
config.js: 14 contributors, 6 changes/month
Coordination time: 2 hours per change (meetings, conflicts, reviews)
Monthly cost: 6 × 2 × $100 = $1,200/month = $14,400/year
Opportunity Cost = (debt_time / total_capacity) × estimated_feature_value
Example:
- 1,800 hours/year on debt-related work
- 10,000 hours/year total capacity (5 devs)
- Debt ratio: 18%
- Could deliver 3-4 more features/year if debt reduced
| Input | Typical Value | How to Estimate |
|---|---|---|
| Developer hourly rate | $80-150 | Salary + benefits + overhead / working hours |
| Average defect cost | $3,000-10,000 | Incident response time + customer impact |
| Team size | - | Current headcount |
| Average feature value | $50,000-200,000 | Revenue impact or cost savings per feature |
#!/bin/bash
# Calculate technical debt cost for a codebase
# Inputs (customize these)
HOURLY_RATE=100
TEAM_SIZE=5
DEFECT_COST=5000
TIME_PERIOD="12 months ago"
echo "TECHNICAL DEBT COST ANALYSIS"
echo "============================="
echo ""
# 1. Identify hotspots (files with high change + complexity)
echo "Analyzing hotspots..."
hotspot_count=$(run_hotspot_analysis | grep "CRITICAL\|HIGH" | wc -l)
hotspot_changes=$(calculate_total_changes_to_hotspots)
# 2. Calculate productivity loss
echo "Calculating productivity impact..."
# Assume hotspots take 2.5x longer to modify
time_tax=1.5 # 2.5x - 1.0x baseline
productivity_loss_hours=$(echo "$hotspot_changes * 2 * $time_tax" | bc)
productivity_loss_cost=$(echo "$productivity_loss_hours * $HOURLY_RATE" | bc)
echo " Productivity Loss: $productivity_loss_hours hours = \$$productivity_loss_cost"
# 3. Calculate defect risk
echo "Calculating defect risk..."
# Research: hotspots have 3x higher defect rate
defect_multiplier=3
expected_defects=$(echo "$hotspot_count * $defect_multiplier" | bc)
defect_risk_cost=$(echo "$expected_defects * $DEFECT_COST" | bc)
echo " Defect Risk: $expected_defects defects = \$$defect_risk_cost"
# 4. Calculate coordination overhead
echo "Analyzing coordination costs..."
high_coord_files=$(find_files_with_many_contributors 7)
coord_overhead_hours=$(echo "$high_coord_files * 6 * 2" | bc) # 6 changes/mo, 2hr/change
coord_cost=$(echo "$coord_overhead_hours * $HOURLY_RATE * 12" | bc)
echo " Coordination Overhead: $coord_overhead_hours hours/mo = \$$coord_cost/year"
# 5. Total annual debt cost
total_cost=$(echo "$productivity_loss_cost + $defect_risk_cost + $coord_cost" | bc)
echo ""
echo "TOTAL ANNUAL TECHNICAL DEBT COST: \$$total_cost"
echo ""
# 6. Calculate debt-to-development ratio
total_capacity=$(echo "$TEAM_SIZE * 2000" | bc) # 2000 hours/year per dev
debt_hours=$(echo "$productivity_loss_hours + $coord_overhead_hours * 12" | bc)
debt_ratio=$(echo "scale=1; $debt_hours / $total_capacity * 100" | bc)
echo "Debt-to-Development Ratio: ${debt_ratio}%"
echo "This represents approximately $(echo "scale=1; $TEAM_SIZE * $debt_ratio / 100" | bc) FTE spent on debt"
Use this template for executive presentations:
## Technical Debt Business Impact
**Executive Summary**
We are spending approximately $[TOTAL_COST]/year on technical debt.
This represents [X]% of engineering capacity, equivalent to [Y] full-time
developers doing nothing but managing complexity and fixing avoidable bugs.
### What This Means
**Development Slowdown**
Features take [X]% longer to ship due to complex, hard-to-change code.
- Impact: [N] fewer features shipped per year
- Value: ~$[VALUE] in missed opportunities
**Quality Issues**
We experience [X]x more bugs in certain areas, leading to:
- Customer escalations and churn
- Emergency fixes that disrupt planned work
- Impact: $[DEFECT_COST] in incident costs annually
**Team Inefficiency**
Developers spend [X] hours per month coordinating changes in complex areas
- Impact: $[COORD_COST] in coordination overhead
- Symptom: Merge conflicts, duplicate work, meeting overhead
**Missed Opportunities**
Could build [N] additional features per year if not burdened by technical debt
- Impact: $[OPP_COST] in potential value
### Recommendation
Invest $[INVESTMENT] ([X] months, [Y] developers) to refactor the
top [N] problem areas.
Expected outcomes:
- Reduce ongoing debt cost by [X]% ($[SAVINGS]/year)
- Break even in [X] months
- Accelerate feature development by [Y]%
- Reduce production incidents by [Z]%
### Cost of Inaction
If unaddressed, technical debt compounds at ~15-20% annually.
By end of [YEAR], debt will cost $[PROJECTED_COST]/year, consuming
[X]% of engineering capacity.
Problem: Claiming exact costs ($327,450.23) when formulas involve assumptions.
# ❌ BAD: False precision
"Technical debt costs exactly $327,450.23 per year"
# ✅ GOOD: Ranges with rounding
"Technical debt costs approximately $300-350K per year"
Fix: Always use ranges and round numbers. This maintains credibility with executives.
Problem: Saying "this is expensive" without backing it up.
Fix: Always cite: "Microsoft Research shows hotspots have 4-9x higher defect rates." Reference the research that backs your multipliers.
Problem: Applying worst-case (9x defect rate) to every file.
Fix: Use conservative estimates (2-3x) unless you have specific data. "We estimate 2-3x defects (Google research) but could be as high as 4-9x (Microsoft Research)."
Problem: Only counting direct costs (time wasted, bugs).
Fix: Always include opportunity cost. "We could deliver 3-4 more features per year" resonates with business stakeholders.
Problem: Presenting estimates without showing your work.
Fix: Explicitly state: "Based on $100/hour developer cost, 10-person team, industry average $5K per defect..."
Context: 8-person team, 2-year codebase, velocity dropped 30% in 6 months
Analysis:
Recommendation: 2-week sprint on top 3 hotspots ($20K investment)
ROI:
Outcome: CEO approved, velocity recovered in 3 months, debt cost reduced to $240K/year.
Context: 50-person team, 5-year codebase, acquisition due diligence
Analysis:
Recommendation: 6-month quality initiative post-acquisition ($500K)
Impact: Acquisition proceeded, debt issues priced into deal (~$2M discount)
Immediately suggest these next steps to the user:
Identify the sources (use forensic-hotspot-finder)
Calculate ROI (use forensic-refactoring-roi)
Check ownership risk (use forensic-knowledge-mapping)
Track trends (use forensic-complexity-trends)
"Using forensic-debt-quantification formulas, I've calculated the annual cost:
TOTAL TECHNICAL DEBT COST: $465,000/year
Breakdown:
- Productivity Loss: $180,000 (1,800 hours at $100/hr)
- Defect Risk: $225,000 (Microsoft Research: 4-9x defect rates)
- Coordination: $60,000 (Google: >9 contributors = overhead)
This represents 18% of engineering capacity (approximately 2 FTE).
RECOMMENDED NEXT STEPS:
1. Identify hotspots (forensic-hotspot-finder) - Which files drive these costs?
2. Calculate ROI (forensic-refactoring-roi) - Where to invest first?
3. Present to stakeholders with business case
Would you like me to proceed with identifying the specific files causing these costs?"
Always provide ROI context - executives need to know the payback, not just the cost.
Use these conservative multipliers for credibility:
Only use aggressive multipliers (4x, 9x) when:
After calculating, sanity check:
Structured design dialogue that validates ideas before implementation begins.
Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.
Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.
Introduction to the obra skills system with mandatory skill invocation rules and best practices.
Execute a written implementation plan with critical review and task checkpoints.
Delegate independent tasks to specialized agents working concurrently with isolated context.
Isolated git worktrees with smart directory selection and safety verification.
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Plan searchable and shareable content that drives traffic, builds authority, and generates leads.
README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.
Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.
Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.
The world's fastest calendar for remote work
Capture, organize, and utilize your knowledge effortlessly.
Instant Summaries of Audio & Video Interviews with AnySummary
Transform PDFs into engaging mind maps.
Chat with any PDF instantly
Create an optimal daily plan using your voice
A productivity platform to centralize organizational knowledge and workflows with contextual AI assistance.
AskYourPDF Pricing Plans: Tailored to Your Needs