Spec-Driven Code Evolution
CodeSpeak is built on a simple premise: a lot of code contains details that go without saying for humans. Before LLMs, machines couldn't figure these out, so we had to spell them out. Now we don't have to.
Specs replace code
In CodeSpeak, you write specs โ plain English descriptions of what your software should do. CodeSpeak generates the implementation. You maintain the spec, not the code.
This is similar to how C raised the level of abstraction above Assembly, and Java above C. CodeSpeak raises it further: you describe what you want, and the toolchain figures out how.
Specs are more concise than code
Specs capture essential complexity โ the parts of your application that a machine can't figure out on its own. Everything else is boilerplate that CodeSpeak handles.
In practice, specs are typically 5-10x shorter than the code they generate. A spec change of +23 lines can generate +221 lines of code. This isn't just about typing less โ it's about reasoning at a higher level.
How specs evolve
Specs evolve the same way code does, but at a higher level of abstraction:
-
Add a feature โ add lines to the spec, rebuild. CodeSpeak turns the diff in the spec into a diff in the code.
-
Remove a feature โ delete lines from the spec, rebuild. The generated code shrinks accordingly.
-
Fix a spec bug โ if the behavior is wrong because the spec is wrong, edit the spec and rebuild.
-
Fix an implementation bug โ if the spec is right but the code has a bug, use
codespeak changeto fix the code without changing the spec. -
Split a growing spec โ as a spec gets large, use imports to break it into focused modules. Each module has its own spec and its own managed files.
From code to specs
Existing code can be migrated to specs using codespeak takeover. It reads your source files and generates a spec that captures their behavior. From that point on, you edit the spec instead of the code.
See the Takeover tutorial for a step-by-step walkthrough.
Modularity for humans
CodeSpeak specs are designed for human teams working on large applications over time:
- Conceptually self-contained modules โ each spec describes one concern
- Clear dependencies โ the
importdirective makes relationships explicit - Scoped changes โ modifying one spec doesn't affect unrelated parts of the codebase
- Version control โ specs are plain text files that work with git, code review, and all existing workflows