Turbocharge Your AI Coding with Cursor + TaskMaster Rules—5‑Minute Easy Setup!
April 18, 2025
Parker walks through turbocharging AI-assisted coding with Cursor rules and Taskmaster, then demonstratesBuilding a reusable data-fetching rule around a Supabase singleton, plus a global logger to improve reliability across server and client code.
Why Cursor rules matter#
- Cursor rules define how the code-behind agent behaves for a given request, turning wild patterns into repeatable, reliable patterns.
- Start with official Cursor rules (e.g., Superbase official rules) for best practices and to align with the project’s tooling.
- Benefits: consistency, easier maintenance, better guidance for both humans and LLMs during debugging.
Getting official Cursor rules up and running#
- Use the Superbase official Cursor rules package. Command and setup:
- Install via a shell command (Cursor rules from Superbase).
- Put rules into a cursor directory in your project with a clear folder structure.
- Structure you’ll typically see:
- DB functions, migrations, RLS policies, SQL style guide, edge functions
- Practical note: official rules are kept up to date; follow relevant creators on Twitter for updates.
Designing your own rules in a monorepo#
- Organize for scale:
- Monorepo with nested apps (Next.js, React Router apps, Vite apps, etc.)
- Separate Superbase-related code into its own package
- Edge functions (Dino), migrations, queries, and mutations are neatly bucketed
- Data fetching patterns
- Start with queries (read) and then add mutations (writes) as needed
- Name endpoints and rules using kebab-case (lowercase with hyphens)
- Singleton pattern for the database client
- Create a single place that wires Superbase (server component -> client component)
- If the request is successful in one place, all dependent calls go through that same singleton
- Example structure (conceptual)
- apps/
- edX/
- marketing/
- packages/
- supabase/
- utils/
- logger.ts
- bore into:
- edge/
- migrations/
- queries/
- mutations/
Global logger to standardize debugging#
- Create a global logger.ts with levels: debug, info, warning, error
- Drive the log level from an environment variable
- Benefits:
- Consistent logging across server/client code
- Helpful for manual debugging and for guiding LLM reasoning
- Integrate into access points (e.g., get_prompts.ts) so every data fetch and prompt path is observable
Building a data-fetching rule (data-fetching.mdc)#
- Goal: standardize how data is fetched, both server-side and client-side
- Key components of the MDC rule you’ll implement:
- Fence and description at the top
- Globs to indicate which files/folders the rule applies to
- Always apply flag (conditional vs. always) to control scope
- Server-side examples (server components, server-side fetching)
- Client-side examples (TSX usage, hooks or components that fetch data)
- Include a singleton import path for the Supabase client
- Include both server and client fetch patterns:
- Server: use a server component or server-side helper via the singleton
- Client: fetch via the appropriate client route or hook, still routed through the singleton
- Ensure type safety with the Supabase client types so TypeScript provides autocomplete and correctness
- Include the logger usage to surface lifecycle events (fetch start, fetch end, errors)
- Naming and organization tips:
- Descriptive prefixes (e.g., get_prompt, fetch_user, create_prompt)
- Use kebab-case naming for actions and endpoints
- Example updates you’ll likely add:
- Server-side query path
- Client-side fetch path
- Updated or additional import paths for the fetching helper
- Validation steps:
- Review the MDC output, ensure it mentions logger usage and singleton
- Confirm the generated rule covers both server and client scenarios
- Test by applying the rule to a real fetch path and verify the code adheres to the rule
Formatting and rule craftsmanship#
- Use a well-formed MDC template:
- Start with a clear fence and description
- Put globs to target code sections
- specify always apply vs conditional
- Align with existing conventions:
- Naming conventions, path structure, and client/server separation
- Keep formatting clean to avoid lint/TS errors
- Dealing with tooling hiccups:
- If an editor/formatter or AI tool acts up, reload the window in your editor
- Don’t force edits that break the rule structure; preserve the template and refine incrementally
- Small, testable increments:
- Start with a small, useful rule (data fetching)
- Expand to client-specific examples or additional patterns if needed
Practical tips and caveats#
- Expect occasional glitches when auto-formatting or generating code with AI; verify and adjust
- Biome ignore rules and strict linting help keep quality high, but use judiciously
- When adding new rules, document how to use them and how to opt-out if needed
How to use and share these rules#
- The rules and templates are hosted in the featured educational project (example: I Vibe with AI)
- To get updates:
- Leave a comment requesting the rules
- You’ll get access to freebies/templates and updates to prompts and templates
- Optional extras:
- Email opt-in for updates on freebies and paid/free templates
- Daily channel for deeper dives into strategy and profitability
- Quick action items:
- Implement official Superbase Cursor rules as a base
- Build a data-fetching MDC for server and client
- Add a global logger and a Supabase singleton
- Apply the rule to your codebase and iterate based on results
Takeaways#
- Cursor rules let you convert ad-hoc patterns into repeatable, engine-friendly behavior
- A singleton Supabase client plus a global logger creates a reliable foundation for both server and client code
- A focused data-fetching MDC rule can dramatically improve reliability and maintainability
- Start with one rule, test thoroughly, and expand as your project grows
Links#
- Cursor rules resources and examples
- Supabase official cursor rules
- Task Master overview and related videos
- Turborepo monorepo structuring concepts
- Deno (edge functions) for server-side logic
- Biome or markdown preview tooling (for editing MDC files)
- I Vibe With AI (educational community context)
- Parker Rex Daily Channel (for deeper strategy content)
Transcript
Hey, I'm Parker X. I led tech for a startup that sold for 23 million bucks. After that, tried a couple different startups and went all in on programming. Then GPT came out, went all in on AI, using it every day for the last three years to learn how to leverage it in code and marketing and business in general. And so I want to talk about rules, cursor rules. So, I'd seen this video a little while back from this guy, Eli, and I want to show you how to implement it because he had some good points and he also runs this uh inbox thing. So, first of all, use Taskmaster, of course. But what we're doing now is I'm building out the site for our education community called I Vibe with AI. That's what this thing is in the picture below me. And I'm getting ready to wrap it up, but there's a bunch of stuff that Taskmaster did that is done. It works, but it can be optimized. So, I want to make it better. And what a better way than to use some of the rules as a piece of educational content. So, cursor rules, if you're not familiar, they determine how cursor will act based on the request that it's sending. So, earlier days, it kind of would run rampant, but then you have patterns that you like. So, you want those patterns to be done. So first off, if you're using Superbase, then you can do a command. It's a a shad CN command. It'll add in the best practices from them. So that's pretty cool. So that's one tip I would do is superbase official cursor rules. Type that in. You can go to the cursor directory too and do it. But in here you'll see the folder structure has for DB functions, migrations, RLS policies, SQL style guide, and edge functions. And you can just grab this and run it and it'll post it into your project. So I have that, right? You want to have ones that are specific. If they're official, that's better. And they update them pretty often. So you can follow a couple of the guys on Twitter to keep up with it. But in this case, we're going to make our own rules. And so I have a bunch of these patterns in my app for fetching, right? So I always lay it out where I have my app and this is just one app, right? It's just Nex.js. But for bigger stuff, I would do the same thing. I just use Turbo Repo and then nest them. So like if I wanted to have a React router app or V app or Astra for marketing or Python server for agents, whatever they'd all be nested in there, but same structure. And then in the monor repo world, you'd have superbases package, but that's a different case. So what I do in these ones is I just have superbases separate. And then I have edge functions in here which is Dino. And then I have migrations in here, queries in here. I usually break them out by the bucket. And then I'll have mutations as well. So let's see. Uh I need to make sure we have mutations for we have queries. Do we have mutations? Yeah, we don't have mutations. So let's add one for mutations. Cool. Mutations are things that change, right? So a mutation is not a read, it's a write. So instead of get prompt, it' be create prompt. Then I typically name them in kebab keys, kebab case, which is this lowercase stuff. So that's rule. But what we're doing is we're going to plus up the existing method that we have here, this existing uh query. And because they're really small, it makes a lot easier to work with. But what we already did was we said, "Hey, we need to update this to use our singleton in blank." So singleton, if you're not familiar, is under clients. I have all these different clients. And this one is the one place that we're making a connection with Superbase. So that way, if this one works, then anything that needs to make a call to Superbase will go through this on a server component and then through this on a client component. And so what I want to do is before it was using just the superbase client and that's because taskmaster did the job but it didn't follow practice that I want. So we're going to make a rule around it. First we're going to make it better, right? So we've done one thing. We said use best practices. Okay, didn't really do much there but it did what we wanted and then it refactored it. It just swapped these things out. But next I'm going to say okay because I want a rule that will have the best practices across the project. I want to further improve this. So this pattern of hey we should have a global logger.ts that we can have in our project that has different levels that can be set in our enonv. Then we can update the get prompts.ts to use it. And what this will do is just that where I'm going to actually grab where I want it. So I'm going to put this inside of here probably. Let's actually make this is a really small project and I'm going to release it later today. It'll have all the freebies in it, but I'm going to put it inside of utils. So, I'm going to grab this and copy relative path. And I'm gonna do a global logger [Music] inside. Boom. That has different levels that can be set in our env. Do I want it be set there to determine the mode? Then we can update that to use it. Okay, cool. Let's see what this does. It should go create the file and then it'll have info. It'll have a standard for it. Yeah, debug info warning error. So, this is a determined thing. This is just a standard practice. But it's really nice not only for you when you're manually debugging, but for uh LLMs as well. So, we can see it didn't get that right. Cool. Now, it got it right. All right. So, we like that. This is good. This way. Now, not only are we using the singleton, but we're also using the types and we're also using this new logger. Great. And if you're not familiar, this is the best way to do it with your types for Subase. So that way when you're trying to call something in your database, it will give you the auto suggestions and your tab button will thank you because it'll know what's going on. So now now that we have that we like it and we want to make this into a rule for data fetching for queries because it has the stuff that we like. I'm going to ask one last time. Is there anything we could do to improve the reliability slash dryness of get prompts? So, I really want to make this one awesome because we're going to make a rule around it. So, let's see what it does. It's reviewing it. Says it does logging, does the singleton potential improvements, generic query helper. Well, if you anticipate having this, let's see what it's thinking of. Yeah, I mean, this is just another extraction which I don't think is great. So, I'm gonna keep this because I don't think that we need another file. I want to make sure it didn't create it. That is, Dino. Cool. It didn't create that. So, now that we have one that we like, let's go ahead and make a rule out of it. So, let's see. How does this look? The unexpected enies are okay, but let's see. I use biome as well. Highly recommend that. So, I'm going to do biome ignore. Cool. And let's add those just because strict formatting and linting is key. And I say that as I let Annies in, but because this is a generic utility, I'm fine with it. So, now we're going to create a rule. And I already have cursor rules in here. So, this is from Taskmaster. If you want to learn about that, you can look on my channel to the last video. But let's do a little bit of formatting in here first. I want to make sure that the rule creator is as good as it could be. So, let's see if we can't find a his example. I believe it's in here. Yeah. So, you always see this at the top where at the top of rules you have a fence. That's what these things are. If you've written Astro, you know what that is. but or like markdown files but it'll have a description. It'll have the globs. Globs is the selector of where in the codebase should this be applied. So if you had rules are specific to just one folder then that's what that means. And then always apply is will this apply for everything or for like conditional if you call it. So looking at this I like this naming convention. So I want to grab that. See naming. Do we have anything about naming? We don't have anything about naming. So let's go ahead and main points in bold. Follow the naming convention. Let's make that actually. What's this doing? That's markdown. Let's put this here. And let's If you guys don't have this plugin for previewing markdown, you should. Oh, this is not Markdown. MDC. So I can't preview it. Interesting. Let's go ahead and we're going to take this and I'm going to just open up a cursor or sorry a chat GBT and then I'm going to attach this and I'm going to say we need to improve the formatting of this NBC file. And for some reason it's saying inactive. So let's try to do that again. Add. Click there. No, doesn't want to do it. Let's paste that in there. We're going to get a nice formatted one. We're going to use for mini high. Yeah, let's do four mini. Boom. Just to make sure because we have bolded ones. That's the stock template for using uh what's it called for using Taskmaster. And then we have some of the ones from his. So I want to kind of mix the two. Uh example, incorrect example. No, I want give me the entire updated version. If that's not going to work, then I could have just done this manually. So, let me take the numbers out. That's all good. And we'll follow Oops. Follow that pattern. always follow this. What is going on? What just happened? Oh boy. We're having a little issue, a little technical issue with I think Chach is trying to overwrite it, which I don't love. So, we're going to nuke that. Let's open it back up. What is going on? If you ever run into issues like this, you just hit reload window. Command shift P. Reload. Anyways, goodbye. Cool. So, now we're back. No clue what just happened there. Honestly, this should just work. I just wanted to peel those numbers out. And I'm not going to edit this because you should if you run into this stuff like look, it's not perfect. Like people will run into issues. So, I'd rather keep it in there so you know how to address it. But I just want to follow the convention that is using the other ones. Good. Directory structure. That looks good. That looks good. Cool. Do we have the naming thing in here? Yeah, we do. It's out of space there. Okay. So, now that we have that all dialed in, this is the thing that's going to make the rules. And then now we're going to use it. So, let's go back and we're going to open up a new one. And I'm going to tag that. I'm going to say create a rule for data fetching and loading. Uh yes for data fetching that's a query using atget prompt types as the example. Cool. So we kick this off. We'll keep it in ask mode because I don't want it to mess up. And let's see. It should determine that. Hey, we should use the logger. Hey, we should do this. Hey, should we do that? And it will give me the output for this. So let's see. Yeah, very cool. Clients server. We will always use clients server for that. Cool. So, let's grab this and we're going to go ahead and create a new one and then review it. So, data-fetching.mdc. Cool. Let's put it in here and take a look together. Let's close that. Oops. Close that side panel. So guidelines for creating superbase data fetching functions to be applied on queries. Yes, that's smart. Uh yeah, that's for calling it always apply. Sure. Uh do we want to always apply it? Probably agent requested. Yeah, because we want to only say, hey, like we're going to make I think always I'm doing a lot of data fetching. So if it does involve that, then it can be passed into context. If I have issues with this though, then I'll flip it off because it's just unnecessary token usage. But because I do a lot of data fetching, I'll keep it on and see and experiment and I'll comment below if if things change. But if you're having issues, it's probably because of that thing purpose standardize how it's done within server side or dedicated query functions. I'm going to make this more generic because it's only for server side. So then let's grab one that does client side fetching. So let's go to I don't know uh what I'll do is I'll just be typing in client and then that way I can see an example of its usage. So I know it's going to be in a TSX. It's probably here and this is probably Yes. Okay, cool. So what I'm doing is because I only had an example of the server side one, I also want to include an example of how to use it in the client side stuff. So let's look where that's being called. It's here. Create client. Cool. If we scroll down, we're going to find where it's passed in. And then that's the sign in with OTP. Where is it? I guess it's just using for the sign in. Yeah, cool. So, we could either do that one or this one, which is probably better because I think it's just doing more. Yeah. So, this is getting a session. Either one of these would work. So, let's update our rule to include client side fetching examples. This way we have coverage for all data fetching patterns it uses. And then I'll grab the singleton which will be in the uh client.ts. So I grab this. Boom. Right here. Copy relative path. Fetching examples. This way we have coverage. Yeah. For all for both server and client components. Here's the singleton for client. Cool. Now we'll have a very generic one, but it will be awesome because anytime we're doing any sort of data fetching that it will do both. Doesn't seem like this is okay. Let me stop that and I'm going to paste in here's the existing rule. Sometimes it has problems with if it's not actually committed. So let's see data fetching. It's because I Oh, it's because I need a different Yeah. Boom. Continue and revert. Let that bad boy run. Add a section specifically for client. Yep. Here's the updated version. And let's see. Is it done return value? Okay. Update the component state. Cool. Let's grab this. Review it. And you guys get it. That's how it works. So then I would look and I'd see well I have it as always guideline for data fetching server and client. If you had issues in a larger codebase you can separate the two for sure and I would go ahead and tweak it. Right. So it knows it's a client component. It knows if it has custom hooks in it. Descriptive prefix with get. Okay. Yep. So it's covering both the like I said the client and the server but then also examples within the file which is really nice. So do import the correct one based on the context. Yeah, good job. So it'll cover all those import issues that I've mentioned in previous videos. It's doing the type stuff. I want to see if it includes the logger. Yeah, it does. Good, good, good, good. So yeah, that worked perfectly. And then whenever I'm doing stuff in the future, I just call that. So, hey, we're going to do data fetching and make sure you follow the rule for this. If it's set to always, then it should just do it and it'll be great. If you want this set of rules, then drop give me the rules below. And unlike previous videos where I say here, you're going to get this thing and then I don't reply, you'll actually get it because the thing that we're working on in here is where I'm hosting all of them. So, instead of you going to a notion link that inevitably I won't update, this will be updated. So, you'll pop your email in, optional, it's anonymous sign in, but giving me the email will allow me to when I make updates on both the freebies, templates, both paid and free stuff, and then updates to uh the prompts because they change all the time when new models come out or I find out something great, then you'll get an email with that. I also have a daily channel if you want to check that out where if you want to go deeper on the stuff of like how I'm strategizing to 100K in profit a month, you can go follow that. That's just my name plus the word daily. And of course, you got to like the video cuz that's your way to be awesome and put good karma in the world. And subscribe so you can see future videos like this. Thanks so much for watching. I'll see you in the next one.