AI in Focus: Pair programming with AI

As part of our AI in Focus learning series, Chad and Senior developer Clarissa Borges livestreamed pair programming with AI. They built a Rails feature using Action Mailbox, but the real focus was exploring how different developers use AI tools in their workflows. This session revealed some interesting insights about control, context and trust. Read on for highlights and watch the full replay on YouTube.

Before we start, a few of our key takeaways on AI coding workflows. AI tools work best in your development process when you:

  • Stay in control of the pace and context
  • Know enough to evaluate suggestions critically
  • Understand when to ask better questions
  • Have existing code patterns to reference
  • Trust your instincts when something feels wrong

Action Mailbox and contract automation

We started with a straightforward goal: Streamline some common admin work around client contracts. When we receive a signed contract (Google Doc or Dropbox sign attachment) via email, we want to automatically upload the PDF to Google Drive and associate it with the contract record in our CRM. Luckily, the contract attachment file names already include contract IDs, which makes this possible.

Action Mailbox handles incoming email in Rails applications, but Clarissa had never used it before. This was a perfect opportunity to see how AI helps with unfamiliar territory.

Finding the right AI workflow

Clarissa’s AI approach differs from some developers. She often defaults to ChatGPT in the browser over editor-integrated tools like Cursor or GitHub Copilot Chat. Why? Control.

She finds it’s easier to control what’s in the context and what’s not with ChatGPT. With Cursor, she felt a little overwhelmed by how fast things moved and found it difficult to properly review at that pace. The browser-based approach with ChatGPT feels slower but more deliberate.

She also uses GitHub Copilot, but mainly for autocomplete and refactoring small bits of code. For brainstorming and validating ideas, ChatGPT wins.

One crucial insight: Avoid telling ChatGPT your proposed solution upfront. Its people-pleasing tendencies means it enthusiastically agrees with suggested approaches even if there are problems. If you ask about those problems later, ChatGPT will pivot completely.

Instead, describe the problem and asks for approaches, letting your own ideas converge with the suggestions naturally.

Where AI Falls Short

This conversation highlighted a critical AI gap: framework knowledge. When we asked ChatGPT how to receive emails in Rails, it suggested building everything manually, creating endpoints and parsing emails with the mail gem.

It never mentioned Action Mailbox, a built-in Ruby on Rails gem for exactly this problem. Only after we explicitly asked, “Is there anything built into Rails?” did it surface the right tool.

This matters. Developers need to know how to evaluate AI suggestions critically and when to prompt AI with better questions when the original guidance misses the mark. The knowledge you already have affects the quality of the answers you get back.

Human-led coding with AI support

Many of us are working through how to use AI in coding, and in this case, we took a human-led coding approach with AI support. This meant a lot of back-and-forth between Copilot, ChatGPT, humans and documentation.

While writing specs, Copilot recommended a different syntax than ChatGPT. We checked the documentation and didn’t find anything to guide us, so we went ahead with the Copilot recommendation to see how it worked.

AI coding workflow in practice

In this case, our AI coding workflow looked like this:

  1. Describe the problem to ChatGPT (without suggesting a solution)
  2. Review suggestions and cross-reference with Rails guides
  3. Look for existing patterns in the codebase
  4. Start with proof-of-concept code, then add tests
  5. Adapt AI suggestions to fit the actual implementation
  6. Use GitHub Copilot for autocompletion while typing

Your AI workflow probably looks different, and that’s fine. The key is finding tools and techniques that keep you in control while amplifying your capabilities.

About thoughtbot

We've been helping engineering teams deliver exceptional products for over 20 years. Our designers, developers, and product managers work closely with teams to solve your toughest software challenges through collaborative design and development. Learn more about us.