051-design-two-steps-methods

$npx mdskill add jabrena/plinth/051-design-two-steps-methods

Splits risky code changes into preparatory refactoring then behavior change.

  • Guides developers through complex or risky code changes safely.
  • Depends on Java development environment and Plinth Toolkit.
  • Identifies design obstacles before proposing preparatory refactoring.
  • Delivers two-step sequence with validation after each step.

SKILL.md

.github/skills/051-design-two-steps-methodsView on GitHub ↗
---
name: 051-design-two-steps-methods
description: Use when a complex or risky code change should be split into Kent Beck's two-step method by first making the change easy through behavior-preserving preparatory refactoring, then making the intended behavior change once the design supports it. This should trigger for requests such as Apply two-step change; Make this risky change safer; Refactor before changing behavior; Separate preparation from behavior change. Part of Plinth Toolkit
license: Apache-2.0
metadata:
  author: Juan Antonio Breña Moral
  version: 0.17.0
---
# Two-Step Change Method

Guide Java developers through complex or risky changes by keeping design preparation separate from behavior modification. **This is an interactive SKILL**.

**What is covered in this Skill?**

- Clarifying the intended behavior change before editing
- Identifying design obstacles that make the change difficult or risky
- Step 1: behavior-preserving preparatory refactoring that makes the change easy
- Validation that Step 1 preserves existing behavior
- Step 2: the smallest intended behavior change after the design supports it
- Verification that Step 2 delivers the intended behavior
- Handoff to focused Java, framework, persistence, messaging, API, or testing skills while preserving the two-step sequence

## Constraints

Separate behavior-preserving preparation from behavior-changing work, and validate after each step.

- **MUST**: State the intended behavior change before proposing preparatory refactoring
- **MUST**: Keep Step 1 behavior-preserving; do not mix broad refactoring with the intended behavior change
- **MUST**: Verify existing behavior after Step 1 using the project-appropriate tests, build, characterization tests, or manual checks
- **MUST**: Make Step 2 only after the design has been prepared and validated
- **MUST**: Verify the intended behavior after Step 2 with focused tests and relevant build checks
- **MUST**: Record assumptions and risks when preparation cannot be fully separated from behavior change

## When to use this skill

- Apply two-step change
- Make this risky change safer
- Refactor before changing behavior
- Separate preparation from behavior change
- Make the change easy, then make the easy change

## Workflow

1. **Define the intended change**

Read `references/051-design-two-steps-methods.md`, inspect the relevant code and tests, and state the exact behavior or capability that must change. Identify why the current design makes the change complex, risky, or hard to verify.

2. **Plan preparatory refactoring**

Choose the smallest behavior-preserving refactoring that reduces the obstacle: extract method or class, clarify names, isolate dependencies, add seams for testing, move responsibilities, improve types, or add characterization tests before touching behavior.

3. **Make the change easy**

Apply Step 1 as focused preparatory refactoring only. Keep commits, notes, or task boundaries clear enough that reviewers can see no intended behavior change is included.

4. **Validate preserved behavior**

Run the relevant existing tests, build checks, characterization tests, or manual verification. If behavior changes unexpectedly, fix or revert the preparation before proceeding.

5. **Make the easy behavior change**

Apply the smallest intended behavior change now that the design supports it. Use focused Java, framework, persistence, messaging, API, or testing skills when detailed implementation guidance is needed.

6. **Verify and report the outcome**

Verify the intended behavior with targeted tests and relevant project validation. Report what was preparation, what changed behavior, what was verified after each step, and any remaining risks.

## Reference

For detailed guidance, examples, and constraints, see [references/051-design-two-steps-methods.md](references/051-design-two-steps-methods.md).

More from jabrena/plinth

