Rune – Open spec pattern for consistent AI code generation
2 points
1 hour ago
| 2 comments
| github.com
| HN
vict00r99
1 hour ago
[-]
AI coding tools generate different code every time for the same requirement.

RUNE is a specification pattern that fixes this: define a function's signature, WHEN/THEN behavior rules, and test cases upfront.

Give the same spec to any AI tool — the generated code has the same behavior.

It's a pattern, not a framework. Works as YAML files or Markdown sections. Any language, any AI tool, no installation.

Includes 7 skills (markdown files you load into your AI tool) for the lifecycle: create specs, validate, refine, generate tests, detect drift, reverse-engineer from code, multi-language generation.

This is the GitHub project: https://github.com/vict00r99/Rune-stone

reply
rondaerth92
1 hour ago
[-]
How do you map dynamically typed languages? Where types are determined at runtime rather than at compile time
reply
vict00r99
51 minutes ago
[-]
You don't map the types, you map the behavior.

Define a behavioral contract (inputs, outputs, edge cases) with test cases, and let each language handle types idiomatically. `dict[str, Any]` becomes `Record<string, unknown>` in TS, `map[string]interface{}` in Go, `HashMap<String, Box<dyn Any>>` in Rust. You don't force one type system onto another.

For dynamic languages, type hints document intent but tests enforce the contract. If the function accepts the specified inputs and produces the specified outputs, the contract is satisfied, regardless of whether types are checked at compile time or runtime.

What do you think?

reply