Claude Code design-patterns skill: Choose a pattern for a code change
Start with the part of a design that is hard to change. Compare patterns such as Strategy, State, Factory, or Adapter with a simple implementation and account for the extra interfaces they introduce.
中文Install in Claude Code
Bring a small code sample or a concrete change request. Keep the upstream REFERENCE.md file with the skill.
- Download the repository snapshot at the linked commit. Copy software-design-plugin/skills/design-patterns/ into .claude/skills/design-patterns/ in your practice project and keep its reference files.
- Check that SKILL.md is directly inside .claude/skills/design-patterns/. Open Claude Code from the project root.
- Enter /design-patterns to try the example below.
Example task
Run /design-patterns for an exporter with CSV and JSON branches. Explain that TSV is next and compare keeping the conditional with using Strategy.What to check
The review identifies the branch that grows for every format, shows when a strategy interface would help, and preserves the existing format selection behavior.
Original SKILL.md on GitHub · Updated
Frequently asked question
Is Strategy useful for an exporter with one stable format?
A direct implementation is usually enough. Revisit Strategy when new formats are recurring and the existing conditional becomes expensive to maintain.