|
1 | 1 | # Git Metrics MCP Server |
2 | 2 |
|
3 | | -MCP server for analyzing git repository metrics and tracking team performance KPIs. Built for Kiro CLI (Amazon Q CLI) and other MCP clients. |
| 3 | +MCP server for analyzing git repository metrics and understanding team health. Built for Kiro CLI (Amazon Q CLI) and other MCP clients. |
4 | 4 |
|
5 | 5 | ## Overview |
6 | 6 |
|
7 | | -This server provides tools to extract meaningful metrics from git repositories, helping teams track productivity, code quality, and collaboration patterns. |
| 7 | +This server provides tools to extract meaningful metrics from git repositories, helping teams understand their development patterns, identify risks early, and have better conversations about code quality and team health. |
| 8 | + |
| 9 | +**This is a mirror, not a microscope.** Use it to reflect on team health and process quality, not to surveil individual behavior. See [INTENT.md](INTENT.md) for our philosophy on responsible metrics usage. |
8 | 10 |
|
9 | 11 | ## Features |
10 | 12 |
|
@@ -419,60 +421,143 @@ Analyze conventional commit usage and release patterns. |
419 | 421 | } |
420 | 422 | ``` |
421 | 423 |
|
| 424 | +## Real-World Use Case: Team Health Analysis |
| 425 | + |
| 426 | +Here's how a real engineering team used this tool to understand their development patterns across 5 repositories with 83 contributors: |
| 427 | + |
| 428 | +### The Challenge |
| 429 | +A team needed to understand their development health across multiple repositories without manually parsing git logs. They wanted to identify risks, improve collaboration, and ensure sustainable work practices. |
| 430 | + |
| 431 | +### What They Discovered |
| 432 | + |
| 433 | +**Team Health Insights:** |
| 434 | +- ✅ Excellent work-life balance: Only 1.3% weekend commits |
| 435 | +- ✅ Strong release discipline: 114 releases with 86.3% conventional commit adoption |
| 436 | +- ⚠️ Bus factor risk: Two developers owned 61% of exclusive files in one repo |
| 437 | +- ⚠️ High fix rate (36.3%) indicated reactive development in one project |
| 438 | + |
| 439 | +**Collaboration Patterns:** |
| 440 | +- Best practice: One repo had 88.9% shared files (excellent knowledge distribution) |
| 441 | +- Needs improvement: Another repo had only 30.5% shared files |
| 442 | +- Identified top collaboration pairs for knowledge sharing |
| 443 | + |
| 444 | +**Code Quality Indicators:** |
| 445 | +- Found complexity hotspots: Files with 66+ changes needing refactoring |
| 446 | +- Identified technical debt: Stale files and high-churn areas |
| 447 | +- Discovered optimal commit patterns: Median 17 lines (focused commits) |
| 448 | + |
| 449 | +### Actions Taken |
| 450 | +1. **Immediate:** Scheduled knowledge transfer sessions for high bus factor areas |
| 451 | +2. **Process:** Implemented pair programming to increase file sharing |
| 452 | +3. **Quality:** Added pre-commit hooks to reduce fix rate |
| 453 | +4. **Culture:** Replicated best practices from high-performing repos |
| 454 | + |
| 455 | +**Time Saved:** What would have taken days of manual analysis was completed in minutes with natural language queries. |
| 456 | + |
| 457 | +**Read the full analysis:** [team-activity-analysis.md](team-activity-analysis.md) |
| 458 | + |
| 459 | +--- |
| 460 | + |
422 | 461 | ## Use Cases |
423 | 462 |
|
424 | | -### Sprint Retrospectives |
| 463 | +### ✅ Good Use Cases |
| 464 | + |
| 465 | +**Sprint Retrospectives** |
425 | 466 | ``` |
426 | 467 | Show me team summary and velocity trends for the last 2 weeks |
427 | 468 | What's our commit pattern? Are we burning out? |
428 | 469 | ``` |
429 | 470 |
|
430 | | -### Performance Reviews |
| 471 | +**Risk Management** |
431 | 472 | ``` |
432 | | -Get author metrics for john@example.com since last quarter |
433 | | -Compare their velocity to team average |
| 473 | +What's our bus factor? Who are single points of failure? |
| 474 | +Show me code ownership - where do we have knowledge concentration? |
434 | 475 | ``` |
435 | 476 |
|
436 | | -### Code Quality Reviews |
| 477 | +**Code Quality Reviews** |
437 | 478 | ``` |
438 | 479 | Show me quality metrics and technical debt |
439 | 480 | What files have high churn and need refactoring? |
440 | 481 | ``` |
441 | 482 |
|
442 | | -### Team Health Checks |
| 483 | +**Team Health Checks** |
443 | 484 | ``` |
444 | | -What's our bus factor? Who are single points of failure? |
| 485 | +Are people committing late at night or on weekends? |
445 | 486 | Show me collaboration metrics - is the team working together? |
446 | 487 | ``` |
447 | 488 |
|
448 | | -### Onboarding Tracking |
| 489 | +**Onboarding Support** |
449 | 490 | ``` |
450 | 491 | Get commit stats for new-dev@example.com since their start date |
451 | 492 | Show their velocity trend over the first 3 months |
452 | 493 | ``` |
453 | 494 |
|
454 | | -## KPIs You Can Track |
| 495 | +### ❌ What This Is NOT For |
| 496 | + |
| 497 | +- ❌ Micromanagement or surveillance |
| 498 | +- ❌ Comparing developers against each other |
| 499 | +- ❌ Performance review ammunition |
| 500 | +- ❌ Daily productivity tracking |
| 501 | + |
| 502 | +**See [INTENT.md](INTENT.md) for our philosophy on responsible metrics usage.** |
455 | 503 |
|
456 | | -- **Velocity**: Commits per developer per week/sprint |
457 | | -- **Code Volume**: Lines added/deleted |
458 | | -- **Activity**: Files changed |
| 504 | +## Team Health Indicators You Can Track |
| 505 | + |
| 506 | +### Risk Management |
| 507 | +- **Bus Factor**: Knowledge concentration risk - who are single points of failure? |
| 508 | +- **Code Ownership**: File sharing patterns - is knowledge distributed? |
| 509 | +- **Technical Debt**: Stale files, complexity hotspots needing attention |
| 510 | + |
| 511 | +### Team Well-being |
| 512 | +- **Burnout Indicators**: Weekend/late-night commits - is the team overworked? |
| 513 | +- **Work Patterns**: When people commit - are boundaries healthy? |
| 514 | +- **Velocity Trends**: Sustainable pace or sprint-and-crash cycles? |
| 515 | + |
| 516 | +### Code Quality |
459 | 517 | - **Churn**: Files changed repeatedly (quality indicator) |
460 | | -- **Contribution Balance**: Even distribution across team |
461 | | -- **Commit Frequency**: Daily/weekly patterns |
462 | | -- **Burnout Indicators**: Weekend/late-night commits |
463 | | -- **Bus Factor**: Knowledge concentration risk |
464 | | -- **Collaboration**: Team interaction frequency |
465 | | -- **Quality**: Commit size, revert rate, fix rate |
466 | | -- **Technical Debt**: Stale files, large files, complexity |
| 518 | +- **Commit Size**: Focused commits vs. large dumps |
| 519 | +- **Revert Rate**: How often do we undo work? |
| 520 | +- **Fix Rate**: Reactive (high fixes) vs. proactive development |
| 521 | + |
| 522 | +### Collaboration Health |
| 523 | +- **File Sharing**: How much code is touched by multiple people? |
| 524 | +- **Collaboration Pairs**: Who works together most often? |
| 525 | +- **Contribution Balance**: Even distribution or bottlenecks? |
| 526 | + |
| 527 | +### Process Maturity |
| 528 | +- **Conventional Commits**: Adoption rate of commit standards |
| 529 | +- **Release Frequency**: How often do we ship? |
| 530 | +- **Breaking Changes**: How disruptive are our releases? |
| 531 | + |
| 532 | +## Tips for Responsible Usage |
467 | 533 |
|
468 | | -## Tips for Best Results |
| 534 | +### How to Use This Tool Well |
469 | 535 |
|
470 | 536 | 1. **Use natural language**: Kiro understands context, so ask questions naturally |
471 | | -2. **Combine metrics**: Ask for multiple analyses in one query |
472 | | -3. **Compare periods**: Track trends over time |
473 | | -4. **Be specific with dates**: Use "since 2025-11-01" or "last month" |
474 | | -5. **Filter by author**: Focus on individual or team performance |
475 | | -6. **Regular reviews**: Run weekly/monthly to track trends |
| 537 | +2. **Focus on trends, not snapshots**: Weekly/monthly patterns matter more than daily counts |
| 538 | +3. **Combine metrics**: Ask for multiple analyses to get the full picture |
| 539 | +4. **Start conversations, don't end them**: Use data to ask "why?" not to judge |
| 540 | +5. **Look for patterns**: Team health indicators, not individual performance scores |
| 541 | +6. **Regular reviews**: Weekly health checks (5 min), sprint retrospectives (15 min), monthly trends (30 min) |
| 542 | + |
| 543 | +### Red Flags (Don't Do This) |
| 544 | + |
| 545 | +- ❌ Checking metrics more than once per day |
| 546 | +- ❌ Creating leaderboards or rankings |
| 547 | +- ❌ Setting commit quotas or targets |
| 548 | +- ❌ Using metrics in performance reviews without context |
| 549 | +- ❌ Comparing developers directly |
| 550 | + |
| 551 | +### Green Flags (Good Usage) |
| 552 | + |
| 553 | +- ✅ You check trends weekly/monthly, not daily |
| 554 | +- ✅ You ask "what does this tell us about our process?" |
| 555 | +- ✅ You use it to start conversations, not end them |
| 556 | +- ✅ You focus on team health, not individual performance |
| 557 | +- ✅ You look for patterns, not outliers |
| 558 | +- ✅ You use it to help, not judge |
| 559 | + |
| 560 | +**Remember:** The best teams are built on trust, not metrics. Use this tool to support your team, not surveil them. |
476 | 561 |
|
477 | 562 | ## Development |
478 | 563 |
|
|
0 commit comments