clean-code-change

Guides contract clarification, safe refactoring, and debt triage for code changes.

1|1|Updated Jul 6, 2026
One-click install
npx skills add https://github.com/gabesan21/project-of-projects --skill clean-code-change-gabesan21
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clean-code-change
Source: https://github.com/gabesan21/project-of-projects/tree/main/.agents/skills/clean-code-change
Command: npx skills add https://github.com/gabesan21/project-of-projects --skill clean-code-change-gabesan21

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code changes often ship with unclear contracts, tangled diffs, and accumulating technical debt because developers skip clarification, mix refactoring with features, or ignore linter warnings. This Skill provides a disciplined workflow for anyone writing code so every change is understandable, testable, and reviewable. ## Core Features & Use Cases - Clarify before coding: Define inputs, outputs, invariants, and error cases, then locate the existing contract and pick the smallest change point with a failing-then-passing test. - Safe refactoring: Characterize current behavior with tests, apply one small transformation at a time, and keep broad refactoring in a separate change from the feature. - Debt triage: Run the project's formatter, linter, and tests declared in AGENTS.md, distinguish mechanical warnings from real risks, and convert larger debt into trackable items. - Use Case: While executing a kanban task in a PoP-managed repository, apply this Skill to write a behavior description, produce a test that fails before and passes after the change, and deliver a diff with a single intention. ## Quick Start Apply the clean-code-change skill to plan and implement my next code change with a clear contract, a protecting test, and a single-intention diff.

Frequently Asked Questions about clean-code-change

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

FAQPage Schema
How do I refactor code safely without breaking behavior?▼

Characterize current behavior with tests or executable examples first, then apply one small transformation at a time such as rename, extract, or move. Compile, run relevant tests, and review the diff at every step, stopping when the goal is met.

How to clarify requirements before writing code?▼

State the change's input, output, invariants, error cases, and external effects, then locate the existing contract in an API, type, test, or representative call. Choose the smallest change point that preserves that contract and write a test that fails before and passes after.

When should I refactor versus fix technical debt later?▼

Fix what is local and safe within the current task, and convert larger debt into a trackable item with context, impact, and next step. Broad refactoring belongs in a separate change from the feature, except for obvious local cleanup.

Does this skill enforce line limits or SOLID rules?▼

No. It never imposes numeric limits on lines, parameters, or nesting, and does not mandate SOLID or OO patterns. Cohesion and domain decide structure, and verification commands come from the project's AGENTS.md.

When should duplicated code be abstracted?▼

Unify duplication only when the rule and the rate of change are the same, since premature abstraction mixes distinct cases and costs more than repetition. An abstraction is valuable when it simplifies a real variation, not a guessed one.