Transcription
Your cloud-code knows how to program, but what if it could do it forever? Autonomously. Hundreds of tasks without your checks. Meet Ralph Uigum, a tool that turns cloud-code into an autonomous developer. You describe the task, and it writes code, runs tests, fixes bugs, and works for hours. While you drink coffee, spend time with friends, or even sleep. And to be clear, this is not a fairy tale. The chief code developer, essentially, the person who invented cloud-code, uses this framework in their work every day. People, robots, hello. This is Prodsovet. My name is Uncle D. You know, if you watch our channel, that I'm all for automation using AI agents. And that means I couldn't pass up all this hype with Ralph. That's it. And the community is now shouting about this framework. If you don't build an agent layer around your activities, you lose productivity. Many tasks can already be automated using AI agents and various scripts. I study all sorts of such things and share them on this channel, so today I'll tell you about the sensational RAL Loop. In 10 minutes, we'll set all this up and learn how to automate a process that used to take hours. I'll provide ready-made files, scripts, and show a real example of using this framework. And even if you're new to AI tools, stay tuned, I'll explain everything in simple terms. And moreover, we have a series of videos that we've already made about AI agents. They will help you figure things out too. Like, leave comments if you want to support our project's work. Subscribe to the channel so you don't miss new releases. And let's go. Essentially, Rlph is a very simple tool. It creates a loop where an agent enters and cannot exit until all tasks from the list are resolved. And these tasks can be 5, 10, 100, or even more. I'll try to explain the principles of RFlub's operation using this visual drawing. We have a certain project that we break down into a number of tasks in programming, in development. This is often called a PRD, product requirements document, which consists of a large list of different tasks. And we'll look at a specific example a bit later. But when we launch this loop, we force the agent to look at this entire list of tasks and choose a specific task to complete. Moreover, we tell it: "Complete one single task from the list and report on its completion." As soon as the task is completed by the agent, it says it has finished its work, but it cannot escape this loop and proceeds to the next task, having already the full context and all information about which tasks have been completed. Moreover, the agent can choose tasks not only in a specific sequence; it can determine the priority of a particular task itself at each iteration. That is, it can choose a task from here, complete it in the same way, and then continue to return to the list of all tasks and proceed to those tasks that remain unresolved. After the entire list of tasks is completed, the agent sees this, notes it for itself, and its only output becomes this response: Promise complete. After such a message from the agent enters our chain, this chain is interrupted and work on the project is completed. And we, rested and refreshed, go to see what the agent has achieved. I'll note that you can use absolutely any AI agent. It can be clud-code, Codex, or OpenCud. I'll be showing on the example of OpenCud today. And the coolest thing is that in this framework, the agent not only performs tasks but also conducts tests. That is, the successful completion of each task is confirmation that all tests have passed, no errors were found, and only after that does the next iteration begin. We need to start with the project documentation, with this very PRD Product Requirements Document, which we will write so that we can then break it down into small tasks. And you can do this in absolutely different ways. You can use some prompt that will help you write the PRD. You can do it yourself, just describe in maximum detail the functionality, the features that you want to see in your project. In my small pdr project, this is already all described. I'm showing you a snippet of the so-called Implementation Plan, the functions that I would like to add to my project. And here there are several steps for integrating my frontend with Stripe to accept payments. The neural network wrote all this for me. And, in principle, there is already a certain sequential logic here. And there are even such checkboxes that the agent could fill in, but this is not quite the format we need to ensure maximum accuracy and maximum reliability of the Ralph Loop's operation. After you have compiled your PRD in absolutely any format, here, in fact, it doesn't matter, and it doesn't even have to be super detailed. I suggest you use this prompt. It's quite extensive. Its main idea is that it forces the agent to rewrite your PRD into this format of so-called user stories. By the way, this prompt and all links, all accompanying materials, GitHub repository sources where I got these prompts and where I got these scripts, I will attach all of this in our bot. You can follow the link in the description of this video and get everything there. But I repeat, the main idea of the prompt is that it takes your PRD, your technical specification, and rewrites it into prd.jon, into a file in json format, which will look like this. There will be several keys, and each of these keys will have a corresponding value. But we'll look at this in more detail with an example as well. Well, and here's how my implementation plan looked at the very beginning. There was a lot of extraneous information, what was done, what was not done, what technical stack. And after I applied the prompt that I just showed you to this plan, I got this list of user stories, which I will then feed to the agent. Before I show you the script itself, the prompt, and we look at everything again, I want to tell you about a mode of working with AI agents called interactive mode, when you can launch a particular prompt with one command in your terminal. And it looks like this. When we simply launch an AI agent, we enter the command CLD, and it launches. But it can be done a little differently. We will launch the Clot command with a specific flag permission mode accept edits so that it doesn't ask for our permission in its work. And after that, we will simply write the prompt to it in these quotes. And when we send such a command to the terminal, then cloud, within a single session, based on our prompt, will perform a task. after which it will complete its work, and we will see the output. You can now notice that it successfully looked at all the folders, files, directories and gave me this answer. It worked. You can do exactly the same with various other CLoud agents. The commands you use to launch such an interactive mode will differ slightly. For example, for Open Code, it will be the command Open Code Run. And after that, the prompt in quotes. And again, at the very beginning, I also enter this additional information so that OpenCud doesn't ask for any confirmations for editing files, for writing files. And ideally, you should also add read here so that it can read files without permission. Here it used tools and gave me a very short and clear answer. Everything that is in my directory. Well, now let's return to this PRD that we made, and look at it in more detail. We have the project key, which contains the name of your project. The branch name in which Ralph is working. Then the description of this project, or rather, the description of the functions that you want to implement within this project. And after that, the user stories object begins, which contains a certain number of values. And each user story consists of the following. First, it's the ID, the number of this user story, first. Then the title. Install Stripe dependencies and create Stripe client. Then the description. As a developer, I want the Stripe client to be installed so that payments can be accepted. Then acceptance criteria, i.e., by what criteria can we understand that our task has been successfully completed. And here, in fact, there should be tests that the agent needs to conduct to ensure that the task is completed. The corresponding libraries are installed, such and such a library is installed, the Stripe client is initialized, and Type-check is passed. After that, there is another key, priority, which you can leave, you can delete. Here you can really experiment with how your agent will work. In some cases, I deleted the priority value altogether and gave the agent full authority to choose tasks from the list independently. But, in principle, you can fill in this priority field yourself. Or, more precisely, it will be filled in automatically based on the prompt that I showed you earlier. After that, we have passes, and here it's already true, because I have already worked with this PRD and the agent has performed these steps for me. But some steps are not yet completed. For example, the fifth one is still false. That is, we haven't gotten to it yet. So, what's important to understand, each user story is one small function or one small step that we propose the agent to perform in one single iteration. It will not take on the entire PRD at once and complete all tasks entirely. It will read the entire list, take one single task, complete it, then change passes from false to true, and then finish its work and launch again within this loop. We have reached the prompt, and it is nothing more than a regular bash script command, which we will now break down. But before that, a small, but for many, incredibly useful sponsorship insert. I understand that the information may seem somewhat convoluted, the entry threshold is not the easiest. I at least recommend you watch a few videos on our channel about AI agents and specifically about working with AI agents. You can watch this video. A video about cloud-code and Ollama. A video about AI agents in general. And we also have a broadcast that costs a mere pittance, 600 rubles, where I spend an hour thoroughly explaining how to install cloud-code, what commands are available, how to work with cloud-code in conjunction with Obsidian. I talk a bit about OpenCud and, in general, all the basics, fundamental principles of working with AI agents. And moreover, for everyone who watches this video, exclusively through the link under this video, there will be a discount on our courses, which will also help you get into development using AI tools at a proper technical level. We have a detailed course on AI coding, we have a course on No-code solutions Nat, and you can get all of this with a good 20% discount via the link in the description of this video. You will be taken to a bot where you can read more about each course or, if you are interested in something else, look at the list of all courses we have. There are basic courses on prompting, on AI graphics, and video. Choose what interests you and start learning. Well, and we're moving on. Here is the script that you need to create in this format. Name RALF OpenCode, in my case DSH, in the root directory of your project where you intend to work. And it does the following. Initially, it checks if the user has specified the number of iterations when launching this script. If not, the script terminates. But what happens next? For each new iteration, this script does the following. First, it writes the iteration number that is currently being launched. Then it outputs a separator to the command line and then launches the agent in interactive mode. Remember, I used exactly the same command Open Code Permission. Then certain permissions, then open run. And after that, the prompt begins. And what do we see in the prompt? From the very first token, we provide the context of the prd. folder in docs. Let's find this folder. Here it is. Here's prd. And also in docs, I have progress.txt. You can create this file, leave it empty. It's already partially filled for me, but on the first iteration, it will be empty. Just put it in some folder and give the agent specific access to this folder, to this file. Then we write: "Find the highest priority feature to take into work, and focus exclusively on this feature." It should be a single feature with the highest priority. Not necessarily the feature that is first. I had a priority key there, if you remember. You can delete this key so that the agent doesn't get confused. Above, we explained to it that it needs to take the user story into work. Then we tell it: "Perform the necessary tests after you have completed the work." And here's the important part, you need to understand what tests it will perform, how it works. If you have a Python project, there should be some tests for Python scripts. If you have a Node.js project or Next.js, then there will be its own tests. And I, as a person without an IT background, have tinkered with this a bit, dug into it, and realized that one thing doesn't fit with another. In general, if you are an experienced developer, you won't have any questions, but if you are a beginner, you might mess up a bit here, and the agent won't understand you and will perform incorrect tests and make mistakes regularly. So, this is not the easiest part that you, on your human side, need to understand and comprehend before giving a task to the agent. Then we tell it: "Update the PRD with the work you have already done." That is, change this passes value from false to true. And add certain notes about the completed work. As you can see, the notes here are empty if it hasn't taken this user story into work yet. Then add progress information that you have made to the progress.txt file. Use this to leave a note for the next person who will work on the codebase. Then make a kit for this function, work exclusively on one feature. And if you notice during the work that the PRD is fully completed, then simply respond with the following: Promise complete. And then this loop will repeat and repeat until our result is this single response from the agent: Promise Complete. As soon as the agent responds with this specific message, the script will terminate with the following response. D complete, exiting. And let's see how it looks in a real example. Here I launched the agent. Before that, I had several errors because I didn't grant certain permissions, but now I'm launching this script as follows. Root directory/rphopencode.sh and the number 11. That is, I'm limiting my agent to 11 iterations. If it gets stuck somewhere and starts doing the same task in a loop, getting errors and not understanding how to get out of it, then at the eleventh time, this loop will definitely stop. We can see that the agent started reading certain files, using tools, and as a result, added a small note in progress.txt about what it did. That is, it initialized the Stripe client, added the necessary dependencies, and did some work. Let's see what happens next. The second iteration started. It received all the same data again, the same JSON, the same progress.txt, but now with this note, with information that the first user story has been completed, and proceeds to write code. After it wrote this code, it also filled in progress.txt, noted that the second user story is completed. And let's go to the frontend and see. Yes, a completely new page with prices has appeared, but for now, I can't do anything. I click the BUY button, it gives me an error, but apparently because the agent hasn't reached the Stripe connection yet. From the third iteration, it again reads all these documents, sees the previous progress it has made. And let's see. It added a note that it completed the third iteration. I think we can go to the frontend, click the buy Now button again, and lo and behold. we already have some basic Stripe page launching where you can make a payment. And this is great, it worked. I'm very happy and impressed. We simply described all the tasks in detail, and the agent began to execute them sequentially. It's amazing, in my opinion. What's worth noting? If you are a complete beginner, you might find some things a bit difficult here because it calls certain tools, you probably don't know how it works, why it calls tools at all. That is, if you are really starting from scratch, it will probably be a bit difficult to figure out, let alone control the agent's work, and even more so to understand how it does all these tests, why it makes mistakes or not. In general, I recommend you improve your IT literacy a bit, either on your own, or on the internet, or take our courses. Welcome. We have a lot of useful things there. The success of the agent's work depends entirely on how clearly, understandably, in detail, and sequentially you write this prd.jon. That is, you must have a very clear picture of what you want to implement and how it will be implemented. And the main job of a developer, AI coder, and enthusiast, whatever you consider yourself to be, is to check this PRD for its overall meaningfulness before giving it to the agent. Because if you don't understand what tasks are here, how complex, large, small they are, whether they make sense at all, and are in the correct sequence, then most likely the agent will do nothing. Therefore, in principle, your main task is to create this detailed document, to ensure that each user story makes sense and is executable within the agent's single context window. You can definitely experiment with the prompt, rewrite it a bit, add something, remove something, describe in more detail how to interact with files. This prompt is not mine. I took it, again, from one of the sources that I'm attaching. I changed something here and there a bit, but I took the basic template, which can be further modified, improved, iterated upon, and observe the results. And an important point is that ideally, all of this should be launched in isolated environments, for example, in some Docker container, so that the agent cannot mess up your files. Because if something happens there, some prompt injection, God forbid, gets into your documentation somewhere, then the agent will go to other directories and might delete the entire content of your files, which is dangerous. So, ideally, you should also deploy Docker. I didn't want to talk about it today because the video would have been too long. Therefore, if you are a complete beginner, be careful, just monitor what the agent is doing at your own risk. Do not leave unattended all those tasks that it performs specifically on your computer with full access to your files. I will definitely continue to work with this agent framework, talk about it in more detail on our resources in Telegram channels, in courses. So don't get lost, subscribe. I will continue to share my experience and results. On my personal Telegram channel, I talk a bit more about my specific ideas, projects, and some small new events in my development life. So you can subscribe there too to follow in more detail and meticulously. But that's all I have for today. I hope it was useful. This was Uncle D. Productive Advice. See you in future episodes. Bye.