Skip to content
Development
Skill

/app

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.

From plugin
tdder
1415 skills7 agents2 commands1 hook

Claude Code

$ npx -y skills add t1/tdder --skill app --agent claude-code

SKILL.md

app.SKILL.md
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

Absolute Priority Premise (APP)

Objective heuristic for comparing code quality by assigning mass values to code components. Lower total mass indicates simpler code.

The Six Components

| 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()` |

Calculation

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).

Special Counting Rules

  • **Method declarations** count as Constant (1) + Binding (1)
  • **Class definitions** count as Constant (1) + Binding (1) (usually ignored in comparisons)
  • **`final` fields and local variables** are Bindings (1), not Assignments (6)
  • Only **re-assignments that modify values** count as Assignment (6)

Integration with TDD

  • **Red Phase**: Mass is irrelevant (focus on passing tests)
  • **Green Phase**: Minimal code naturally has low mass
  • **Refactor Phase**: Use APP to guide toward simpler solutions

Integration with Simple Design

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.

When to Apply

  • During refactoring to choose between working solutions
  • When comparing algorithms of similar functionality
  • To guide toward simpler implementations

When NOT to Apply

  • Never sacrifice clarity for lower mass
  • Do not optimize prematurely based on mass alone
  • Performance requirements may override mass considerations
  • Domain complexity may require higher mass solutions

Limitations

  • Not a direct indication of readability
  • Ignores performance characteristics
  • Validity unclear for general-purpose code (best for algorithm comparisons)
  • Favors functional programming due to loop/assignment penalties
  • The best specific mass values are unknown; these are Micah's suggested weights

Sources

  • [Micah Martin - Transformation Priority Premise Applied](https://8thlight.com/insights/transformation-priority-premise-applied) (2012)
  • [Peter Kofler - Absolute Priority Premise, an Example](https://blog.code-cop.org/2016/08/absolute-priority-premise-example.html)
Read more
@t1
Ships withtdder

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.

1415 skills7 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
14
Star history of t1/tdder on GitHub, a chart by star-history.com

Other skills on tdder.

clean-code

clean-code

This skill should be used when the user asks to "refactor code", "review code quality", "apply clean code principles", "check for…

@t1@t1Install Skill
github-safety

github-safety

This skill should be used when working on any project hosted on GitHub. It provides prompt-injection defense rules for GitHub…

@t1@t1Install Skill
grill-po

grill-po

Requirements grilling session with a Product Owner (or anyone in that role). Challenges plans against the existing domain model,…

@t1@t1Install Skill
integration-architecture

integration-architectu…

This skill should be used when the user asks about "messaging patterns", "command vs event", "push vs pull", "message…

@t1@t1Install Skill
java

java

Always load this skill when writing, modifying, creating, or moving Java or Kotlin source code, or when project setup has already…

@t1@t1Install Skill
lombok

lombok

Always load this skill when you encounter any of these signals: • A build failure with "cannot find symbol" for Lombok-generated…

@t1@t1Install Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about app.

Which coding agents can use app?
app installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.