Skip to content

Add design patterns support —> 123-java-design-patterns #722

@jabrena

Description

@jabrena

User Story: 123-java-design-patterns

As a Java developer using this cursor-rules-java project
I want to add a new 123-java-design-patterns skill for Java design patterns support
So that I can get consistent, practical guidance for selecting, implementing, and refactoring toward appropriate design patterns in Java projects without over-engineering the codebase.

Acceptance Criteria

Feature: Java design patterns skill

Background:
  Given the repository generates skills from XML sources under "skills-generator/src/main/resources"
  And generated content under "skills/" is not edited directly
  And the Java design guidance currently includes neighboring skills such as "121-java-object-oriented-design" and "122-java-type-design"

@acceptance-test
Scenario: Generate the Java design patterns skill from XML sources
  Given a new Java design patterns skill is defined in the skill generator sources
  When the skills-generator module is installed
  Then the generated skills include "123-java-design-patterns"
  And the skill explains when design patterns should and should not be applied
  And the skill provides practical Java examples for common creational, structural, and behavioral patterns
  And the skill emphasizes maintainability, simplicity, testability, and avoiding pattern overuse

@integration-test
Scenario: Register the Java design patterns skill in the skill catalog
  Given the Java design patterns skill XML source exists
  When the skill index and skill list are generated
  Then "123-java-design-patterns" appears in the generated skills inventory
  And the skill can be discovered with prompts such as "apply Java design patterns" or "refactor this code using an appropriate pattern"

@integration-test
Scenario: Align the new skill with existing Java design guidance
  Given the repository already contains object-oriented and type-design skills
  When the Java design patterns skill is authored
  Then it complements "121-java-object-oriented-design" and "122-java-type-design"
  And it avoids duplicating broad SOLID, type-design, and generic refactoring guidance that belongs in neighboring skills

@integration-test
Scenario: Keep generated artifacts reproducible
  Given the Java design patterns skill is generated from XML
  When "./mvnw clean verify -pl skills-generator" is executed
  Then the build succeeds
  And no generated skill content requires manual edits under "skills/"

@integration-test
Scenario: Validate generated skill quality
  Given the generated Java design patterns skill exists under "skills/"
  When "npx skill-check@latest skills --no-security-scan --format github" is executed
  Then the skill passes the formatter and structural checks
  And any behavioral scan findings are reviewed before promoting the change

Notes

  • Implement changes in XML sources under skills-generator/src/main/resources/, including the relevant skill reference, skill index, and catalog wiring.
  • Do not edit generated skills/ content directly; regenerate it through the Maven pipeline.
  • Place the skill numerically between 122-java-type-design and 124-java-secure-coding as 123-java-design-patterns.
  • Cover the most useful Java design pattern families: creational, structural, and behavioral patterns.
  • Include guidance for deciding whether a pattern is justified, with explicit warnings against pattern-driven design when simpler code is enough.
  • Keep examples compatible with the repository guidance for Java 25 and Maven-based workflows.

INVEST Validation

  • Independent: The design patterns skill can be added as a new Java design skill without changing the behavior of existing OOP, type-design, or secure-coding skills.
  • Negotiable: The exact set of patterns, examples, and anti-pattern warnings can be refined while preserving the intent of practical Java design-pattern guidance.
  • Valuable: Java developers gain a focused skill for selecting and applying patterns thoughtfully, improving code structure while avoiding unnecessary complexity.
  • Estimable: The work is bounded by creating and wiring one generated skill plus validation through the existing generator and skill-check workflows.
  • Small: The scope should fit in one iteration because it follows the existing single-skill generation pattern.
  • Testable: Completion can be verified by generated skill output, catalog discovery, Maven verification, and skill validation commands.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions