xiaohongshu
xiaohongshu
forensic-onboarding-risk
Use when developer is leaving or new hire onboarding, assessing team resilience, planning for developer departures, calculating bus/truck factor, identifying knowledge silos, or evaluating organizational risk - identifies knowledge gaps and transition risks
Full skill instructions
State explicitly: "Using forensic-onboarding-risk pattern"
Then follow these steps:
Onboarding risk analysis identifies knowledge gaps when team members join or leave. Research shows single-owner files have 3-5x higher risk of quality issues and delays.
This analysis reveals:
Core principle: Knowledge should be shared. Single points of failure in knowledge create organizational risk.
This is the knowledge risk metric - don't create custom calculations:
Bus Factor = Minimum people whose departure cripples project
Single-Owner Risk = Files where 1 person = >80% of commits
Knowledge Silo Threshold:
- >80% owned by 1 person: CRITICAL (knowledge silo)
- >60% owned by 1-2 people: HIGH (at-risk)
- >40% owned by 2-3 people: MODERATE (manageable)
- <40% distributed: GOOD (shared knowledge)
Transition Cost = Ramp-up Time + Lost Productivity + Mentoring Time
Example: 3 months ramp-up + 30% reduced productivity + 20% mentor time
Critical: Bus factor of 1-2 = organizational risk. Project could halt if they leave.
Always reference research when presenting knowledge risk findings:
| Finding | Impact | Source | When to Cite |
|---|---|---|---|
| Single-owner files | 3-5x higher defect risk | Microsoft Research | "Single-owner files have 3-5x higher defect risk (Microsoft)" |
| Knowledge silos | 40-60% longer feature delivery | Conway's Law Studies | "Knowledge silos slow delivery by 40-60% (Conway)" |
| Onboarding time | 3-6 months to full productivity | Software Engineering Research | "Average onboarding: 3-6 months to full productivity" |
Always cite the source when justifying knowledge sharing investment.
| Purpose | Command |
|---|---|
| Contributors per file | git log --since="12 months ago" --format="%an" -- FILE | sort -u | wc -l |
| Primary owner | git log --since="12 months ago" --format="%an" -- FILE | sort | uniq -c | sort -rn | head -1 |
| Single-owner files | Loop through files, count contributors = 1 |
| Contribution % | Count commits per person / total commits × 100 |
| Ownership % | Contributors | Risk | Action |
|---|---|---|---|
| >80% | 1 person | CRITICAL | Immediate knowledge sharing |
| >60% | 1-2 people | HIGH | Schedule pairing/docs |
| >40% | 2-3 people | MODERATE | Monitor, encourage sharing |
| <40% | 3+ people | GOOD | Maintain practices |
| Bus Factor | Risk Level | Meaning | Action |
|---|---|---|---|
| 1 | CRITICAL | One person holds keys | Urgent mitigation |
| 2 | HIGH | Two people critical | Knowledge sharing needed |
| 3-4 | MODERATE | Small core team | Expand expertise |
| 5+ | GOOD | Distributed knowledge | Maintain standards |
For each file in codebase:
# Pseudocode for ownership calculation
def calculate_ownership(file, since="12 months ago"):
commits = git_log(file=file, since=since)
# Count commits per contributor
contributor_counts = defaultdict(int)
for commit in commits:
contributor_counts[commit.author] += 1
total_commits = len(commits)
if total_commits == 0:
return None # No recent activity
# Calculate ownership percentages
ownership = {}
for contributor, count in contributor_counts.items():
ownership_pct = (count / total_commits) * 100
ownership[contributor] = ownership_pct
# Find primary owner
primary_owner = max(ownership, key=ownership.get)
primary_pct = ownership[primary_owner]
return {
'file': file,
'total_commits': total_commits,
'primary_owner': primary_owner,
'primary_pct': primary_pct,
'all_ownership': ownership,
'contributor_count': len(ownership)
}
Find single-owner critical files:
def find_knowledge_silos(ownership_data, criticality_scores):
silos = []
for file_data in ownership_data:
primary_pct = file_data['primary_pct']
contributor_count = file_data['contributor_count']
is_critical = criticality_scores.get(file_data['file'], False)
# Knowledge silo criteria
is_silo = (
(primary_pct > 80 and contributor_count == 1) or
(primary_pct > 60 and contributor_count <= 2)
)
if is_silo:
severity = 'CRITICAL' if (is_critical and primary_pct > 80) else 'HIGH'
silos.append({
'file': file_data['file'],
'owner': file_data['primary_owner'],
'ownership_pct': primary_pct,
'contributors': contributor_count,
'is_critical': is_critical,
'severity': severity
})
return sorted(silos, key=lambda x: x['ownership_pct'], reverse=True)
Criticality score: From hotspot analysis or manual business criticality rating.
Minimum people whose loss cripples project:
def calculate_bus_factor(ownership_data):
# Group files by owner
owner_files = defaultdict(list)
for file_data in ownership_data:
if file_data['primary_pct'] > 50: # Primary ownership
owner = file_data['primary_owner']
owner_files[owner].append(file_data['file'])
# Sort by number of primary-owned files
owners_sorted = sorted(owner_files.items(),
key=lambda x: len(x[1]),
reverse=True)
# Calculate bus factor
# How many top contributors own >50% of files?
total_files = len(ownership_data)
files_covered = set()
bus_factor = 0
for owner, files in owners_sorted:
files_covered.update(files)
bus_factor += 1
coverage = (len(files_covered) / total_files) * 100
if coverage > 80: # 80% coverage threshold
break
return {
'bus_factor': bus_factor,
'coverage': coverage,
'key_people': [owner for owner, _ in owners_sorted[:bus_factor]],
'risk_level': 'CRITICAL' if bus_factor <= 2 else 'HIGH' if bus_factor <= 4 else 'MODERATE'
}
If person X leaves:
def estimate_transition_cost(person, ownership_data, team_size, avg_salary=150000):
# Find files they own
owned_files = [f for f in ownership_data
if f['primary_owner'] == person and f['primary_pct'] > 50]
orphaned_count = len([f for f in owned_files if f['contributor_count'] == 1])
# Estimate ramp-up time
if orphaned_count > 20:
ramp_up_months = 6 # Long learning curve
elif orphaned_count > 10:
ramp_up_months = 4
elif orphaned_count > 5:
ramp_up_months = 3
else:
ramp_up_months = 2
# Calculate cost
monthly_cost = avg_salary / 12
ramp_up_cost = monthly_cost * ramp_up_months * 0.5 # 50% productivity during ramp-up
mentoring_cost = monthly_cost * ramp_up_months * 0.2 # 20% mentor time
total_cost = ramp_up_cost + mentoring_cost
return {
'person': person,
'owned_files': len(owned_files),
'orphaned_files': orphaned_count,
'ramp_up_months': ramp_up_months,
'total_cost': total_cost,
'risk_level': 'CRITICAL' if orphaned_count > 10 else 'HIGH' if orphaned_count > 5 else 'MODERATE'
}
Onboarding Risk Assessment (forensic-onboarding-risk pattern)
Bus Factor: 2 (CRITICAL)
Key People: Alice, Bob
Single-Owner Files: 47 (15% of codebase)
Knowledge Silos: 12 critical files
Research shows single-owner files have 3-5x higher defect risk (Microsoft).
DEPARTURE RISK:
If Alice leaves:
- 23 orphaned files (no other contributor)
- 6 critical systems affected
- Estimated transition cost: $75,000
- Ramp-up time: 4-6 months
If Bob leaves:
- 18 orphaned files
- 4 critical systems affected
- Estimated transition cost: $60,000
- Ramp-up time: 3-4 months
RECOMMENDATION: URGENT knowledge sharing needed
Critical Knowledge Silos:
Rank | File | Owner | Ownership | Contributors | Criticality
-----|----------------------------|--------|-----------|--------------|-------------
1 | payments/stripe.js | Alice | 100% | 1 | 🚨 CRITICAL
2 | auth/oauth-provider.js | Alice | 95% | 1 | 🚨 CRITICAL
3 | core/legacy-migration.js | Bob | 92% | 1 | ❌ HIGH
4 | api/webhooks-handler.js | Alice | 88% | 1 | ❌ HIGH
5 | integrations/salesforce.js | Bob | 85% | 1 | ❌ HIGH
Research: Single-owner files have 3-5x higher defect risk (Microsoft).
IMPACT:
- 47 single-owner files total (15% of codebase)
- 12 are business-critical
- If Alice leaves: 23 orphaned (49% of single-owner files)
- If Bob leaves: 18 orphaned (38% of single-owner files)
BUS FACTOR: 2 (CRITICAL)
Meaning: Project would be severely compromised if these 2 people left
Key People:
1. Alice: Primary owner of 23 files (12% of codebase)
- Domains: Payments, Authentication, Integrations
- Critical files: 8
- Unique expertise: Stripe integration, OAuth
2. Bob: Primary owner of 18 files (9% of codebase)
- Domains: Legacy systems, Core APIs, Database
- Critical files: 6
- Unique expertise: Legacy migration, Database optimization
Coverage Analysis:
- Top 2 people: 80% of codebase knowledge
- Top 5 people: 100% of codebase knowledge
- Team size: 12 developers
RISK LEVEL: CRITICAL
- Bus factor of 2 for 12-person team = severe organizational risk
- Research: Knowledge silos slow delivery by 40-60% (Conway)
RECOMMENDATION: Immediate action required
- Pair Alice/Bob with 2-3 developers each
- Document critical knowledge
- Cross-train on key systems
DEPARTURE SCENARIO: Alice Leaves
Immediate Impact:
- 23 orphaned files (no other contributor)
- 8 critical systems without expert
- Domains affected: Payments, Authentication, Integrations
Knowledge Gap:
- Stripe API integration (payments/stripe.js)
- OAuth provider setup (auth/oauth-provider.js)
- Salesforce integration (integrations/salesforce.js)
- Webhook processing (api/webhooks-handler.js)
Ramp-Up Estimate:
- Learning curve: 4-6 months to full productivity
- Reduced productivity: 50% for first 3 months, 75% for next 3 months
- Mentoring overhead: 20% of senior developer time
Financial Impact:
- Lost productivity: $37,500 (6 months × $150K × 50% average)
- Mentoring cost: $22,500 (6 months × $150K × 20%)
- Mistake/rework: $15,000 (estimated bugs during learning)
- Total transition cost: $75,000
Timeline Impact:
- Features requiring payment changes: Delayed 3-6 months
- Authentication upgrades: Blocked until knowledge transfer
- Integration work: High-risk period
MITIGATION (Before Departure):
1. URGENT: Pair programming on critical files (2-3 months)
2. Document Stripe integration patterns (2 weeks)
3. Cross-train 2 developers on payments (1 month)
4. Code review all Alice's PRs with knowledge transfer focus
MITIGATION (After Departure):
1. Hire specialist with Stripe experience ($20K+ higher salary)
2. Consulting budget for Stripe integration ($30K)
3. Extended timeline for payment features (3-6 month delay)
Problem: Flagging single-owner files without considering business impact.
# ❌ BAD: All single-owner files equal
flag all files with 1 contributor
# ✅ GOOD: Prioritize by criticality
flag single-owner files where (
ownership > 80% AND
(is_business_critical OR is_hotspot OR is_complex)
)
Fix: Always consider business criticality - single-owner test file < single-owner payment file.
Problem: Identifying bus factor without quantifying business impact.
Fix: Calculate:
Problem: Reporting risk without actionable recommendations.
Fix: For each knowledge silo, recommend:
Problem: Same mitigation for planned retirement vs sudden departure.
Fix: Two scenarios:
Immediately suggest these next steps to the user:
Cross-check with code hotspots (use forensic-hotspot-finder)
Check coordination patterns (use forensic-coordination-analysis)
Calculate knowledge sharing ROI (use forensic-refactoring-roi)
Track bus factor quarterly
"Using forensic-onboarding-risk pattern, I analyzed knowledge distribution.
BUS FACTOR: 2 (CRITICAL for 12-person team)
Key People: Alice (23 files, 12%), Bob (18 files, 9%)
SINGLE-OWNER RISK:
- 47 files with 1 contributor (15% of codebase)
- 12 are business-critical
- Research: 3-5x higher defect risk (Microsoft)
DEPARTURE SCENARIO: If Alice leaves:
- 23 orphaned files (payments, auth, integrations)
- Transition cost: $75,000
- Timeline impact: 3-6 month delays on payment features
- Ramp-up: 4-6 months to full productivity
MITIGATION PLAN:
1. URGENT: Pair Alice with 2 developers on payments (3 months)
2. Document Stripe integration (2 weeks)
3. Cross-train on OAuth (1 month)
4. Code reviews with knowledge transfer focus
NEXT STEPS:
1. Check hotspots (forensic-hotspot-finder) - Single-owner hotspots?
2. Check coordination (forensic-coordination-analysis) - Process needed?
3. Calculate ROI (forensic-refactoring-roi) - Cost of mitigation?
4. Track quarterly - Measure improvement
Would you like me to proceed with hotspot correlation?"
Always provide this integration guidance - knowledge risk is organizational risk, requires executive attention.
Gradual knowledge transfer:
Succession Plan: Alice (Retiring in 6 months)
Phase 1 (Months 1-2): Shadow & Document
- Pair programming on payments (Alice + Junior Dev)
- Document Stripe integration (Alice writes, Junior reviews)
- Expected: Junior reaches 30% proficiency
Phase 2 (Months 3-4): Reverse Shadow
- Junior leads, Alice reviews
- Knowledge validation (can Junior explain to others?)
- Expected: Junior reaches 60% proficiency
Phase 3 (Months 5-6): Independent with Support
- Junior owns features, Alice available for questions
- Handoff critical contacts (Stripe support, etc.)
- Expected: Junior reaches 80% proficiency
Residual Risk: 20% knowledge gap (tribal knowledge)
Mitigation: Alice available as consultant for 3 months post-departure
Accelerated ramp-up:
New Hire Onboarding (Target: 3 months to productivity)
Week 1-2: Codebase Overview
- Architecture walkthrough
- Local setup, test suite
- Read top 10 most-changed files
- Expected: Can navigate codebase
Week 3-4: First Contribution
- Bug fixes in low-risk areas
- Pair with senior on feature
- Expected: First PR merged
Month 2: Domain Learning
- Payments module deep-dive (pair with Alice)
- Auth system understanding (pair with Bob)
- Expected: Can work semi-independently
Month 3: Full Productivity
- Own small feature end-to-end
- Participate in on-call rotation
- Expected: 70-80% productivity
Prioritize documentation efforts:
Documentation Priority (High-Impact, Low-Coverage):
1. payments/stripe.js (Alice's, CRITICAL)
- Stripe API integration patterns
- Webhook handling
- Estimated doc time: 2 days
- Impact: Reduces transition risk 60%
2. auth/oauth-provider.js (Alice's, CRITICAL)
- OAuth flow diagrams
- Token management
- Estimated doc time: 1.5 days
- Impact: Reduces transition risk 50%
Total documentation effort: 1 week
Total risk reduction: 55% average
ROI: Very high (1 week prevents $75K transition cost)
Key studies:
Microsoft Research (2013): Code ownership and quality
Conway's Law Studies (2015): Knowledge silos and velocity
Software Engineering Research (2018): Onboarding time
Organizational Risk Research (2016): Bus factor analysis
Why knowledge risk matters: People leave. Knowledge must outlive individual contributors. Bus factor measures organizational resilience.
Combine onboarding risk with:
Why: Knowledge risk is organizational risk - affects hiring, retention, and business continuity planning.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience