Back to YouTube
Parker RexSeptember 27, 2024

What Happens When AI Replaces My CoFounder? (Scary)

AI as a cofounder: a live coding session on using AI without skill atrophy—read AI output, ask the right questions, and debug performance.

Show Notes

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.
  • 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.