maintainability-scan

Grades codebase maintainability across five sub-characteristics using Sokrates metrics and scanner findings.

3|1|Updated Aug 26, 2026
One-click install
npx skills add https://github.com/zeljkoobrenovic/sokrates-skills --skill maintainability-scan-zeljkoobrenovic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: maintainability-scan
Source: https://github.com/zeljkoobrenovic/sokrates-skills/tree/main/skills/scanners/maintainability-scan
Command: npx skills add https://github.com/zeljkoobrenovic/sokrates-skills --skill maintainability-scan-zeljkoobrenovic

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Sokrates produces raw numbers — size, complexity, duplication, coupling, churn, ownership — but numbers alone do not answer whether a codebase is easy to change. This Skill turns those metrics plus sibling scanner findings into graded, evidenced judgements of maintainability per component and per sub-characteristic. ## Core Features & Use Cases - Five-dimension grading: Assigns strong/adequate/weak/poor grades for modularity, reusability, analysability, modifiability, and testability, at system level and per major component, using indicative bands so runs agree. - Deterministic roll-up script: compute_maintainability.py derives cross-component duplication, temporal co-change, fan-in/fan-out, cycles, single-ownership share, stale files, doc-comment coverage, and fix-vs-feature commit mix from an unzipped Sokrates data export, with full provenance. - Typical-change tracing: Ranks cross-component co-change pairs as reading leads, then traces two realistic changes end to end to ground the grades in concrete evidence. - Use Case: After running a Sokrates analysis on a legacy monorepo, ask for a maintainability assessment to learn which component costs the most maintenance effort, whether shared utilities are trapped or reusable, and where duplication or single ownership makes changes expensive. ## Quick Start Run a maintainability scan on the _sokrates analysis of this repository and report the five grades with the costliest component.

Frequently Asked Questions about maintainability-scan

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

FAQPage Schema
How do I assess codebase maintainability with Sokrates?

Run a Sokrates analysis on the repository, then invoke the maintainability scan. It rolls up size, complexity, duplication, coupling, churn, and ownership metrics into graded verdicts for modularity, reusability, analysability, modifiability, and testability.

What maintainability metrics does the scan compute?

The script computes high-risk file LOC share, high-complexity unit share, cross-component duplicated lines, temporal co-change pairs, component fan-in/fan-out and cycles, single-owner file share, stale file share, doc-comment coverage, and fix-vs-feature commit mix.

Does the maintainability scan require other scanners to run first?

It requires a completed _sokrates analysis and works standalone, but it is strongest after architecture, testing, risk-synthesis, domain-language, and evolution scans have run, since it references their findings as evidence anchors.

What happens when Sokrates has no dependency data for my language?

The script reports the gap explicitly, for example when Sokrates extracts no dependencies for Rust. The scan then falls back to architecture-scan's manifest-derived counts by reference and lowers confidence to likely for those drivers.

How are maintainability grades assigned per component?

Each sub-characteristic gets strong, adequate, weak, or poor using indicative bands on its drivers, such as cross-component co-change share or duplicated line share. Components with no commits in 90 days are graded dormant for modifiability and testability.