Skip to content

Commit f133bcb

Browse files
Merge pull request #96 from wphillipmoore/release/1.1.1
release: 1.1.1
2 parents 6307323 + d849674 commit f133bcb

4 files changed

Lines changed: 76 additions & 193 deletions

File tree

.github/workflows/docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ jobs:
7070
run: |
7171
if [ -n "${{ steps.version.outputs.alias }}" ]; then
7272
mike deploy -F docs/site/mkdocs.yml --push --update-aliases ${{ steps.version.outputs.version }} ${{ steps.version.outputs.alias }}
73+
mike set-default -F docs/site/mkdocs.yml --push latest
7374
else
7475
mike deploy -F docs/site/mkdocs.yml --push ${{ steps.version.outputs.version }}
7576
fi

CLAUDE.md

Lines changed: 71 additions & 189 deletions
Original file line numberDiff line numberDiff line change
@@ -2,248 +2,130 @@
22

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

5-
## Documentation Strategy
6-
7-
This repository uses two complementary approaches for AI agent guidance:
8-
9-
- **AGENTS.md**: Generic AI agent instructions using include directives to force documentation indexing. Contains canonical standards references, shared skills loading, and user override support.
10-
- **CLAUDE.md** (this file): Claude Code-specific guidance with prescriptive commands, architecture details, and development workflows optimized for `/init`.
11-
12-
### Integration Approach
13-
14-
**For Claude Code** (`/init` command):
15-
1. Read CLAUDE.md (this file) first for optimized quick-start guidance
16-
2. Process include directives to load repository standards
17-
3. Reference AGENTS.md for shared skills and canonical standards location
18-
4. Apply layered standards: canonical → project-specific → user overrides
19-
20-
**For other AI agents** (Codex, generic LLMs):
21-
1. Read AGENTS.md first as the primary entry point
22-
2. Process include directives to load all referenced documentation
23-
3. Resolve canonical standards repo path (local or GitHub)
24-
4. Load shared skills from standards repo
25-
5. Apply user overrides from `~/AGENTS.md` if present
26-
27-
**Key differences**:
28-
- **CLAUDE.md**: Prescriptive, command-focused, optimized for `/init`
29-
- **AGENTS.md**: Declarative, include-directive-driven, forces full documentation indexing
30-
31-
Both files share the same underlying standards via include directives, ensuring consistency across all AI agents working in this repository.
32-
33-
### Best Practices for Dual-File Approach
34-
35-
**What goes in AGENTS.md**:
36-
- Include directives for documentation indexing
37-
- Canonical standards repository references
38-
- Shared skills loading instructions
39-
- User override mechanisms
40-
- Minimal, declarative content
41-
42-
**What goes in CLAUDE.md**:
43-
- Claude Code-specific quick-start commands
44-
- Detailed architecture and design patterns
45-
- Implementation notes and common workflows
46-
- Integration guidance between the two files
47-
- More verbose, prescriptive content
48-
49-
**What goes in neither (use includes instead)**:
50-
- Repository standards (keep in `docs/repository-standards.md`)
51-
- Canonical standards (reference external repo)
52-
- Project-specific conventions (keep in referenced docs)
53-
54-
**Maintenance strategy**:
55-
- Update standards in source files, not in AGENTS.md or CLAUDE.md
56-
- Use include directives to pull in shared content
57-
- Keep AGENTS.md minimal and CLAUDE.md focused on Claude Code workflows
58-
- Test both entry points when updating documentation structure
59-
605
<!-- include: docs/standards-and-conventions.md -->
616
<!-- include: docs/repository-standards.md -->
627

638
## Project Overview
649

65-
This is a Java port of `pymqrest`, providing a Java wrapper for the IBM MQ administrative REST API. The project will provide a Java mapping layer for MQ REST API attribute translations and command metadata.
66-
67-
**Project name**: mq-rest-admin
68-
69-
**Status**: Pre-alpha (initial setup)
10+
Java wrapper for the IBM MQ administrative REST API, ported from `pymqrest` (Python). Provides method-per-command API (`displayQueue()`, `defineQlocal()`, etc.) with attribute mapping between snake_case and MQSC parameter names.
7011

71-
**Build coordinates**: `io.github.wphillipmoore:mq-rest-admin:0.1.0-SNAPSHOT`
12+
**Build coordinates**: `io.github.wphillipmoore:mq-rest-admin:1.1.1`
7213

7314
**Java package**: `io.github.wphillipmoore.mq.rest.admin`
7415

75-
**Canonical Standards**: This repository follows standards at https://github.com/wphillipmoore/standards-and-conventions (local path: `../standards-and-conventions` if available)
16+
**Canonical Standards**: https://github.com/wphillipmoore/standards-and-conventions (local: `../standards-and-conventions`)
17+
18+
**Reference implementation**: `../mq-rest-admin-python`
7619

7720
## Development Commands
7821

79-
### Environment Setup
22+
### Environment
8023

8124
- **Java**: 17+ (install via `brew install openjdk@17` or SDKMAN)
8225
- **Maven**: Provided by Maven Wrapper (`./mvnw`), no separate install needed
8326

84-
### Build
85-
86-
```bash
87-
./mvnw compile # Compile sources
88-
./mvnw clean # Remove target/
89-
./mvnw clean compile # Clean rebuild
90-
./mvnw package # Compile and package JAR
91-
```
92-
93-
### Validation
94-
95-
```bash
96-
./mvnw verify # Run entire validation pipeline (single command)
97-
```
98-
99-
The `verify` lifecycle runs in order: formatting check (Spotless) → style check
100-
(Checkstyle) → compile → unit tests (Surefire) → integration tests (Failsafe) →
101-
coverage enforcement (JaCoCo 100% line + branch) → bug analysis (SpotBugs) →
102-
code smell detection (PMD).
103-
104-
Individual tools can also be run standalone:
27+
### Build and Validate
10528

10629
```bash
107-
./mvnw spotless:check # Check formatting
108-
./mvnw spotless:apply # Auto-format code
109-
./mvnw checkstyle:check # Check style rules
110-
./mvnw spotbugs:check # Check for bug patterns
111-
./mvnw pmd:check # Check for code smells
30+
./mvnw compile # Compile sources
31+
./mvnw verify # Full pipeline: Spotless → Checkstyle → compile → unit tests →
32+
# integration tests → JaCoCo (100% line+branch) → SpotBugs → PMD
33+
./mvnw spotless:apply # Auto-format code (run before committing)
11234
```
11335

11436
### Testing
11537

11638
```bash
117-
./mvnw test # Unit tests only (*Test.java)
118-
./mvnw verify # Unit + integration tests (*IT.java)
39+
./mvnw test # All unit tests (*Test.java)
40+
./mvnw test -Dtest=MqRestSessionTest # Single test class
41+
./mvnw test -Dtest="MqRestSessionTest#testMethod" # Single test method
42+
./mvnw verify # Unit + integration tests (*IT.java)
11943
```
12044

12145
- **Framework**: JUnit 5 (Jupiter)
12246
- **Mocking**: Mockito 5 with `@ExtendWith(MockitoExtension.class)`
12347
- **Assertions**: AssertJ (`assertThat(x).isEqualTo(y)`)
12448
- **Coverage**: JaCoCo — 100% line and branch coverage enforced at BUNDLE level
12549

126-
### Linting and Formatting
127-
128-
- **Formatter**: Spotless + google-java-format (2-space indent, opinionated)
129-
- **Style**: Checkstyle with `google_checks.xml` (bundled)
130-
- **Bug analysis**: SpotBugs (`effort=Max`, `threshold=Low`)
131-
- **Code smells**: PMD (default ruleset)
132-
133-
Run `./mvnw spotless:apply` to auto-format before committing.
134-
135-
## Architecture
136-
137-
Direct port of `pymqrest`'s architecture, adapted to Java idioms.
138-
139-
### Technology Stack
140-
141-
- **HTTP client**: `java.net.http.HttpClient` (JDK built-in, zero runtime dependencies)
142-
- **JSON library**: Gson (`com.google.code.gson:gson`, single JAR, zero transitive deps)
143-
- **Runtime dependencies**: 1 (Gson ~280KB)
50+
### Individual Lint Tools
14451

145-
### API Surface
52+
```bash
53+
./mvnw spotless:check # Check formatting (google-java-format, 2-space indent)
54+
./mvnw checkstyle:check # Check style (google_checks.xml)
55+
./mvnw spotbugs:check # Bug patterns (effort=Max, threshold=Low)
56+
./mvnw pmd:check # Code smell detection
57+
```
14658

147-
- **Style**: Method-per-command mirroring pymqrest (`displayQueue()`, `defineQlocal()`, etc.)
148-
- **Parameters/results**: `Map<String, Object>` for MQ attributes (dynamic attribute sets, permissive mode)
149-
- **Fixed-schema types**: Java records for `TransportResponse`, `SyncConfig`, `SyncResult`, `EnsureResult`, `MappingIssue`, credential types
150-
- **Credentials**: Sealed interface (`Credentials permits BasicAuth, LtpaAuth, CertificateAuth`)
151-
- **Session**: Single `MqRestSession` class (no mixin decomposition)
59+
## Git Conventions
15260

153-
### Transport Layer
61+
### Pre-flight Checklist
15462

155-
- `MqRestTransport` interface (mirrors pymqrest's Protocol) — enables Mockito-based testing
156-
- `HttpClientTransport` implementation behind that interface
157-
- Supports TLS/mTLS via `SSLContext`, timeouts via `Duration`, custom headers
63+
1. Check current branch: `git status -sb`
64+
2. If on `develop` or `main`, create a `feature/*`, `bugfix/*`, or `hotfix/*` branch first
65+
3. Enable git hooks: `git config core.hooksPath scripts/git-hooks`
15866

159-
### Attribute Mapping
67+
### Branching Model (`library-release`)
16068

161-
- Direct port of pymqrest's 3-layer pipeline: key map, value map, key-value map
162-
- Two directions: request and response
163-
- Strict/permissive modes with `MappingIssue` tracking
164-
- Mapping data stored as JSON resource file in `src/main/resources/` (loaded by Gson)
165-
- Override mechanism with merge/replace modes
69+
- **`develop`**: Integration branch — PRs target here (squash merge)
70+
- **`main`**: Release branch — release PRs merge here (regular merge)
71+
- Allowed branch prefixes: `feature/*`, `bugfix/*`, `hotfix/*`
16672

167-
### Exception Hierarchy
73+
### Commit Message Rules (enforced by hooks)
16874

169-
Unchecked (`RuntimeException`), sealed:
75+
Conventional Commits format required:
17076

17177
```
172-
MqRestException (sealed, extends RuntimeException)
173-
├── MqRestTransportException (network/connection failures)
174-
├── MqRestResponseException (malformed JSON, unexpected structure)
175-
├── MqRestAuthException (authentication/authorization failures)
176-
├── MqRestCommandException (MQSC command returned error codes)
177-
└── MqRestTimeoutException (polling timeout exceeded)
178-
179-
MappingException (separate hierarchy, data-transformation errors)
180-
```
181-
182-
### Package Structure
78+
<type>(optional-scope): <description>
18379
184-
```
185-
io.github.wphillipmoore.mq.rest.admin
186-
MqRestSession, MqRestTransport, HttpClientTransport, TransportResponse
187-
io.github.wphillipmoore.mq.rest.admin.auth
188-
Credentials, BasicAuth, LtpaAuth, CertificateAuth
189-
io.github.wphillipmoore.mq.rest.admin.exception
190-
MqRestException, MqRest{Transport,Response,Auth,Command,Timeout}Exception
191-
io.github.wphillipmoore.mq.rest.admin.mapping
192-
AttributeMapper, MappingData, MappingIssue, MappingException, MappingOverrideMode
193-
io.github.wphillipmoore.mq.rest.admin.sync
194-
SyncConfig, SyncResult, SyncOperation
195-
io.github.wphillipmoore.mq.rest.admin.ensure
196-
EnsureResult, EnsureAction
80+
Co-Authored-By: wphillipmoore-claude <255925739+wphillipmoore-claude@users.noreply.github.com>
19781
```
19882

199-
## Repository Standards Quick Reference
83+
Allowed types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`
20084

201-
The include directives at the top of this file load the full repository standards. Key highlights for quick reference:
85+
The co-author hook validates trailers against approved identities in `docs/repository-standards.md`. Only use the approved co-author lines listed there.
20286

203-
**Pre-flight Checklist**:
204-
- Check current branch: `git status -sb`
205-
- If on `develop`, create `feature/*` branch or get explicit approval
206-
- Enable git hooks: `git config core.hooksPath scripts/git-hooks`
207-
208-
See `docs/repository-standards.md` for complete details.
209-
210-
## Documentation Indexing Strategy
87+
## Architecture
21188

212-
This repository uses `<!-- include: path/to/file.md -->` directives to force documentation indexing. When you encounter these directives:
89+
Direct port of pymqrest's architecture, adapted to Java idioms.
21390

214-
1. **Read the referenced files** to understand the full context
215-
2. **Apply layered standards** in order:
216-
- Canonical standards (from `standards-and-conventions` repo)
217-
- Project-specific standards (`docs/repository-standards.md`)
218-
- User overrides (`~/AGENTS.md` if present)
219-
3. **Load shared skills** from `<standards-repo-path>/skills/**/SKILL.md`
91+
### Key Design Decisions
22092

221-
The include directives appear in:
222-
- `AGENTS.md` - Includes repository standards and conventions
223-
- `CLAUDE.md` - Includes same standards for Claude Code
224-
- `docs/standards-and-conventions.md` - Includes canonical standards reference
93+
- **Zero runtime deps** beyond Gson (~280KB) — HTTP via `java.net.http.HttpClient`
94+
- **Sealed types**: `MqRestException` hierarchy (unchecked) and `Credentials` interface
95+
- **Nullability**: JSpecify `@Nullable` annotations; Error Prone + NullAway enforced on JDK 21+ (auto-activated `error-prone` profile)
96+
- **Dynamic attributes**: `Map<String, Object>` for MQ attributes; Java records for fixed-schema types (`TransportResponse`, `SyncConfig`, `SyncResult`, `EnsureResult`, `MappingIssue`)
97+
- **Testability**: `MqRestTransport` interface enables Mockito-based testing without HTTP
22598

226-
This approach ensures all AI agents (Codex, Claude, etc.) have access to the same foundational documentation.
99+
### Attribute Mapping Pipeline
227100

228-
## Documentation Structure
101+
3-layer pipeline (key map → value map → key-value map) with request/response directions. Strict mode throws `MappingException`; permissive mode records `MappingIssue` entries. Mapping data in `src/main/resources/.../mapping/mapping-data.json`.
229102

230-
- `README.md` - Project overview and quick start
231-
- `AGENTS.md` - Generic AI agent instructions with include directives
232-
- `CLAUDE.md` - This file, Claude Code-specific guidance
233-
- `docs/repository-standards.md` - Project-specific standards (included from AGENTS.md)
234-
- `docs/standards-and-conventions.md` - Canonical standards reference (includes external repo)
103+
### Exception Hierarchy
235104

236-
## Key References
105+
```
106+
MqRestException (sealed, RuntimeException)
107+
├── MqRestTransportException (network/connection)
108+
├── MqRestResponseException (malformed JSON)
109+
├── MqRestAuthException (auth failures)
110+
├── MqRestCommandException (MQSC errors)
111+
└── MqRestTimeoutException (polling timeout)
112+
113+
MappingException (separate, data-transformation errors)
114+
```
237115

238-
**Canonical Standards**: https://github.com/wphillipmoore/standards-and-conventions
239-
- Local path (preferred): `../standards-and-conventions`
240-
- Load all skills from: `<standards-repo-path>/skills/**/SKILL.md`
116+
### Package Layout
241117

242-
**Reference implementation**: `../mq-rest-admin-python` (Python version)
118+
```
119+
.admin — MqRestSession (Builder pattern), MqRestTransport, HttpClientTransport, TransportResponse
120+
.admin.auth — Credentials (sealed), BasicAuth, LtpaAuth, CertificateAuth
121+
.admin.exception — Sealed exception hierarchy
122+
.admin.mapping — AttributeMapper, MappingData, MappingIssue, MappingDirection, MappingOverrideMode
123+
.admin.sync — SyncConfig, SyncResult, SyncOperation
124+
.admin.ensure — EnsureResult, EnsureAction
125+
```
243126

244-
**External Documentation**:
245-
- IBM MQ 9.4 administrative REST API
246-
- MQSC command reference
247-
- PCF command formats
127+
## Documentation and Standards
248128

249-
**User Overrides**: `~/AGENTS.md` (optional, applied if present and readable)
129+
- `AGENTS.md` — Generic AI agent instructions with include directives
130+
- `docs/repository-standards.md` — Project-specific standards (branching, co-authors, naming)
131+
- `docs/standards-and-conventions.md` — Canonical standards reference

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<groupId>io.github.wphillipmoore</groupId>
99
<artifactId>mq-rest-admin</artifactId>
10-
<version>1.1.0</version>
10+
<version>1.1.1</version>
1111
<packaging>jar</packaging>
1212

1313
<name>mq-rest-admin</name>

scripts/git-hooks/pre-commit

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fi
1212

1313
# Block commits to protected branches (universal set — safe for all models).
1414
case "$current_branch" in
15-
develop|release|main|release/*)
15+
develop|release|main)
1616
echo "ERROR: direct commits to protected branches are forbidden ($current_branch)." >&2
1717
echo "Create a short-lived branch and open a PR." >&2
1818
exit 1
@@ -44,8 +44,8 @@ case "$branching_model" in
4444
allowed_display="feature/*, bugfix/*, hotfix/*, or promotion/*"
4545
;;
4646
library-release)
47-
allowed_regex='^(feature|bugfix|hotfix)/'
48-
allowed_display="feature/*, bugfix/*, or hotfix/*"
47+
allowed_regex='^(feature|bugfix|hotfix|release)/'
48+
allowed_display="feature/*, bugfix/*, hotfix/*, or release/*"
4949
;;
5050
"")
5151
echo "WARNING: branching_model not found in $profile_file; falling back to feature/*/bugfix/*." >&2

0 commit comments

Comments
 (0)