<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/spec-driven-development-kit-w-hexalayered-architecture-lvvlu2wat" -->

---
title: Spec Driven Development Kit w/HexaLayered Architecture
description: A developer turned their HexaLayered Architecture rules into a Claude Code-readable spec kit, addressing the problem of developers ignoring architectural...
canonical: https://daily.dev/posts/spec-driven-development-kit-w-hexalayered-architecture-lvvlu2wat
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Spec Driven Development Kit w/HexaLayered Architecture | daily.dev
og:description: A developer turned their HexaLayered Architecture rules into a Claude Code-readable spec kit, addressing the problem of developers ignoring architectural...
og:url: https://daily.dev/posts/spec-driven-development-kit-w-hexalayered-architecture-lvvlu2wat
og:image: https://api.daily.dev/og/posts/lVVLU2wAt.png
og:image:alt: Spec Driven Development Kit w/HexaLayered Architecture
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Spec Driven Development Kit w/HexaLayered Architecture

**[Just Java](https://daily.dev/sources/justjava)** · [@agitrubard](https://daily.dev/agitrubard) · 2 min read · 1 upvotes · 0 comments

## Summary

A developer turned their HexaLayered Architecture rules into a Claude Code-readable spec kit, addressing the problem of developers ignoring architectural conventions. The kit includes a constitution.md file with testable architecture rules, a Spec Driven Development flow (/hexa:specify, /hexa:plan) to define what gets built and where classes belong, and a shell script hook that runs on every file write to catch violations (like services importing entities or public controllers) before code review, exiting with code 2 when rules are broken. A /hexa:bootstrap command auto-detects the base package, build tool, and test command to set up the architecture correctly from a project's first commit. The approach was validated against a real project called ays-be.

## Content

**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](https://github.com/agitrubard/hexalayered-architecture/pull/1)

#SpecDrivenDevelopment #HexaLayered #HexaLayeredArchitecture #Claude #ClaudeCode #CleanCode #HexagonalArchitecture #LayeredArchitecture #DDD #SpringBoot #Java

## Similar posts on daily.dev

- [GitHub's Spec Kit Puts the Spec Back in Software Development](https://daily.dev/posts/github-s-spec-kit-puts-the-spec-back-in-software-development-37w0wv590) · DevOps.com · 7 upvotes · 1 comments
- [Four cutting-edge tools for spec-driven development](https://daily.dev/posts/four-cutting-edge-tools-for-spec-driven-development-2dhiahwij) · InfoWorld · 2 upvotes · 0 comments
- [Spec Driven Development: When Architecture Becomes Executable](https://daily.dev/posts/spec-driven-development-when-architecture-becomes-executable-nzxwl96bo) · InfoQ · 7 upvotes · 0 comments
- [ArchSpec: Executable Architecture Specs for Ruby and Rails](https://daily.dev/posts/archspec-executable-architecture-specs-for-ruby-and-rails-3kvuxcldv) · RUBYLAND · 0 upvotes · 0 comments
- [Spec-Driven Development: Enforcing Agent Architectural Contracts](https://daily.dev/posts/spec-driven-development-enforcing-agent-architectural-contracts-xvqgn1fyd) · SitePoint · 3 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java), [#architecture](https://daily.dev/tags/architecture), [#claude-code](https://daily.dev/tags/claude-code), [#spring-boot](https://daily.dev/tags/spring-boot), [#spec-driven-development](https://daily.dev/tags/spec-driven-development)

[View this post on daily.dev](https://daily.dev/posts/spec-driven-development-kit-w-hexalayered-architecture-lvvlu2wat)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/spec-driven-development-kit-w-hexalayered-architecture-lvvlu2wat","headline":"Spec Driven Development Kit w/HexaLayered Architecture","text":"A developer turned their HexaLayered Architecture rules into a Claude Code-readable spec kit, addressing the problem of developers ignoring architectural conventions. The kit includes a constitution.md file with testable architecture rules, a Spec Driven Development flow (/hexa:specify, /hexa:plan) to define what gets built and where classes belong, and a shell script hook that runs on every file write to catch violations (like services importing entities or public controllers) before code review, exiting with code 2 when rules are broken. A /hexa:bootstrap command auto-detects the base package, build tool, and test command to set up the architecture correctly from a project's first commit. The approach was validated against a real project called ays-be.","url":"https://daily.dev/posts/spec-driven-development-kit-w-hexalayered-architecture-lvvlu2wat","datePublished":"2026-09-12T23:28:33.576Z","dateModified":"2026-09-12T23:28:52.600Z","author":{"@type":"Person","name":"Agit Rubar Demir","url":"https://daily.dev/agitrubard","image":"https://media.daily.dev/image/upload/s--gsC1qg-V--/f_auto/v1720083860/avatars/avatar_Qy2bbcmdRYiU4xLUetILb","description":"Software Engineer at Finartz | Technical Mentor \u0026 Consultant, Project Management Consultant","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":40}},"image":"https://media.daily.dev/image/upload/s--DWlW1cmk--/f_auto/v1789239827/posts/00g8XtNaG?_a=BAMAMicg0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/justjava","name":"Just Java"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Just Java","item":"https://daily.dev/squads/justjava"},{"@type":"ListItem","position":3,"name":"Spec Driven Development Kit w/HexaLayered Architecture"}]}
```

