Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

maintainable

A Claude Code skill that enforces single-responsibility, LOC limits, and decomposition standards across your codebase. Keeps functions small, components focused, and files manageable.

What it does

  • Enforces LOC thresholds across functions, components, and files
  • Detects SRP violations using heuristics (name test, change test, reuse test)
  • Framework-aware decomposition — understands React, Vue, Svelte, Angular, Node, Python, Go
  • Generates docs/architecture.md — a living map of how your codebase connects, updated on every run
  • Integrates with /prepush-check — catches maintainability issues before code leaves your machine

Thresholds

Scope Green (Good) Yellow (Watch) Red (Refactor)
Function < 20 LOC 20–100 LOC > 100 LOC
Component < 200 LOC 200–500 LOC > 500–600 LOC
File < 400 LOC 400–1000 LOC > 1000–2000 LOC

Installation

Copy the SKILL.md file into your Claude Code skills directory:

mkdir -p ~/.claude/skills/maintainable
cp SKILL.md ~/.claude/skills/maintainable/SKILL.md

Usage

Standalone

/maintainable src/components/Dashboard.tsx

Analyzes the target, reports violations, suggests decomposition, and offers to refactor.

Within prepush-check

Automatically runs as part of /prepush-check on changed files. Red violations block the push, Yellow violations produce warnings.

Modes

Mode Scope Behavior
Standalone Whatever you point it at Full analysis + refactor offer + architecture update
Prepush-check Changed/new files only Report violations, flag connections, update architecture

Architecture Map

On every run, the skill generates or updates docs/architecture.md in your project root. This file maps:

  • Directory structure and purpose
  • Module responsibilities (one line per component/function)
  • Dependency graph between features
  • Decomposition log (what was split and when)

This map is designed for both humans and AI agents to quickly understand how the codebase connects.

Single Responsibility Heuristics

  1. Name test — Can't name it without "and"/"or"? It does too much.
  2. Change test — Would change for more than one reason? Multiple responsibilities.
  3. Reuse test — Need to copy-paste part of it? That part should be extracted.
  4. Test test — Mocking 3+ dependencies? Doing too much.
  5. Scroll test — Can't see it all on one screen? Consider splitting.

License

MIT

About

Claude Code skill that enforces single-responsibility, LOC limits, and decomposition standards. Keeps functions small, components focused, and files manageable.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors