Claude Code Guidance

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project overview

A Java library providing ASCII-safe Charset SPI implementations that transliterate Unicode to ASCII subsets rather than simply rejecting non-ASCII input. Published to GitHub Packages as com.maybeitssquid:ascii-safe-charsets.

Commands

./gradlew build          # compile, run tests, spotless check
./gradlew test           # tests only
./gradlew spotlessApply  # auto-format Java source (required before commit)
./gradlew javadoc        # generate Javadoc

# Run a single test class
./gradlew test --tests "com.maybeitssquid.safeascii.CacheTest"

Build versions are timestamped (1.0.0-YYYYMMDDHHMMSS); this is intentional for snapshot publishing.

Architecture

The library wires together two subsystems: a Charset implementation and a configurable transliteration pipeline.

Charset layer

Transliterator pipeline

Each step implements IntFunction<CharSequence> and chains to the next. The actual pipelines assembled by the provider are:

Code style

Spotless enforces Google Java Format. Run ./gradlew spotlessApply before committing. The formatter excludes module-info.java.

Security patches

Transitive dependency CVEs are pinned in gradle/libs.versions.toml as patch-* library entries collected in the security-patches bundle. build.gradle applies them as implementation constraints. settings.gradle also loads them into the buildscript classpath via regex. New CVE patches follow the same patch-cve-XXXX-NNNN naming convention.

The OWASP dependency check plugin (./gradlew dependencyCheckAnalyze) fails the build at CVSS ≥ 7.