Building a Ledger with Spec-Driven Development and Maintaining Living Documentation

One of the challenges I’m facing as a tech lead while building and maintaining any service with AI is keeping living documentation up to date. It is mostly for humans, because more often than not, AI relies on code and points out the drift. Another challenge is the amount and kind of document artifacts. Generating lots of prose based on code is a maintenance hell and downright dangerous, as outdated docs will mislead. ...

November 22, 20264 min

Improving First Request Latency in Java Spring Application

I was recently facing a problem with first requests into a double entry financial ledger service taking more than double of subsequent requests. This got me digging into Java’s Ahead-Of-Time Cache (AOT) and Spring. I was under the wrong impression that AOT is only about startup speedup, but looking a bit through recent AOT JEP additions found out each one will bring something to the first request. JEP 483: Ahead-of-Time Class Loading & Linking (JDK 24) JEP 515: Ahead-of-Time Method Profiling (JDK 25) JEP 516: Ahead-of-Time Object Caching with Any GC (JDK 26) So here’s the setup: ...

September 3, 20264 min

Pull Request Review Resolution with Claude Code

Are you tired of Copilot comments on your PR? Then let AI deal with it. In the following article, find a useful command for Claude Code. Prerequisites Claude Code gh cli brew install gh gh auth login Create Claude Code command Create file ~/.claude/commands/resolve-pr-comments.md with content: Fetch all open/unresolved review comments on a PR and help me resolve them. ## Step 1: Determine the PR If a PR number is provided as $ARGUMENTS, use that. Otherwise, run this command first and capture the output: ``bash gh pr view --json number -q .number `` Store the result as the PR number. If the command fails or returns empty, tell me there's no open PR on this branch and stop. ## Step 2: Get Repo Info Run this command and store the owner and repo name: ``bash gh repo view --json owner,name -q '.owner.login + "/" + .name' `` This gives you OWNER/REPO. Use these values in all subsequent commands. ## Step 3: Fetch Unresolved Comments Use the PR number and OWNER/REPO from previous steps. Replace OWNER, REPO, and PR_NUMBER with the actual values — do NOT use $() substitution. First, get unresolved review threads via GraphQL: `` gh api graphql -f query='query { repository(owner:"OWNER", name:"REPO") { pullRequest(number:PR_NUMBER) { reviewThreads(first:100) { nodes { isResolved, comments(first:10) { nodes { id, body, author { login }, path, line } } } } } } }' `` Only include threads where `isResolved` is `false`. Skip any already-resolved threads entirely. **Important**: Filter out noise before analysis. Ignore any comments from bots like SonarQube/SonarCloud (user login containing "sonar") that indicate passing quality gates, no issues found, or "Passed" status. Only keep Sonar comments that flag actual issues, bugs, or code smells. Also ignore other CI bot comments that are purely status updates (e.g. coverage reports that just show numbers with no actionable feedback). ## Step 4: Critical Analysis For each comment, provide a structured analysis: - **Comment**: The reviewer's feedback - **File & Line**: Where it applies - **Assessment**: Do you agree this is a valid concern? Be honest — if the comment is nitpicky, subjective, or wrong, say so with reasoning. - **Recommendation**: One of: - **AGREE & FIX** — Valid point, here's the proposed change - **DISCUSS** — Has merit but needs discussion, here's a suggested reply - **PUSH BACK** — Disagree, here's why and a suggested reply - **Proposed Change** (if fixing): Show the exact code diff ## Step 5: Present the Plan Present ALL comments with your analysis in a single summary table, then wait for my approval before making any changes. ## Step 6: Execute (only after approval) Once I confirm which comments to resolve: 1. Make the code changes for approved fixes 2. For DISCUSS/PUSH BACK items, draft reply comments 3. Stage and show me the final diff before committing Permissions This is optional, without it you’ll need to approve multiple commands. ...

March 25, 20263 min

Decouple Maven Releases from Version Logic

