Fetch contributor statistics for a GitHub repository and generate a pie chart visualization.
Analyzes GitHub repository contributors and generates ASCII pie chart visualization of contribution distribution.
/plugin marketplace add jpoley/repo-summary/plugin install repo-summary@repo-summary-marketplacegithub/Analyze repository contributors and generate visualization of contribution distribution.
$ARGUMENTS
The input should be in the format: owner repo (space-separated)
Use the GitHub API to get contributor statistics. Since we don't have a direct contributors MCP tool, use commits to analyze contributors:
Fetch recent commits using mcp__github__list_commits:
Aggregate by author:
For each contributor, collect:
Sort contributors by commit count (descending).
Create a visual representation of contributor distribution.
Pie Chart Format:
Contributor Distribution
========================
Top Contributors (by commits)
████████████████████ 45% | contributor1 (450 commits)
██████████ 25% | contributor2 (250 commits)
████████ 20% | contributor3 (200 commits)
██ 5% | contributor4 (50 commits)
█ 5% | others (50 commits)
Total: 1000 commits from 15 contributors
Bar Generation Rules:
Determine:
Bus Factor Calculation:
Sort contributors by commits (descending)
Count how many contributors it takes to reach 80% of total commits
This number is the "bus factor"
Contribution Spread Assessment:
Output the following:
## Contributor Analysis
### Contribution Distribution
[ASCII Pie Chart Here]
### Key Metrics
| Metric | Value |
|--------|-------|
| Total Contributors | [count] |
| Bus Factor | [number] |
| Contribution Spread | [Concentrated/Moderate/Distributed] |
### Top Contributors
| Rank | Contributor | Commits | Percentage |
|------|-------------|---------|------------|
| 1 | [name] | [count] | [%] |
| 2 | [name] | [count] | [%] |
| 3 | [name] | [count] | [%] |
| 4 | [name] | [count] | [%] |
| 5 | [name] | [count] | [%] |
### Contributor Health Assessment
[Natural language paragraph describing:
- Whether contributions are well-distributed
- Risk assessment based on bus factor
- Recommendation for project sustainability]
Generate bars using this pattern:
def generate_bar(percentage):
full_blocks = int(percentage / 5) # Each block = 5%
return '█' * full_blocks
# Example:
# 45% -> █████████ (9 blocks)
# 25% -> █████ (5 blocks)
# 10% -> ██ (2 blocks)
# 3% -> █ (1 block, minimum)
| Issue | Solution |
|---|---|
| No commits found | Report as "No contribution data available" |
| Single contributor | Note as "Solo project" with appropriate messaging |
| API rate limits | Inform user and suggest waiting |