Skip to content

Add comprehensive code and test writing guides - #1

Merged
bernardladenthin merged 1 commit into
mainfrom
claude/add-documentation-files-6ekhc
Mar 19, 2026
Merged

Add comprehensive code and test writing guides#1
bernardladenthin merged 1 commit into
mainfrom
claude/add-documentation-files-6ekhc

Conversation

@bernardladenthin

Copy link
Copy Markdown
Owner

Summary

This PR adds three authoritative reference documents to guide contributors on code style, test conventions, and project context:

  • TEST_WRITING_GUIDE.md — Complete reference for writing JUnit 4 tests with Hamcrest assertions, data providers, mocking patterns, and editor fold organization
  • CODE_WRITING_GUIDE.md — Standards for production code including named constants (DRY principle), logger injection, records for immutable types, and defensive null checks
  • CLAUDE.md — Project overview, architecture, build commands, dependencies, and CI/CD guidance for AI assistants and contributors
  • CODE_OF_CONDUCT.md — Contributor Covenant 2.0 code of conduct

Key Changes

  • TEST_WRITING_GUIDE.md (572 lines)

    • JUnit 4 + Hamcrest assertion patterns with complete examples
    • Arrange/Act/Assert structure with // pre-assert sections
    • Data provider usage with junit-dataprovider
    • Editor fold organization by method under test
    • Test naming convention: methodUnderTest_inputOrCondition_expectedBehavior
    • Mock logger injection and LLM integration test guards
    • Anti-patterns and what NOT to do
  • CODE_WRITING_GUIDE.md (167 lines)

    • Named constants requirement (DRY principle) with Javadoc
    • Constructor-based logger injection pattern
    • Records for immutable value objects
    • Defensive null/empty checks at public boundaries
    • Prompt target string constants
  • CLAUDE.md (363 lines)

    • Project overview and goals
    • Build system and common Maven commands
    • Complete project structure with file descriptions
    • Core architecture (two-phase operation, key components)
    • Document format specification with header field meanings
    • Maven plugin goals and parameters
    • Testing frameworks and conventions
    • CI/CD pipeline descriptions
    • Design principles (local-first, deterministic, incremental)
  • CODE_OF_CONDUCT.md (128 lines)

    • Contributor Covenant 2.0 standard code of conduct

Notable Details

  • All guides include concrete code examples and anti-patterns
  • Test guide emphasizes Hamcrest over JUnit assertions and editor fold organization
  • Code guide enforces DRY through named constants with mandatory Javadoc
  • CLAUDE.md serves as both onboarding and AI assistant context
  • Guides are derived from analysis of existing codebase patterns

https://claude.ai/code/session_017t5CsBznigJ7pyVkadJg97

…GUIDE.md, TEST_WRITING_GUIDE.md

Mirrors the documentation structure from BitcoinAddressFinder, adapted for the
Maven plugin context (Maven Log, GGUF/JNI provider, Mojo architecture).

https://claude.ai/code/session_017t5CsBznigJ7pyVkadJg97
@bernardladenthin
bernardladenthin merged commit e663b3b into main Mar 19, 2026
1 check failed
@bernardladenthin
bernardladenthin deleted the claude/add-documentation-files-6ekhc branch April 20, 2026 18:35
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.

2 participants