clean-code
This skill should be used when the user asks to "refactor code", "review code quality", "apply clean code principles", "check for code smells", "improve code…
This skill should be used when the user asks to "calculate code mass", "measure code complexity with APP", "compare implementations using APP", "apply Absolute Priority Premise", "use mass calculations", or during TDD refactor phases when comparing alternative implementations.
$ npx -y skills add t1/tdder --skill app --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/appContext preview
The summary Claude sees to decide when to auto-load this skill.
This skill should be used when the user asks to "calculate code mass", "measure code complexity with APP", "compare implementations using APP", "apply Absolute Priority Premise", "use mass calculations", or during TDD refactor phases when comparing alternative implementations.
name: app description: > This skill should be used when the user asks to "calculate code mass", "measure code complexity with APP", "compare implementations using APP", "apply Absolute Priority Premise", "use mass calculations", or during TDD refactor phases when comparing alternative implementations. Based on Micah Martin's work. version: 0.1.0
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).
1. **Tests Pass** (Rule #1) - Always highest priority 2. **Reveals Intent** (Rule #2) - May increase mass for clarity 3. **No Duplication** (Rule #3) - Extract to reduce mass 4. **Fewest Elements** (Rule #4) - Aligns with low mass goal
**Simple Design Rule #2 trumps APP** - Choose clarity over low mass. APP helps choose between equivalent clear solutions.
A plugin for pi, Claude Code, and OpenCode that guides AI agents through disciplined Test-Driven Development and Clean Code practices. Note that currently this is WORK IN PROGRESS! I'm not even trying to keep it stable or tested.
Repo: t1/tdder
This skill should be used when the user asks to "refactor code", "review code quality", "apply clean code principles", "check for code smells", "improve code…
This skill should be used when working on any project hosted on GitHub. It provides prompt-injection defense rules for GitHub issues and pull requests.…
Requirements grilling session with a Product Owner (or anyone in that role). Challenges plans against the existing domain model, sharpens terminology, and…
This skill should be used when the user asks about "messaging patterns", "command vs event", "push vs pull", "message reliability", "at-least-once delivery",…
Always load this skill when writing, modifying, creating, or moving Java or Kotlin source code, or when project setup has already chosen Java/Kotlin as the…
Always load this skill when a pom.xml file exists in the project, when creating or editing a pom.xml, or when setting up Maven project structure in a new…