What Happens When AI Replaces My CoFounder? (Scary)
September 27, 2024
In this live, hands-on look, Parker shows how to use AI as a tool without letting it atrophy your problem-solving skills. He walks through concrete workflows, patterns, and utilities that keep you sharp while AI handles the routine bits.
Read the code, not just the AI output#
- Always read the generated code. AI can create code you don’t fully understand or that lacks the full context.
- Use reading as a debugging discipline: you’ll spot type issues, edge cases, and integration gaps that the AI might miss.
- Don’t rely on “one-and-done” AI fixes. If you don’t trace and validate, you’ll flip-flop and waste time.
Treat AI like a pair programmer#
- Use AI as a teammate who can draft, brainstorm, and refactor, but you drive the conversation and decisions.
- Ask targeted questions to surface alternatives, tradeoffs, and better architectural choices.
How Parker asks the right questions#
- What are other ways to write this code? Pros and cons of each approach.
- How would I explain this change to a teammate over the phone? A good litmus test for clarity.
- How can this be refactored to be more modular, readable, and robust?
- What are common mistakes people make with this pattern or feature?
The debugging workflow in a real project#
- The project example: a Google Calendar meets Health app called Map.
- Distinguish between UI state vs data state:
- Calendar UI Context: manages selected date, current view, UI flags.
- Calendar Data Context: handles data fetching, events, and caching.
- Use AI to propose architectural patterns, then validate by reading and integrating with your codebase.
- Downtime happens. Build the habit of understanding the full picture so you’re productive even when AI is unavailable.
Contexts, caching, and your code structure#
- Clear separation of concerns helps you debug faster when AI isn’t in the loop.
- A caching layer (inspired by the Midday pattern) can dramatically improve performance but requires careful handling so AI changes don’t break the flow.
The repo pack trick#
- Repo pack lets you condense your repo into a format AI can read easily—great for onboarding, code review, or large refactors.
- How it works (high level):
- Scans your repo, estimates tokens, and produces a readable summary/file.
- Useful for feeding code into LLMs for analysis, docs, or refactoring ideas.
- Practical uses:
- Open-source project onboarding
- Understanding unfamiliar codebases quickly
- Generating docs or quality checks based on the entire project
The aai prompts directory and per-project prompts#
- Maintain an aai (AI-assisted guidance) directory with prompts tailored to your project.
- Example use: SQL prompts for a calendar action. Provide objective, link docs, and specify outputs.
- Benefits: faster, more consistent AI responses and clearer expectations for what the AI should produce.
Add targeted comments to prompts#
- Use inline comments in your prompts to speed up AI understanding.
- Clear, explicit prompts reduce back-and-forth and produce more useful results.
- Example approach: describe the calendar action (clear user calendar in Google Calendar and local DB) and return shape, params, and error behavior.
Dictation: speed up prompt drafting#
- Built-in dictation (e.g., macOS) is a practical alternative to paid tools.
- Tweak: set up dictation to trigger with a quick shortcut (e.g., Command key twice) and transcribe prompts as you speak.
- Benefit: faster iteration when you’re outlining or explaining code changes.
Practical takeaways and personal workflow#
- Don’t rely on AI to solve everything; use it to accelerate learning and reduce drudgery.
- Keep your problem-solving muscles sharp by:
- Reading all AI output
- Validating changes across the full codebase
- Regularly questioning architecture and tradeoffs
- Build a local toolkit:
- Repo pack for repo-wide AI context
- aai prompts directory for project-specific guidance
- Dictation for rapid prompt drafting
Takeaways you can apply today#
- Read and audit AI-generated code before integrating it into your project.
- Treat AI as a collaborative partner; push for multiple solutions and explain decisions as if to a teammate.
- Use repo pack to get AI-friendly summaries of your codebase for reviews and onboarding.
- Create an aai prompts directory and keep per-project prompts up to date.
- Add descriptive comments to prompts to speed up AI comprehension.
- Leverage built-in dictation to speed up prompts and explanations.
Links#
- Repomix - Tool for packing a repo into an AI-friendly format (formerly Repopack)
- Midday - Open-source business management platform (inspiration for caching pattern)
If you have other tools you’re using to collaborate with AI on code, share them in the comments.
Transcript
so a big part of building software obviously is being good at problem solving that's pretty much the whole thing you're not always going to know what to do and with AI being brought in I feel like a big part that is missed is how to use the tools to not atrophy the muscles that you're trying to maintain or also trying to gain you're trying to get better at certain things so these are some of the things that I'm using right now in my project to help me kind of debug get through problems because you'll actually get worse if you just constantly have these training wheels on but there's obviously upside and there's certain ways of doing it so I'm not scripting anything this is me live working and I wanted to just show you some of the stuff that I've learned from using these tools for a little over a year uh to help my workflow and learning as well so by the end of the video I just kind of show you we're going to be going through these topics so you know always read the code that it produces that's kind of something I'm just going to harp on a lot because if you're not doing that you're not learning and it will generate stuff that you don't even know what it means so what's the point of that the next one we'll cover is how to ask the right questions so it's treating this as a pair programmer that's sitting next to you that is really like a stack Overflow replacement or Google replacement and less about the the Cod gen it's still doing the code gen obviously but you want to ask those questions and then there's a trick with this thing called repo pack and then using dictation and then adding comments so always read the code of produces here's a case in point example where I've already gone through and we're building this uh Google Calendar meets Health app called map that's what I work on fulltime it's launching soon and it has a lot to it it's got an AI model it's trained on your future self but for the point of this we are debugging some stuff around the performance of pulling in events and using context and all of that caching and so I've run into this problem where I refactored things such that we have a couple different contexts and the layout of the project is I have super base is the back end I have all these mutations and queries in here that are broken into directories for the area Focus make this a little bigger so all these are here these are the reusable kind of building blocks of contacting the database for reads and writes and then we have a caching layer which frankly I'm pretty new to in this pattern but I learned it from a project called midday and what I've done is I have all the components so on a calendar you have a grid you have the content for the grid that hydrates it you have the header you have a menu the thing on the left current time indicator all these things that make up the calendar and then the contexts so actually reading the code is we're going to talk about where I'm debugging something and I try to do it without AI first because otherwise I'm not going to get better at problem solving and another thing is these things have a lot of downtime like a lot of downtime so if this thing's down and it's not working you still want to know how to do it and the more you know the better you're going to be able to dirting these so I have an issue where I updated to have the calendar data context and calendar context and reason I did that was because this will handle all the UI related State such as the selected date which your calendar is visible currently selected event it's purely for managing user interface state so that's the calendar UI one and then calendar data context manages all the data related State including fetching calendar events yada y y so that came out of asking a question right asked it a bunch of questions after it generated the code after I read the code and so in here now that I've made these contact I'm kind of going back and seeing that I have these problems seeing that there's some data types that are incorrect and what an llm will do if you just come in and you say hey look like here's some information about it like this is what we're doing um here's you know some linting errors well good news is that will be helpful most of the time but some of the time it'll actually undo a change that it just made so if I had this issue where the get cached events has the wrong types and I'm yapping at it hey go fix this thing but it doesn't have context of what it needs to look like like what's actual full picture issue then it'll just go in isolation and fix the error within that one file without thinking about the rest of the project even if you do like the you know command enter way of it like indexing the whole code base a lot of times it misses it so if I didn't actually read the stuff that's coming in I wouldn't recognize that I wouldn't know my code based like the back of my hand and that's what you want you want it so that anytime you come back in you already know exactly what's going on so again just make sure you're actually reading this and that way when I go to fix the next issue I'm going to know that it's un maybe undoing the work that it just did so that's really really important is just make sure you're like reading through everything um otherwise you can just kind of flip-flop and you can actually spend more time just yapping at this thing and sitting there and hoping that it'll work than if you just taking the time to read everything that it gives and this brings you into the second thing which is just asking a lot of questions so the beauty of these are you know there's no bad questions like you can ask it as many questions as you want without feeling bad and it's not going to make you you know it's not going to ridicule you right it's going to just answer them so some of the questions that I like to ask are in the this file let me just pull it up so coding promps I'll ask you what are other ways that we could write this code what are the pros and cons of this approach or those approaches that's a really good one I have explained this code from the perspective of a blank programmer so in my case I always plop in you know nextjs with app router typescript react um and then it'll break things down so in the case where I was trying to get better at managing the state it provided me with a bunch of different options it says you're not actually going to need to manage it you can use these contexts um and so then another one would be are there ways of refactoring this code to be more modular readable and robust this one is not something you want to just use lightly so if you are going to use that just be aware that it's you know this is like architectural this is like saying hey you using the Constructor pattern before how about this wrapper pattern or hey you were using classes let's try TR this this could be better um and so you want to be careful with that one but it is helpful if you feel like you have a lot of spaghetti code um the next one would then be you know what are the common mistakes people make when writing code like this so these kind of questions are really helpful and then finally like if you're trying to really drill home concept because that's what you're trying to do you want to understand it well is I like to ask well hey if we make this decision on introducing this new pattern or updating the way that we're handling this particular part of the project how would I explain what we're about to do to a friend on the phone who's also an engineer and that's a really good trick because then it will break it down in simple language like it's talking to somebody on the phone and you end up with something really helpful that if you make this decision you want to you know have some conviction behind it and sometimes if it's going to add more work you want to be able to like come back to that so I found that helpful too where we're about to do these contexts and then it says you know hey there so we're working on optimizing our calendar and it explains all the things so if I ever want to really like drill home why we're about to do something I'll typically ask that question and it ends up being really helpful like I found myself coming back to it because I want to just make sure I drill home that concept um the next one is what I'm about to do which is the repo pack so I've seen people on Twitter talking about how you can you know write these custom scripts that will allow you to take the whole repo and optimize it into a text file that's optimized for llm readability you don't have to do that you don't have to like write anything custom you just get this thing called repo pack and it'll save you a whole bunch of time and it's powerful tool that packs your entire repo into a single AI friendly file perfect for when you need to feed your code based to llms that's set right and so what I'll do is I install it and then and I run it running turbo or uh let's just try running repo pack and see I don't think I need the MPX maybe that's it let's try running repo pack cool so forget the script I need to edit that but I typed in repo pack and all it did was ran through everything oh looks like I have an environment variable I'm going to have to revoke that but anyways it took that it said hey I went through 400 files I went through all the characters in it here's how many tokens it is so normally you know I would exclude a lot of the stuff right and now I'd get it under like sub 200,000 if you're using Gemini there's just half a million tokens but then you could just take this output that's at the root and start doing some pretty interesting and helpful stuff with it so I like doing this for new uh new code bases like if I wanted to open up an open source project and understand how it works like good case for that was last night it uh kind of helped me figure out this project which there's a lot of storms in Florida right now and there's lightning everywhere and I was looking at this map and I was like how do they do this like how do they figure out how all the lightning is you know striking and like it's not loading right now like how do they get this data and then I found out that there's these you know it's this kind of Open Source community of people and then I found a repo that lets you automate your house so if there's lightning within 5 kilometers it can do some interesting stuff but point is is I was able to then take this repo which is written in Python which I don't really know a whole lot about I can get around in it but I would then go and I'd repo pack it and then I would start asking it a lot of questions and they have some pretty helpful ideas for things that you want to do so you could just you know you could pack a remote repo you don't have to pull it you can do it for code review and refactoring suggestion so hey this has my entire code base yada y y you can generate docks with it you can evaluate the code the quality that here best practices again with these things you know it's kind of like the needle in the haast stack um test or like the smaller the amount the better so what I would do after this was you know I would basically cut things right so if I wanted to run it again with and pass it that flag I would just do that and then I would start working with that but you get the idea um you know it has like in terms of the format it will give you the structure of it so you can see all the files and then it actually explains it in here like you have the files file names at the top and you can also add custom instructions I haven't used this one but definitely check out the repo it's you know well maintained 3 days ago is a last thing it's got 885 Stars pretty helpful and the last one I want to cover and I've mentioned this in a previous video but I always have this aai um directory and in here I'll have prompts so when it comes to SQL I will have stuff in here and it's specific to my project so this is what we're trying to do here's your objective you can even Link in the docs for certain things so if you want to do that you could and then add comments this is one that I found really helpful because it just speeds up the output and it makes it so that these LMS don't have to spend a lot of time thinking about like what's going on in this file and it's just a good thing for you the dev to be able to say like hey like what's going on in this clear calendar action well it clears user's calendar both in Google Calendar and the local database that's pretty cool and then it explains you know this will look a lot like a library right or like if you had V3 calendar types from Google Calendar this is what you'd be looking at it would show you what the params are what it returns if it throws anything thing and then it'll actually write out the steps so I can put this in a gist in the video uh description but those are the things that I found really helpful uh last one is dictation I almost missed it I used a paid tool for this for a while it was called super whisper but it it's just kind of useless like you don't you know need it so what you can do is just use the built-in apple one if you're on Apple sorry if you're not but in here uh I think it's see dictation and I just have this set to command key twice and I have the microphone sourced to this thing and so when I jump in here I'm not sure if it'll allow me to do this here because I have like other stuff going on I don't want to throw off my well let's just try so if I do a command K and then I hit this twice I could say what's going on in this file and I'm you know that's a pretty bad question but you can see it's actively transcribing that and it's really accurate and so then I can just use voice to do a lot of like the prompting and explanations which is quicker than typing so those are the things that I'm using so I'm going to actually go and do the work now but wanted to just pause and ask you guys if there's any other things that you guys are using that I didn't mention because I think this this is where it's going where the developers and the builders who know how to leverage these tools and have a deep understanding of how the technology works are the ones who can really really just fly and it's going to give you that kind of like generalist ability to touch a lot of different parts of the stack and learn so so much uh quicker you like the video make sure you like it it's really helpful for me it encourages me to continue making videos and subscribe to the channel for more stuff like this and I'll see you in the next one