record-quality-baseline

Record code quality metrics before refactoring into a timestamped JSON baseline.

7|3|Updated Oct 23, 2025
One-click install
npx skills add https://github.com/BerryKuipers/claude-code-toolkit --skill record-quality-baseline
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: record-quality-baseline
Source: https://github.com/BerryKuipers/claude-code-toolkit/tree/main/.claude/skills/quality/record-quality-baseline
Command: npx skills add https://github.com/BerryKuipers/claude-code-toolkit --skill record-quality-baseline

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires npm, tsc, jq, grep, sed, bc.

What problem does it solve?

Without a clear baseline, it's impossible to objectively measure the impact of refactoring or major code changes on overall quality. This Skill captures a snapshot of key metrics before any modifications are made.

Core Features & Use Cases

  • Comprehensive Metric Capture: Runs tests with coverage, extracts coverage metrics, executes code quality audits, checks TypeScript errors, and optionally analyzes code complexity.
  • Persistent Baseline: Saves all captured metrics to a JSON file (.claude/baseline/quality-baseline.json) for easy comparison after changes.
  • Pre-Refactor Validation: Ensures that the codebase is in a stable state (e.g., all tests passing) before allowing refactoring to begin.
  • Use Case: Before embarking on a major refactoring effort, use this Skill to establish a quality baseline, then compare against it post-refactor to prove improvements or prevent regressions.

Quick Start

Record the current quality baseline for your project

This will run npm test --coverage, npm run audit:code, tsc --noEmit

and save results to .claude/baseline/quality-baseline.json.

record-quality-baseline

Output:

{

"status": "success",

"baseline": {

"tests": {"status": "passing", "total": 45},

"coverage": {"overall": 87.5},

"audit": {"score": 7.5},

"typescript": {"errors": 0}

},

"canProceed": true

}

Frequently Asked Questions about record-quality-baseline

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I capture code quality metrics before refactoring?

Record quality metrics baseline by running this Skill to execute tests with coverage, code audits, and TypeScript checks, saving results to a JSON file for before/after comparison. This ensures you have objective data to measure refactoring impact.

What metrics does code quality baselining capture?

Baselining captures test status and count, code coverage percentage, audit scores, TypeScript error counts, and optional complexity analysis. All metrics are saved with a timestamp for tracking changes across refactoring cycles.

Can I use baseline metrics to prevent regressions during refactoring?

Yes, baseline metrics establish a quality threshold before changes. After refactoring, you compare new metrics against the baseline to verify improvements or catch regressions in coverage, test results, and code quality scores.

What dependencies do I need to record quality baselines?

You need npm, TypeScript compiler (tsc), jq for JSON processing, grep and sed for text extraction, and bc for numeric calculations. These tools execute tests, audits, type checks, and metric extraction.

When should I capture a quality baseline in my workflow?

Capture a baseline immediately before major refactoring, technical debt reduction, or code restructuring. This ensures all tests pass and metrics are stable, establishing a valid checkpoint for measuring the changes' impact.

Does baselining work with existing npm test and audit scripts?

Yes, baselining integrates with your existing npm test --coverage and npm run audit:code commands. It extracts metrics from your current tooling without requiring additional setup or custom scripts.