In standard Maven projects, versions are hardcoded in the POM, requiring a manual update after every release. This workflow is prone to several issues that often complicate CI/CD pipelines. I will explain why this approach is problematic and show a better way to handle releases by decoupling the version and Git operations from Maven. Let’s first revise what Maven offers out of the box, namely the maven-release-plugin workflow: Change version from 0.1.0-SNAPSHOT to 0.1.0. Commit the change and create a Git release tag. Build and push the tagged version to the repository. Bump the version to 0.1.1-SNAPSHOT and commit again. Issues with Maintaining Hardcoded Versions in POM Noise in Git History Tags are required as they mark a point in Git history where we can reliably track releases. Version change commits, on the other hand, are not used in any context and add noise. ...

January 2, 20264 min

CrOp 0.1.3: Adding Result Counts and a Look at API Trade-offs

I’m happy to share that I’ve added a new feature to CrOp and also moved it to a new namespace. In my previous articles, I explained what problem it solves in a typical REST service. At the time, I was still missing a way to count the total result. This is a must-have in a paginated query. @Query from Spring Data JPA, for example, has a separate attribute for that - countQuery. Seems trivial now, as any problem in retrospect, but at the time I was getting SqmRoot not yet resolved to TableGroup error. And that was because I was using the wrong root to apply predicates for count. Storing predicates as a function that accepts another root allowed me to reapply them for count. ...

December 22, 20253 min

Premature ORM-ification

ORMs promise to simplify persistence, but in practice, they introduce recurring problems. In many cases, there’s no clear or well-documented justification for why an ORM was introduced in the first place. Most probably it’s adopted by default, based on assumptions such as the belief that you can switch the database vendor without changing any code or that an ORM somehow “bridges” object-oriented programming and relational databases. While intended to ease data access, ORMs often end up dictating the entire application design. Instead of designing models around business logic, we adapt them to fit ORM limitations, flattening structures, adding unnecessary relationships, or compromising encapsulation just to bypass ORM constraints. The result is a codebase where the data model drives the design and the actual logic comes second. ...

July 23, 20252 min

Java Database Search Made Easy

Search functionality is so ubiquitous in any web app that at some point you start asking yourself if it can be done any easier. Introducing CrOp, a lightweight, zero dependency, and type-safe wrapper around Java Persistence Criteria API, which simplifies building queries, particularly useful within REST SQL (RSQL) context. Let’s dive into it’s core principles. Zero Dependency We all know the pain of upgrading dependencies. What I find the most troublesome is going through compatibility matrices (if you are lucky enough to find them). For example, you can’t use Spring 3 with Hibernate 5. And if you built something with Hibernate 5, you’ll have to rewrite it before upgrading Spring. ...

July 14, 20243 min

A Feature Toggle Story

Feature toggle is a technique that helps to change the system’s behavior without altering the code. It’s interesting how stories around it vary from the catastrophic failure of the Knight Capital Group[1] to the stellar success of the first GPS satellite[2]. In the following article, we’ll see a more typical example that all engineers have to deal with. Delivering a new feature according to Murphy’s Law Imagine an existing flow in a system that generates a PDF report, and then uploads it to the cloud: ...

August 22, 20234 min

Unit Testing Anti-Patterns

Writing unit tests might be challenging, especially when dealing with an ongoing project with already established hard-to-break anti-patterns. I will go through some of the most common pitfalls I’ve encountered quite often. Verifying the stubs Let’s suppose we write the following piece of code: @AllArgsConstructor public class UserCreationService { private final UserFactory factory; private final UserRepository repository; private final NotificationService notificationService; public void create(UserCreateRequest request) { var user = factory.createEntity(request); user = repository.save(user); notificationService.notify(USER_CREATED, user.getId()); } } And then create a test for the happy path: ...

August 11, 20233 min

REST Search API with QueryDSL

One of the most common features in a typical web application is the search functionality. The tricky thing is that we have to provide it via REST API and make it quite dynamic in terms of supported operators and filtrable fields. In the following paragraphs, we’ll go through what QueryDSL offers and how a lightweight extension could help. Out of the box, QueryDSL comes with Web Support. It boils down to having a Predicate parameter in REST controller method. The bad news is that you cannot do much of the customization. Imagine the ubiquitous example of Pet Shop, where we have to search by nickname using contains or exact match. The natural thing that comes to mind is having in a query parameter the search field, operator and value: ...

January 7, 20233 min