cd /news/ai-agents/spec-driven-development-kit-w-hexala… · home topics ai-agents article
[ARTICLE · art-127844] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Spec Driven Development Kit w/HexaLayered Architecture

A developer released a Spec Driven Development kit that encodes the rules of the HexaLayered Architecture into a Claude Code-readable .claude directory, including a constitution.md of testable constraints and slash commands for specifying and planning work. A shell script runs on every file write and rejects violations such as a service importing an entity or a public Controller by exiting with code 2, feeding the error back to the model before code review. The kit can be copied into another project with `cp -r .claude .` followed by `/hexa:bootstrap`, which auto-detects the base package, build tool, and test command.

by read2 min views2 publishedSep 12, 2026

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

── more in #ai-agents 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/spec-driven-developm…] indexed:0 read:2min 2026-09-12 ·