What I'm going to do is take you through sort of a recursive deep dive on how I use tools like Cursor and LLMs to go about rapidly developing, in my case, SaaS applications, but also a whole range of different things. I'm going to step you through some of the things that I've done and the way that I've done them and get into some of the weeds of using AI to build multi-tenant SaaS apps.
And I've put all of this online. And all of the source code is open source as well.
So we're going to be talking about a couple of different things, one of which is something called 00 SaaS, which is meant to be an agent-friendly SaaS base to work off of when building multi-tenant SaaS apps. And this is work in progress, but I'll talk you through the process of which I went through.
And the other is actually the presentation website. After the last AI Tinkerers event that I did, people wanted my presentations online.
So I used the code that I was showing to create the presentation website, which you could also look at. And I'll talk about how these rules work.
When I learned that I need to use this computer instead of mine, I quickly pushed my presentation through the system online so that we have a nice little RevealJS presentation.
So I'll show you how that works as well towards the end. Because it all uses the same basic concept, which is cursor rules at a way of putting them all together.
So overview of what this is going to be.
First, I got to talk a little bit about Cursor, what it is. For those of you who use it, you'll know. For those of you who use it a lot, you might know what some of the things I'm about to go into are. And then I'll talk about what Cursor rules are and why that's kind of cool and different, talk a little bit about the OO SAS template and how and why, and then talk about some lessons learned.
1Cursor is a version of Visual Studio Code that is basically been designed to focus purely on AI agent coding. And they're moving more and more in the direction of focusing on coding via agents.
cursor is you can go into pay-as-you-go mode.
So for another $20, I was nonstop for a whole month.
But with Microsoft Copilot, Visual Studio Code, you hit that limit. There's no way to, there wasn't a way to break through it previously. So it just sort of rate limited me and I didn't like that.
And then their approach of agent mode and the way they've implemented that plus cursor rules together is super powerful. But the problem is cursor rules are poorly documented.
They completely changed them between version 4.5 and 4.6. And the editor they have for working on the rules is broken. Agent mode itself has issues.
If you're using the latest version of Cursor, it's kind of crazy. People on the forums are tearing their hair out, but you can work your way through it.
VS Code is copying what they're doing because it's all open source and they're copying back and forth. I think Cursor still has a very interesting sort of theory of this. And VS Code's trying to do a lot of different things.
Cursor's really trying to get you to be very helpful with AI. So yes, the vibe coders are disappointed.
A little bit tongue-in-cheek, but one of the things that comes up, especially when you're browsing the forums, are all these people who are talking about how, thanks to AI agent coding, they're 100x, 10x, 1,000x developer coding massive SaaS applications in an hour. Some of this is using no code, low code. very much echoing what Doug said on the business side.
Really taking the time to understand the problem space is where a lot of this is at. The good news is now you can really focus on the problem space. And you can actually iterate and prototype and pilot and test things out and throw away a lot more code a lot easier when you're using these tools, which is what I find.
I mean, I'm mostly operating in the early innovation prototyping pilot space, but I like to have the opportunity to get things to go beyond something that's throwoutable into something that I could actually deploy, which is where this idea of the 00SAS came from.
But I think that while these tools are really great, the more you try to build big things with them and the more you try to go from really cool little tech demos to actually working with legacy stacks and other things like that, the limitations become obvious. Also, the speed at which we're getting rid of some of those limitations is becoming obvious as each model comes out.
But at the end of the day, you really You need to make the decisions around architecture, just like you need to know who your customer is.
And by the way, I've been on Orbit for probably like seven, eight months now through the MIT alumni network that was bugging them for access. And it is pretty amazing as an entrepreneur and as someone to just be able to rapidly go through and test out ideas. So to me, Orbit is like Cursor for startups.
Anyhow, so I still use Cursor. I haven't jumped ship. I've only been using it for about a month and a half, actually, because I was using VS Code.
And then I went to an AI Tinkers event. And I got convinced at that event to switch over to Cursor. And I really appreciated that insight.
There's a startup here over at MIT called Codapt, C-O-D-A-P-T, that's trying to be the next. Cool. I can only imagine what that actually looks like. I'm still trying to wrap my head around this one. So I might stay on this one for a few months.
But yeah, I mean, for me, it's like I also started programming on a Commodore 64 I don't really just want to hit a button and get an app. I like the process of understanding the software architecture process.
I want the AI to work with me and just make me faster, but also help me understand things. And one of the things, there's a lot I've learned about modern tech stacks, because I did most of my coding back in the PHP days.
So trying to wrap my head around, OK, so what is this edge runtime stuff, and why am I constantly banging my head up against it, was really important. And I do like the way Cursor, when you go over, lets you set caps on how much you use. Other models don't necessarily have the same cost controls, especially when you've got agents that literally just run out of control, which is very easy to do with Cursor.
So if you're using Cursor, first important thing, you need to do this. You need to go into the VS code settings, search for workbench editor associations and add, and this presentation is online, but you have to put like star dash MDC, which is their rules file and value default.
Basically, you have to turn off their Cursor rules editor and just use their normal text editor.
Otherwise, the rules are just horribly broken. But once you do that, they start working again. And they're quite cool.
So what are these things? OK, so inside cursor, there's a directory called rules.
And it's dot cursor slash rules. And these rules are markdown code, which is MDC. And they come with a bit of front matter header, which tells you the description and then the patterns of files that they should apply to.
Now, this is super important. So the globs basically restrict which files they can apply on, but the description tells the AI agent whether they should even bother injecting the rules in.
So what Cursor does behind the scenes, and again, this is not documented, but thanks to some great person on the forums, I actually now understand this. It basically uses the descriptions.
It passes all your rule descriptions in to an LLM and says, which of these rules should I use for the task that the person has just given me? And then it will pick the appropriate rules, check the globs, and if it matches the file type, it will basically inject that into the context of that request.
And that's really, really important to know if you're trying to wonder why your rules aren't getting picked up or why they're not doing certain things. So having really good descriptions for these rules is really helpful.
Now, in the previous version, there was a dot cursor rules file in the base of your project route. And that file, you would basically put all your rules into. And then the whole thing got shoved into the context of every request, which was blowing context windows out if your rules started getting complicated.
But this is actually kind of nice, because if you have good glob patterns and good descriptions, you can generally get your rules to align to stuff.
This first rule, the core rule, is actually a rule generating rule. So once you have this rule in place, you can tell it things like, I'm going to be generating a lot of RevealJS presence. some rules for proper formatting of Reveal.js. And it will then create some rules which you can then review and edit. And then any time you go to create a Reveal.js presentation, it will consult those rules.
So you could use it for documentation. You can use it for things like business planning, for personal planning. I have a set of rules for basically being my personal assistant. And I could actually run a whole bunch of stuff from within Cursor.
It's a very odd experience trying to like organize your life and plan to-do lists inside of an IDE, but it kind of works.
So this is the core one, and this is the rule generating rule. It's longer than this, but you'll be able to see them all online.
And then I have the next one that I actually had it make, which is my architect rule, which is telling it to be a CTO and think about which other rules it should need, what tasks it should delegate to. So it's thinking about testing at the same time as it's thinking about writing up new features. And also thinking about some of the things that are important from a database architecture and system architecture for this particular project.
That's the other really important thing. Cursor rules are project specific. So when you put them in and you activate them, then they can be very customized to the project you're working on, which is really nice.
So you can have a combination of general. And then this one's very specific to the project, which is telling it about Next.js, that it's telling about how I want this particular project to work.
I've given it some, oops, let's see if I can scroll down. Maybe it'll let me, no, oh, there we go. Yeah, some some examples of good things that I want in there for working with Prisma. And so that's the database one. This is the project one.
Here's the project structure, where I want the directories, and so on and so forth. And again, this really helps the agents not make the sort of common mistakes.
One of the things that people are finding right now with the latest version of agent mode is that when you activate YOLO mode, which is essentially you let the agent just keep going and ultimately you get to specify things like which commands on the command line it shouldn't run. I highly recommend if you ever put in YOLO mode, the first thing you do is tell it, do not allow the RM command. That's pretty important because people have wiped their entire project directory out with YOLO mode.
There's a couple others that you want. The minute you put it into whitelist mode by putting, I think you could actually go into whitelist and put one command like CP. Then all the other commands will be blacklisted and then you can add them piecemeal at a time. That's the best way to work with YOLO mode.
So yeah, so having a good set of these rules and thinking about them, and then actually using the rule manager rule to write more rules. And by the way, that fix that I said you have to make before is actually essential, because if you don't make that fix, Cursor can't actually properly update its own rules. But if you make that fix, then once you disable that editor, it all works.
So that's a look at that.
Now, the OO SAS template, I'm not going to go into too much because it's a work in progress. But the idea here is I want to be able to very quickly, I mean, I have lots of things that I want to try out or concepts or things that we're looking at on our product roadmap.
where it's like, right, almost everything we do is multi-tenant. Almost everything we do needs a certain type of authentication in place. I want all of that stuff locked down so that if any of this stuff is actually good, I don't have to sit there and retrofit it in.
I could actually put it live almost immediately and not have to worry because I know it's got solid sort of token-based and passkey-based authentication. I know that it's got strong separation, the way the database is set up, the secrets are all done correctly.
So there's a lot of things like that. And there are a lot of Next.js templates out there. But what they were missing was the structure and the cursor rules files that were specifically set up for it so that if I was building off of it in cursor, I could just start putting my prompts in and go.
So that's the idea of this. The repository is here, and it'll be linked at the end of the presentation. And again, it's a work in progress, but you can see in here the different cursor rules that sit in here.
So there's authentication rules, because I'm working with the latest version of NextAuth, which is still sort of in beta. The documentation isn't super clear, and so I've had to put in some extra documentation so it works with the correct version of it.
Things about using good accessible UI. what it means to do multi-tenancy, things around QA, security standards, how to document requirements, how to document the architecture. So all of these things are rules that I'm building out, testing as I go, editing them.
That's one of the nice thing about the 0, 0, 0 rule is that if something's not working, you basically just put into your prompt, hey, You know, I didn't like the way this worked. I don't like it. You've been deleting stuff that I don't like deleting.
And it will actually find the appropriate rule files and make those edits to them and then try to avoid doing that in the future. It is very dependent on the model that you use. And Cursor lets you choose between Sonnet 3.7 thinking mode and Sonnet 3.7 sort of regular.
And sometimes I find that thinking mode plus rules plus agent mode plus YOLO mode causes it to really spin its wheels like nuts. So sometimes you might want to back it off and just go to regular. 3.7. But this is a lot of this.
There's also suspicion that some parts of this are actually being done by older versions of Sonnet in the background. So just something to bear in mind.
And I'll just go pretty quickly.
But I wanted to talk about just a couple of things that came up. The process of doing this.
So again, I'm not a next JavaScript expert. I'm not even a modern JavaScript expert.
But one of the things I love about working with a tool like Cursor and these rules and being able to iterate through this is I end up learning a lot about what the sort of current state of the art is in frameworks. And so I learned a lot about edge runtime because I was trying to get certain types of things to work with authentication.
And I couldn't get the database queries to work because Latest versions of Next.js try to push as much stuff into the edge, which is generally content distribution networks, most of which have the ability to run certain amounts of JavaScript but limited. And they can't make database queries. So there's now tools that help them actually make database queries.
Lots of cool things that you learn about. And you can actually get it to sort of teach you about it as it goes. So that's something that I do.
And then with authentication, again, there's a lot of moving best practices like do not put passwords into any app that you build. Use pass keys, use token-based, and it's much easier to do now. And again, by putting that stuff into the application,
Stack, not only for me, but my other dev team members, can work off of that 00SAS. And I know that they're going to be working off a good base.
1The hardest part about this is that, as all of you know, LLMs are only indexed to a certain point in time. So another very important cursor thing is at web. In any request that you put in, you at web. And it tells it to go and search the internet for latest information. That's sometimes super important.
So yeah, get comfortable with the forums when you start running into problems with stuff. There are some really helpful, like I learned all of these cursor rules from some people on the forums. And in fact, I have to thank them both because not only provided the explanation on how cursor rules actually works, and bmadcode is the one who came up with this really cool set of rules templates that actually can modify themselves.
Just last thing that I'll point out is when I... I'll just switch back to the presentations, which is also open source.
So...
When I wanted to do this presentation, I have a couple of rules in here for working on different types of presentations in Reveal. And so what I needed to do was I had a draft of this presentation, which was here. And so this was my draft markdown file that had my notes for the presentation.
And so I was just basically able to go in and say, with those cursor rules under cursor, I said, hey, I need this to be a Reveal.js presentation like it's done, make it work with my website, follow the rules, and convert it. And so what you're seeing here was literally all of this was almost all of it was the first go around and then I had to make a little bit of change because Markdown in Markdown really confuses it. So I had to replace this stuff for it to come out right.
And then while it was fixing that, it came up with a, it injected that slide. I don't really actually know what it's trying to say there, but you know, the AIs, you know, they really love just, you know, going crazy.
But yeah, so... So yeah, this entire website was built off of those cursor rules. So I wanted it to be able to also take the presentation markdown from Reveal.js plus the notes files and allow you to ask questions.
What are some things that can go wrong?
I don't know if this is going to work. Let's see if it's actually
Yeah, paying attention. No, this one's not hooked up.
But again, very lightweight work, very easy to build, something that gave it a couple other websites I wanted it to work off of. And it came up with it pretty quickly.
So anyway, a lot of stuff there. Happy to dive into more details in Q&A.
But yeah, so that's just some things that I've gone through trying to figure out how to code with AI.