Rails World 2026: From Prompt to Rails: An Online Rails App Generator (Paweł Strzałkowski) Video: https://www.youtube.com/watch?v=0_ZLKWlc7FY Talk page: https://www.rubyevents.org/talks/from-prompt-to-rails-an-online-rails-app-generator Unedited machine transcript, generated with Whisper. It contains recognition errors (names, technical terms). Check the video before quoting. ---- Every website starts with a dream. My son would say he wants a website that just makes him rich. But a famous David has once said that he wanted a blog with posts and comments and here we are. I also have a name called who would really like to have an internal HR web application for his company. All of them can now fulfill their dreams. There is a world of LLM-based app generators. You go in there, you put your idea inside of a prompt box, and there it is. You go to Lovable, Bold, New, and just fill that prompt. There is just one problem. to just such websites produce some version of JavaScript. But it doesn't have to be this way. As far as I know, Ruby on Rails is still the best framework to build a web application. So in order to bring Ruby on Rails to people who build just using Trompbox, today I'm going to tell you about Hifumi, my online Rails app generator. Hi, I'm Pawel Strałkowski. By the day, I'm the CTO of Visuality, a Ruby agency from Warsaw in Poland. I'm also a founding member of Century Perspective, a consultancy that helps mature, raise product in this AI era transformation. This year marks the 30th anniversary of me building my first website. Back then, it was just HTML. Today, I'm prototyping with LLMs. I'm teaching agency coding. LLM-based applications and websites, all that still with Ruby and Rails. If you want to chat about any of that, please find me on GitHub or LinkedIn or at the Corridor later on. You may ask yourself why web generators even matter and why they even exist. Because when we look around, there are already like 30 million people using agentic development tools. Yet there are 6 billion people using the internet, and they all have ideas and dreams. But since there are already so many generators online, why do we bother introducing Crails to that? Basically, the prompt box that the non-technical people would use owns their next startups. Whatever technology this prompt box produces, the big portion of their journey. In general, building with Rails just increases awareness of people, of LLMs, and just increases the richness of our ecosystem. Yeah, so I went on this journey to build a Ruby on Rails generator. Well, in here the project almost failed. name with something crazy like maybe a locomotive my best shot was the depot but i didn't didn't like it that much so i started thinking about falling back to the japanese heritage of ruby and i also started to think that it should be as easy as building an application should be as easy as one two three thankfully i can speak some japanese well i can count to 99 and that's it so i thought one two three How about Ichinisan? But it's a mouthful. It didn't really feel right. So I talked a lot with my friends. You might know him, Claude. And it said that there is another way, more traditional way of speaking in Japanese, at least of counting at least to 10. And it would go Hifumi. Actually, Hifumi is also a name, a first name. So it's kind of a word which really resonated with me. So here it comes, Hifumi. open source blueprint for Rails app generator. It's already in production as hifomi.dev. You can go there, you can build your first application. Just one thing, registration requires an open router API key. I'm not paying for your tokens. That time has passed. But still, you can go there. It's open source, so you can clone it, you can run it locally, and you can build whatever you want on top of that. of such a generator. You come with an idea, the application builds your idea, then you can preview that, refactor, sorry, maybe refine a bit. And eventually it's your project, right? So you export it to your own GitHub. And as Rails promise says, you go to IPO. Simple enough. Let's start with the idea. You go to Hifomi and you provide your functional requirements, the business needs. And you work with business. When they come to you with their ideas, you ask follow-up questions because the idea isn't clear ever. Hifumi does it for you. So when someone comes with an idea, it asks several follow-up questions and eventually asks, are we ready to build? Let's see how it looks. This is a panel in Hifumi. I'm already logged in. Let's start a new project. The centerpiece is a big input box. select different models on different subtasks within the workflow. On the right, you have some example ideas, but today we are building a personal fitness app. So we've put it as a simplified prompt. We start building. Here it is. You can probably recognize this is Ruby LLM. We get some follow-up questions. So we answer yes, no, whatever, do what you want, depending on the depth you want to go in. There is also a question whether you want to include some example data in your application. Because without that, it looks like crap. And when there is some example data, it really shines. So I send the answers. Now the question is, okay, so this is how I understand about your application. Do you want to start building? Yes, please. And we quickly get an answer from the assistant. Okay, the build has started. This is, again, what I understand about the application. I can go to preview and I can see that there is a plan that is going to be implemented to get to this application. So now the plan. Every change needs an implementation plan. Of course, we could just run the user prompt directly, like in slash goal in Cloud, for example, and we can just build with an agent whatever the user asks for. But to get to a great application, we really need to fill in the gaps of what user didn't know to ask for. Because as you probably know, with agentic coding, whatever you don't say will be used against you one way or the other. So to be able to build this application, we want to first start with building an implementation plan divided into phases. So let's go back to the original dream of Ruby on Rails. this prompt, I'd like to have a beautiful blog with posts and comments into HIFO.me, edit answers with a five-step plan. It starts with adding post models and comments, then layout, then some seeding to the database, and eventually end-to-end integration testing. Looks quite nice. But a plan isn't just a set of those summaries, those quick sentences. Each step is an elaborate prompt for an agentic tool to implement this very specific step. This is just a snippet. It goes on and on. It's just like a page of text for each of the steps. And when all is implemented, this prompt and this plan results in this. We could have asked for a specific kind of layout, a specific kind of arrangement. We didn't, so he, for me, decided to go with this. But David's dreams do not settle on one goal, right? You've heard today. I've heard there is a new dream, a part of AI, and it's about making everything about Omarchie. So I entered this prompt, made the blog about Omarchie into Hifumi project chat. Again, I got a plan, rebrand, restyle, restyle, and so on. Each step, again, is a full prompt for engineering implementation. And when all is said and done, our blog transformed into this. new styling, new fonts, new content. Basically, we've quickly created the application and modified it to our new needs. So, to recap, with Hifumi, whenever you start the application, it first builds an implementation plan. The plan is based on the fact that Hifumi always starts with a Rails new skeleton app. So, it never creates it from scratch. It starts by copying some files. starts implementation it also thinks what front end template it should use what kind of what kind of colors what kind of fonts just to leave it out from the later implementation so with creation of this plan the best hint i can give you to you guys whenever you build a generator the last point is the most important put the main feature at the root path because otherwise hifumi could generate like the best app in the world you open that and there is nothing so that's very essential however when we want to modify plan the plan has a bit different shape you we have to make sure that the agent eventually that's going to build the application the modification understand that the application already exists that it should modify not not just recreate everything from scratch all right so we have a plan the plan is ready divided into phases now we want to build the new race application You've already seen this. This is the plan in Hifumi where we have each stage is marked as either completed, generating or pending. I will play a bit so you can see that the generating part has been completed and now the next phase is being implemented. We have live changes thanks to hotwire and active support notifications. about the domain language of HIFOMI. I've said we have a plan divided into phases. The domain word, the domain term for HIFOMI for a single phase of plan is revision. So a plan is divided into revisions, which together form the full plan. Each revision, as you've seen, has a goal, one sentence as a summary, and the scope of works. of the plan, each phase of the plan is implemented in the workflow. Workflow is a set of steps. Some of them are deterministic, some of them are LLM-based. When a revision is set and done, is ready, what we get are two commits into a Git repository, one with the changed code and the other with documentation. implemented using Roast. Roast is Shopify's open source Ruby DSL for workflows, especially those that mix deterministic code changes and LLM-based code changes. In here, I could have used Ruby LLM for workflow part as well, but I wanted a clear separation between Ruby LLM, workflow passed. I wanted to ask you how many people, how many of you use Ruby LLM, but I cannot see you, so I won't, but I hope you all updated to Ruby LLM 2.0, released recently, and I really thank Carmine for creating Ruby LLM that I could use this in here, because otherwise this project wouldn't exist. So, I've mentioned I use Ruby LLM and I use to fully decouple those two parts. So basically two great tools for Hifumi. Let's go back to the Roast workflow. This is a set of steps that is run for every revision. So for every phase in the plan. We start by building a prompt. A prompt is, first of all, it starts with the tasks, the revisions prompt, the scope of works. Then this prompt contains the so far created documentation of the project. It contains a kind of snapshot of the current workspace. It also contains some rules, for example, saying do it the Rails way or fill with tests. Once the prompt is ready, we just push it to Cloud. Yes, Hifumi is fully coupled with Cloud code because it's my tool of choice. Of course, it could be redone in codecs, but this is exactly why I need your open router API key, or in general, cloud-compatible API. And it runs with the best flag ever, dangerously skip permissions, because we don't want to ask the user of Hifumi about anything. So this one, this part implements the revisions change. After that, of course, we have to verify, but before that, one remark, this has one great benefit. It's free in localhost, provided that you have a cloud subscription. You can test HIFUMI as much as you want and don't pay a penny for code or documentation generation. The conversation with LLM through Ruby LLM still runs on open router, but that's only pennies. Right. So, once we implemented the code, we want to verify with each revision, Does it still work? Does bundle work? Does sidebar check go through? I also check all the get pages, whether they error out or not. And I also, of course, run, Hifumi runs the full test suite of the application. And when it passes, we go through. But when there are any errors, we try to fix the errors first in a deterministic way. Let's say that the agent forgot to run bundle install. do it in here, but if there are no deterministic errors to be fixed, then we push another fixing prompt to the agent once or twice and try to fix the error this way. Once all that is set and done, we check if it still fails. If it fails, we say, okay, this revision's build just failed, and let's reset our Git repository of our application back to before the revision. But I haven't seen that in three months, actually, in Hivomi. But if everything passes, we commit the code, we generate the new documentation, and we commit the documentation as well. So, after all phases are done, we see everything completed. So, our plan has been implemented. The most important thing probably about the build is where it happens. we can't really run all that cloud dangerously skip permissions directly on the server. So every revision spawns a new Docker container. It's a throwaway one. You can see minus minus RM. So it's going to be gone after this revision is complete. And of course, it's not a full separation. It's just Docker, but it's some separation nevertheless. So each revision, each roast process runs in a separate Docker container. Now, the most fun part for me to implement was the preview, because how do you preview a Rails app that was built on another Rails app? First of all, let's see. Here's an app built with a fully refined prompt. You can see the length of it. Nothing in it is technical. There is nothing about Rails. basic business needs and the build has started and finished so the plan is gone i start i click show preview and i get the page in an iframe let's enjoy the page for a little bit you can click through it but you can also open it in a in a separate tab and the next minute Please enjoy. It's a one-shot application in Hifumi. I just wanted to show you a fully working Ruby on Rails application where you can register. can find i don't remember if i said it that's a page where you can find uh organize a hike hiking trip and you can find find yourself one so i wanted to join this but it's already full so i now i'm looking for another hike to join let's go to england only two people coming so let's ask them to to take us with them and when i go to my account i can see pending request. So, let's say it's not rocket science, but it's a fully operational, quite nice-looking Ruby on Rails page. So, let's see how that preview came to be, how you can spawn such a preview inside of a Rails application. We start by using a lot of Docker. So, the only terms that I'm going to use are docker and camel proxy. So we start by building the Docker image, and then we run container. As easy, as simple as it gets. Docker run with a lot of attributes. When we start this container in production, this container is not yet visible to the open internet. But we already tell it with this preview host argument what URL is going to be visible at. to be visible at projectid.preview.hifumi.dev. I shouldn't use hifumi.dev for preview, but that's a long story. However, in localhost, I get it much easier. I can just bind it, bind the localhost to any port, right? What we do every day. So in development, I just bind it to localhost and port 3000 plus project ID. So some project would go under, for example, localhost 3010. I run my container. The page is already running. Now what I do next, I health check. So I just curl into /app, so a native Ruby on race endpoint. And when also it's done, with health check in production, I have to route this container to the outside world. So I run docker-exert-camal-proxy, again, with a bunch of other attributes. After this step, anyone can get to this site. it is done through a solid queue job, I still maintain the context of the Hifumi Rails application. And I can just broadcast the change to the user that requested the preview. So all I do is I broadcast and Hifumi shows an iframe pointed to our new page. None of that would have worked if we didn't have async capabilities in Rails. So, all resource-heavy operations are deferred to background processing, of course, but still with this complexity of HIFOMI, it only uses five jobs. But even a message incoming for this LLM chat is deferred to solid queue jobs, solid queue job, and what you see, the response from the agent, all the actions are delivered via hotwire. Hifumi, I planned on submitting another talk to Rails world, and that was supposed to be about Pub/Sub, so publisher subscriber pattern, which I really love the topic, and maybe next year. In Rails, you have a very strong mechanism called active support notifications, where you can publish an event and subscribe to that event to consume it and react. in HIFOMI, I publish events, again, only five of those, and I can subscribe to that. So for example, whenever a new plan is requested, so we are about to build something, the event is called instruction requested. It means we are about to build a new plan. So if we are building something, we should probably close the preview if any of those are running for this project. So whenever a new plan is requested, I put a stop preview job i enqueue the stop preview job to to stop the previews that are running this way i can decouple fully decouple two sides of the application the one for building and the one for for preview without any direct connections between them probably the most important part the project belongs to you not to hifumi not to me so when you finish your build or are anywhere on your way, you can export it to GitHub easily to a private repository. You can review that later on because, again, each revision was saved under two separate commits. And even if you export, you can then still keep building with Hifumi and just push the next commits that you add later on. Let's see how it works. Let's go back to this fitness app that I started at the very beginning i already authorized with github because there is nothing interesting there but if i go to export i can just click export to github and this is lifetime actually i can now go to github and look at the code all the changes were committed by hifumi.dev let's go to controllers trainings controller looks like almost Rates controller, very simple. Let's take a look at some other. Calendars controller contains a bit more of the domain logic. So you might wonder, what can you actually build with HIFOMI? Would it be useful for all the examples of non-technical people and all their ideas? Let's take a look. Let's start by looking at the landing page of a gym. Once again, right? Just a landing page. No logic inside here. Just looks nice. This is an interior design portal with a design assistant. You can specify your rooms, your furniture, your budget, and organize yourself a nice-looking apartment. Social media platform. We already looked at that. Oh, this is another social page for sharing your dearest moments with your family. Company HR app for managing days off and timesheets inside of an agency. This is a conference track planner. So you can add yourself a conference, add speakers, add agenda, and you can publish that under a public URL so that you can share that with your attendees. And finally, a corporate fleet manager where you can add vehicles. You can track fuel usage, you can have reports, drivers, and so on and so forth. So a bit more complex and less and more B2B application. So I'd say it's a combination of beauty and functionality. And all of those were built with Ruby on Rails and by Ruby on Rails. And basically all of those were either one-shotted or under some slight modifications later on. Basically, this is the power of Rails that we can use with all the advantages that we acquired over the last 20 or so years. So all the conventions, all the testing-first mindset, all the things that we have out of the box within Rails, with all the conventions that LLNs understand better and better. and good phasing of those plans, good parts, good revisions. You can use this technique with Hifumi or without it in your day-to-day work. But I very much invite you to come to Hifumi.dev, test it out, and most importantly, clone and run and just enjoy and build with Ruby on Rails. Because I really think that Ruby on Rails is fully set agent era. Thank you very much.