code-priority

Apply the State > Coupling > Complexity > Code priority framework to design decisions.

26|Updated Feb 5, 2022
One-click install
npx skills add https://github.com/atusy/dotfiles --skill code-priority-atusy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-priority
Source: https://github.com/atusy/dotfiles/tree/main/dot_claude/skills/code-priority
Command: npx skills add https://github.com/atusy/dotfiles --skill code-priority-atusy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guide design decisions using the State > Coupling > Complexity > Code priority framework. Use when evaluating tradeoffs, reviewing design choices, deciding between implementations, or when code volume seems prioritised over deeper concerns.

Core Features & Use Cases

  • Priority Hierarchy: State > Coupling > Complexity > Code, with clear rationale for why each level matters.
  • Core Principle: "It's okay to increase coupling if it makes your code more stateless."
  • Decision Framework: A stepwise guide to compare options on state, coupling, complexity, and finally code volume.
  • Practical Examples: Scenarios showing tradeoffs between maintaining state, reducing dependencies, and simplifying logic.
  • Integration: Complementary with Tidy First, TDD, and targeted refactoring practices.

Quick Start

Apply the code optimization priority framework by sacrificing lower priorities to improve higher ones.

Frequently Asked Questions about code-priority

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

FAQPage Schema
How do I prioritize software architecture decisions when reducing code complexity?

To prioritize architecture decisions, apply the State > Coupling > Complexity > Code framework, evaluating design options stepwise by statelessness, dependencies, and simplicity before considering code volume. This ensures higher-priority structural concerns guide refactoring over mere code reduction.

What is the state > coupling > complexity > code priority framework for refactoring?

The state > coupling > complexity > code framework is a decision hierarchy for refactoring that prioritizes minimizing state, then reducing coupling, then managing complexity, and finally shrinking code volume. It permits tradeoffs, allowing increased coupling if it achieves greater statelessness.

When should I increase coupling to improve state management in my code?

You should increase coupling to improve state management when it makes your code more stateless. The core principle of this design priority framework explicitly accepts trading lower-priority coupling concerns for higher-priority state reduction during architecture reviews.

Does the code-priority framework work with TDD and targeted refactoring practices?

Yes, the code-priority framework integrates directly with TDD, Tidy First, and targeted refactoring practices. It complements these workflows by providing an explicit priority hierarchy to evaluate design tradeoffs during test-driven development cycles.

What is the best way to evaluate design tradeoffs between dependencies and simplicity?

The best way to evaluate tradeoffs between dependencies and simplicity is using a stepwise decision framework comparing options on state, coupling, complexity, and code volume. This hierarchy consistently favors reducing dependencies and simplifying logic over minimizing code size.