feat: add bootcamp metrics command for standalone codebase metrics#58
Merged
Conversation
`bootcamp health` already exposes the HEALTH.md engine as a standalone, LLM-free command โ but the parallel METRICS.md engine had no equivalent. This closes that gap. `bootcamp metrics <repo-url>` (local path or remote URL) scans the repo and reports the deterministic codebase metrics that power METRICS.md: language breakdown, source/test/doc/config composition, average/median file size, test-to-source ratio, size classification, top-level directory distribution, largest-file hotspots, and an approachability score (0-100 + A-F grade) with human-readable drivers. - Human-readable report by default (language bars, distribution, hotspots) - `--json` for scripting (full CodebaseMetrics payload) - `--check`/`--min-score` CI gate on the approachability score - `--branch`, `--max-files` (routed past root-flag collisions like `health`), `--keep-temp`, `--verbose` Mirrors `health-command.ts` in structure and reuses `computeCodebaseMetrics` verbatim, so the command can never drift from METRICS.md. Tests: 9 unit (DI-mocked: report/JSON/check/local/keep-temp/scan-failure/ resolve-failure), 4 E2E spawning the real CLI (human report, JSON, --check gate both directions, --max-files routing). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
bootcamp metrics <repo-url>command โ the codebase-metrics counterpart tobootcamp health.The project already exposes the
HEALTH.mdengine as a standalone, LLM-freebootcamp healthcommand. The parallelMETRICS.mdengine (computeCodebaseMetrics) had no standalone equivalent โ you could only get those metrics by running a full generation. This closes that asymmetry.What it reports
Scans any repo (local path or remote URL) and reports the deterministic metrics that power
METRICS.md:Flags
--jsonโ fullCodebaseMetricspayload for scripting--check/--min-scoreโ CI gate on the approachability score (exit non-zero when below)--branch,--max-files(routed past root-command flag collisions, same ashealth),--keep-temp,--verboseImplementation
Mirrors
health-command.tsin structure and reusescomputeCodebaseMetricsverbatim, so the command output can never drift fromMETRICS.md. Repo resolution, scanning, cleanup, and the--checkgate all follow the established pattern.Testing
--json,--checkboth directions, custom--max-files, local path,--keep-temp, scan-failure cleanup, resolve-failure.--checkgate (pass + fail), and--max-filesrouting.npm testโ 1115 passing; typecheck + lint + build clean.๐ค Generated with Claude Code