So how do we get started building a new app?
We could go directly into cursor and say something like build a flashcards app, and cursor will probably
build something decent, but it is very unlikely it will match our expectations and we will need to
have a long conversation.
Practically a lot of back and forth to get all the details right.
So this process is not really optimal.
Instead, it is best to invest some time in the beginning and create a proper specification, or how
it is sometimes referred to as a product requirements document PRD.
And this is a key step in building a proper software, because the AI cannot know what is inside our
head.
So we may know already how the app should look like, but we're going to say that the AI doesn't know
what we want.
So we need to be really, really specific.
So this is why this is a key step in building any software.
Even if you think, oh, this is a relatively small app.
It should be self-explanatory.
Well, nothing really is.
So for the process of creating this PRD, we can use cursor directory and have a conversation here,
because in itself we have here the agent mode.
But we can also have here the ask mode that pretty much the chat mode and say, hey, I'm trying to
build this app.
Can you come up with product requirements document and something like that?
But ideally what I like to use is a regular LM.
In this case I'm using ChatGPT.
But you can use Gemini from Google or something from anthropic or anything else.
Doesn't really matter so much.
It's more important to have this conversation in the beginning.
And if you don't know exactly what you're trying to build, just use ChatGPT to ask questions.
Trying essentially to consult with a chatbot in terms of what are your options to building something
like that and how this PRD document can definitely look like?
And so if you don't know exactly which technology you should use or how exactly you should build something
like that, do have this exploring conversation in the beginning.
Don't try to do everything in one shot.
That would be in a technical language, like a zero shot prompt.
Just sending something and expecting it to work.
It generally doesn't work like that.
So for this flashcard application, I'm gonna attach an initial prompt as a resource to this lecture
as a text file.
This is exactly what I'm going to use next in order to get ChatGPT to write this PRD document, which
is essentially a specification for our application.
So we're going to go ahead and see exactly what's going on here.
I'm going to submit it first.
And we're going to take a look at exactly what it's saying.
So I need to write a software specification.
And I need your help writing it.
I'm describing here what I'm trying to build, and I already know which technology I want to use.
And also I'm listing here the features that I think the application should have.
And the features can be essentially a brain dump, because we're going to use the LLM to try to organize
everything.
Apart from this, we're going to format this as markdown.
And probably the last prompt here is the most important one, because I don't want ChatGPT to start
outputting a specification instead.
This is the consulting part.
This is the part where is there something that's still unclear about my requirements?
Let's clarify that before we generate anything, because that's again a much more efficient process.
And we're going to see here we're going to get here clarification questions.
It's going to ask us exactly how do you want to have this.
Do we want to have text categories.
How about user accounts and so on.
So there can be a lot of things that go into this.
And once we clarify all these questions, we're going to get back a software specification.
And again, a software specification is something that I'm going to attach as a resource to this lecture.
And you're going to take a look at it.
And we're going to see in a second how it looks like.
I'm not going to bore you with answering all these questions.
It's self-explanatory, but I'm going to show you in the next step how the specification looks like.
So as a next step, I answered all the questions to the best of my knowledge.
And what came out of this is this flashcards web application specification.
And it contains various let's say, categories.
So what I would do next is I'm going to go ahead and copy this entire specification that is here.
And for the next step I'm going to check it and make some changes to it.
And once I'm done I'm also going to share this specification with you as a resource to this lecture.
But generally keep in mind that even if you share the exact same prompt and put it into an LM using
the exact same model.
The output will always be slightly different because generally speaking, llms are non-deterministic,
meaning for the same input you can get different outputs.
But what I'm going to do with this specification and it's super important to review it inside here I
created a new folder which is called flashcards.
And inside this folder what I'm going to do here is create a new file.
And I put it in the docs directory.
And I'm going to call it specification dot.
And this is the specification in the markdown format.
Again it's super important that if you're building a product not just to rely on the LM, but to go
over this specification, read absolutely every line.
It does contain a few technical aspects, but most of the content is actually how the application is
supposed to work, and this is important for building the application itself.