🧩 Background
Current badge focuses on contribution grid + streak style output. Some users want a compact monthly summary view for clean READMEs.
🎯 Objective
Add a new badge mode that displays current month contribution totals and month-over-month delta.
💡 Example usage
/api/streak?user=octocat&view=monthly
📁 Files to check
app/api/streak/route.ts
lib/svg/generator.ts
types/index.ts
README.md
lib/svg/generator.test.ts
🛠️ Implementation steps
- Parse optional
view query param in route.
- Support values:
default (existing behavior)
monthly (new)
- In monthly mode:
- compute current month total from contribution days.
- compute previous month total.
- show delta (+12%, -8%, etc.) or absolute diff if preferred.
- Render compact SVG layout for monthly mode (smaller and text-focused).
- Keep theme/color parameters compatible with both views.
- Add tests for mode routing + snapshot tests for monthly SVG.
- Add docs section with examples.
✅ Definition of done
🧩 Background
Current badge focuses on contribution grid + streak style output. Some users want a compact monthly summary view for clean READMEs.
🎯 Objective
Add a new badge mode that displays current month contribution totals and month-over-month delta.
💡 Example usage
/api/streak?user=octocat&view=monthly📁 Files to check
app/api/streak/route.tslib/svg/generator.tstypes/index.tsREADME.mdlib/svg/generator.test.ts🛠️ Implementation steps
viewquery param in route.default(existing behavior)monthly(new)✅ Definition of done
view=monthlyrenders a valid SVG summary.defaultmode remains unchanged.