From tdder
Calculates code mass using Absolute Priority Premise (APP) to compare code quality objectively. Useful during TDD refactoring to guide toward simpler implementations.
How this skill is triggered — by the user, by Claude, or both
Slash command
/tdder:appThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Objective heuristic for comparing code quality by assigning mass values to code components.
Objective heuristic for comparing code quality by assigning mass values to code components. Lower total mass indicates simpler code.
| Component | Mass | Examples |
|---|---|---|
| Constant | 1 | 5, "hello", true, [] |
| Binding | 1 | amount, userName, result |
| Invocation | 2 | calculate(), Math.max(a, b) |
| Conditional | 4 | if, switch, case, ?: |
| Loop | 5 | while, for, forEach, map |
| Assignment | 6 | x = 5, count++, list.add() |
Total Mass = (constants x 1) + (bindings x 1) + (invocations x 2)
+ (conditionals x 4) + (loops x 5) + (assignments x 6)
Lower mass = Better code (all else being equal).
final fields and local variables are Bindings (1), not Assignments (6)Simple Design Rule #2 trumps APP - Choose clarity over low mass. APP helps choose between equivalent clear solutions.
npx claudepluginhub t1/tdder --plugin tdderAnalyzes code structure, complexity, and quality using cyclomatic and cognitive complexity metrics, detects code smells like long methods and god objects, and suggests refactoring strategies.
Measuring and reducing cyclomatic complexity and cognitive complexity to improve maintainability.
Enforces SOLID principles, TDD (red-green-refactor), and clean code practices to elevate code quality. Activates during coding, refactoring, architecture, code review, and debugging.