Building an RAG with Ralph and a spec-driven development approach so I don’t have to design

I need to automate one of my content pillar generations because I’d rather spend my time somewhere else. Landing a job, for example.

This is what I had in mind

The idea & vision

an oversimplified product flow on generating reels
Oversimplified user flow. *BYOK : Bring Your Own Key (API Key)

And this is the result

1:1 implementation with the vision. With a couple of whistles and bells.

Prompt engineering is not scalable

Among any other things about building a tool with AI is prompt engineering. Every time I want the AI to build something for me, I have to type it over and over again in a different chatroom. It’s unmanageable, undocumented, and hard to iterate and trace back.

Here goes SDD (Spec-driven development), arguably the closest AI harness that mimics the Agile lifecycle from understanding the vision until deployment.

Spec-driven development

Idea, PRD, Epic, User stories, Tasks, and Subtasks

Familiar? It's because the SDD principle isn't prompt engineering; it's context management. Every context is different at each level of granularity, depending on the task to run.

My context structure for Spec-driven development, managed with Markdown

The execution layer continues until finished

You may be wondering: if prompt engineering is “not needed” to create the product, then how does the AI execute? The answer: Ralph loop.

Ralph’s development loop: every failure will never touch spec anymore. Iterate until it marked as Pass

Ralph loop is an AI Agent loop that executes the task defined in the user story. Ralph will continue doing a batch of user stories, and it only stops when all the user stories per epic are done. My job is now only to do UAT, brainstorming, prioritization, and reporting bugs for improvements after Ralph finishes the work.

Managing the context

Where do the PRD, TDD, Epics, Stories, Tasks, and Subtasks lie? How to ensure the context scalability and visibility of the specifications?

Comparison on managing context and specification — select based on your product or team size

There are two distinct ways of managing the context. If you prefer something more human-readable that scales across the team, use Linear and its MCP. If you are a solo builder and not intending to share the code with anybody, a simple markdown is enough. Cheaper to digest by your AI provider.

ROI

A total of 101 user stories were executed. Consuming 479 million tokens in 86 sessions. With this RAG system, I can create 7+ reels in under 1 minute. I only invested $20, but I can use this for a very long time and save my time.

The usage value is 10x higher than the actual money spent

At the moment, the pricing compared to the actual value of each model is arguably cheap. 1 user story is equal to 1 Indomie.

A thought for the future

Dealing with context in Markdown is tiresome but cheap. For a solo product builder i think it still works. But if your work requires more people to handle it, consider using Linear, onboard all your peers there, and use Linear MCP so all of the PRD, epic, user story, task, and subtask are visible across the team and AI Agent.

Footnote

/init-sdd-ralph

A Claude skill that I made tailored for the SDD approach, with the Ralph loop as the AI agent executor. Use this to convert or start a project. To instantiate, execute /init-sdd-ralph in your Claude Code terminal.

Want to contribute? visit the repository https://github.com/claudiofrs/init-sdd-ralph/


Building an RAG with Ralph and a spec-driven development approach so I don’t have to design was originally published in Bootcamp on Medium, where people are continuing the conversation by highlighting and responding to this story.

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论