Code ownership & knowledge map CLI โ bus factor, knowledge silos, and CODEOWNERS generation from git history
Project description
๐ git-tribe
Code Ownership & Knowledge Map CLI โ Analyze git history to reveal who owns what code, calculate bus factor, identify knowledge silos, and auto-generate CODEOWNERS files.
Why?
git blameshows the last editor, not the true owner- No CLI tool calculates bus factor โ critical for team risk assessment
- CODEOWNERS files are hand-maintained and go stale quickly
- Engineering managers need knowledge distribution visibility at a glance
- Useful for onboarding: "who should I ask about module X?"
Features
| Feature | Description |
|---|---|
| Ownership Map | Who owns each file/directory by commit volume & line authorship |
| Bus Factor | Risk score: how many people must leave before knowledge is lost |
| Knowledge Silos | Files/modules where only 1-2 people have contributed |
| CODEOWNERS Gen | Auto-generate GitHub/GitLab CODEOWNERS from git history |
| Turnover Risk | Highlight files where top contributor is inactive |
| Team View | Aggregate ownership by team (configurable mapping) |
Installation
pip install git-tribe
Quick Start
# Run in any git repository
cd your-repo
# Full ownership report
git-tribe scan
# Deep analysis (blame every file)
git-tribe scan --depth full
# Analyze specific directory
git-tribe scan src/auth/
# Bus factor analysis
git-tribe bus-factor
# Detect knowledge silos
git-tribe silos --threshold 2
# Generate CODEOWNERS
git-tribe codeowners --output CODEOWNERS --format github
# JSON output for CI integration
git-tribe scan --format json --output report.json
# Time-bounded analysis
git-tribe scan --since "6 months ago"
Output Example
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ ๐ git-tribe ยท Code Ownership Report โ
โ my-project ยท Bus Factor: 3 โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
๐ Directory Ownership
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโโโโโ
โ Path โ Primary Ownerโ Share โ Bus Factor โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโผโโโโโโโโโโโโโค
โ src/auth/ โ alice โ 72% โ 1 โ ๏ธ โ
โ src/api/ โ bob โ 45% โ 3 โ
โ
โ src/core/ โ charlie โ 38% โ 4 โ
โ
โ src/utils/ โ alice โ 55% โ 2 โ ๏ธ โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโดโโโโโโโโโโโโโ
โ ๏ธ Knowledge Silos (single-author files):
โข src/auth/oauth.py โ alice (100%)
โข src/auth/jwt_handler.py โ alice (97%)
๐ก Recommendations:
1. src/auth/ has bus factor 1 โ schedule pair review sessions
2. 3 files are single-author โ assign cross-review in next sprint
Configuration
Create a .git-tribe.toml in your repository root:
[teams]
backend = ["alice", "bob", "charlie"]
frontend = ["diana", "eve"]
devops = ["frank"]
[ignore]
paths = ["vendor/", "node_modules/", "*.generated.*"]
authors = ["dependabot[bot]", "renovate[bot]"]
[thresholds]
bus_factor_warning = 2 # Warn if bus factor โค this
silo_max_authors = 2 # Flag files with โค this many authors
stale_months = 6 # Author considered inactive after this
Output Formats
| Format | Flag | Use Case |
|---|---|---|
| Terminal | --format terminal (default) |
Interactive review |
| JSON | --format json |
CI/CD pipelines, programmatic use |
| Markdown | --format markdown |
Documentation, PRs |
| CSV | --format csv |
Spreadsheet analysis |
| CODEOWNERS | git-tribe codeowners |
GitHub/GitLab integration |
How It Works
Ownership Score
Combines multiple signals with weighted formula:
- 60% โ Blame-based (current lines attributed to author)
- 40% โ Commit frequency (number of commits touching file)
Bus Factor
Minimum number of contributors whose departure would result in >50% of the code having no active author. Sort authors by contribution %, accumulate until >50% โ that count is the bus factor.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file git_tribe-1.0.0.tar.gz.
File metadata
- Download URL: git_tribe-1.0.0.tar.gz
- Upload date:
- Size: 635.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27c2089d2ba95ad2b28805d8afb47368e975eaedaae6e3a552a1dfdfb8863f9e
|
|
| MD5 |
34b47e280ef67ac95af77d63f7a02b0d
|
|
| BLAKE2b-256 |
8b91b42056ff29ec8094e5f54105895f0dbf24d993684ab6f5253bae2c538eed
|
Provenance
The following attestation bundles were made for git_tribe-1.0.0.tar.gz:
Publisher:
release.yml on bhayanak/git-tribe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
git_tribe-1.0.0.tar.gz -
Subject digest:
27c2089d2ba95ad2b28805d8afb47368e975eaedaae6e3a552a1dfdfb8863f9e - Sigstore transparency entry: 1634262529
- Sigstore integration time:
-
Permalink:
bhayanak/git-tribe@9c4c9ac66f35f4f1023ef473414020299100798e -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/bhayanak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9c4c9ac66f35f4f1023ef473414020299100798e -
Trigger Event:
push
-
Statement type:
File details
Details for the file git_tribe-1.0.0-py3-none-any.whl.
File metadata
- Download URL: git_tribe-1.0.0-py3-none-any.whl
- Upload date:
- Size: 20.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
735d42e6598c7c898fe13c36c201f28a433d75e585b66ce5fd2eb6142c2ad80c
|
|
| MD5 |
da6c0d9d7e09aa1421aac7b9547c3577
|
|
| BLAKE2b-256 |
136e5e1f89f0effbf504945f7022ddfeb5be5150eaef652d121fb1d49ee43999
|
Provenance
The following attestation bundles were made for git_tribe-1.0.0-py3-none-any.whl:
Publisher:
release.yml on bhayanak/git-tribe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
git_tribe-1.0.0-py3-none-any.whl -
Subject digest:
735d42e6598c7c898fe13c36c201f28a433d75e585b66ce5fd2eb6142c2ad80c - Sigstore transparency entry: 1634262556
- Sigstore integration time:
-
Permalink:
bhayanak/git-tribe@9c4c9ac66f35f4f1023ef473414020299100798e -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/bhayanak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9c4c9ac66f35f4f1023ef473414020299100798e -
Trigger Event:
push
-
Statement type: