Transcription
Hey guys, thanks for checking out our video.
Today, we would like to show you how we could use AI in the next two to three years. I understand a lot of us have already checked out many videos about how you can complete a website by screen capturing using some AI product. However, we found that's not really practical at the moment.
What comes after that is a huge pain when you need to fight with AI output. When you need to add a new feature, you might find the AI output was in a random style, a random structure, and maybe using some bad practices. It might not align with your style, or maybe after one or two weeks, the AI output, the project just falls apart because of bad practices, not using enough correct patterns, or not using enough functions and files.
That's one problem now, but in the next two to three years, I think we could say AI will become another higher level of programming language. We talk to the AI, it completes what we want, and we would care less and less about the code. We may just care about the output or the result.
So, let's see how it could be in the next two to three years. Before that, let's talk about Cursor. It released some cool features, let's say the YOLO mode. We are not doing that, but along with the Lo pad feature, which we are not using as well. We tried it, but we don't really like it.
We will show you what we are using, so let's start with the Cursor rules first. Although we are having close to 1,009 rules, we would also be shipping those out from this file. Actually, what we have been trying recently is adding some backgrounds, some more ground rules to this file.
We found we cannot just do one-to-one conversations with AI. The very first thing we tried was adding some roles to the conversation. We added the BA, we added the product manager, we added some software engineers, and asked them to start a conversation. The result is good; however, sometimes the AI is just too unpredictable.
So, recently this week, we tried to add a discussion thread for them. As you can see here, we get the steps 1, 2, 3, 4, 5. Each step, we got some examples, which they are not 100% respecting, but that is already good enough for us.
So, let's see how we could make Cursor AI useful in the next two to three years. Before that, we would also like to mention that we don't want to use the loads. Instead, we use some documentation files in the repo. If we are using loads, we cannot contribute to the file to the load because it lives on my local computer. I cannot just push them to a repo, and basically, it cannot be reused by others.
So, what we are trying is using this kind of documentation files, basically developed by the AI. We will also ask the AI to refer to these kinds of files whenever we need. Let's say if we are doing a new controller, we will just ask the AI to refer to the controller patterns and ask them to follow the patterns.
Of course, we will also provide some working samples to the AI so that they could understand more about the context because AI depends on the context.
So, let's talk about what we are going to do. We are going to use the only fresh repo, which is a mono repo. It provides a lot of code. We use the mono repo because we want to fit the coding style as the context to the AI, making sure they have enough examples.
Except they don't really read enough examples, but that's the AI limitation; they limit the input size. So, let's hope they will fix that or we could find a workaround in the future. We will be using another git repo in the apps server directory. It already contains some of the modules we are doing.
We will be doing the simple or the management module by the AI, and all the repo links could be found in the description section. Please check it out and give it a try.
Okay, so this is what we are going to do. We will be starting a new module by the AI with a draft diagram. They should make sure the team starts with the documentation and then refer to the model examples from the other modules.
Let's see how they would react to this request. They should be starting a discussion thread by the BA, translating the user request into some technical terms. The shared engineer, he should be able to locate the correct examples and correct documentation, and the team would work on that.
So, they start with the use case. That's good. Let's see, in reality, we would need a few rounds of this request. They would be doing things still wrong, although we fed the examples to the AI. That's the limitation of AI, I guess.
We would be needing to adjust the documentation ourselves, making sure it is correct so that we could commit documentation and anyone could use that later. Or we could cheat the documentation at the chat points so that whatever the AI has done wrong, we could just reset the git and make sure they could have a fresh start with some correct directions.
Okay, so they completed the request, I guess. This looks okay to me, although it's not the format from the other modules. The technical requirement is still not in the format; they are making up some other things.
Okay, so let's try to correct them. Let's fit the example directly. In the next two to three years, in our opinion, we would be doing this: documenting the requirements, adjusting the documents, and then I think we should do some test cases.
We start with test cases; we don't need the implementation of the test, we just need the test cases. It's more like documentation or some user requirements. Once we are happy with the test cases, we could ask the AI to make it happen. It's more like a TDD approach, and that would be the next two to three years approach in my opinion.
Okay, so they are okay to pick up the correct example. As you can see, they expanded the entities. These are some rough entities they expanded according to the requirements. They got the schemas, they got the models.
Okay, that looks good. They got the relationships, and they also copied this. We don't need that, but that's okay for demo. Let's see what they... Okay, so I'm happy with this, and I'm going to commit this.
Okay, so we commit these changes to git and share that as a Chon like G, the purpose of G. Then we should try to ask AI to create the repositories.
Okay, let's see what we got. We got a to-do list repo. Let's see. Although we got a lot of examples in the repo, the AI still cannot pick the correct examples themselves. So sometimes we need to feed them.
Okay, well, the AI is working on the repo, so we could reveal a little bit of their conversation. They got the steps correctly, although the output is totally rubbish.
Okay, looks like they skipped some steps. Maybe I know they do it. Yeah, looks like they got the correct steps now, but sometimes they still cannot get the correct example. Actually, I think that's the reason behind the Lo pack feature Cursor just released.
Okay, we got the repo completed. Let's see. Okay, this looks okay to me, although I don't think we need this kind of stuff. But I will leave it here and let them prescribe the STA rows. I'm being lazy here; I'm not giving them the files.
Let's see what they would do. Please look at the examples from the other module and also the documentation. However, despite them doing something I'm not expecting, they are still doing it in our style, in our scope, with the correct example. That's good.
Okay, so this is why we want to use the documentation files. They could pick up the files, and everyone can just contribute to the files. Let's see.
Okay, do the product stuff, which is good. By the way, we also have some rules to ask the junior dev to ask some questions to the team. Sometimes the team will just explain what's happening, and sometimes the junior devs will find some interesting examples for the team so that the team could adjust according to the findings.
The benefit of doing a discussion like this is usually this long conversation could cost around 10 to 20 tokens. But with this discussion approach, they could adjust themselves, and I think it would cost less than five tokens if Cursor is not charging per scan or per token.
Okay, we got the product staff RS, and also we have all the staff RS. What they found is they are missing the request schemas. I think they would be doing that.
Oh, actually, they're doing it correctly unless they're using the wrong package and they're checking points. Okay, so let's correct them. Oh, by the way, just today, actually, this is a bad habit for me. We shouldn't ask the AI to guess.
Actually, what I did is wrong about not feeding them the direct file or the direct document. We should do that because they are not good at guessing or scanning files.
Please take this as the example. We would be having this Rec comments like stop Expos RS.
How I think this is... Yeah, oh no, no, this is a cursor box. I don't know if it's just me or it's a cursor box. Sometimes it just cannot find the correct file, but I think this is good.
Oh, nice! They are now exporting the round. Okay, nice. Now they're doing the correct format, using the correct package. They also assign the example here.
Okay, well, it is still generating. Let me see if I could start the server. In our discussion thread, the AI could try to reveal the implementation against the working sample documentation. Of course, they will make up something; we would be adjusting that session, but that looks good to me.
And I think, yes, we started the server. Okay, so this is autogenerated W documentation. This is what we have implemented. We got about 12 or 13 endpoints. We don't know if that would work, but it got some nice documentation.
Okay, so let's ask the AI to create... Oh no, let's commit the change and then ask the AI to generate some tests for the endpoints.
Okay, let me try to commit the changes while they are generating code. Let's see if they can pick the number of tests correctly. Sometimes we mention we want two test cases per route file; it could still mess up with the number two.
Okay, they're scanning. Oh yeah, we need the helpers according to the other examples. Yes, we use this per... Yeah, we are copying this module for every module. It looks okay. We also need a setup; that's right, that's our structure.
Okay, let's set this up. The setup looks like... Okay, they also copied these two functions; they live in every module for now. We'll be extracting this kind of thing to the model repo later.
Okay, how many do we have? We have two. So they do two test cases per route. Oops, now they are making some other test cases. I think that's according to some documentation mentioning that there should be 41 if there's no off.
Okay, I think they are wrapping up. Nice last try. Oh, let's commit first.
Okay, please relate your changes by Young test. Oh, we don't need to F the sil y test simple order management. Oops, they failed to pick it up. So that's why we don't want the AI to guess, especially if we have this long conversation. They are bad at memory, and they like to do that if we're having a long conversation.
Okay, let's cancel. I need to pop it up. I don't know again if it's just me or is it a bug. Please rerun the test with this option.
Okay, that's okay. Let's create another cursor and keep the changes. Oops, I shouldn't be asking for your changes because there's a new team, new conversation.
That's nice; that's a good start. Just one failed test case, and actually, that would be another loop between me and AI to guide them to fix the issue.
I will stop here because I think we got the idea. So, yeah, right. AI still cannot pick up the correct file, although it is there. According to my experience, unless I reboot the computer, it won't be so.
We are not waiting for it to finish, but I guess we all have the idea of what we are trying to say. In the next two to three years, this could be what we are doing: high-level describing the user requirements.
We set up the documentation and ask the AI to implement that with test cases. We imagine the future would be we program the requirements, we program the test cases, just the test case titles, and the AI should be able to finish everything else.
Of course, like the current situation, the current screen we are seeing, in some cases, are failing. We need to guide the AI to fix that correctly, in the correct direction, in the correct style, and not compromise the code quality or some security concerns, etc.
But this is what we want to imagine. That's how we feel it could be in the future.
So once again, thank you for your time. I'm hoping to see you soon in another video. So, see you!