{"slug": "spec-driven-development-kit-w-hexalayered-architecture", "title": "Spec Driven Development Kit w/HexaLayered Architecture", "summary": "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.", "body_md": "**Something has bothered me ever since I wrote HexaLayered Architecture.**\n\nThe 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.\n\nSome 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.\n\nInside 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.\n\nThere 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.\n\nI 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.\n\nWhile I was testing it, I found a bug in my own script, but that is another story.\n\nYou only need two commands to move it to another project:\n\n`cp -r .claude .`\n\n`/hexa:bootstrap`\n\nbootstrap 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.\n\nI 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.\n\n🔗 [https://github.com/agitrubard/hexalayered-architecture/pull/1](https://github.com/agitrubard/hexalayered-architecture/pull/1)", "url": "https://wpnews.pro/news/spec-driven-development-kit-w-hexalayered-architecture", "canonical_source": "https://dev.to/agitrubard/spec-driven-development-kit-whexalayered-architecture-578i", "published_at": "2026-09-12 19:07:26+00:00", "updated_at": "2026-09-12 19:23:54.277575+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools"], "entities": ["Claude Code", "HexaLayered Architecture", "Spring Boot", "Maven", "Gradle", "ays-be", "GitHub"], "alternates": {"html": "https://wpnews.pro/news/spec-driven-development-kit-w-hexalayered-architecture", "markdown": "https://wpnews.pro/news/spec-driven-development-kit-w-hexalayered-architecture.md", "text": "https://wpnews.pro/news/spec-driven-development-kit-w-hexalayered-architecture.txt", "jsonld": "https://wpnews.pro/news/spec-driven-development-kit-w-hexalayered-architecture.jsonld"}}