Skip to content

docs: verify, consolidate and align project documentation #335

@nanotaboada

Description

@nanotaboada

Context

This repo contains a REST API built with Java 25 and Spring Boot 4. Project guidance currently lives in two files: CLAUDE.md (a two-line stub with an @ include) and .github/copilot-instructions.md (the actual content). GitHub Copilot is no longer in use, making the split pointless. The goal is to establish CLAUDE.md as the single source of truth, verify its content against the code, and close gaps in .coderabbit.yaml.

Note: issue #299 (Implement Architecture Decision Records) has been implemented — docs/adr/ is live with all 12 ADRs. This issue should reference the existing directory directly rather than adding a forward reference.

Conflict resolution rule

The code is the source of truth. When copilot-instructions.md contradicts what the code actually does, fix the documentation — do not change the code.

Implementation steps

1. Verify copilot-instructions.md against the code

Before copying any content, read the actual code and confirm these claims are still accurate:

  • No cache TTL: check src/main/java/**/services/PlayersService.java@Cacheable should have no time-based expiry; cache invalidation should use @CacheEvict(allEntries = true) on writes only
  • Constructor injection only: spot-check service and repository classes — no @Autowired field injection should be present
  • @Transactional(readOnly = true) on reads: check service read methods
  • In-memory SQLite for tests: check src/test/resources/application.properties — should configure an in-memory SQLite datasource
  • BDD test naming (givenX_whenY_thenZ): spot-check test class names and method names
  • Port 9000: check src/main/resources/application.properties

Document any discrepancies found. Correct copilot-instructions.md content before moving to step 2.

2. Consolidate into CLAUDE.md

Replace the entire content of CLAUDE.md with the (now-verified and corrected) content from .github/copilot-instructions.md. Then add:

## Invariants (never change without explicit discussion)

- Port: 9000
- API contract: endpoints, HTTP status codes, and response shapes are fixed;
  do not change them without explicit discussion
- Commit format: `type(scope): description (#issue)` — max 80 chars
- Conventional Commits types: feat fix chore docs test refactor ci perf
- CHANGELOG.md `[Unreleased]` section must be updated before every commit

## Architecture Decision Records

Architectural decisions are documented in [`docs/adr/`](../docs/adr/README.md).
When proposing structural changes, check both this file and the relevant ADR.
When a decision changes, update this file and create or amend the relevant ADR.

Then update the Pre-commit Checks section to add:

6. If this commit introduces or changes an architectural decision, update
   CLAUDE.md and create or amend the relevant ADR in `docs/adr/`.

Delete .github/copilot-instructions.md.

3. Update .coderabbit.yaml

Add to the src/**/services/**/*.java path instruction:

- Spring Cache is configured with NO expiry — this is intentional. Do not
  suggest adding a TTL or time-based eviction. Cache is invalidated only on
  write operations via @CacheEvict(allEntries = true).

Acceptance criteria

  • Every claim in CLAUDE.md has been verified against the current code
  • Any discrepancies found during verification are corrected in CLAUDE.md
  • CLAUDE.md contains all content previously in copilot-instructions.md
  • CLAUDE.md has an Invariants section and a reference to docs/adr/
  • CLAUDE.md pre-commit checklist includes the ADR/CLAUDE.md update requirement
  • .github/copilot-instructions.md is deleted
  • .coderabbit.yaml service path instruction documents the intentional no-expiry cache behaviour
  • CHANGELOG.md [Unreleased] updated
  • No regressions in existing tests

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestjavaPull requests that update Java code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions