Live data from Hacker News

Domain-Driven Agents

coldtake.dev

21–29 of 29 posts

Re: Domain-Driven Agents

#23
post #13
post #6

I've also been a little-d DDD fan, and we've had luck with per-entity `md` files to language-independent document domain behavior/quirks/usages. I.e. an `Author.ts` has an `Author.md`, `Book.ts` has an `Book.md`. For agents, we've given them a skill to read & write the `md` files: https://github.com/joist-orm/joist-orm/blob/main/packages/co... And so agent-written `md` updates are showing up in PRs. So far it seems u…

Why not put the content from the md file in the code as documentation? Ideally, the code can actually help you structure that information. I've written a bunch of Haskell and OCaml like this, where the types in each module let me structure my documentation in a way that is actually easier for people—and maybe also LLMs—to track. As a bonus, it makes it more natural to keep the two in sync.

I currently use the separate md file to capture the mermaid diagrams about the code, it helps to get overview of the file and various scenarios. It is good to keep all documentation ideally part of the same code. But if documentation is more as part of the code, passion to read source file is reducing, for me.

*_learnings.md: I am also using one more _learning.md, that captures what agents learn while building this file. it depends the complexity of the source file. mainly if the source files is about low level, protocols and so on. even separate _learnings.md also helps. so have now. _learnings.md may be needed how much investigation we have done to produce a working protocol.c.

protocol.c, protocol.md, protocol_learnings.md

Re: Domain-Driven Agents

#24

i'm sorry to say that besides like the first paragraph, this article is mostly ai slop. i thought that we mostly weren't allowing ai written content on hn? (@dang whats the policy here?) aside from that, i think that this is overcomplicating a more basic idea. You should have agents that leave docs behind in your codebase, and those docs should be localized to the structure of your code, but you do not need any fancy…

[dead]

Re: Domain-Driven Agents

#25
post #7

When asked about DDD at a job interview I joked it was Debug Driven Development, when you start with empty directory and file the first bug "The app doesn't do anything. It should ..." Non-ironically that's pretty much the way I work with AI agents now.

Same. No spec. Just an empty folder and "it should do X".

Re: Domain-Driven Agents

#26
post #6

I've also been a little-d DDD fan, and we've had luck with per-entity `md` files to language-independent document domain behavior/quirks/usages. I.e. an `Author.ts` has an `Author.md`, `Book.ts` has an `Book.md`. For agents, we've given them a skill to read & write the `md` files: https://github.com/joist-orm/joist-orm/blob/main/packages/co... And so agent-written `md` updates are showing up in PRs. So far it seems u…

I get your point @stephen. In such areas, finding balance to not overcomplicate, can be a challenge. The approach I described works for me, though, as I'm focused on closing LLM statistical behavior within deterministic barriers. That's why I highly rely on schema-based ideas.

Re: Domain-Driven Agents

#27
post #4
post #2

Something i read in the earlier paragraphs about llms being easier to work with in greenfield projects… My experience has been the opposite. They work well on existing projects but are not so great at new ones (unless you are just vibe coding something simple). I think it has something to do with it being able to rely on years of established structure/conventions on existing projects that makes them better IME

My experience with greenfield is that when you're just starting out, you have to be really strict and careful about overall architecture, establish a framework, provide structure, separate concerns well. If the project is not throwaway, this first set of iterations is critical, without guidance LLMs will just bolt on things and produce special-cased spaghetti, even the very-frontier models. Once the framework is esta…

Totally agree. It's totally worth it to invest this way at the start.

Re: Domain-Driven Agents

#28
post #2

Something i read in the earlier paragraphs about llms being easier to work with in greenfield projects… My experience has been the opposite. They work well on existing projects but are not so great at new ones (unless you are just vibe coding something simple). I think it has something to do with it being able to rely on years of established structure/conventions on existing projects that makes them better IME

I’ve had a good experience with a greenfield project. The single thing that seems to have helped is that we all agreed to use OpenSpec early on, and to commit the specs alongside the code. I have no affiliation with OpenSpec and I don’t suspect it’s doing anything unique here, but having the intent develop alongside the code in the repository seems to have ensured that agents have a more holistic view of the project.…

> to commit the specs alongside the code.

Hmm, I'm still undecided when it comes to the best approach: commit or not commit. Now I'm leaning toward the second one, as the implementation can diverge from the spec files, even though I store some impl logs in specs. As a part of feature delivery, I update the main repo docs based on the spec and code written. IMO it makes context for the LLM a bit cleaner.

Re: Domain-Driven Agents

#29
I completely agree. At the early stage of service development I was recently in charge of Judging that this service will clearly continue to be domain-advanced I have refactored everything using DDD patterns. And as expected, the service rules are becoming more and more complex, but thanks to the well-prepared bounded context boundary definitions and Ubiqutous language definitions at the start, it hasn’t gotten messy and Claude is still developing it.

The cost of writing code is now converging to zero, but Communicating with people and setting precise boundaries and language settings for the service is I believe that it is still an extremely remain role for developers.

My concern is that none of our services have applied the DDD pattern. I can’t even refactor the existing legacies If they could build the service again, they would have strongly insisted that everything be built using DDD patterns...

I look forward to the next article.

Post reply on HN