Urgent.News

What's breaking now, across thousands of outlets.

Tech

Spec Driven Development Kit w/HexaLayered Architecture

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…

A developer has introduced a new method for ensuring adherence to HexaLayered Architecture rules through the implementation of Spec Driven Development and a shell script. This innovative approach aims to eliminate ambiguity and streamline the development process.

Previously, new team members would often inadvertently incorporate TicketEntity into the service layer during pull requests, sometimes bypassing oversight. To address this, the architecture rules were translated into testable guidelines, housed in the constitution.md file located within the /hexa directory of the repository. The rules clarify aspects such as the visibility of classes, their respective package placements, and the hierarchical progression of entities.

In tandem with this, the Spec Driven Development flow was introduced. Commands /hexa:specify define the future build's components, while /hexa:plan outlines which classes should reside in specific packages. Once these files are open, developers are guided directly by the predefined architecture without needing to consult external sources.

To reinforce adherence to these rules, a shell script has been integrated. This script scans for violations each time a file is saved. If a service references an entity, a controller remains public, or a class intrudes into another module's repository, the script terminates with a code 2, notifying the model immediately without waiting for a code review. In testing, the developer encountered and rectified a bug within the script itself.

To transfer this architecture to another project, only two commands are necessary: cp -r .claude . /hexa:bootstrap. The script identifies the base package, the build tool (Maven or Gradle), and the test command. During the initialization of a Spring Boot project from scratch, the architecture is set correctly from the very first commit.

This system draws from existing practices, exemplified by ays-be, which successfully utilizes the architecture. For more information, the detailed implementation can be accessed at https://github.com/agitrubard/hexalayered-architecture/pull/1.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Mapping Page Ranges to Output Files: A Data-Driven Decision Tree for PDF Splits

Most engineers treat splitting a document into parts as a trivial action — choose a page, hit the button, get a smaller file.

  • Page ranges encoded in PDF using indirect objects and cross-reference table
  • MediaBox and CropBox define visible page region, normalization may lose vector fidelity
  • Three valid splitting strategies: fixed-size, boundary-driven, selector-driven

A Screenshot Is Not an Agent Failure Artifact

A screenshot of an execution tree looks useful in a pull request. It is also missing almost everything a skeptical reviewer should ask: Which trace produced it? Was the trace changed after capture?

  • Screenshot alone insufficient for reviewer assessment
  • Raw JSONL output may expose sensitive identifiers
  • Bundle generated via agent-inspect tool with verification

More from Saturday 12 September →