General
Spec Driven Development Kit w/HexaLayered Architecture
0 views

Something has bothered me ever since I wrote HexaLayered Architecture.
The documentation was good, the examples were good, the rules were clear. But the rules only worked if someone read them. A new developer would join a project and use TicketEntity in the service layer. I would see it in the pull request. Sometimes I did not see it, and it was merged.
Some time ago I sat down and turned the architecture into something Claude Code can read and apply. There is a .claude directory in the repo now.
Inside it there is a file called constitution.md. It keeps the rules of the architecture, not as advice like "you should do it this way", but as rules you can test. Which classes are public, which ones are package-private, how far an entity can go up through the layers.
There is also a Spec Driven Development flow. /hexa:specify writes down what will be built, /hexa:plan writes down which class goes into which package, and the code comes after that. Nobody has to ask "where does this class go?" when the file is already open.
I also added a shell script that runs on every file write. If a service imports an entity, if a Controller is still public, if a class reaches into another module's repository, the script exits with code 2 and the error goes straight back to the model. It does not wait for the code review.
While I was testing it, I found a bug in my own script, but that is another story.
You only need two commands to move it to another project:
cp -r .claude .
/hexa:bootstrap
bootstrap finds the base package, the build tool (Maven or Gradle) and the test command by itself. When you start a Spring Boot project from zero, the architecture is correct from the first commit.
I took the rules from the README, then checked them on ays-be. It is a real project that uses the architecture, so it was a good test.
🔗 https://github.com/agitrubard/hexalayered-architecture/pull/1
SpecDrivenDevelopment #HexaLayered #HexaLayeredArchitecture #Claude #ClaudeCode #CleanCode #HexagonalArchitecture #LayeredArchitecture #DDD #SpringBoot #Java
Read original: https://dev.to/agitrubard/spec-driven-development-kit-whexalayered-architecture-578i
PreviousSouth Korea Just Gave 52 Million People Free, Unlimited AI - But the Real Catch Is an 80% Domestic Model QuotaNextSpec-Driven Development (SDD): De la improvisación a la ingeniería con agentes de IA
Related posts
I Read the Clankers' Code
0Hacker News
A Right-Wing Think Tank Has a Plan to Prevent Democrats From Being Seated in Congress
0Wired
White Noise Machines Worthy of Your Nightstand in 2026: Snooz, Hatch, and More
0Wired
F1 in Mexico City: Yet another Ferrari fiasco, but that’s not all
0Ars Technica
China publicly discloses plan for a lunar landing within three years
0Ars Technica
Let Me Ch...
0Hacker News