Skip to content

Extract generic Java TDD skill; refactor project-specific test guides#148

Open
bernardladenthin wants to merge 2 commits intomainfrom
claude/consolidate-tdd-guides-M6p7Z
Open

Extract generic Java TDD skill; refactor project-specific test guides#148
bernardladenthin wants to merge 2 commits intomainfrom
claude/consolidate-tdd-guides-M6p7Z

Conversation

@bernardladenthin
Copy link
Copy Markdown
Owner

Summary

This PR extracts a reusable, project-independent Java Test-Driven Development skill guide and refactors the BitcoinAddressFinder project documentation to separate generic conventions from project-specific patterns.

Key Changes

  • New file: .claude/skills/java-tdd-guide.md (961 lines)

    • Comprehensive, project-independent Java TDD guide covering Red → Green → Refactor workflow
    • Includes test framework stack (JUnit 4, Hamcrest, Mockito), class layout, naming conventions, AAA structure, editor folds, assertions, exception testing, data providers, null safety (JSpecify), logger injection patterns, mocking, randomness, concurrency, and records/immutability
    • Designed for reuse across multiple projects with generic examples
  • Refactored: TEST_WRITING_GUIDE.md (now 58 lines)

    • Reduced from 371 lines to focus exclusively on BitcoinAddressFinder-specific conventions
    • Removed all generic TDD content (now in java-tdd-guide.md)
    • Retained only project-specific patterns: custom marker annotations (@AwaitTimeTest, @ToStringTest, @OpenCLTest), timing test conventions, static address constants, and platform assumptions
    • Added header clarifying it supplements the generic guide
  • Refactored: .claude/skills/tdd.md (now 44 lines)

    • Reduced from 785 lines; removed all generic TDD workflow and test framework details
    • Now serves as a project-context wrapper that references java-tdd-guide.md for generic conventions
    • Retains only BitcoinAddressFinder-specific context and pointers to project guides
  • Updated: CODE_WRITING_GUIDE.md

    • Streamlined to focus on production code conventions
    • Removed redundant content now covered in java-tdd-guide.md
    • Maintains project-specific patterns (named constants, logger injection)
  • Updated: CLAUDE.md

    • Minor clarification in test writing compliance section

Notable Implementation Details

  • The generic java-tdd-guide.md uses project-agnostic examples (e.g., Foo, Bar, MyService) to ensure portability
  • Project-specific guides now clearly reference the generic skill as the authoritative source for standard conventions
  • Separation enables the generic skill to be versioned independently and reused across multiple projects
  • All three-segment test naming patterns, AAA structure, Hamcrest assertions, and data provider patterns are documented in the generic guide with full detail

https://claude.ai/code/session_01LthQuHQh9NUGgPdR3jDHpg

claude added 2 commits April 2, 2026 11:54
…kill

Create .claude/skills/java-tdd-guide.md as a project-independent, versioned
Java TDD skill (v1.0.0) containing all generic conventions extracted from
tdd.md, CODE_WRITING_GUIDE.md, and TEST_WRITING_GUIDE.md. Examples use
generic names (com.example, Foo, Bar) instead of project-specific references.

Trim CODE_WRITING_GUIDE.md and TEST_WRITING_GUIDE.md to project-specific
supplements only (BitHelper radix, C-prefix POJOs, domain exceptions,
marker annotations, static address constants, LMDB/OpenCL patterns).

Update tdd.md to delegate to the generic guide and reference supplements.
Update CLAUDE.md compliance sections to reference both generic and
project-specific guides.

https://claude.ai/code/session_01LthQuHQh9NUGgPdR3jDHpg
Restructure .claude/skills/java-tdd-guide.md -> .claude/skills/java-tdd-guide/SKILL.md
and .claude/skills/tdd.md -> .claude/skills/tdd/SKILL.md to follow the
Agent Skills open standard directory convention. Update path references
in CLAUDE.md and tdd/SKILL.md accordingly.

https://claude.ai/code/session_01LthQuHQh9NUGgPdR3jDHpg
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 2, 2026

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.54%. Comparing base (71fd6a0) to head (8f2102c).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #148      +/-   ##
============================================
+ Coverage     74.50%   74.54%   +0.04%     
  Complexity      562      562              
============================================
  Files            84       84              
  Lines          2428     2428              
  Branches        208      208              
============================================
+ Hits           1809     1810       +1     
+ Misses          564      563       -1     
  Partials         55       55              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants