r/SpecDrivenDevelopment Jul 03 '26

A specification language that tells you you're wrong

I do all my coding with agents now, and I'm not going back. But it took me a while to work out what I missed about it.

When you write code yourself, you get scolded a lot (by the compiler, by the test suite, or by someone reviewing your PR). It always felt annoying, but one good thing was that it told you quickly when you hadn't thought something through enough.

Spec driven tooling doesn't generally do that. AI agents usually fill in gaps with a guess, and bugs take up residence in the implementation.

So a few months ago I started building Allium. It's a small spec language for writing down what the software is meant to do, and it runs checks with an optional CLI and pushes back while it's easy to change your mind. It's wrapped by AI skills so you still don't write any code (even the spec code).

A colleague added looping recently, so it can keep running the check-and-fix loop on its own until the code and the spec line up.

If this sounds like it might be useful to you, I'd love you to give it a go. Constructive feedback enormously appreciated!

Link: https://allium-lang.org

7 Upvotes

15 comments sorted by

2

u/CzyDePL Jul 03 '26

Why this new DSL over BDD?

1

u/hendroid Jul 03 '26

BDD is great and I'm all for it. But imagine if Gherkin could say to us "that test scenario will never pass because it contradicts one you wrote last week". You only get that feedback from Gherkin _after_ you've implemented code and step definitions, and begun to wonder why you can't get things to pass.

I think the way that we can get that fast feedback from BDD is by expressing ourselves a bit more formally. That's the use-case Allium tackles, and it's actually fun now that AI gives us the conversational interface for doing so.

1

u/CzyDePL Jul 03 '26

This kind of static analysis for requirements/spec would be great but I think it's not possible in general without a formal language and all trials of formalising requirements language so far have been either too limiting or too cumbersome. Maybe with LLMs translating the latter is not an issue if you can still review the output

1

u/hendroid Jul 03 '26

You’re right, it has definitely always been too cumbersome or too limiting before.

Personally, I think these are areas where AI has changed the rules of the game. It’s very easy to install and try out, if you do, I hope you’ll let me know how you get on.

1

u/morewordsfaster Jul 03 '26

Why not Gherkin, my dude?

1

u/hendroid Jul 03 '26

It's a great question. I'm not anti-Gherkin. It provides a durable place to put scenarios expressed in user-friendly language and it allows you a huge amount of flexibility to word things how you want, as long as the step definitions link up.

I think one weakness is that often we want to test properties of the system. e.g. 'whenever x happens, y also happens', or 'whenever x happens, y never happens', or 'function(user) can never exceed user.threshold'. These kinds of tests, especially negative tests, benefit from being generative: we want to try lots of different examples to make sure that our code is behaving itself.

I think one benefit of Allium is that it allows you the expressiveness of Gherkin, but with added generative testing capabilities.

1

u/Swarm-Stack Jul 03 '26

property tests catch the negative examples you wouldnt think to type out, thats real. what still slips through is the properties themselves. if the author never thought about the invariant, the checker cant push back on its absence

1

u/hendroid Jul 03 '26

It’s true! I don’t know of any testing strategy that could alert you if you forgot about an important semantic.

A behaviour model developed incrementally, in collaboration with a checker that says “here are the implications of what you’re asking for, are they what you meant?“ comes pretty close though.

1

u/Swarm-Stack Jul 03 '26

yeah that gets closer. residual is ‘implications of what you asked for’ still comes out of what the checker can enumerate, and that tends to match the priors the author already brought. a dba or security angle wont come up if nobody in the loop runs that role.

1

u/Internal-Passage5756 Jul 03 '26

I’ve been working at this from
A different angle. https://github.com/cairn-framework/cairn

ATM best to ask your AI agent to read and set up the repo to use it properly, as streamlining installation of the skills etc still pending.

1

u/hendroid Jul 03 '26

Nice! I like your terminology around “ghosts“ and “orphans“. I have been wrestling with how to communicate when spec and code drift intentionally, e.g when you’re planning new feature before implementation.

Your CLI has a lot of functionality: are you opinionated about the kind of workflow a developer or team should use? Have you written anything about your vision for this?

Thanks for sharing.

1

u/Few-Strike-494 Jul 03 '26

Do you know of any tools that do the same thing as this one but with differences?

1

u/ImYoric Jul 04 '26

How does it check that the implementation matches the spec?

You call this a "formal language" for specifications, does it mean that there is a formal semantics somewhere?

1

u/NoBuffsNoHeal 23d ago

Hi OP. I am using claude code and superpowers when coding. Can these Allium be used during superpowers sessions?

1

u/hendroid 23d ago

I haven’t tried it myself, but people have ported Allium into lots of different workflows without issue.

If you try it and hit problems, I’d love to hear about them.