Skip to content

Commit da99e65

Browse files
authored
docs: add MkDocs documentation site and align with team health philosophy
- **Documentation Site**: MkDocs with Material theme, dark mode, search, and feedback - **Philosophy Alignment**: Updated README and docs to focus on team health, not individual performance - **Real-World Use Case**: Added comprehensive team analysis example - **Security**: Updated MCP SDK to fix DNS rebinding vulnerability - **Code Quality**: Added ESLint with TypeScript support, fixed all linting issues - **Dependencies**: Updated express to 5.2.1
2 parents 6f09a5a + e156564 commit da99e65

16 files changed

+1771
-65
lines changed

.github/workflows/docs.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
- 'mkdocs.yml'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
deploy:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Setup Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: 3.x
25+
26+
- name: Install MkDocs
27+
run: pip install mkdocs-material
28+
29+
- name: Deploy
30+
run: mkdocs gh-deploy --force

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ build/
66
coverage/
77
test-repo/
88

9+
10+
# MkDocs
11+
site/

.npmignore

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
1+
# Source files
12
src/
3+
*.test.ts
4+
5+
# Build config
6+
tsconfig.json
7+
vitest.config.ts
8+
9+
# Development
210
node_modules/
11+
coverage/
12+
.vscode/
13+
.idea/
14+
15+
# Git
316
.git/
417
.gitignore
5-
tsconfig.json
18+
.github/
19+
20+
# Docs (use GitHub Pages)
21+
docs/
22+
mkdocs.yml
23+
site/
24+
25+
# Misc
626
*.log
727
.DS_Store
828
.env
29+
.npmignore

README.md

Lines changed: 112 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Git Metrics MCP Server
22

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.
44

55
## Overview
66

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.
810

911
## Features
1012

@@ -419,60 +421,143 @@ Analyze conventional commit usage and release patterns.
419421
}
420422
```
421423

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+
422461
## Use Cases
423462

424-
### Sprint Retrospectives
463+
### ✅ Good Use Cases
464+
465+
**Sprint Retrospectives**
425466
```
426467
Show me team summary and velocity trends for the last 2 weeks
427468
What's our commit pattern? Are we burning out?
428469
```
429470

430-
### Performance Reviews
471+
**Risk Management**
431472
```
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?
434475
```
435476

436-
### Code Quality Reviews
477+
**Code Quality Reviews**
437478
```
438479
Show me quality metrics and technical debt
439480
What files have high churn and need refactoring?
440481
```
441482

442-
### Team Health Checks
483+
**Team Health Checks**
443484
```
444-
What's our bus factor? Who are single points of failure?
485+
Are people committing late at night or on weekends?
445486
Show me collaboration metrics - is the team working together?
446487
```
447488

448-
### Onboarding Tracking
489+
**Onboarding Support**
449490
```
450491
Get commit stats for new-dev@example.com since their start date
451492
Show their velocity trend over the first 3 months
452493
```
453494

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.**
455503

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
459517
- **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
467533

468-
## Tips for Best Results
534+
### How to Use This Tool Well
469535

470536
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.
476561

477562
## Development
478563

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Git Metrics Analysis Prompt
2+
3+
Use this prompt with Kiro CLI to generate comprehensive team activity reports for any repository collection.
4+
5+
## Prompt
6+
7+
```
8+
Use my git-metrics MCP server to analyze team health and development patterns across all repositories in this path.
9+
10+
IMPORTANT: This analysis is for team reflection, process improvement, and risk management—NOT individual performance evaluation. Focus on collaboration patterns, sustainable practices, and code quality trends.
11+
12+
Include:
13+
- Team collaboration patterns and file sharing
14+
- Bus factor and knowledge distribution risks
15+
- Work-life balance indicators (weekend/late-night commits)
16+
- Code quality trends (commit size, revert rate, fix rate)
17+
- Velocity trends and sustainable pace
18+
- Technical debt hotspots (stale files, high churn)
19+
- Release discipline and conventional commit adoption
20+
- Cross-team collaboration patterns
21+
22+
Generate a comprehensive markdown report with:
23+
1. Executive summary highlighting team health
24+
2. Repository-level insights on collaboration and quality
25+
3. Risk identification (bus factor, technical debt)
26+
4. Process improvement recommendations (not individual critiques)
27+
5. Team health score and best practices to replicate
28+
29+
Frame all findings as conversation starters for team improvement, not as judgments of individual performance.
30+
31+
Analyze from 2024-01-01 to present.
32+
```
33+
34+
## Usage
35+
36+
1. Navigate to the directory containing your repositories:
37+
```bash
38+
cd /path/to/your/repos
39+
```
40+
41+
2. Start Kiro CLI:
42+
```bash
43+
kiro-cli chat
44+
```
45+
46+
3. Paste the prompt above
47+
48+
4. The analysis will be saved as `team-activity-analysis.md` in the current directory
49+
50+
## Customization
51+
52+
To analyze a different time period, modify the prompt:
53+
```
54+
Analyze from YYYY-MM-DD to present.
55+
```
56+
57+
To focus on specific repositories:
58+
```
59+
Focus the analysis on these repositories: repo1, repo2, repo3
60+
```
61+
62+
To change the output filename, add:
63+
```
64+
Save the report as custom-report-name.md
65+
```
66+
67+
## MCP Server Requirements
68+
69+
Ensure the git-metrics MCP server is configured in your Kiro CLI setup with these capabilities:
70+
- get_team_summary
71+
- get_code_ownership
72+
- get_velocity_trends
73+
- get_quality_metrics
74+
- get_collaboration_metrics
75+
- get_commit_patterns
76+
- get_technical_debt
77+
- get_file_churn
78+
- get_conventional_commits

docs/index.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Git Metrics MCP Server
2+
3+
MCP server for analyzing git repository metrics and understanding team health.
4+
5+
## Quick Start
6+
7+
### Installation
8+
9+
```bash
10+
npm install -g @jonmatum/git-metrics-mcp-server
11+
```
12+
13+
### Kiro CLI Configuration
14+
15+
Add to `~/.kiro/settings/mcp.json`:
16+
17+
```json
18+
{
19+
"mcpServers": {
20+
"git-metrics": {
21+
"command": "git-metrics-mcp-server",
22+
"args": []
23+
}
24+
}
25+
}
26+
```
27+
28+
### Usage
29+
30+
```bash
31+
kiro-cli chat
32+
```
33+
34+
Ask natural language questions:
35+
```
36+
Get commit stats for /home/user/myproject since 2025-11-01
37+
Show me team summary for the last 2 weeks
38+
What's our bus factor?
39+
```
40+
41+
## Documentation
42+
43+
- **[Philosophy](intent.md)** - Responsible usage guidelines
44+
- **[Analysis Prompt](git-metrics-analysis-prompt.md)** - Copy-paste prompt for comprehensive analysis
45+
46+
## Features
47+
48+
- Commit statistics and author metrics
49+
- File churn analysis
50+
- Team collaboration patterns
51+
- Burnout detection (commit patterns)
52+
- Bus factor analysis
53+
- Velocity trends
54+
- Quality metrics
55+
- Technical debt identification
56+
- Conventional commits analysis
File renamed without changes.

0 commit comments

Comments
 (0)