Summary
Add a status-badge generator: an SVG badge (total debt and/or trend arrow) teams can embed in a README, plus a shields.io-compatible JSON endpoint artifact.
Motivation
A visible badge is a cheap, high-impact adoption driver — it keeps maintainability debt in front of contributors on the repo landing page. DebtLens already produces all the numbers; it just needs a small badge reporter.
Proposed behavior
debtlens scan --format badge (or debtlens badge) writes:
debtlens-badge.svg — a self-contained SVG showing e.g. "debt: 142" with severity-based color, and (when history data exists) a trend arrow.
debtlens-badge.json — a shields.io endpoint schema ({ schemaVersion, label, message, color }) so users can render via https://img.shields.io/endpoint?url=....
- Color thresholds configurable (green/yellow/red by total or by high-severity count).
Implementation surface
- New
src/reporters/badgeReporter.ts (pure string SVG + JSON; no new dependency).
- Wire format/command into
src/cli/commands/scan.ts (or a tiny src/cli/commands/badge.ts) and src/reporters/index.ts.
- Optional trend arrow reads
.debtlens/history.jsonl if the history feature is present.
- Tests: SVG/JSON snapshot, color thresholds, shields endpoint schema validity.
Acceptance criteria
Difficulty: small.
Summary
Add a status-badge generator: an SVG badge (total debt and/or trend arrow) teams can embed in a README, plus a shields.io-compatible JSON endpoint artifact.
Motivation
A visible badge is a cheap, high-impact adoption driver — it keeps maintainability debt in front of contributors on the repo landing page. DebtLens already produces all the numbers; it just needs a small badge reporter.
Proposed behavior
debtlens scan --format badge(ordebtlens badge) writes:debtlens-badge.svg— a self-contained SVG showing e.g. "debt: 142" with severity-based color, and (whenhistorydata exists) a trend arrow.debtlens-badge.json— a shields.ioendpointschema ({ schemaVersion, label, message, color }) so users can render viahttps://img.shields.io/endpoint?url=....Implementation surface
src/reporters/badgeReporter.ts(pure string SVG + JSON; no new dependency).src/cli/commands/scan.ts(or a tinysrc/cli/commands/badge.ts) andsrc/reporters/index.ts..debtlens/history.jsonlif the history feature is present.Acceptance criteria
npm run test:allpasses.Difficulty: small.