SkillDescription
001-commands-inventoryUse when you need to generate a checklist document with embedded commands inventory, following the embedded template exactly and producing INVENTORY-COMMANDS-JAVA.md in the project root. This should trigger for requests such as Create embedded commands inventory checklist; Generate INVENTORY-COMMANDS-JAVA.md; Use @001-commands-inventory; Inventory embedded Java project commands; List command files bundled for Java agents. Part of Plinth Toolkit
002-agents-inventoryUse when you need to generate a checklist document with embedded agents inventory, following the embedded template exactly and producing INVENTORY-AGENTS-JAVA.md in the project root. This should trigger for requests such as Create embedded agents inventory checklist; Generate INVENTORY-AGENTS-JAVA.md; Use @002-agents-inventory; Inventory embedded Java agent definitions; List generated agent roles for Java development. Part of Plinth Toolkit
003-skills-inventoryUse when you need to generate a checklist document with Java system prompts from skills.xml, following the embedded section template and producing INVENTORY-SKILLS-JAVA.md. This should trigger for requests such as Create Java system prompts checklist; Generate INVENTORY-SKILLS-JAVA.md; Use @003-skills-inventory; Inventory Java cursor rule skills; List available Java system prompt skills. Part of Plinth Toolkit
004-commands-installationUse when you need to install the embedded project commands into command directories (.github/commands, .claude/commands, .cursor/command, .codex/commands), selecting the destination interactively and copying the embedded command definitions from project assets. This should trigger for requests such as Install embedded commands; Bootstrap .cursor/command; Bootstrap .claude/commands; Copy project commands; Install project command suite. Part of Plinth Toolkit
005-agents-installationUse when you need to install the embedded robot agents into .github/agents, .claude/agents, .cursor/agents, or .codex/agents, selecting the destination interactively and copying the embedded agent definitions from project assets. This should trigger for requests such as Install embedded agents; Bootstrap .github/agents; Bootstrap .cursor/agents; Bootstrap .claude/agents; Bootstrap .codex/agents; Copy robot agents. Part of Plinth Toolkit
012-agile-epicGuides the creation of agile epics with comprehensive definition including business value, success criteria, and breakdown into user stories. Use when the user wants to create an agile epic, define large bodies of work, break down features into user stories, or document strategic initiatives. This should trigger for requests such as Create an agile epic; Write an epic; I need to create an epic; Define an epic; Epic definition. Part of Plinth Toolkit
013-agile-featureGuides the creation of detailed agile feature documentation from an existing epic. Use when the user wants to split an epic into feature files, derive features with scope and acceptance criteria, or plan feature documentation for stakeholders or engineering. This should trigger for requests such as Create features from an epic; Split epic into features; Feature files from epic; Derive features from epic; Break down an agile epic into deliverable features. Part of Plinth Toolkit
014-agile-user-storyGuides the creation of agile user stories and Gherkin feature files. Use when the user wants to create a user story, write acceptance criteria, define Gherkin scenarios, or author BDD feature files. This should trigger for requests such as Create a user story; Write a user story; I need to write a user story; Create Gherkin scenarios for a user story; Split feature requirements into user stories. Part of Plinth Toolkit
030-architecture-adr-generalUse when you need to generate Architecture Decision Records (ADRs) for a Java project through an interactive, conversational process that systematically gathers context, stakeholders, options, and outcomes to produce well-structured ADR documents. This should trigger for requests such as Generate ADR; Create Architecture Decision Record; Document architecture decision; Architecture Decision Record for Java. Part of Plinth Toolkit
031-architecture-adr-functional-requirementsFacilitates conversational discovery to create Architectural Decision Records (ADRs) for functional requirements covering CLI, REST/HTTP APIs, or both. Use when the user wants to document command-line or HTTP service architecture, capture functional requirements, create ADRs for CLI or API projects, or design interfaces with documented decisions. This should trigger for requests such as Create ADR for functional requirements; Document functional requirements; Capture functional requirements; Generate functional requirements in an ADR; Decide CLI versus REST functional requirements for an ADR. Part of Plinth Toolkit