frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Design is Code – UML to TDD tests that constrain AI code generation

https://mossgreen.github.io/introducing-design-is-code/
2•mossgu•1h ago
Two root causes make AI code generation unreliable:

Natural language isn't a contract. It's ambiguous by nature. Same prompt, different code, every time. There's no determinism.

Cost is asymmetric. AI generates at zero cost with zero responsibility. You review at high cost with full responsibility.

These compound. Ambiguous input produces unpredictable output. Unpredictable output demands expensive review. And if no one designed the code, no one can defend the architecture, no one can maintain it, and no one owns it.

DisC (Design is Code) applies London-school TDD to AI code generation. You draw a sequence diagram. Each arrow becomes one verify() in a mockist test. The tests leave exactly one valid implementation. The AI doesn't interpret — it types what the tests require.

It ships as a Claude Code skill. Works best with Opus, should be fine with Sonnet.

Here's a real example. This diagram:

  @startuml
  InvoiceService -> OrderRepository: findAllByCustomerId(customerId)
  InvoiceService <-- OrderRepository: orders: List<Order>
  InvoiceService -> InvoiceBuilderFactory: create()
  InvoiceService <-- InvoiceBuilderFactory: invoiceBuilder: InvoiceBuilder
  loop for each order in orders
      InvoiceService -> InvoiceBuilder: addLine(order)
  end
  InvoiceService -> InvoiceBuilder: build()
  InvoiceService <-- InvoiceBuilder: invoice: Invoice
  @enduml
Generates these tests:

  @Test void shouldFindAllOrdersByCustomerId() { verify(orderRepository).findAllByCustomerId(customerId); }
  @Test void shouldCreateInvoiceBuilder() { verify(invoiceBuilderFactory).create(); }
  @Test void shouldAddLineForOrder() { verify(invoiceBuilder).addLine(order); }
  @Test void shouldBuildInvoice() { verify(invoiceBuilder).build(); }
  @Test void shouldReturnInvoice() { assertThat(result).isEqualTo(invoice); }
AI implements the only thing that passes:

  public Invoice generateInvoice(UUID customerId) {
      List<Order> orders = orderRepository.findAllByCustomerId(customerId);
      InvoiceBuilder invoiceBuilder = invoiceBuilderFactory.create();
      orders.forEach(invoiceBuilder::addLine);
      return invoiceBuilder.build();
  }
4 arrows + 1 loop → 5 tests → 1 possible implementation.

Java + Spring only for now. Orchestration code only (not algorithms). PlantUML format. The mockist coupling tradeoff is real — but when AI writes the implementation, refactoring cost moves from code to the diagram.

Try it without installing anything — clone the demo repo and run in a Claude Code session:

  git clone https://github.com/mossgreen/design-is-code-demo
  cd design-is-code-demo
  /disc 01_hello-world.puml
Blog: https://mossgreen.github.io/introducing-design-is-code/

Plugin: https://github.com/mossgreen/design-is-code-plugin

Happy to hear what breaks, what's missing, and whether this is worth expanding to other languages.

Urban sprawl is a tragedy of the commons (2021)

https://devon.postach.io/post/urban-sprawl-is-a-tragedy-of-the-commons
1•surprisetalk•42s ago•0 comments

The road to hell is paved with asphalt (2024)

https://devon.postach.io/post/the-road-to-hell-is-paved-with-asphalt
1•surprisetalk•44s ago•0 comments

Show HN: TypeGraph – Type-safe graphs on Postgres/SQLite (no graph DB required)

https://typegraph.dev
1•pdlug•48s ago•0 comments

Trump Fake Electors Plot

https://en.wikipedia.org/wiki/Trump_fake_electors_plot
1•surprisetalk•49s ago•0 comments

Tech Turned Against Women

https://www.ft.com/content/60e2a900-8999-46cc-8107-4f468f442aae
1•tbs1980•53s ago•1 comments

Proof that at most one of e*pi and e+pi can be rational

https://math.stackexchange.com/questions/1095416/proof-that-at-most-one-of-e-pi-and-e-pi-can-be-r...
1•surprisetalk•1m ago•0 comments

Huntarr – Your passwords and your ARR stack's API keys are exposed

https://old.reddit.com/r/selfhosted/comments/1rckopd/huntarr_your_passwords_and_your_entire_arr_s...
1•pavel_lishin•2m ago•1 comments

Bareclaw: Claude Code Is All You Need

https://elliotbonneville.com/claude-code-is-all-you-need/
1•elliotbnvl•2m ago•1 comments

Show HN: Bruce – AI signal radar for Reddit/HN that learns what matters to you

https://smartbruce.com/
1•rklosowski•2m ago•0 comments

The Prisoner's Dilemma: Why Rational Choices Can Lead to the Worst Outcomes

https://twitter.com/Riazi_Cafe_en/status/2025621049082089548
1•ibobev•3m ago•0 comments

We Shouldn't Fight Automation

https://www.update.news/p/why-we-shouldnt-fight-automation
1•StefanSchubert•3m ago•0 comments

First-of-a-kind stem-cell therapies set for approval in Japan

https://www.nature.com/articles/d41586-026-00585-x
1•Brajeshwar•3m ago•0 comments

Bhutan's crypto experiment shows how hard digital money is in the real world

https://restofworld.org/2026/bhutan-bitcoin-tourism-payment-adoption-failure/
1•Brajeshwar•4m ago•0 comments

AI 2027 and the Shrinking of Understanding

https://nader.io/posts/ai-2027/
1•nader•4m ago•0 comments

OpenClaw Meets Healthcare

https://evestel.substack.com/p/how-i-build-my-personal-openclaw
1•brandonb•4m ago•0 comments

I'm a 15-year-old girl. Here's the vile misogyny I face daily on social media

https://www.theguardian.com/commentisfree/2026/feb/23/15-year-old-girl-misogyny-social-media-onli...
1•randycupertino•4m ago•0 comments

Female Reproductive Tract-on-a-Chip for selecting healthier sperm

https://www.nature.com/articles/s41378-026-01165-9
1•TEHERET•4m ago•0 comments

Covert DEI Design Techniques for Earthly Survival in Hostile Contexts

https://dl.acm.org/doi/10.1145/3750069.3755946
1•tokai•4m ago•0 comments

LFM2-24B-A2B: Scaling Up the LFM2 Architecture

https://www.liquid.ai/blog/lfm2-24b-a2b
1•salkahfi•4m ago•0 comments

SQL history lesson with Oracle V2

https://databaseblog.myname.nl/2026/02/some-sql-history-with-oracle-v2.html
1•dveeden2•4m ago•0 comments

Metabolism, not cells or genetics, may have begun life on Earth

https://bigthink.com/starts-with-a-bang/metabolism-begun-life-earth/
1•Brajeshwar•4m ago•0 comments

Walkman.land

https://walkman.land/
1•ohjeez•5m ago•0 comments

Show HN: DoNotify – Google Calendar reminders as phone calls(not notifications)

https://donotifys.com
1•micahele•5m ago•0 comments

There's software, and then there's promptware

https://kelvinfichter.com/pages/thoughts/promptware/
1•kfichter•6m ago•0 comments

EDRi Open Letter: We say no to Big Tech mass snooping on our messages

https://edri.org/our-work/open-letter-we-say-no-to-big-tech-mass-snooping-on-our-messages/
1•robtherobber•8m ago•0 comments

Tim Cook Warned by CIA That China Could Move on Taiwan by 2027

https://www.macrumors.com/2026/02/24/tim-cook-warned-by-cia-china-taiwan-2027/
1•stalfosknight•8m ago•1 comments

IBM stock tumbles 10% after Anthropic launches COBOL AI tool

https://finance.yahoo.com/news/ibm-stock-tumbles-10-anthropic-194042677.html
2•jspdown•10m ago•0 comments

Data center builders thought farmers would willingly sell land, learn otherwise

https://arstechnica.com/tech-policy/2026/02/im-not-for-sale-farmers-refuse-to-take-millions-in-da...
3•stalfosknight•10m ago•0 comments

Towards a Science of AI Agent Reliability

https://arxiv.org/abs/2602.16666
1•smartmic•10m ago•0 comments

How we made Docker builds 193x faster across AI agent sessions

https://blog.helix.ml/p/how-we-made-docker-builds-193x-faster
1•quesobob•12m ago•0 comments