Stop Fighting AI Drift. Control What Goes Into Context.
The 5-phase methodology I use to build CodeMySpec with AI - from stories to production code.
Define requirements in plain English
Map stories to Phoenix contexts
Write specifications that control AI context
Generate tests from design documents
Generate code that makes tests pass
AI drift compounds through reasoning layers. The farther the LLM's reasoning gets from your actual prompt, the more the output drifts from your intent.
LLM's reasoning slightly off from your intent β code generation is more off. Each inference step compounds the error.
Generate PRD β generate code from PRD β two layers of drift between your intent and the output.
Ask LLM to prescribe AND follow process β compounding error. Every time you ask the LLM to figure out the process, you add drift.
Remove drift by controlling exactly what goes into the LLM's context. No intermediate reasoning about requirements. No inventing process.
Design documents define the specifications
Tests define the validation
LLM only generates code to match both
Define requirements in plain English
Write stories yourself or interview with AI
Stories MCP Server handles interviews and generation
lib/code_my_spec/stories/story.ex
Map stories to Phoenix contexts
Map stories to Phoenix contexts using vertical slice architecture
Architect MCP Server guides context design and validates dependencies
docs/design/code_my_spec/stories.md
Write specifications that control AI context
Write design docs following template structure
Context Design Sessions orchestrator generates designs from stories
lib/code_my_spec/documents/context_design.ex
Generate tests from design documents
Write tests from design docs before implementation
Component Test Sessions orchestrator generates and validates tests
test/code_my_spec/stories_test.exs
Generate code that makes tests pass
Paste design + tests into LLM, iterate until green
Component Coding Sessions orchestrator implements and iterates until green
lib/code_my_spec/stories.ex
I built CodeMySpec using this method. The codebase is the proof.
Learn the methodology, works with any framework
Full automation with CodeMySpec, Phoenix/Elixir only
Update stories β regenerate designs β update tests β regenerate code. Version control shows impact. The process supports change.
Manual process works anywhere. Automation is Phoenix/Elixir only (for now).
No. Manual process is copy-paste. MCP removes tedium.
They optimize prompts. This controls context. Different approach.
Tests catch it. Iterate until green. If repeatedly failing, refine design. Tests are the validation gate.
Less overhead than refactoring AI-generated technical debt. Manual process takes time; automation removes overhead.
We can't find the internet
Attempting to reconnect
Something went wrong!
Attempting to reconnect